G4P GUI Builder Tree View - Altering Parent-Child relationships?

Hi Quark,

I realize this is more of a feature request, than a question. Regardless, I thought I should mention it in case you agreed with regard to any upcoming version. I'd be lost without G4P and your GUI Builder. :)

It would be helpful if in the tree view of the GUI Builder if a user was able to sort each control, in order to define parent and child relationships with respect to controls belonging to Windows and Floating Panels. This could be accomplished with up and down buttons to move a control vertically along the tree-- and then left and right buttons to declare the hierarchy.

Alternatively, if in the Properties of a control, there was a drop down that allowed that relationship to change?

The problem I face is that I'm stuck with my current organization- and face starting all over from scratch. It's one of those, "if only I'd had the foresight to know how this app was going to change," things. At minimum, I wish I'd put everything in separate floating panels! Because of how X,Y of a control are relative to the floating panel, I can't simply add them in the CustomGUI() function without making a huge overlapping mess in the GUI. :)

I realize what I'm suggesting sounds simple enough but may be a catastrophic nightmare on your end to implement. :) Hope this makes sense & thanks for your continued improvements on G4P,

Rudnik

Tagged:

Answers

  • edited April 2015

    In case anyone might find this with the same dilemma, I'm solving my problem of wanting to shove controls into Panels-- after my GUI is already been laid out. I'm doing it with this function that I call within my customGUI():

    `

    void cp(GPanel panel, GSlider control, int x, int y){ panel.addControl(control); control.moveTo(control.getX() - panel.getX() + x, control.getY() - panel.getY() + y); }

    void cp(GPanel panel, GCheckbox control, int x, int y){ panel.addControl(control); control.moveTo(control.getX() - panel.getX() + x, control.getY() - panel.getY() + y); }

    void cp(GPanel panel, GLabel control, int x, int y){ panel.addControl(control); control.moveTo(control.getX() - panel.getX() + x, control.getY() - panel.getY() + y); }

    `

    This assumes that in the GUI, your panel is to the left and level to the top of the controls you want to package into a panel. If not, the x and y can be used to offset.

    It's hacky.. and less than ideal. But it sure beats starting over fresh with my GUI!

  • Answer ✓

    I appreciate the difficulties you are experiencing and I will investigate what can be done in a future release.

Sign In or Register to comment.