Author Topic: Inserting a new sizer between existing ones  (Read 189 times)

Offline spflanze

  • Multiple posting newcomer
  • *
  • Posts: 27
Inserting a new sizer between existing ones
« on: November 08, 2017, 12:17:48 am »
Inside a verically aligned wxBoxerSizer I have several wxStaticBox sizers with items such as wxComboBox and wxGid in them. Now I need to add a new wxStaticBox sizer between two that already exist. I find I am not able to do this. When I try to the new sizer ends up inside an existing one, or it ends up outside them all but at the bottom of all of them.

How can this insertion between two existing sizers be done?

Is there a way to move a sizer or other item around in the Resources tab's tree? I could achieve my goal if I could change the order the sizers re listed in there.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7217
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Inserting a new sizer between existing ones
« Reply #1 on: November 08, 2017, 06:16:01 am »
I guess you are talking about wxSmith here.

On the right side of the wxSmith "editor" you should have some buttons, id you place the mousepointer over theme a tooltip should be shown.
Click the fourth button ("Insert new widgets after current selection"), select the sizer,that should be before the new one in the "Resources"-tab of the "Management"-pane (or directly with the mouse), then click on the appropriate sizer in the "Layoout"-tab of the wxSmith "editor" and it should appear where you want it.

Offline spflanze

  • Multiple posting newcomer
  • *
  • Posts: 27
Re: Inserting a new sizer between existing ones
« Reply #2 on: November 09, 2017, 02:02:11 am »
Thanks for your help. This did work. Now I need to know now to move an already existing sizer between two other sizers. Can this be done? Or will I have to move the widgets within an existing sizer into a new sizer and then delete the emptied sizer?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 4982
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Inserting a new sizer between existing ones
« Reply #3 on: November 09, 2017, 05:01:44 pm »
For me, If I can't do something with wxSmith GUI, then I just manually edit the wxs file, as it is a xml file which has the wxWidigets' XRC format.  ;)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.