User forums > Help

is it posible to convert a wxs file into a xrc?

<< < (2/2)

aPlatypus:
Hi Byo

Hope all is well.  Thanks for your response.  I appreciate that the xwSmith layout is similar to XRC.


--- Quote ---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
--- End quote ---

The reason to use a XSLT is to make transformations automatic, to wxSmith and from wxSmith to XRC and the paired-down-wxSmith layout makes it for a fully automated step possible.  It is a philosophical point(??) never repeat yourself.  In my history, the most tedious of repetitive exercises involve text editors -- At that time I throw and awk script at the opportunity.

XSLT is the Naughty (00-s) answer for we remaining frustrated awk fans.

Having looked at the wxSmith layout and made the conversion to XRC a few times now, why don't you just use the XRC by default anyway!  That would make for a cleaner design.  As if the wxSmith encapsulated the XRC.  At them moment it looks as if we have a bit of a hybrid.

Surely that kind, DRY (don't repeat yourself), approach has to be easier on maintaining the plug-in.  It is a minor thing really.  My unspeakable history reminds me that it is just the small things in design that have the potential to be annoying in the long-run.  *grin*

Aloha,
          Will

byo:

--- Quote from: aPlatypus on May 01, 2008, 02:47:39 pm ---Having looked at the wxSmith layout and made the conversion to XRC a few times now, why don't you just use the XRC by default anyway!  That would make for a cleaner design.  As if the wxSmith encapsulated the XRC.  At them moment it looks as if we have a bit of a hybrid.

--- End quote ---

XRC file adds some limits into designer - for example such items like timers are not available because XRC can not handle them. It also don't define some extra properties - for example with XRC you can't define items inside wxTreeCtrl and I planned this functionality. So currently wxSmith works like this: by default it don't use XRC file because it adds limitations, but if you have to use it for some reason you can always do so.

Regards
   BYO

rickg22:
Byo: How about making derivative classes that do the initialization like you want it?

From http://lists.wxwidgets.org/pipermail/wx-users/2002-September/024391.html :


--- Quote ---> one major thing i fight with is usually that it seems to allowe
> only the common classes like wxTreeCtrl and stuff.

Fortunately for you, this is not true anymore :) The syntax is quite
simple:

--- Code: ---   <object class="wxTreeCtrl" subclass="MyTreeCtrl">
       ...
   </object>
MyTreeCtrl must be registered in wx's RTTI system:
   class MyTreeCtrl: public wxTreeCtrl
   {
      DECLARE_DYNAMIC_CLASS(MyTreeCtrl)
   }
   ...
   IMPLEMENT_DYNAMIC_CLASS(MyTreeCtrl, wxTreeCtrl)


--- End code ---
HTH,
Vaclav

--- End quote ---

I imagine that if you also define xrc handlers for objects like wxTimer, maybe that could do the trick :)

byo:

--- Quote from: rickg22 on May 05, 2008, 08:00:51 pm ---Byo: How about making derivative classes that do the initialization like you want it?

From http://lists.wxwidgets.org/pipermail/wx-users/2002-September/024391.html :

--- End quote ---

That may require some extra libraries to be included in project using wxSmith. I quess that it would be better just to add some extra customizing code right after xrc file is loaded. But that won't be simple solution ;).


--- Quote ---I imagine that if you also define xrc handlers for objects like wxTimer, maybe that could do the trick :)

--- End quote ---

It won't help much, I can only get items accessible through wxWindow::FindWindow. So the only solution I see now is to create some fake invisible component that contains timer - but that adds some overhead.

Regards
   BYO

xawari:
Sorry for bringing up such an old topic, but I really want to ask.

I too want and option to use XRC by default in a New App wizard. But still there's nothing done after two years and I wonder if it's still planned to be done?
(I'm really tired of deleting and re-creating dialogs and frames every time :) )


PS: using XML comments for additional data storing is not an option? (MSVC does this all the time)

Navigation

[0] Message Index

[*] Previous page

Go to full version