News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to add a standalone panel(dialog) in wxSmith

Started by ollydbg, December 30, 2011, 10:46:10 AM

Previous topic - Next topic

ollydbg

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.

oBFusCATed

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!]

MortenMacFly

Quote from: ollydbg on December 30, 2011, 10:46:10 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

Quote from: MortenMacFly on December 30, 2011, 11:09:09 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.

Radek

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.

MortenMacFly

Quote from: Radek on December 30, 2011, 01:30:10 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Radek

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?

oBFusCATed

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!]

Jenna

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

ouch

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.