// ------------------------------------------------------------------------
IF nCOLEND = "111" // Glass-Optik is shown
REDEFINE INFOBAR oInfoBar2 ID 103 COLOR e_COLOR1 GLASS ;
BITMAP e_BITMAP PROMPT SPACE(e_POSLEFT) + ;
"Test" COLOR e_COLTEXT LEFT FONT oBFont ;
OF oDlg5 UPDATE BORDER
ELSE
IF nORIENT = "1" // Horizontal Color
REDEFINE INFOBAR oInfoBar2 ID 103 GRADIENT e_COLOR1, ;
e_COLOR2 HORIZONTAL ;
BITMAP e_BITMAP PROMPT SPACE(e_POSLEFT) + ;
"Test" COLOR e_COLTEXT LEFT FONT oBFont ;
OF oDlg5 UPDATE BORDER
ENDIF
IF nORIENT = "2" // Vertical Color
REDEFINE INFOBAR oInfoBar2 ID 103 GRADIENT e_COLOR1, ;
e_COLOR2 BITMAP e_BITMAP ;
PROMPT SPACE(e_POSLEFT) + "Test" COLOR e_COLTEXT ;
LEFT FONT oBFont OF oDlg5 UPDATE BORDER
ENDIF
ENDIF
// When i press this Button, i want to show new values
// ---------------------------------------------------------------------
REDEFINE BUTTONBMP oBtn9 ID 601 OF oDlg5 ;
ACTION ( NEW_COLOR(oInfoBar2) ) ;
BITMAP "colors" PROMPT SPACE(5) + "&Test" TEXTRIGHT
oBtn9:cToolTip = { "Bar-Color-Test", "Test", 1, CLR_BLACK, 14089979 }
.....
.....
//------------------------------
FUNCTION NEW_COLOR(oInfoBar2)
When you want to use CLASS - informations,
the function must know the OBJECT ( oInfoBar2 ).
The functions are allways belong to a OBJECT ( in this sample => oInfobar2 )
e_COLTEXT, e_COLOR1 and e_COLOR2 have the new values i want to test.
oInfoBar2:cPrompt := "Test" // Write "Test" to the Var => cPrompt
oInfoBar2:oFontPrompt := oBFont // Show a try-out Font for the Text
oInfoBar2:nClrPrompt := e_COLTEXT // Show a try-out Color for the Text
IF e_COLEND = 9 // Glass - look
oInfoBar2:nClrLabel := e_COLOR1 // Show a try-out Color for the text
oInfoBar2:lDrawGradient := .F.
oInfoBar2:lGlass := .T.
ELSE
oInfoBar2:nBeginColor := e_COLOR1 // Show a Color Start-Grad.
oInfoBar2:nEndColor := e_COLOR2 // Show a Color End-Grad
IF e_ORIENT = 1
oInfoBar2:lVertGradient := .F.
ENDIF
IF e_ORIENT = 2
oInfoBar2:lVertGradient := .T.
ENDIF
ENDIF
oInfoBar2:Paint() // METHOD Paint()
oInfoBar2:Refresh() // REFRESH oInfoBar2
// With this, the BAR => oInfoBar2 is UPDATED with the new Values !!!
// You send directly informations to the OBJECT oInfobar2
RETURN( NIL )
Some Lines of the Class
--------------------------------
// On Top there are DATA
// These are the used vars inside the CLASS
// and can be modified from outside
// see Function NEW_COLOR(oInfoBar2)
DATA cPrompt AS CHARACTER
DATA nClrPrompt AS NUMERIC
DATA oFontPrompt AS OBJECT
DATA nClrLabel AS NUMERIC
DATA lDrawGradient AS LOGICAL
DATA lGlass AS LOGICAL
DATA lVertGradient AS LOGICAL
DATA nBeginColor AS NUMERIC
DATA nEndColor AS NUMERIC
// These DATAS i have given new Values
// Then you have METHOD ( Functions )
METHOD Paint() // I paint oInfoBar2 with the new values
.....
.....
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 87 guests