TGet's Color

TGet's Color

Postby richard-service » Sat Jul 09, 2016 10:58 am

Hi
I use this function below:
Code: Select all  Expand view

Function ChangeTGetColor_1(oDlg)

AEval( oDlg:aControls,{|o| if(o:ClassName()=="TGET",;
                             ( o:bGotFocus  := {|o|o:SetColor( RGB(0,0,0), RGB(252,232,191) )} ,;
                               o:bLostFocus := {|o|o:SetColor( CLR_BLACK, CLR_WHITE )} ),) } )

Return NIL
 

I use ChangeTGetColor_1(::oDlg) work(TGet in Dialog)
ChangeTGetColor_1(::oFld) not work(TGet in TFolder/TFolderex).
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: TGet's Color

Postby ukoenig » Sat Jul 09, 2016 12:55 pm

Richard,

called from Main-dialog 2 functions next each other

CHANGETGETCOLOR_1(oDlg) // for dialog
CHANGE_FGETCOL(oFld) // for folderpages

Code: Select all  Expand view

// --------------- SET FOLDER GET-colors -----

FUNCTION CHANGE_FGETCOL(oFld)
LOCAL n, oFDlg

FOR n := 1 to Len( oFld:aDialogs )
    oFDlg := oFld:aDialogs[ n ]
    ChangeTGetColor_1(oFDlg) // calls Your get-colorchange
    oFDlg:Update()
NEXT

RETURN( NIL )

// ---------- SET GET-COLORS ( for dialog and folder ) ------

FUNCTION ChangeTGetColor_1(oDlg)

AEval( oDlg:aControls,{|o| if(o:ClassName()=="TGET",;
                             ( o:bGotFocus  := {|o|o:SetColor( RGB(0,0,0), RGB(252,232,191) )} ,;
                               o:bLostFocus := {|o|o:SetColor( CLR_BLACK, CLR_WHITE )} ),) } )


RETURN NIL
 


regards
Uwe :D
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: TGet's Color

Postby richard-service » Sat Jul 09, 2016 5:06 pm

ukoenig wrote:Richard,

called from Main-dialog 2 functions next each other

CHANGETGETCOLOR_1(oDlg) // for dialog
CHANGE_FGETCOL(oFld) // for folderpages

Code: Select all  Expand view

// --------------- SET FOLDER GET-colors -----

FUNCTION CHANGE_FGETCOL(oFld)
LOCAL n, oFDlg

FOR n := 1 to Len( oFld:aDialogs )
    oFDlg := oFld:aDialogs[ n ]
    ChangeTGetColor_1(oFDlg) // calls Your get-colorchange
    oFDlg:Update()
NEXT

RETURN( NIL )

// ---------- SET GET-COLORS ( for dialog and folder ) ------

FUNCTION ChangeTGetColor_1(oDlg)

AEval( oDlg:aControls,[code][/code]{|o| if(o:ClassName()=="TGET",;
                             ( o:bGotFocus  := {|o|o:SetColor( RGB(0,0,0), RGB(252,232,191) )} ,;
                               o:bLostFocus := {|o|o:SetColor( CLR_BLACK, CLR_WHITE )} ),) } )


RETURN NIL
 


regards
Uwe :D


Hi Uwe,
Thanks a lot. it's work now.
I have a question about it.
1.How to disable bitmap gray color
2.I hope change Yellow color to gray color for disable
Code: Select all  Expand view

LOCAL aBitmaps := { "System\TabBmp\24\Tab_WConnect.bmp",;
                    "System\TabBmp\24\Tab_Photo.bmp",;
                    "System\TabBmp\24\Tab_DiskDrive.bmp",;
                    "System\TabBmp\24\Tab_ReMark.bmp" }

      REDEFINE FOLDEREX ::oFld ID 300 OF ::oDlg      ;
               PROMPT "網際網路"  ,;
                      "圖片路徑"  ,;
                      "備份磁碟機",;
                      "參數設定"                     ;
               DIALOGS "D_DR_WIN_SYSDATAMSF_FLD1",;
                       "D_DR_WIN_SYSDATAMSF_FLD2",;
                       "D_DR_WIN_SYSDATAMSF_FLD3",;
                       "D_DR_WIN_SYSDATAMSF_FLD4"    ;
               BITMAPS aBitmaps                      ;
               TAB HEIGHT 40                         ;
               ANIMATE SPEED 50

::oFld:SetFont(oFont)
::oFld:aEnable = { .T., .F., .T., .T. }
::oFld:DisableTab( 2 )
::oFld:ReFresh()
 

Image
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: TGet's Color

Postby stefano » Sun Jul 10, 2016 8:04 am

for disable color TFolderex

aColorDis := { { 1, nRGB( 190, 190, 190), nRGB( 211, 211, 211 ) } }

oFld:DisableTab( 2 )
oFld:aGradDis := aColorDis

Stefano
FWH 14.11 + xHarbour + bcc582
stefano
 
Posts: 80
Joined: Tue Mar 25, 2008 9:03 pm
Location: ITALIA

Re: TGet's Color

Postby richard-service » Sun Jul 10, 2016 4:15 pm

stefano wrote:for disable color TFolderex

aColorDis := { { 1, nRGB( 190, 190, 190), nRGB( 211, 211, 211 ) } }

oFld:DisableTab( 2 )
oFld:aGradDis := aColorDis

Stefano


Hi Stefano,
Thanks a lot. it's work.
Just bitmap not change disable( gray bitmap )
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: TGet's Color

Postby stefano » Sun Jul 10, 2016 4:40 pm

I think that is possible to use 2 bitmap, one gray and the other colored

if ....
aBitmaps := { , , , cperete+"\bmp\f1.BMP" } // color
oFld:EnableTab( 4 )
else
aBitmaps := { , , , cperete+"\bmp\f0.BMP" } // gray
oFld:DisableTab( 4 )
endif
ofld:LoadBitmaps( aBitmaps )
ofld:refresh()

Stefano
FWH 14.11 + xHarbour + bcc582
stefano
 
Posts: 80
Joined: Tue Mar 25, 2008 9:03 pm
Location: ITALIA

Re: TGet's Color

Postby richard-service » Sun Jul 10, 2016 5:12 pm

stefano wrote:I think that is possible to use 2 bitmap, one gray and the other colored

if ....
aBitmaps := { , , , cperete+"\bmp\f1.BMP" } // color
oFld:EnableTab( 4 )
else
aBitmaps := { , , , cperete+"\bmp\f0.BMP" } // gray
oFld:DisableTab( 4 )
endif
ofld:LoadBitmaps( aBitmaps )
ofld:refresh()

Stefano


Hi Stefano,

I see. Thanks a lot.
But I hope TFolderex Should be Auto change Same as ToolBar
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 94 guests