Page 1 of 1

Progress Wheel Control

Posted: Sun Nov 01, 2020 7:10 pm
by gfilatov
Hello All,

Please take a look for my first attempt to create a new Progress Wheel Control in HMG.
capture.png
capture.png (28.95 KiB) Viewed 3857 times
I've attached also a sample application for your review. 8-)

Your feedback is welcome :arrow:

Re: Progress Wheel Control

Posted: Mon Nov 02, 2020 10:13 pm
by Claudio Ricardo
Look very good and can change all properties in run time !
Great job !!!

Re: Progress Wheel Control

Posted: Tue Nov 03, 2020 12:35 am
by jairpinho
great job, we need more visual aids as well as line graph in real time

Re: Progress Wheel Control

Posted: Tue Nov 03, 2020 12:28 pm
by gfilatov
Claudio Ricardo wrote: ↑Mon Nov 02, 2020 10:13 pm Look very good and can change all properties in run time !
Great job !!!
Hello Friends,

Thanks for your feedback and attention.

I've prepared an other sample application (see screen shot).
capture2.png
capture2.png (12.86 KiB) Viewed 3085 times
The all source code of this example is below:

Code: Select all

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2020 Grigory Filatov <gfilatov@inbox.ru>
 */

#include "hmg.ch"
#include "winprint.ch"
#include "i_winuser.ch"

FUNCTION Main

   DEFINE WINDOW  main ;
	CLIENTAREA 810, 390 ;
	TITLE 'Progress Wheel Control Demo' ;
	ICON 'MAINICON' ;
	MAIN ;
	FONT 'MS Sans Serif' SIZE 9

     DEFINE FRAME Frame_1
            ROW	8
            COL	16
            WIDTH 380
            HEIGHT 175
            CAPTION 'Inner size'
     END FRAME

     DEFINE LABEL Label_1
            ROW    155
            COL    75
            WIDTH  10
            HEIGHT 15
            VALUE  '0'
            VCENTERALIGN .T.
     END LABEL  

     DEFINE LABEL Label_2
            ROW    155
            COL    195
            WIDTH  15
            HEIGHT 15
            VALUE  '50'
            VCENTERALIGN .T.
     END LABEL

     DEFINE LABEL Label_3
            ROW    155
            COL    320
            WIDTH  15
            HEIGHT 15
            VALUE  '90'
            VCENTERALIGN .T.
     END LABEL

     DEFINE PROGRESSWHEEL PW_1
            ROW    30
            COL    22
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            INNERSIZE 0
            SHOWTEXT .F.
     END PROGRESSWHEEL

     DEFINE PROGRESSWHEEL PW_2
            ROW    30
            COL    145
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            INNERSIZE 50
            SHOWTEXT .F.
     END PROGRESSWHEEL

     DEFINE PROGRESSWHEEL PW_3
            ROW    30
            COL    268
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            INNERSIZE 90
            SHOWTEXT .F.
     END PROGRESSWHEEL

     DEFINE FRAME Frame_2
            ROW	8
            COL	416
            WIDTH 380
            HEIGHT 175
            CAPTION 'Inner color'
     END FRAME

     DEFINE LABEL Label_4
            ROW    155
            COL    422
            WIDTH  114
            HEIGHT 15
            VALUE  'White'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL  

     DEFINE LABEL Label_5
            ROW    155
            COL    545
            WIDTH  114
            HEIGHT 15
            VALUE  'Gray'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL

     DEFINE LABEL Label_6
            ROW    155
            COL    668
            WIDTH  114
            HEIGHT 15
            VALUE  'Black'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL

     DEFINE PROGRESSWHEEL PW_4
            ROW    30
            COL    422
            WIDTH  114
            HEIGHT 114
            VALUE  25
            INNERSIZE 50
            SHOWTEXT .F.
     END PROGRESSWHEEL

     DEFINE PROGRESSWHEEL PW_5
            ROW    30
            COL    545
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORINNER GRAY
            INNERSIZE 50
            SHOWTEXT .F.
     END PROGRESSWHEEL

     DEFINE PROGRESSWHEEL PW_6
            ROW    30
            COL    668
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORINNER BLACK
            INNERSIZE 50
            SHOWTEXT .F.
     END PROGRESSWHEEL

     DEFINE FRAME Frame_3
            ROW	203
            COL	16
            WIDTH 380
            HEIGHT 175
            CAPTION 'Text'
     END FRAME

     DEFINE LABEL Label_7
            ROW    350
            COL    22
            WIDTH  114
            HEIGHT 15
            VALUE  'Standard'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL  

     DEFINE LABEL Label_8
            ROW    350
            COL    145
            WIDTH  114
            HEIGHT 15
            VALUE  'Custom'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL

     DEFINE LABEL Label_9
            ROW    350
            COL    268
            WIDTH  114
            HEIGHT 15
            VALUE  'Custom 2'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL

     DEFINE PROGRESSWHEEL PW_7
            ROW    226
            COL    22
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            INNERSIZE 50
     END PROGRESSWHEEL

     DEFINE PROGRESSWHEEL PW_8
            ROW    226
            COL    145
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            INNERSIZE 50
     END PROGRESSWHEEL

     PW_SetCustomText( 'PW_8', thiswindow.Name, {| Position, Max | hb_ntos( Position ) + '/' + hb_ntos( Max ) } )

     DEFINE PROGRESSWHEEL PW_9
            ROW    226
            COL    268
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            INNERSIZE 60
     END PROGRESSWHEEL

     PW_SetCustomText( 'PW_9', thiswindow.Name, {| Position, Max | hb_ntos( Position ) + ' from ' + hb_ntos( Max ) } )

     DEFINE FRAME Frame_4
            ROW	203
            COL	416
            WIDTH 380
            HEIGHT 175
            CAPTION 'Colors (ColorRemain/ColorDoneMax)'
     END FRAME

     DEFINE LABEL Label_10
            ROW    350
            COL    422
            WIDTH  114
            HEIGHT 15
            VALUE  'BtnFace/Green'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL  

     DEFINE LABEL Label_11
            ROW    350
            COL    545
            WIDTH  114
            HEIGHT 15
            VALUE  'Black/Yellow'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL

     DEFINE LABEL Label_12
            ROW    350
            COL    668
            WIDTH  114
            HEIGHT 15
            VALUE  'White/SkyBlue'
            VCENTERALIGN .T.
            CENTERALIGN .T.
     END LABEL

     DEFINE PROGRESSWHEEL PW_10
            ROW    226
            COL    422
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORDONEMAX LGREEN
            COLORREMAIN nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            SHOWTEXT .F.
     END PROGRESSWHEEL

     DEFINE PROGRESSWHEEL PW_11
            ROW    226
            COL    545
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORDONEMAX YELLOW
            COLORREMAIN BLACK
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            SHOWTEXT .F.
     END PROGRESSWHEEL

     DEFINE PROGRESSWHEEL PW_12
            ROW    226
            COL    668
            WIDTH  114
            HEIGHT 114
            VALUE  25
            COLORDONEMAX cColorToArray( 'SkyBlue' )
            COLORREMAIN WHITE
            COLORINNER nRGB2Arr( GetSysColor( COLOR_BTNFACE ) )
            SHOWTEXT .F.
     END PROGRESSWHEEL

   END WINDOW	

   Main.Center
   Main.Activate	
	
