Star Rating Control

HMG Samples and Enhancements

Moderator: Rathinagiri

Post Reply
User avatar
gfilatov
Posts: 1077
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Star Rating Control

Post by gfilatov »

Hello All,

Please take a look for my first attempt to create the new Star Rating Control in HMG.
image1.png
image1.png (85.46 KiB) Viewed 1066 times
I've attached also a sample application for your review. 8-)

Your feedback is welcome :arrow:
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
User avatar
apais
Posts: 440
Joined: Fri Aug 01, 2008 6:03 pm
DBs Used: DBF
Location: uruguay
Contact:

Re: Star Rating Control

Post by apais »

Where's IronMan ?
LOL
Angel Pais
Web Apps consultant/architect/developer.
User avatar
gfilatov
Posts: 1077
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Star Rating Control

Post by gfilatov »

apais wrote: Tue Jun 29, 2021 11:08 pm Where's IronMan ?
LOL
Hi Angel,

Thanks for your attention :!:

May be the following example is better :?:
capture.png
capture.png (11.24 KiB) Viewed 962 times
The full souce code of this sample is below :arrow:

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
Post Reply