wxXUL perhaps?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

wxXUL perhaps?

Post by Jorg »

As next post to my previous one, called "Getting tired of GUI programming" I noticed my idea was not as new as it seemed ..

XUL is a language used for simple windows in browsers, but can also be a stand alone viewer. This XML could be used very good for generating C++ code for wxWidgets as it also supports sizers etc.

http://www.xulplanet.com/tutorials/xultu/window.html

It would be great if this would become the way to describe the GUI. It is lots easier then XRC, more flexible and widely supported. As XRC converts runtime, XUL could be used to define the GUI and generate C++ code for it

It is just a thought, but it would be a nice addition :-)

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
darklordsatan
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Jul 14, 2005 5:51 am
Contact:

Post by darklordsatan »

Seems nice indeed. But the question is how much of its functionality should be implemented in lets say your imaginary "wxXUL".
I think we would still have the problem of a good RAD editor though(from what I tested in the trial version, Dialog Blocks is amazing, but its not free, so...)
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Well my goal would not be superseding a RAD editor. Everywhere on the web you will find what I was talking about. People are getting tired of the code that needs to be made to make an app work. I was going to extend the XML idea by something like this;

Code: Select all

<dialog name="MainWindow">
   <settings type="registry">
        <autosave windowpos="true">
            <splitter type="pos" name="m_splitter" />
            <list type="index" name="m_items" />
        </autosave>
   </settings>
</dialog>
As you see the added value can be in pre-generated code for VERY common tasks. The settings part should (in theory) generate the code to save the window pos, and more defined GUI elements when needed.

More common solutions can be added like this. I started out with wxCRP to get rid of common solutions and to auto generate them, but in my eyes it was still to cumbersome to maintain the templates and generate the code. When this is possible and for example an about dialog can be added instantaneausly like;

Code: Select all

<dialog type="about">
  <text>Thanks to ... and ... for providing the lib for this</text>
</dialog>
And in the window definition where you want to show the about dialog you can do:

Code: Select all

<dialog>
  <menulist name="File">
    <menuitem name="About" showmodal="about">
  </menulist>
</dialog>
You can clearly see the power of having this. It would definately add value to code programming by eliminating the need to write the standard stuff for very trivial parts of the GUI.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
darklordsatan
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Jul 14, 2005 5:51 am
Contact:

Post by darklordsatan »

The template idea seems really nice, as it would leverage the creation of namely "simple" common dialogs like the about, or maybe the find in files and such.

But the idea is to use some app to generate them anyways, or use a simple XML editor?
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

The editor can be used to add the XML and a parser will interpret the code, generate the C++ code for it. When the backend is generic, there is even no need to have it wxWidgets / C++ specific. Even Python code or Pascal DFM + pas code can be generated.

With the use of comment tags, generated code could be easily replaced.

This is all in concept and in my head. But right now it seems like the missing link I needed for a long time. If you know wxCRP, it did about that by asking some questions, and generating conditional code for it. The problem was that old code was overwritten and no proper code insertion mechanism was there. With XML and code generation tags, templates can be improved / added (e.g. others can make "components" that implement other common stuff) and re-generated when needed.

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
darklordsatan
Earned a small fee
Earned a small fee
Posts: 17
Joined: Thu Jul 14, 2005 5:51 am
Contact:

Post by darklordsatan »

Well anyway, if you're thinking of making such idea a reality, Ill be glad to see it someday. I wish I could tell you "I can help!", but I just started my wx journey some days ago (although Ive been following its progress since before the "wxwindows" times, and recommending it everywhere the question "what GUI toolkit should I use?" pops up. Ironically is, I recommended it but I never tried it before :) )

Cheers
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

Thanks :-)

Well I am thinking of ways how to implement it. One thing that springs to mind is creating a skeleton codebase in a repository. This code base has "internal" tags which map back to the code generation from XML. I will re-use techiques I used in wxCRP, and based upon the XML description generate the C++ code. It will take a while before I start this, but I think I finally found my final form of how I wanted to implement the next version of wxCRP ;-)

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Post Reply