User forums > Help
is it posible to convert a wxs file into a xrc?
wobien:
Hi,
If I start a new wxWidgets project with wxSmith my main window is created in a wxs file without an xrc.
Is it possible to convert this wxs file into a xrc file?
Comparing them in a texteditor shows that they are very similar, but not quite the same.
mikeroku:
I would also recommend to have XRC main dialog in new app wizard.
byo:
XRC option in wizard will have to wait for a while - nobody asked for it before so I thought it's not really necessary.
Quick workaround for wizard is to create project, remove main resource (available under right-click menu on resource browser) and add new resource using XRC. New resource may be set to main (the one that starts up) in wxSmith->Project options menu.
Automatic switching content from wxs to xrc may introduce some small problems. You can try the following:
* Backup project files (I didn't test this method well so it may lead to data loss)
* Copy content of wxs file to desired xrc one
* Edit created xrc file and change name of main node from <wxsmith> to <resource> (remember to rename closing tag at the end of file too)
* Open .cbp file in some text editor (remember to close it in C::B first), find entry related to the resource (it will be inside <wxsmith> node and add attribute called xrc with name of created xrc file like here:
<wxDialog wxs="wxsmith/Testdialog.wxs" src="TestMain.cpp" hdr="TestMain.h" name="TestDialog" language="CPP" xrc="Testdialog.xrc" />,
name relative to project path.
* Now open project in C::B and open converted resource - while opening wxSmith should update xrc file to follow xrc standard.
I'm planning to add conversion on demand one day (just by few clicks) but it ontroduces few problems - not everything can be done when using xrc file so it may cut some stuff.
Regards
BYO
aPlatypus:
Hello ...
I am interested in the XRC question myself. I was looking at the 'complicated' recipe to convert. How different are the files? It occurs to me, that an XSLT filter is called for. After all that is what XSLT is built to do :wink:
It seems to me that a simple little script might do the job anyway (without XSLT). Is the wxSmilth layout documented some place?
I've got another question, why not use an XRC based schema? I would 'see' two way to accomplish that. To embed the XRC as embedded XML in a wxSmith layout. Or, to keep two files. One the XRC and the other a 'wxSmith helper' file.
I hope I'm not over simplifying this. Something to think about, I think.
Cheers,
Will.
byo:
--- Quote from: aPlatypus on March 26, 2008, 01:10:48 pm ---I am interested in the XRC question myself. I was looking at the 'complicated' recipe to convert. How different are the files? It occurs to me, that an XSLT filter is called for. After all that is what XSLT is built to do :wink:
--- End quote ---
Generraly wxs file (when used for resource without separate xrc file) only use different name of root node and adds few extra properties / nodes. Simple text editor should be enough ;)
--- Quote ---I've got another question, why not use an XRC based schema? I would 'see' two way to accomplish that. To embed the XRC as embedded XML in a wxSmith layout. Or, to keep two files. One the XRC and the other a 'wxSmith helper' file.
--- End quote ---
You can create wxSmith resources which does use xrc files, in such case wxs file does keep only those extra informations that are not covered inside xrc files and xrc should have valid resource structure.
But XRC files have some limitations which have to be taken into consideration - for example you can not put wxTimer object inside it. That's why wxSmith have to add few limitations to be compatible with XRC.
Regards
BYO
Navigation
[0] Message Index
[#] Next page
Go to full version