Author Topic: Is it possible to copy and past all panel in wxsmith?  (Read 4163 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Is it possible to copy and past all panel in wxsmith?
« on: December 27, 2011, 02:23:43 am »
I'm design a wxform application, when after adding many items in a wxPanel, I found that I need a wxSizer to wrap the panel.

Unluckily, I found that I need to delete the wxPanel, and add all the items again, waste a lot of time.

My question is: Is it possible that I can either
1, add a wxSizer around the wxPanel
2, Cut the whole panel, and add the wxSizer, then past the whole panel in that wxSizer.

Or, Do I have to manually edit the wxs file? (It is a XML file, but I have tried and failed, wxSmith still delete all the inner items when I reopened the resource, maybe, I did not edit the wxs file correctly)

Thanks.
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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Is it possible to copy and past all panel in wxsmith?
« Reply #1 on: December 27, 2011, 11:05:03 am »
I just tested it in the wxSmith branch and it works.

I created a wxFrame, added a panel with two subitems.
I cut the panel with Ctrl+x (the editor must have the focus), added a sizer, selected the "Insert new widgets into selected item" button and pasted the panel with Ctrl+v.

Seems to work in trunk also.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Is it possible to copy and past all panel in wxsmith?
« Reply #2 on: December 27, 2011, 03:05:26 pm »
selected the "Insert new widgets into selected item" button and pasted the panel with Ctrl+v.
I forgot to select this button, so I got failed.

Now, it works. Thanks jens.  :)
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.