Dimmed xBrowse

Dimmed xBrowse

Postby fraxzi » Thu Nov 19, 2009 3: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
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines

Re: Dimmed xBrowse

Postby nageswaragunupudi » Thu Nov 19, 2009 4: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
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dimmed xBrowse

Postby fraxzi » Thu Nov 19, 2009 8: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: Select all  Expand view

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 view

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

Re: Dimmed xBrowse

Postby fraxzi » Thu Nov 19, 2009 8: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: Select all  Expand view

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 view

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

Re: Dimmed xBrowse

Postby Antonio Linares » Thu Nov 19, 2009 8:42 am

Frances,

Please review FWH\samples\TestBlu2.prg example:

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Dimmed xBrowse

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dimmed xBrowse

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

Re: Dimmed xBrowse

Postby fraxzi » Fri Nov 20, 2009 12:11 am

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 105 guests