[Gambas-user] getting dataview to expand??

Bruce bbruen at ...2308...
Thu Aug 30 12:59:02 CEST 2012


On Thu, 2012-08-30 at 11:47 +0200, Fabien Bodard wrote:
> Yes you can
> Put the button in a hbox and for example add a panel on the left on it and
> set the expand property of the panel to true. You will have a right aligned
> button. You have tools, then it's just matter of imagination
> Le 29 août 2012 23:10, "rocko" <sunblaster5 at ...626...> a écrit :
> 
> >

Rocko,

I have attached a project which I hope might help you.

(Forgive me Richard!) It was Richard Walker's sample project for
assessing his gb.Desktop problems recently - errm as amended by me for
my own purposes.

Look at how it runs and responds to resizing, maximizing etc on the
screen. In particular, look at dragging the bottom right hand corner. Is
this the type of thing you are looking for?

Then look at the form layout in the IDE.  


Before we start, look at the help for the following !Properties! (not
events!):

Form.Arrangement (Returns or sets how this THING arrange its children
controls.)

Form.Expand ((inherited from control) Returns or sets if a THING will
expand if included in a container that arranges its contents.)

<AnyContainer>.Spacing and .Margin and .Padding

OK? Now, the form is arranged Arrange.Vertical  That is, "Indicates that
a container layout its children vertically.  
The children control extends their width to the width of the container
inside."  

Turning that into en_AU, I read: "If you set a container's Arrange
property to "Arrange.Vertical" (or "Vertical" in the IDE property
designer) then firstly, all the children in that container will be laid
out one under the other in the order determined by their Y property.
Secondly, (unless otherwise instructed by their Ignore property*) each
child control will be expanded horizontally to the width of that
container's "inside" (refer back to the Padding and Margin properties)."

One thing you should note here is just what does "children" mean.  It
means only the direct or "first level" controls within the container.
In other words, if container A contains a container B that contains a
control C, then we are only talking about the layout of container B
within container A.

So, within Richard's form, (ignoring the timers, which are virtual
controls anyway) there are two children "Panel1" and "HBox2".  Remember,
FMain is .Arrange=Arrange.Vertical, .Spacing=True and .Margin=True.
What happens is that FMain, when it is resized in any way will layout
Panel1 and HBox2 one under the other in that order and expand them to
the width of it's "inside".  Nothing more and nothing less.

Note however, that Panel1's .Expand property is set to True and
HBox2's .Expand property is set to False.  

Try changing the HBox2.Expand property to True.  See what happens.

I have rattled on here at length.  Have a look at what happens within
these two containers.  Report back if it is or is not starting to make
sense :-)

Bruce 





-------------- next part --------------
A non-text attachment was scrubbed...
Name: WindowExplorer-0.0.4.tar.gz
Type: application/x-compressed-tar
Size: 11967 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20120830/e977ea14/attachment.bin>


More information about the User mailing list