FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour About TMeterEx - Gradient
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
About TMeterEx - Gradient
Posted: Thu Oct 13, 2011 12:55 PM
Daniel,

I did some Tests ( changes ) with Class TMeterEx,
to create a Vertical running Gradient.
It works, but stops at the End at Center ( must be complete Green ).
Is it possible to add this Function to the Class ?



@ 280, 40 METEREX oMeter3 VAR nActual3 SIZE 135, 20 TOTAL 50 PIXEL;
GRADIENT CHUNK { { 0, 255, 6472704 }, { 0, 6472704, 255 } }; // Defined Red / Green
GRADIENT TRACK { { 0, 255, 255 }, { 0, 255, 255 } }; // Start with 100 % red
ROUND LINECOLORS CLR_BLACK, CLR_WHITE

For my Test I changed in Method Paint :

GradientFill( ::hDC, 0, 0, ::nHeight, ::nWidth, ::aGrad, .F. ) // ! ::lVertical )
GradientFill( ::hDC, nTop, nLeft, nHeight, nWidth, ::aGradMet, .F. ) // ! ::lVertical )

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: About TMeterEx - Gradient
Posted: Thu Oct 13, 2011 01:04 PM

Uwe

sure...
please send me the class modified...

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: About TMeterEx - Gradient
Posted: Thu Oct 13, 2011 01:11 PM

Daniel,

I only changed the 2 Gradientlines in Method PAINT
and defined the Start Gradient ( posted above ).

Best Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: About TMeterEx - Gradient
Posted: Fri Oct 14, 2011 12:17 AM
Daniel,

maybe a better looking Solution for a colored Meter :
using Your TSelex-class ( works the same ) moving the Button in Relation to a Counter ?



Code (fw): Select all Collapse
@ 260, 40 SELEX oSelex  VAR nOption SIZE 135, 50 OF oDlgChild PIXEL  ;
ITEMS "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100" ;
GRADIENT OUTTRACK { { 0.5, 16770250, 16312263 }, ;
                       { 0.5, 16312263, 16770250 } } ;
GRADIENT INTRACK  { { 1, 255, 6472704 } } ;
THUMBSIZE 15, 50 ROUNDSIZE 5 ;
COLOR THUMB 16770250 ;
COLORTEXT 128, 32768 ; 
TITLE "Progress-counter ..." TOP ;
FONT oFont

@ 260,  180 BUTTON "+" ACTION ;
IIF(nOption < 11,(nOption++, oSelex:SetOption(nOption)),NIL) SIZE 20, 20 PIXEL FONT oFont
@ 260,  205 BUTTON "-" ACTION  ;
IIF(nOption > 1,(nOption--, oSelex:SetOption(nOption)),NIL) SIZE 20, 20 PIXEL FONT oFont
@ 260,  230 BUTTON "Rst" ACTION oSelex:SetOption( 1 ) SIZE 20, 20 PIXEL FONT oFont
@ 260,  255 BUTTON "Auto" ACTION Automatic(oSelex, 12) SIZE 40, 20 PIXEL FONT oFont
..
..
// --------------------

FUNCTION Automatic( oSelex, nMax )
LOCAL n := 1

FOR n = 1 TO nMax
      oSelex:SetOption( n ) 
      n++
NEXT
   
RETURN NIL



Best Regards
uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion