Idea about simple way to create GUI

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
ArtDen
Earned a small fee
Earned a small fee
Posts: 10
Joined: Sun Mar 17, 2013 7:01 am

Idea about simple way to create GUI

Post by ArtDen » Sun Mar 17, 2013 7:19 am

Hi,
First, sorry for my English :)

I like the way to define widgets and sizers by declarative mode. For example look at IUP example http://www.tecgraf.puc-rio.br/iup/en/layout.html (IUP is GUI library for Lua):

Code: Select all

dialog = iup.dialog
{
  iup.hbox
  {
    iup.fill{},
    iup.button{title="Ok",size="40"}, 
    iup.button{title="Cancel",size="40"},
    iup.fill{}
    ;margin="15x15", gap="10"
  }
  ;title="Title"
}
I want to create simple library which allow to create controls by declarative way in C++. It has already written a little and code which use it looks like this:

Code: Select all


wxTextCtrl *edit1, *edit2;
...
auto dlg = dialog()
[
    grid(2, 0)
    [
        text("bla-bla"),
        edit(width(20) | expand) >> edit1, 
        text("bla-bla"),
        edit(width(20) | expand) >> edit2
    ]
];
dlg.build_gui();
"grid(2, 0)" means flex grid sizer with 2 cols
"width(20)" means width in 20 dialog units, "expand" means flag wxEXPAND will be added when crating of wxTextCtrl object
">> edit2" means edit2 will hold wxTextCtrl object created by library after dlg.build_gui called
What do you think about this way?

User avatar
doublemax
Moderator
Moderator
Posts: 15084
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Idea about simple way to create GUI

Post by doublemax » Sun Mar 17, 2013 9:21 am

There was a similar project, wxGuiBuilder:
http://forums.wxwidgets.org/viewtopic.php?f=10&t=8536

But its homepage is offline, so i don't know how far it went. But if you google for it, maybe you still find some information that you can use for "inspiration".
Use the source, Luke!

ArtDen
Earned a small fee
Earned a small fee
Posts: 10
Joined: Sun Mar 17, 2013 7:01 am

Re: Idea about simple way to create GUI

Post by ArtDen » Sun Mar 17, 2013 10:58 am

wxGuiBuilder takes string with gui description but I use only c++ without parsing of string.

ArtDen
Earned a small fee
Earned a small fee
Posts: 10
Joined: Sun Mar 17, 2013 7:01 am

Re: Idea about simple way to create GUI

Post by ArtDen » Wed Apr 03, 2013 4:18 pm

Nobody like this idea? Look how it can be used in code:
http://code.google.com/p/dng4ps2/source ... rFrame.cpp (see body of CamCalibrFrame::CamCalibrFrame)

Sarah Keys
In need of some credit
In need of some credit
Posts: 7
Joined: Thu Jan 02, 2014 3:55 pm

Re: Idea about simple way to create GUI

Post by Sarah Keys » Wed Jun 04, 2014 6:59 pm

Hi ArtDen,
21 Day Fix Containers
It's a good idea but as doublemax said there's this similar project called wxGuiBuilder .WoW Gold Tycoon
They have now moved to Google Code.
Best Phone Grip
Good luck with your project.

S.Keys

Post Reply