# Groupbox elements get their bounds mixed up (fixed)

**URL:** <https://forum.cabbageaudio.com/t/groupbox-elements-get-their-bounds-mixed-up-fixed/32>\
**Category:** Cabbage slugs\
**Created:** [15 October 2015 19:29 UTC](https://forum.cabbageaudio.com/t/groupbox-elements-get-their-bounds-mixed-up-fixed/32 "2015-10-15T19:29:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsenna](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/g/a88e4f/32.png) [@gsenna](https://forum.cabbageaudio.com/u/gsenna)\
**Post date:** [15 October 2015 19:29 UTC](https://forum.cabbageaudio.com/t/groupbox-elements-get-their-bounds-mixed-up-fixed/32/1 "2015-10-15T19:29:13Z")

</div>

This bug could probably be related to the other thing I mentioned over the Csound list. That is, in Linux, I can’t select/move the elements inside a groupbox. Whenever I click on them, the groupbox itself gets selected. The bug of this topic is that if I double-click inside a groupbox, bounds() get mixed up. For example, I created a groupbox with:

groupbox bounds(278, 52, 351, 154), plant(“GUIabst\_1”), text(“Selector”), colour(0, 200, 100, 100), fontcolour(255, 255, 255, 255) {  
checkbox bounds(16, 32, 28, 25), channel(“chk\_1”), shape(“rounded”), colour(“red”)  
label bounds(56, 30, 249, 12), text(“Label 1”), fontcolour(“white”), align(“left”)  
label bounds(56, 42, 249, 12), text(“Label 2”), fontcolour(“white”), align(“left”)  
combobox bounds(206, 30, 60, 25), channel(“combo\_1”), channeltype(“string”), text(“3”, “5”, “8”)  
}

Then I double-click on it while in edit-mode and the magic happens:

groupbox bounds(278, 52, 351, 154), plant(“GUIabst\_1”), text(“Selector”), colour(0, 200, 100, 100), fontcolour(255, 255, 255, 255) {  
checkbox bounds(56, 30, 249, 12), channel(“chk\_1”), shape(“rounded”), colour(“red”)  
label bounds(56, 42, 249, 12), text(“Label 1”), fontcolour(“white”), align(“left”)  
label bounds(16, 32, 28, 25), text(“Label 2”), fontcolour(“white”), align(“left”)  
combobox bounds(206, 30, 60, 25), channel(“combo\_1”), channeltype(“string”), text(“3”, “5”, “8”)  
}

So:

- Checkbox’s bounds get replaced by label 1 bounds,
- Label 1 -\> Label 2,
- Label 2 -\> Checkbox,
- Combobox actually stays the same.

What could be happening?

EDIT: I just installed Cabbage in Windows XP(32bit) and I’m observing the same two bugs described above.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 October 2015 19:36 UTC](https://forum.cabbageaudio.com/t/groupbox-elements-get-their-bounds-mixed-up-fixed/32/2 "2015-10-16T19:36:33Z")

</div>

The whole point of a plant is that you can move all the components in one go, as a group. If you want to move each component on its own, don’t make the groupbox a plant?

---

<div class="post-metadata">

**Author:** ![gsenna](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/g/a88e4f/32.png) [@gsenna](https://forum.cabbageaudio.com/u/gsenna)\
**Post date:** [16 October 2015 20:51 UTC](https://forum.cabbageaudio.com/t/groupbox-elements-get-their-bounds-mixed-up-fixed/32/3 "2015-10-16T20:51:41Z")

</div>

Oh, sorry. You’re right. If you don’t make the groupbox a plant, it works! So when you are just sketching the UI, you should not set the plant value. Otherwise you have to edit the bounds by hand.

I think the other thing is really a bug. Could you try to reproduce it? Just create a groupbox like this:

groupbox bounds(72, 120, 351, 154), text(“G1”), colour(0, 200, 100, 100), fontcolour(255, 255, 255, 255), plant(“newPlant”){  
combobox bounds(44, 64, 53, 28), channel(“combo\_1”), channeltype(“string”), text(“1”,“2”)  
combobox bounds(120, 64, 53, 28), channel(“combo\_2”), channeltype(“string”), text(“3”,“4”)  
label bounds(38, 26, 142, 23), text(“Label”)  
}

Then save/update instrument, go into Edit-mode and click on the groupbox.

I was lookin into the code. Could it be that the line numbers somehow get mixed up in ‘void ComponentLayoutEditor::mouseUp(const MouseEvent& e)’?

Thank you Rory.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 October 2015 22:55 UTC](https://forum.cabbageaudio.com/t/groupbox-elements-get-their-bounds-mixed-up-fixed/32/4 "2015-10-16T22:55:16Z")

</div>

Thanks, I can recreate the problem, but only if I double click on the plant. So I’m thinking that disabling double-clicking on a plant would be a simple solution. Let me take a look.

…just took a quick look there. I think I had better find the route of the problem rather than covering it up 😉

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [17 October 2015 10:51 UTC](https://forum.cabbageaudio.com/t/groupbox-elements-get-their-bounds-mixed-up-fixed/32/5 "2015-10-17T10:51:41Z")

</div>

Commenting out the label widget stops the weirdness. I’m still looking for a fix.

…I’ve found the problem. A workaround for now is to put the label above other components in the plant. In fact, all non-interactive components(labels, images, etc) should be placed above interactive ones(sliders, buttons. checkboxes, .etc). Now that I have identified the problem, I should be able to fix it. Fingers crossed!

…That was an interesting one! But I found a fix. I just checked it into the main dev branch if you want to have a go. I haven’t had time to really test it out yet.

---

<div class="post-metadata">

**Author:** ![gsenna](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/g/a88e4f/32.png) [@gsenna](https://forum.cabbageaudio.com/u/gsenna)\
**Post date:** [18 October 2015 15:27 UTC](https://forum.cabbageaudio.com/t/groupbox-elements-get-their-bounds-mixed-up-fixed/32/6 "2015-10-18T15:27:18Z")

</div>

As soon as I have some time I’ll check the devel branch and start testing! Thanks Rory.
