nDataStrAlign := AL_RIGHT
Is it possible to change alignment on the fly?
Thanks in advance
Otto
nDataStrAlign := AL_RIGHT
Is it possible to change alignment on the fly?
Thanks in advance
Otto
Otto,
Have you tried to change it and refresh the browse ?
Thank you. Yes I tried with refresh().
Here is my code:
func f_DataStrAlign(r,c,f,o)
oBrw:nRowDividerStyle := 0 // I put this to proof that refresh is working
oBrw:aCols[ o:nPos ]:nDataStrAlign := AL_RIGHT
oBrw:refresh()
return nil
The text does not move.
Regards,
Otto
Otto,
Try it this way:
oCol = oBrw:aCols[ o:nPos ]
oCol:nDataStrAlign := AL_RIGHT
oCol:nDataStyle := oCol:DefStyle( oCol:nDataStrAlign, ( oCol:oBrw:nDataLines == 1 ) )

Try to RTrim() the column data.
EMG
Working perfectly
METHOD DataAlign( nAlign ) CLASS TXBrwColumn
if ! ( ::nDataStrAlign == nAlign ) // tolerate nil param
::nDataStrAlign := AL_RIGHT
::nDataStyle := ::DefStyle( ::nDataStrAlign, ( ::oBrw:nDataLines == 1 ) )
endif
RETURN ::nDataStrAlign
To nageswaragunupudi:
If I insert the method DataAlign I get all centered.
Regaqrds,
Otto
Mr Otto
Obviously the values should be rtimmed for right justification. My proposed method is only for changing justification on the fly.
If you change the paint method you may like to cover the cases of left, center and riight justifcations and all other possibilities. For non left justified painting probably alltrim(,,,) may be better, We should also keep in mind multiple line painting. Paint is a very generic method. Should we change this paint method or specify bStrData appropriately?
It is most common to right justify numbers and left justify text in tables. Numbers need to be right justified to make the decimals aline. I can't think of a good reason to right justify text.
James
Hello James,
to learn to use xBrowser I created a little tool xBTool to build a xBrowser visually.
There I want to click on the header and select if the column should be right aligned or left.
Doing this I saw that text fields do not align accurately. Therefore I pointed this problem out.
Regards,
Otto