Dimmed xBrowse

Post Reply
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Dimmed xBrowse

Post by fraxzi »

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
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Dimmed xBrowse

Post by nageswaragunupudi »

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
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: Dimmed xBrowse

Post by 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.



Thanks Nageswaragunupudi ,

I did

Code: Select all | Expand


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: Select all | Expand


...
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
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: Dimmed xBrowse

Post by 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.



Thanks Nageswaragunupudi ,

I did

Code: Select all | Expand


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: Select all | Expand


...
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
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: Dimmed xBrowse

Post by Antonio Linares »

Frances,

Please review FWH\samples\TestBlu2.prg example:

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: Dimmed xBrowse

Post by nageswaragunupudi »

>>
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
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: Dimmed xBrowse

Post by fraxzi »

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
User avatar
fraxzi
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines
Contact:

Re: Dimmed xBrowse

Post by fraxzi »

Antonio Linares wrote:Frances,

Please review FWH\samples\TestBlu2.prg example:

Image



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