FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Dimmed xBrowse
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Dimmed xBrowse
Posted: Thu Nov 19, 2009 03:56 AM

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

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Dimmed xBrowse
Posted: Thu Nov 19, 2009 04:36 AM

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.

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Dimmed xBrowse
Posted: Thu Nov 19, 2009 08:38 AM
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.



Thanks Nageswaragunupudi ,

I did
Code (fw): Select all Collapse
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

...


then somewhere in code...

Code (fw): Select all Collapse
...
lDimmed := .T.
oBrw:Refresh(.T.)
oBrw:Disable()
...


It works fine... But I thinks yours is more simplified.

Dimming xBrowse when :disable() (Maybe), should be included in next xBrowse version. Just a thoughts.


Thank you!.
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Dimmed xBrowse
Posted: Thu Nov 19, 2009 08:39 AM
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.



Thanks Nageswaragunupudi ,

I did
Code (fw): Select all Collapse
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

...


then somewhere in code...

Code (fw): Select all Collapse
...
lDimmed := .T.
oBrw:Refresh(.T.)
oBrw:Disable()
...


It works fine... But I think yours is better simplified.

Dimming xBrowse when :disable() (Maybe), should be included in next xBrowse version. Just a thoughts.


Thank you!.
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Dimmed xBrowse
Posted: Thu Nov 19, 2009 08:42 AM
Frances,

Please review FWH\samples\TestBlu2.prg example:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Dimmed xBrowse
Posted: Thu Nov 19, 2009 10:37 AM

>>
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

Regards



G. N. Rao.

Hyderabad, India
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Dimmed xBrowse
Posted: Fri Nov 20, 2009 12:07 AM
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



Dear nageswaragunupudi,

You are correct. No need to create lDimmed variable.

I will change my code based on oBrw:lActive instead of lDimmed variable.


Many thanks!

Regards,
Fraxzi
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: Dimmed xBrowse
Posted: Fri Nov 20, 2009 12:11 AM
Antonio Linares wrote:Frances,

Please review FWH\samples\TestBlu2.prg example:




Dear Mr. Antonio,

Thank you so much! this what I'm looking for. I will try and test this great sample to dialog and window too.


Regards,
Frances
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15

Continue the discussion