Code::Blocks Forums

User forums => Help => Topic started by: ollydbg on December 30, 2011, 10:46:10 am

Title: How to add a standalone panel(dialog) in wxSmith
Post by: ollydbg 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.
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: oBFusCATed on December 30, 2011, 11:02:24 am
Why don't you use wxsmith to create the dialog and skip the XRC part?
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: MortenMacFly 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.
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: ollydbg 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.
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: Radek 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.
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: MortenMacFly 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.
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: Radek 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?
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: oBFusCATed on December 30, 2011, 07:01:59 pm
What is the problem with placing the custom error dialog in separate xrc file?
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: Jenna 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).
Title: Re: How to add a standalone panel(dialog) in wxSmith
Post by: ouch 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.