Jump to content

New widget aligns: expandx, expandy


photo

Recommended Posts

My suggestion would be to use the HBox and VBox containers with align=expand. Children will only expand in one direction.

I am not sure I can use this advice in my case.

I need to create some widget with 3 childrens:

  1. scrollbox (top)
  2. editline (bottom left)
  3. button (bottom right)

Button size should be fixed; editline should have fixed height and flexible width. Editbox should take all the place that left. How can I do this?

Link to comment

I'm trying write .ui like this:

<window>
 <vbox align="expand">
<scrollbox align="expand"/>
<hbox height="40">
   	<editline align="expand"/>
   	<button width="30"/>
</hbox>
 </vbox>
</window>

In this case editline doesn't actually expand. If I add align="expand" property to hbox, it ignores the height limit (well, it takes 40 as minimum heights value, while I want it to be fixing).

Link to comment

try

<window>
 <vbox align="expand">
   <vbox>
<scrollbox align="expand">
<hbox align="expand">
     <editline align="expand"/>
     <button width="30"/>
   </hbox>
 </vbox>
</vbox>
</window>

 

the double vbox is a trick I picked up from looking at the editor code.

It would be nice if there was a less hacky way to do it.

Link to comment

try

<window>
 <vbox align="expand">
   <vbox>
<scrollbox align="expand">
<hbox align="expand">
     <editline align="expand"/>
     <button width="30"/>
   </hbox>
 </vbox>
</vbox>
</window>

 

the double vbox is a trick I picked up from looking at the editor code.

It would be nice if there was a less hacky way to do it.

 

Then my editbox doesn't change its height either 8(

Link to comment

what about

<window>
  <scrollbox align="expand">
 </scrollbox>
<vbox>
   <hbox align="expand">
  	<editline align="expand" />
  	<button width="30" />
  </hbox>
</vbox>
</window>

 

I don't see any harm in making a less hacky way of doing this then.

Link to comment

what about

<window>
  <scrollbox align="expand">
 </scrollbox>
<vbox>
   <hbox align="expand">
  	<editline align="expand" />
  	<button width="30" />
  </hbox>
</vbox>
</window>

 

I don't see any harm in making a less hacky way of doing this then.

Yay) It works, thank you very much!)

Link to comment
×
×
  • Create New...