Author Topic: How to add a standalone panel(dialog) in wxSmith  (Read 16556 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
How to add a standalone panel(dialog) in wxSmith
« on: December 30, 2011, 10:46:10 am »
I would like to create a custom dialog, similar like many option dialogs in Codecompletion plugins.

Do I just create a xrc file, and then open/edit it with wxsmith?

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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #1 on: December 30, 2011, 11:02:24 am »
Why don't you use wxsmith to create the dialog and skip the XRC part?
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #2 on: December 30, 2011, 11:09:09 am »
Do I just create a xrc file, and then open/edit it with wxsmith?
When creating a wxSmith dialog there is an option to (also) create a XRC file. I guess that's what you want.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #3 on: December 30, 2011, 11:58:58 am »
When creating a wxSmith dialog there is an option to (also) create a XRC file. I guess that's what you want.
Thanks OBF and morten. But I have no idea how to let wxsmith to create an empty dialog for me, I have look at the items panel (Dialogs) of wxsmith, but all were specific dialogs(ColorDialog, DirDialog)..

So, how to create an empty dialog?

EDIT:
answer my self:
Oh, I found it under the wxSmith menu.

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 Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #4 on: December 30, 2011, 01:30:10 pm »
It's one of reasons why I have switched from wxSmith to wxFormBuilder. I haven't found how can I create more than one "top level" resource in my XRC file using wxSmith. Once I created a top level window, everything needed to be a child of this window. Create a set of popup menus? Forget it. Create a set of dialogs along with your main window? Forget it. wxFormBuilder allows more than one top level resource. Moreover, wxFormBuilder can create only a XRC file - well, it creates a code, too, and you can paste parts of the code in your own code.

I am curious what I have missed. I am a "XRC user", too.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #5 on: December 30, 2011, 02:24:31 pm »
I haven't found how can I create more than one "top level" resource in my XRC file using wxSmith.
That's not supported, yes - but I also believe that's a bad coding style. So I doubt it really makes sense to support such.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #6 on: December 30, 2011, 06:08:27 pm »
Why a bad coding practice, Morten? Where do you want to place popup menus and dialogs and how do you want to load them? For example, wxSmith allowed me only one menu per window: having a menu, I wasn't able to add a popup one. Or, consider a user written error dialog: which window does it belong to, which window should it be a child? What about bitmaps or icons, they can be a part of XRC as well?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #7 on: December 30, 2011, 07:01:59 pm »
What is the problem with placing the custom error dialog in separate xrc 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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #8 on: December 30, 2011, 07:50:25 pm »
You can also add several menus and use the (e.g.) as popup-menu.
Images are also supported as single images or image-list (look into tools in wxSmith tabs).

Offline ouch

  • Almost regular
  • **
  • Posts: 223
Re: How to add a standalone panel(dialog) in wxSmith
« Reply #9 on: December 31, 2011, 12:19:44 am »
Yeah, I was going to say, just create a new file for each dialog/window. It works great, plus it makes it easy to use bits from one program in another. For example I pretty much use the same about box in all my apps.