Page 1 of 1
bBrowser 4 tweaks
Posted: Sat May 25, 2019 4:00 am
by Anonymous
I've just got a datawindow, and dropped a bBrowser control onto it via the WED. How do I change the order and width of each column please? I worked out the captions, but can't see how to set the default column order and widths...
Any ideas please?
bBrowser 4 tweaks
Posted: Sat May 25, 2019 4:17 am
by wriedmann
Hi Jeff,
you have to do it manually.
I'm using this method to simplify:
Code: Select all
method AddColumn( cCaption, uField, symType, nWidth, nAlignment ) class StdBrowser
//p Spalte hinzufügen mit möglichst wenig Code
//s
local oColumn as bDataColumn
oColumn := bDataColumn{ oDCGrid, _oDBServer, uField, IIf( IsSymbol( symType ), symType, #field ) }
oColumn:Caption := cCaption
if IsNumeric( nWidth )
oColumn:Width := nWidth
endif
if IsNumeric( nAlignment ) .and. nAlignment >= 0
if oColumn:DataView == null_object
oColumn:DataView := bViewStyle{ ,, nAlignment }
else
oColumn:DataView:Alignment := nAlignment
endif
if oColumn:CaptionView == null_object
oColumn:CaptionView := bViewStyle{ ,, nAlignment }
else
oColumn:CaptionView:Alignment := nAlignment
endif
endif
oDCGrid:AddColumn( oColumn )
oDCGrid:OpenColumn( oColumn )
return oColumn
And yes, this code works also in the X# version of bBrowser.
Wolfgang
bBrowser 4 tweaks
Posted: Sat May 25, 2019 4:28 am
by BiggyRat
Thank you very much Wolfgang, I'll give that a try.
Question, I get it needs to be done manually, but how do I pass the parameters? The bBrowser was put on the window via the WED, but I can't see where to pass any parameters
bBrowser 4 tweaks
Posted: Sat May 25, 2019 8:02 am
by wriedmann
Hi Jeff,
this has to be done in the Init() method of your window.
But there are samples in the bBrowser documentation how it needs to be used.
Wolfgang