A couple questions regarding TWBrowse:
1. How can I paint alternate rows in different colors ?
2. Is there a way to display a header/footer as part of the TBrowse dialog ?
3. Paint a cell (field/column) based on the data contents, i.e. outstanding
balances in red ?
Thank you.
More on browse.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: More on browse.
HunterEC wrote:1. How can I paint alternate rows in different colors ?
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw, lOdd := .F.
USE TEST
DEFINE DIALOG oDlg;
SIZE 400, 400
@ 0, 0 LISTBOX oBrw FIELDS TEST -> last,;
TEST -> first
oBrw:bLogicLen = { || LastRec() }
oBrw:lCellStyle = .T.
oBrw:bSkip = { | nRec | nRec := ( oBrw:cAlias ) -> ( DbSkipper( nRec ) ),;
lOdd := If( nRec % 2 = 0, lOdd, !lOdd ),;
nRec }
oBrw:nClrPane = { || If( lOdd, CLR_HRED, CLR_HGREEN ) }
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
CLOSE
RETURN NIL
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: More on browse.
No way using TWBrowse, as far as I know. Try other browses (TCBrowse? TXBrowse?).HunterEC wrote:2. Is there a way to display a header/footer as part of the TBrowse dialog ?
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: More on browse.
HunterEC wrote:3. Paint a cell (field/column) based on the data contents, i.e. outstanding balances in red ?
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw
USE TEST
DEFINE DIALOG oDlg;
SIZE 400, 400
@ 0, 0 LISTBOX oBrw FIELDS TEST -> last,;
TEST -> first
oBrw:bLogicLen = { || LastRec() }
oBrw:nClrPane = { | nCol | If( nCol = 1 .AND. FIELD -> last = "A", CLR_HRED, CLR_HGREEN ) }
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
CLOSE
RETURN NIL
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact: