Cabbage Logo
Back to Cabbage Site

Groupbox elements get their bounds mixed up (fixed)

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.

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?

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.

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 :wink:

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.

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