LAYOUT_WeightBar

4 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2014-04-21 21:15
LAYOUT_WeightBar

1) Is there a way yet to get a signal from a LAYOUT_WeightBar like with WMHI_GADGETUP? I want to know when the user resized the panes so I can update some stuff.

2) In my layout I have a horizontal group separated by vertical LAYOUT_WeightBar for left/right sizing. I tried putting another LAYOUT_WeightBar below that group for up/down sizing. It won't move. Is this possible?

  1. --------------------------------
  2. | | |
  3. | | |
  4. | | | <--- weightbar in center left/right
  5. | | |
  6. | | |
  7. -------------------------------- <--- weightbar up/down
  8. | |
  9. | |
  10. --------------------------------

3) The weightbar for the top section will accept WeightedWidth sizes if there is 1 gadget on each side (same horizontal group). If I try to put 2 on the right side stacked, it always splits the 2 sides 50/50, even though I am giving it a WeightedWidth size. Using a group "breaks" it.

This works fine:

  1. StartHGroup,
  2. Gadget1,
  3. WeightedWidth,25,
  4.  
  5. WeightBar,
  6.  
  7. Gadget2,
  8. WeightedWidth,75,
  9. EndHGroup,

This does not:

  1. StartHGroup,
  2. Gadget1,
  3. WeightedWidth,25,
  4.  
  5. WeightBar,
  6.  
  7. StartVGroup,
  8. Gadget2,
  9. Gadget3,
  10. WeightedWidth,75,
  11. EndVGroup,
  12. EndHGroup,

It makes both sides 50/50.

salass00
salass00's picture
Offline
Last seen: 7 months 2 weeks ago
Joined: 2011-02-03 11:27
In the second version you are

In the second version you are setting the weighted width for Gadget3 inside the VGroup, which is a no-op since there is nothing else that uses horizontal space in there as it's a vertical group. You want to set it for the VGroup instead.

mritter0
mritter0's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2014-04-21 21:15
That was it! I didn't know

That was it! I didn't know you could use CHILD_ tags on the groups. Thank you!

thomas
thomas's picture
Offline
Last seen: 1 week 5 days ago
Joined: 2011-05-16 14:23
1) Is there a way yet to get

1) Is there a way yet to get a signal from a LAYOUT_WeightBar like with WMHI_GADGETUP? I want to know when the user resized the panes so I can update some stuff.

Actually you should not need this. Every gadget in the resized area is automatically resized and redrawn by each gadget's respective GM_LAYOUT and GM_RENDER method.

If you have custom graphics, you should embed it into a space.gadget with a SPACE_RenderHook. Then your graphics will be redrawn automatically, too.

If you need more control, for example mouse clicks into your custom area, you could make your own gadget class. Then you have full control over every aspect of the gadget.

2) In my layout I have a horizontal group separated by vertical LAYOUT_WeightBar for left/right sizing. I tried putting another LAYOUT_WeightBar below that group for up/down sizing. It won't move. Is this possible?

The weight bar can only be moved if the parts on both sides of the bar are resizable. If one side holds only gadgets with fixed size, then the bar cannot be moved.

In your drawing the area below the up/down bar looks like a group with ok / cancel buttons. Such a group usually has the LAYOUT_FixedVert attribute set to FALSE. In this case the group cannot be resized vertically and the bar won't move.

The same applies to the window's size gadget. If the window contains only gadgets / groups with a fixed width, the size gadget won't move horizontally and if all gadgets have a fixed height, the size won't change vertically.

I didn't know you could use CHILD_ tags on the groups.

Layout groups are gadget objects like any other. From the parent group's point of view, the child group is just another member. It does not know nor care whether it is a usual gadget or another group.

Log in or register to post comments