Author Topic: How to convert a wxPanel to wxDialog or back in wxSmith?  (Read 4287 times)

Offline Calmarius

  • Multiple posting newcomer
  • *
  • Posts: 32
How to convert a wxPanel to wxDialog or back in wxSmith?
« on: May 23, 2010, 02:27:58 pm »
I created a wxPanel with lots of gui elements and I've done with the event handlers and so on when I suddenly realized what I need is a wxDialog not a wxPanel. And it seems I can't show a wxPanel as modal dialog.
I tried to change its class name but there is no such option for the root element.

Is there any way to convert a wxPanel to wxDialog?

Even if I try to rename the file rename every wxPanel to wxDialog in the wxs, rename and refactor everything in the H and CPP file, trying to remove the wxs from the project and add it again manully by writing the cbp file it still somehow find the way to turn everything back to wxPanel and still show that resource among the wxpanels, As soon as I changed a label in a button and I hit save it ruins all my refactorings and turns every wxDialog back to wxPanel. Where is the magic that does this and how to circumvent that?

Do I really need to start over every time from scratch after such wrong decisions?
« Last Edit: May 23, 2010, 02:33:39 pm by Calmarius »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to convert a wxPanel to wxDialog or back in wxSmith?
« Reply #1 on: May 23, 2010, 02:39:24 pm »
Maybe you can try to modify the wxs file?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Calmarius

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: How to convert a wxPanel to wxDialog or back in wxSmith?
« Reply #2 on: May 23, 2010, 02:46:31 pm »
"rename every wxPanel to wxDialog in the wxs"

I tryed it that but it didn't work... wxSmith still able to turn everything back.
« Last Edit: May 23, 2010, 02:49:32 pm by Calmarius »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to convert a wxPanel to wxDialog or back in wxSmith?
« Reply #3 on: May 23, 2010, 03:04:03 pm »
"rename every wxPanel to wxDialog in the wxs"

I tryed it that but it didn't work... wxSmith still able to turn everything back.
You should try to change it in the project-file (*.cbp) also.
Section "Extensions -> wxsmith -> resources"

Offline Calmarius

  • Multiple posting newcomer
  • *
  • Posts: 32
Re: How to convert a wxPanel to wxDialog or back in wxSmith?
« Reply #4 on: May 23, 2010, 03:39:32 pm »
Oh, thx now its works. I didn't noticed the element name...  xD