About TMeterEx - Gradient

About TMeterEx - Gradient

Postby ukoenig » 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 ?

Image

@ 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 :?:
Last edited by ukoenig on Thu Oct 13, 2011 1:05 pm, edited 2 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: About TMeterEx - Gradient

Postby Daniel Garcia-Gil » Thu Oct 13, 2011 1:04 pm

Uwe

sure...
please send me the class modified...
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: About TMeterEx - Gradient

Postby ukoenig » Thu Oct 13, 2011 1: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: About TMeterEx - Gradient

Postby ukoenig » 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 ?

Image

Code: Select all  Expand view

@ 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 111 guests