Hello All,
Please take a look for my first attempt to create the new Star Rating Control in HMG.
I've attached also a sample application for your review.
Your feedback is welcome
Star Rating Control
Moderator: Rathinagiri
Star Rating Control
- Attachments
-
- demo.zip
- Demo application
- (852.47 KiB) Downloaded 89 times
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: Star Rating Control
Hi Angel,
Thanks for your attention
May be the following example is better
The full souce code of this sample is below
Code: Select all
/*
* HMG - Harbour Win32 GUI library Demo
*
* Copyright 2014-2021 Grigory Filatov <gfilatov@inbox.ru>
*/
#include "minigui.ch"
Function Main
DEFINE WINDOW Win_1 ;
AT 0,0 ;
WIDTH 400 HEIGHT 380 ;
TITLE 'Rating Test' ;
ICON 'star.ico' ;
MAIN ;
FONT "Arial" SIZE 14 ;
BACKCOLOR WHITE
DEFINE MAINMENU
DEFINE POPUP "File"
MENUITEM "Exit" ONCLICK ThisWindow.Release
END POPUP
END MENU
@ 20, 20 LABEL LABEL_0 VALUE '5 Star Rating Scale' WIDTH 360 FONT "Arial" SIZE 16 CENTERALIGN BOLD TRANSPARENT
@ 70, 40 LABEL LABEL_1 VALUE 'Loved It' BOLD TRANSPARENT
@ 70, 180 RATING Rate_1 ;
WIDTH 21 ;
HEIGHT 21 ;
STARS 5 ;
FROM RESOURCE ;
SPACING 15 ;
RATE 5
@ 120, 40 LABEL LABEL_2 VALUE 'Liked It' BOLD TRANSPARENT
@ 120, 180 RATING Rate_2 ;
WIDTH 21 ;
HEIGHT 21 ;
STARS 5 ;
FROM RESOURCE ;
SPACING 15 ;
RATE 4
@ 170, 40 LABEL LABEL_3 VALUE 'It was ok' BOLD TRANSPARENT
@ 170, 180 RATING Rate_3 ;
WIDTH 21 ;
HEIGHT 21 ;
STARS 5 ;
FROM RESOURCE ;
SPACING 15 ;
RATE 3
@ 220, 40 LABEL LABEL_4 VALUE 'Disliked It' BOLD TRANSPARENT
@ 220, 180 RATING Rate_4 ;
WIDTH 21 ;
HEIGHT 21 ;
STARS 5 ;
FROM RESOURCE ;
SPACING 15 ;
RATE 2
@ 270, 40 LABEL LABEL_5 VALUE 'Hated It' BOLD TRANSPARENT
@ 270, 180 RATING Rate_5 ;
WIDTH 21 ;
HEIGHT 21 ;
STARS 5 ;
FROM RESOURCE ;
SPACING 15 ;
RATE 1
END WINDOW
Win_1.Center
ACTIVATE WINDOW Win_1
Return Nil
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein