Amigos :
Como puedo colorear el GET que esta en foco? con FWH2.7 /xHarbour
DE ANTEMANO
MUCHAS GRACIAS
SALUDOS Y xHabrazos
#define CLR_PIEL1 RGB(216,185,165)
#define CLR_PIEL2 RGB(192,192,192)
#define CLR_MENTA1 RGB(175,255,215)
#define CLR_MENTA2 RGB(221,255,238)
#define CLR_DISABLE RGB(255,255,217)
#define CLR_AMARILLO1 RGB(255,251,225)
#define CLR_BLUE1 RGB(231,220,228)
#define CLR_CAFE RGB(128,064,000)
#xcommand REDEFINE GET [ <oGet> VAR ] <uVar> ;
[ ID <nId> ] ;
[ <dlg: OF, WINDOW, DIALOG> <oDlg> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ VALID <ValidFunc> ] ;
[ PICTURE <cPict> ] ;
[ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ WHEN <uWhen> ] ;
[ ON CHANGE <uChange> ] ;
[ <readonly: READONLY, NO MODIFY> ] ;
[ <spin: SPINNER> [ON UP <SpnUp>] [ON DOWN <SpnDn>] [MIN <Min>] [MAX <Max>] ] ;
=> ;
[ <oGet> := ] KTGet():ReDefine( <nId>, bSETGET(<uVar>), <oDlg>,;
<nHelpId>, <cPict>, <{ValidFunc}>, <nClrFore>, <nClrBack>,;
<oFont>, <oCursor>, <cMsg>, <.update.>, <{uWhen}>,;
[ \{|nKey,nFlags,Self| <uChange> \}], <.readonly.>,;
<.spin.>, <{SpnUp}>, <{SpnDn}>, <{Min}>, <{Max}>)
#include "fivewin.ch"
#include "miapp.ch"
CREATE CLASS KTGet FROM TGet
DATA nClrForeFocus INIT CLR_BLACK
DATA nClrBackFocus INIT CLR_PIEL1
DATA nOldClrFore
DATA nOldClrBack
METHOD GotFocus()
METHOD LostFocus( hCtlFocus)
METHOD Paint()
ENDCLASS
METHOD GotFocus() CLASS KTGet
IF ::nClrForeFocus != NIL .and. ::nClrBackFocus != NIL
::nOldClrFore := ::nClrText
::nOldClrBack := ::nClrPane
::SetColor( ::nClrForeFocus, ::nClrBackFocus )
ENDIF
RETURN Super:GotFocus()
METHOD LostFocus( hCtlFocus ) CLASS KTGet
::bWhen := iif( ::bWhen == NIL, {|| TRUE }, ::bWhen )
IF ::nClrForeFocus != NIL .and. ::nClrBackFocus != NIL
::SetColor( ::nOldClrFore, ::nOldClrBack )
ENDIF
IF ::lReadOnly == TRUE .or. !eval( ::bWhen )
::SetColor( CLR_BLACK, CLR_AMARILLO1 )
ENDIF
RETURN Super:LostFocus( hCtlFocus )
METHOD Paint() CLASS KTGet
::bWhen := iif( ::bWhen == NIL, {|| TRUE }, ::bWhen )
IF ( ::lReadOnly == TRUE .or. !eval( ::bWhen ) ) .and. ::lFocused == FALSE
::SetColor( CLR_BLACK, CLR_AMARILLO1 )
ELSEIF ::lReadOnly == FALSE .and. ::lFocused == TRUE
::SetColor( CLR_BLACK, CLR_MENTA2 )
ELSE
::SetColor( CLR_BLACK, CLR_WHITE )
ENDIF
RETURN Super:Paint()
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 42 guests