XBrowse – show lines slashed
XBrowse – show lines slashed
Is it possible to show some lines in a crossed out font?
Thanks in advance
Otto
Thanks in advance
Otto
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
- Richard Chidiak
- Posts: 946
- Joined: Thu Oct 06, 2005 7:05 pm
- Location: France
- Contact:
Hello Antonio,
I did some changes to get rowFont for each column.
Could you please have a look if these changes are save.
xBrowser is very complex and I don't feel secure about my own changes.
In xbrowse-class i made 5 chances:
Please see the red lines
1) //----------------------------------------------------------------------------//
CLASS TXBrowse FROM TControl
DATA bClrHeader,; // default color pair for header
bClrFooter,; // default color pair for footer
bClrStd,; // default color pair for normal rows
bClrSel,; // default color pair for selected row
bClrSelFocus,; // default color pair for selected row when control has focus
bFntRowData // default color pair for edition
2) //----------------------------------------------------------------------------//
METHOD New( oWnd ) CLASS TXBrowse
::bFntRowData := {|| oWnd:oFont }
3) //----------------------------------------------------------------------------//
CLASS TXBrwColumn
DATA bClrHeader,; // default color pair for header
bClrFooter,; // default color pair for footer
bClrStd,; // default color pair for normal rows
bClrSel,; // default color pair for selected row
bClrSelFocus,; // default color pair for selected row when control has focus
bClrEdit,; // default color pair for edition
bFntRowData
4) //----------------------------------------------------------------------------//
METHOD Adjust() CLASS TXBrwColumn
DEFAULT ::bClrHeader := ::oBrw:bClrHeader,;
::bClrFooter := ::oBrw:bClrFooter,;
::bClrStd := ::oBrw:bClrStd,;
::bClrSel := ::oBrw:bClrSel,;
::bClrSelFocus := ::oBrw:bClrSelFocus ,;
::bClrEdit := ::bClrStd,;
::bFntRowData := ::oBrw:bFntRowData
5) //----------------------------------------------------------------------------//
METHOD PaintData( nRow, nCol, nHeight, lHighLite, lSelected, nOrder ) CLASS TXBrwColumn
hDC := ::oBrw:GetDC()
oFont := ::oDataFont
if ::bFntRowData != nil
oFont := Eval( ::bFntRowData )
endif
//----------------------------------------------------------------------------//
In your prg-file adress the codeblock like:
//----------------------------------------------------------------------------//
oxBrw:bFntRowData := { || f_fntRowData() }
STATIC FUNCTION f_fntRowData()
LOCAL oFntRow:=""
IF (ordkeyno()) % 2 == 0
oFntRow := oWHSetup:oFntKlein()
ELSE
oFntRow := oWHSetup:oFntGross()
ENDIF
RETURN (oFntRow)
I did some changes to get rowFont for each column.
Could you please have a look if these changes are save.
xBrowser is very complex and I don't feel secure about my own changes.
In xbrowse-class i made 5 chances:
Please see the red lines
1) //----------------------------------------------------------------------------//
CLASS TXBrowse FROM TControl
DATA bClrHeader,; // default color pair for header
bClrFooter,; // default color pair for footer
bClrStd,; // default color pair for normal rows
bClrSel,; // default color pair for selected row
bClrSelFocus,; // default color pair for selected row when control has focus
bFntRowData // default color pair for edition
2) //----------------------------------------------------------------------------//
METHOD New( oWnd ) CLASS TXBrowse
::bFntRowData := {|| oWnd:oFont }
3) //----------------------------------------------------------------------------//
CLASS TXBrwColumn
DATA bClrHeader,; // default color pair for header
bClrFooter,; // default color pair for footer
bClrStd,; // default color pair for normal rows
bClrSel,; // default color pair for selected row
bClrSelFocus,; // default color pair for selected row when control has focus
bClrEdit,; // default color pair for edition
bFntRowData
4) //----------------------------------------------------------------------------//
METHOD Adjust() CLASS TXBrwColumn
DEFAULT ::bClrHeader := ::oBrw:bClrHeader,;
::bClrFooter := ::oBrw:bClrFooter,;
::bClrStd := ::oBrw:bClrStd,;
::bClrSel := ::oBrw:bClrSel,;
::bClrSelFocus := ::oBrw:bClrSelFocus ,;
::bClrEdit := ::bClrStd,;
::bFntRowData := ::oBrw:bFntRowData
5) //----------------------------------------------------------------------------//
METHOD PaintData( nRow, nCol, nHeight, lHighLite, lSelected, nOrder ) CLASS TXBrwColumn
hDC := ::oBrw:GetDC()
oFont := ::oDataFont
if ::bFntRowData != nil
oFont := Eval( ::bFntRowData )
endif
//----------------------------------------------------------------------------//
In your prg-file adress the codeblock like:
//----------------------------------------------------------------------------//
oxBrw:bFntRowData := { || f_fntRowData() }
STATIC FUNCTION f_fntRowData()
LOCAL oFntRow:=""
IF (ordkeyno()) % 2 == 0
oFntRow := oWHSetup:oFntKlein()
ELSE
oFntRow := oWHSetup:oFntGross()
ENDIF
RETURN (oFntRow)
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Otto,
Instead of adding a new DATA, we could check if ::oDataFont contains a codeblock:
Anyhow, there are more places where this must be checked. See next msg
Instead of adding a new DATA, we could check if ::oDataFont contains a codeblock:
Code: Select all
METHOD PaintData( nRow, nCol, nHeight, lHighLite, lSelected, nOrder ) CLASS TXBrwColumn
oFont := ::oDataFont
if ValType( oFont ) == "B"
oFont = Eval( oFont, Self )
endif
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Code: Select all
METHOD DataHeight() CLASS TXBrwColumn
...
if ::bStrData != nil .and. ::oDataFont != nil
if ValType( ::oDataFont ) == "B"
nHeight := FontHeight( ::oBrw, Eval( ::oDataFont, Self ) )
else
nHeight := FontHeight( ::oBrw, ::oDataFont )
endif
endif
...
Code: Select all
METHOD DataWidth() CLASS TXBrwColumn
...
if ::bStrData != nil
cText := Eval( ::bStrData, Self )
nLen := Len( cText )
if ValType ( ::oDataFont ) == "B"
oFont = Eval( ::oDataFont, Self )
else
oFont = ::oDataFont
endif
while nFrom <= nLen
cLine := ExtractLine( cText, @nFrom )
cLine := Replicate( "B", Len( cLine ) )
nWidth := Max( nWidth, ::oBrw:GetWidth( cLine, oFont ) )
enddo
endif
...
Code: Select all
METHOD CreateButtons() CLASS TXBrwColumn
...
::oBtnList:SetFont( If( ValType( ::oDataFont ) == "B", Eval( ::oDataFont, Self ), ::oDataFont ) )
...
::oBtnElip:SetFont( If( ValType( ::oDataFont ) == "B", Eval( ::oDataFont, Self ), ::oDataFont ) )
>Instead of adding a new DATA, we could check if ::oDataFont contains a codeblock:
But
oxBrw:bFntRowData := { || }
I think we need to know what Font should be used.
Antonio, do you think 8.01 will have a codeblock for different row height.
For the moment I have hard coded the functionality for my neccessity.
So I can wait for 8.01.
Regards,
Otto
But
oxBrw:bFntRowData := { || }
I think we need to know what Font should be used.
Antonio, do you think 8.01 will have a codeblock for different row height.
For the moment I have hard coded the functionality for my neccessity.
So I can wait for 8.01.
Regards,
Otto
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Otto,
>
But oxBrw:bFntRowData := { || }
I think we need to know what Font should be used.
>
Each column can have a different font, and the font can change in the same column too. oDataFont is ok for that. Unless I am missing something.
>
Antonio, do you think 8.01 will have a codeblock for different row height.
For the moment I have hard coded the functionality for my neccessity.
>
If we have enough time then we will work to include it
>
But oxBrw:bFntRowData := { || }
I think we need to know what Font should be used.
>
Each column can have a different font, and the font can change in the same column too. oDataFont is ok for that. Unless I am missing something.
>
Antonio, do you think 8.01 will have a codeblock for different row height.
For the moment I have hard coded the functionality for my neccessity.
>
If we have enough time then we will work to include it
Thank you.
I meant not different row height but Font.
Although row height would be nice too depending how much text (memofield) you have.
Could you please post a little example how this font codeblock should look like
and how to evaluate.
At the moment I use this to get the different fonts per column:
oCol:bFntRowData := { || f_fntRowData() }
STATIC FUNCTION f_fntRowData()
LOCAL oFntRow:=""
IF (ordkeyno()) % 2 == 0
oFntRow := oFnt1
elseif
…
ELSE
oFntRow := oFnt2
ENDIF
RETURN (oFntRow)
I meant not different row height but Font.
Although row height would be nice too depending how much text (memofield) you have.
Could you please post a little example how this font codeblock should look like
and how to evaluate.
At the moment I use this to get the different fonts per column:
oCol:bFntRowData := { || f_fntRowData() }
STATIC FUNCTION f_fntRowData()
LOCAL oFntRow:=""
IF (ordkeyno()) % 2 == 0
oFntRow := oFnt1
elseif
…
ELSE
oFntRow := oFnt2
ENDIF
RETURN (oFntRow)
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Mr Antonio
My small suggestion. Instead of having a public data bRowfont or oFont holding either codeblock or font object, if oFont is a setget method( access assign ) we do not have to search where all we need to change in the code.
In my personal copy I have done the same for cFooter so that it works without breaking or making too many changes in the orginal source.
my 2 cents
My small suggestion. Instead of having a public data bRowfont or oFont holding either codeblock or font object, if oFont is a setget method( access assign ) we do not have to search where all we need to change in the code.
In my personal copy I have done the same for cFooter so that it works without breaking or making too many changes in the orginal source.
my 2 cents
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Otto,
You use it exactly the same way:
You use it exactly the same way:
Code: Select all
oCol:oDataFont := { || f_fntRowData() }
STATIC FUNCTION f_fntRowData()
LOCAL oFntRow:=""
IF (ordkeyno()) % 2 == 0
oFntRow := oFnt1
elseif
…
ELSE
oFntRow := oFnt2
ENDIF
RETURN (oFntRow)
Last edited by Antonio Linares on Mon Dec 17, 2007 1:28 pm, edited 1 time in total.