RETURN NIL


FUNCTION cColorToArray( gr )

   LOCAL data, hexNumber, r

   INIT PRINTSYS
   data := HBPRNCOLOR( gr )
   RELEASE PRINTSYS

   hexNumber := DECTOHEXA( data )
   r := Rgb( HEXATODEC( SubStr( HexNumber, -2 ) ), HEXATODEC( SubStr( HexNumber, 5, 2 ) ), HEXATODEC( SubStr( HexNumber, 3, 2 ) ) )

RETURN HMG_n2RGB( r )
It is a Harbour MiniGUI power (an above work is based on the wonderful BosTaurus library) 8-)

Re: Progress Wheel Control

Posted: Wed Nov 04, 2020 3:22 pm
by gfilatov
Hello,

I've attached a recent version of a sample application with a simple animation of Progress Wheel Control for your review.

Your feedback is welcome.

Enjoy 8-)

Re: Progress Wheel Control

Posted: Wed Nov 04, 2020 3:57 pm
by mol
It looks great!

Re: Progress Wheel Control

Posted: Sat Nov 07, 2020 7:59 pm
by Claudio Ricardo
Muy lindo y moderno, el " Inner text " es la cereza del postre.
Lo incluiré en mi proximo proyecto... chau antiguo " Progress bar " :lol:

Very cute and modern, the "Inner text" is the icing on the cake.
I'll include it in my next project ... bye old "Progress bar" :lol: