Hello!
How can I dimmed or grayed xBrowse?
I tried oBrw:Disable() but still in predefined colors unlike other objects like Get, Radio, etc... they are dimmed when is oOBj:Disable().
Any Idea?
Regards,
Fraxzi
nageswaragunupudi wrote:Please try this or similar code:
oBrw:bClrStd := { || If( oBrw:lActive, { CLR_BLACK, CLR_WHITE }, { CLR_WHITE, CLR_HGRAY } ) }
func BrwDisable( oBrw )
oBrw:SetColor( CLR_WHITE, CLR_HGRAY )
oBrw:Disable()
return nil
func BrwEnable( oBrw )
oBrw:SetColor( CLR_BLACK, CLR_WHITE )
oBrw:Enable()
oBrw:Refresh()
return nil
Now you can use BrwDisable and BrwEnable functions.
local lDimmed := .F.
...
WITH OBJECT oBrw
:bClrStd := {|| IF( lDimmed, { nRGB(204,204,204) , nRGB(235,233,237) }, {CLR_BLACK, GetSysColor( COLOR_WINDOW )} ) }
:bClrSel := {|| IF( lDimmed, { nRGB(204,204,204) , nRGB(235,233,237) }, {CLR_BLACK, CLR_YELLOW} ) }
:bClrSelFocus := :bClrSel
:bClrHeader := {|| IF( lDimmed, { nRGB(204,204,204) , nRGB(235,233,237), nRGB(235,233,237), nRGB(235,233,237)},;
{ CLR_BLACK , nRGB(196,225,255), nRGB(125,165,224), nRGB(203,225,252 )} ) }
:bClrFooter := :bClrHeader
END//with
...
...
lDimmed := .T.
oBrw:Refresh(.T.)
oBrw:Disable()
...
nageswaragunupudi wrote:Please try this or similar code:
oBrw:bClrStd := { || If( oBrw:lActive, { CLR_BLACK, CLR_WHITE }, { CLR_WHITE, CLR_HGRAY } ) }
func BrwDisable( oBrw )
oBrw:SetColor( CLR_WHITE, CLR_HGRAY )
oBrw:Disable()
return nil
func BrwEnable( oBrw )
oBrw:SetColor( CLR_BLACK, CLR_WHITE )
oBrw:Enable()
oBrw:Refresh()
return nil
Now you can use BrwDisable and BrwEnable functions.
local lDimmed := .F.
...
WITH OBJECT oBrw
:bClrStd := {|| IF( lDimmed, { nRGB(204,204,204) , nRGB(235,233,237) }, {CLR_BLACK, GetSysColor( COLOR_WINDOW )} ) }
:bClrSel := {|| IF( lDimmed, { nRGB(204,204,204) , nRGB(235,233,237) }, {CLR_BLACK, CLR_YELLOW} ) }
:bClrSelFocus := :bClrSel
:bClrHeader := {|| IF( lDimmed, { nRGB(204,204,204) , nRGB(235,233,237), nRGB(235,233,237), nRGB(235,233,237)},;
{ CLR_BLACK , nRGB(196,225,255), nRGB(125,165,224), nRGB(203,225,252 )} ) }
:bClrFooter := :bClrHeader
END//with
...
...
lDimmed := .T.
oBrw:Refresh(.T.)
oBrw:Disable()
...
nageswaragunupudi wrote:>>
Dimming xBrowse when :disable() (Maybe), should be included in next xBrowse version. Just a thoughts.
>>
When a oBrw:Disable() is called oBrw:lActive is automatically set to .f. and when oBrw:Enable() is called oBrw:lActive is automatically set to .T. , That is a part of Window.prg code. This can be used for all windows ( and all controls )
When there is this oBrw:lActive is already available, why do you want to create a new variable lDimmed ? Are you not duplicating unnecessarily ?
So please use oBrw:lActive. No need to create and manage another variable lDimmed and no need for any change in Libraray. The facility already exists
Antonio Linares wrote:Frances,
Please review FWH\samples\TestBlu2.prg example:
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 105 guests