Dear Mr. Rao,
Can you please help me.
I try to change row colors.
With a button I do:
oBrw:bClrStd := {||{CLR_WHITE,rgb(240, 173, 78) }}
But if I look into the paint method of xBrowse, there are no changes:
METHOD Display() CLASS TXBrowse
local nSecs := SECONDS()
if !::lCreated
return nil
endif
fwlog Eval( ::bClrSel )
...
Can you please show me how I can change bClrStd.
Best regards,
Otto
XBROWSE COLOR ROWS
XBROWSE COLOR ROWS
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
Re: XBROWSE COLOR ROWS
Dear Otto
This run OK for me ( in ACTION Button )
This run OK for me ( in ACTION Button )
Code: Select all
oBrw1:bClrStd := { || { CLR_WHITE, CLR_BLACK } }
oBrw1:Refresh()
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Re: XBROWSE COLOR ROWS
WIKI
Postby Otto » Fri Sep 18, 2020 12:01 pm
Dear Cristobal,
I inserted the code into yunus.prg.
static function Invoices() and commented
// BrwColors( oBrw ).
This is not working.
If BrwColors( oBrw ) is uncommented, then I get black background but not the rows.
Maybe it is different when there is mdi?
Best regards,
Otto
Postby Otto » Fri Sep 18, 2020 12:01 pm
Dear Cristobal,
I inserted the code into yunus.prg.
static function Invoices() and commented
// BrwColors( oBrw ).
This is not working.
If BrwColors( oBrw ) is uncommented, then I get black background but not the rows.
Maybe it is different when there is mdi?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: XBROWSE COLOR ROWS
Mr. Otto
Please try
Note: bClrStds not bClrStd
Please try
Code: Select all
oBrw:bClrStds := {||{CLR_WHITE,rgb(240, 173, 78) }}
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: XBROWSE COLOR ROWS
Thank You Mr. Rao,
I added for a test 2 buttons to YUNUS.prg
( switching row-colors on button-action )
working with conditions and multiple colors
regards
Uwe
I added for a test 2 buttons to YUNUS.prg
( switching row-colors on button-action )
Code: Select all
static function Clients()
..
..
// I added 2 buttons
DEFINE BUTTON OF oBar PROMPT "Color" RESOURCE "magic" ;
ACTION BrwColors1( oBrw, 1 )
DEFINE BUTTON OF oBar PROMPT "Reset" RESOURCE "prev" ;
ACTION BrwColors1( oBrw, 2 )
// ---------------
static function BrwColors1( oBrw, nStatus )
IF nStatus = 1
oBrw:bClrStds = { || If( oBrw:KeyNo() % 2 == 0, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLACK ),;
RGB( 240, 173, 78 ) }, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLACK ),;
nRGB( 255, 217, 197 ) } ) }
ELSE
oBrw:bClrStds = { || If( oBrw:KeyNo() % 2 == 0, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLACK ),;
RGB( 198, 255, 198 ) }, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLACK ),;
RGB( 232, 255, 232 ) } ) }
ENDIF
oBrw:Refresh()
return nil
Code: Select all
static function BrwColors1( oBrw, nStatus )
IF nStatus = 1
oBrw:bClrStds = { || If( oBrw:KeyNo() > 6 .and. oBrw:KeyNo() < 12 ;
.or. oBrw:KeyNo() > 14 .and. oBrw:KeyNo() < 18 , ; // any condition
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLACK ),;
If( oBrw:KeyNo() > 6 .and. oBrw:KeyNo() < 12, nRGB( 240, 173, 78 ), nRGB( 140, 168, 197 ) ) }, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLACK ),;
If( oBrw:KeyNo() % 2 == 0, nRGB( 198, 255, 198 ), nRGB( 232, 255, 232 ) ) } ) }
ELSE
oBrw:bClrStds = { || If( oBrw:KeyNo() % 2 == 0, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLACK ),;
nRGB( 198, 255, 198 ) }, ;
{ If( ( oBrw:cAlias )->( Deleted() ), CLR_HRED, CLR_BLACK ),;
nRGB( 232, 255, 232 ) } ) }
ENDIF
oBrw:Refresh()
return nil
Uwe
Last edited by ukoenig on Fri Sep 18, 2020 8:37 pm, edited 1 time in total.
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: XBROWSE COLOR ROWS
Dear Mr Rao, Critobal and Uwe,
many thanks for your help. It works.
Mr. Rao can you please explain to me
the differences of bClrStds and bClrStd.
Best regards,
Otto
many thanks for your help. It works.
Mr. Rao can you please explain to me
the differences of bClrStds and bClrStd.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: XBROWSE COLOR ROWS
Code: Select all
oBrw:bClrStds := b
Code: Select all
for n := 1 to Len( oBrw:aCols )
oBrw:aCols[ n ]:bClrStd := b
next
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: XBROWSE COLOR ROWS
Dear Mr. Rao,
thank you so much for your help.
Have a nice Sunday and best regards,
Otto
thank you so much for your help.
Have a nice Sunday and best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
********************************************************************