News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Adding existing wxsmith dialog to project

Started by Rocketrrt, October 18, 2016, 04:18:12 PM

Previous topic - Next topic

Rocketrrt

Hi,

I created a wxsmith dialog in a project I have, already had 40 dialogues in it. It did not save the new files in the project (not sure why)  All the files are there(cpp, h and wxs) in correct directories.  I can easily add the cpp and h file the project no problem.  How do I add the wxs (dialog) file to the Resources so I can edit the dialog using CodeBlocks.  I have tried to add the file like I would with cpp and h files and it adds it to the Resources under projects but when I try to edit it it comes up as XML file, not in the dialog editor.

Any help would be appreciated.

Thanks,
Ron

BlueHazzard

This is a bit tricky...
sadly i don't know any ui to do this. @dev: Is there any?

You have to edit the project file by yourself:
1) Make a copy of the target project file
2) Copy all needed files (xrc, cpp, h, wxs) to the right locations
3) Open the start project file with a editor (notepad++ or notepad)
4) Copy the the right line from the Extensions->wxsmith part:

<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
<wxsmith version="1">
<gui name="wxWidgets" src="fdgfdhgfApp.cpp" main="fdgfdhgfDialog" init_handlers="necessary" language="CPP" />
<resources>
<wxDialog wxs="wxsmith/fdgfdhgfdialog.wxs" src="fdgfdhgfMain.cpp" hdr="fdgfdhgfMain.h" fwddecl="0" i18n="1" name="fdgfdhgfDialog" language="CPP" />
<wxDialog wxs="wxsmith/NewDialog.wxs" src="NewDialog.cpp" hdr="NewDialog.h" xrc="NewDialog.xrc" fwddecl="0" i18n="1" name="NewDialog" language="CPP" />
</resources>
</wxsmith>
</Extensions>

to the target project file in the same location

for example if you want to add the dialog NewDialog.wxs to the new project copy the line
<wxDialog wxs="wxsmith/NewDialog.wxs" src="NewDialog.cpp" hdr="NewDialog.h" xrc="NewDialog.xrc" fwddecl="0" i18n="1" name="NewDialog" language="CPP" />

5) Save project file and open it in codeblocks
6) Add all files to the target project via the codeblocks ui

hope this helps

greetings

Rocketrrt


oBFusCATed

Bluehazzard: I don't remember if there is an UI for this, but it will be good if we have this. Because I think I've done the same editing steps in the past.
(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!]

Rocketrrt

Hi,

I also found another way to do this, but I think the way first posted is the fastest.  The other way is save all the files (.cpp .h and wxs) off some where else or rename them.  Then in code::blocks create a new dialog with the same name save and exit and copy or rename the files that we saved overwriting the new files created. I was just playing around and tried this and it worked also.

Ron