Philip Bennefall
Philip Bennefall

Reputation: 1487

Automatically generating guis?

I am blind, and I have trouble making nice looking guis. This really frustrates me because while I am a capable developer, I cannot complete projects on my own because I am unable to make the front-end. I am wondering if any of you know of some automatic solution which produces professional looking guis? They don't have to be fancy, most of the time we are talking about basic forms/wizzard style layouts. I basically need to get away from specifying pixel heights, widths, and positions. I need something that figures out how to make things match in terms of sizes and positions in relation to one another, resize well, etc. My primary target platform is Windows. I have worked with WxWidgets before and have been very satisfied, but I needed to hire another person to do the design which I cannot keep doing longterm. I have no problem writing code, I just am not able to effectively figure out how to position and set the size for controls on the form.

Any advice would be appreciated.

Upvotes: 4

Views: 524

Answers (2)

ravenspoint
ravenspoint

Reputation: 20457

I doubt there could ever be a perfect substitute for someone with keen eyesight, a passion for the work and lots of time to devote to dragging and dropping, pushing and pulling at the the widgets of a GUI until everything is just so.

However, if you are satisfied with a workaday solution that gets the job done, then I think that the wxWidgets sizers do a reasonable job. Are you familiar with these? Specify how much space you want to leave around your widgets, and whether you want them arranged vertically or horizontally. Now all you have to do is add your widgets in order to the sizer, and the sizer will automatically arrange them in an often quite decent first pass sort of way.

As a simple example, here is a simple form.

The code:

wxPanel * panel = new wxPanel(this,-1,wxPoint(-1,-1),wxSize(1000,1000));

wxSizerFlags szrflags(0);
szrflags.Border(wxALL,5);

wxBoxSizer * szrCRUDForm = new wxBoxSizer(wxVERTICAL );

wxFlexGridSizer * szr = new wxFlexGridSizer(2,1,1);

wxStaticText * field1text =  new wxStaticText(panel,-1,"Entry Field #1");
wxTextCtrl   * field1ctrl =  new wxTextCtrl(panel,-1,"              ");
wxStaticText * field2text =  new wxStaticText(panel,-1,"Second Entry Field");
wxTextCtrl   * field2ctrl =  new wxTextCtrl(panel,-1,"              ");
wxStaticText * field3text =  new wxStaticText(panel,-1,
    "A very big entry field\n"
    "with a lot of description\n"
    "Spread over several long lines of text");
wxTextCtrl   * field3ctrl =  new wxTextCtrl(panel,-1,"",wxPoint(-1,-1),wxSize(600,-1));
wxStaticText * field4text =  new wxStaticText(panel,-1,"Yet another Field");
wxTextCtrl   * field4ctrl =  new wxTextCtrl(panel,-1,"              ");

szr->Add( field1text,szrflags );
szr->Add( field1ctrl,szrflags );
szr->Add( field2text,szrflags );
szr->Add( field2ctrl,szrflags );
szr->Add( field3text,szrflags );
szr->Add( field3ctrl,szrflags );
szr->Add( field4text,szrflags );
szr->Add( field4ctrl,szrflags );

wxBoxSizer * szrButtons = new wxBoxSizer( wxHORIZONTAL );
szrButtons->Add( new wxButton(panel,-1,L"CREATE"),szrflags);
szrButtons->Add( new wxButton(panel,-1,L"READ"),szrflags);
szrButtons->Add( new wxButton(panel,-1,L"UPDATE"),szrflags);
szrButtons->Add( new wxButton(panel,-1,L"DELETE"),szrflags);

szrCRUDForm->Add( szr );
szrCRUDForm->Add( szrButtons );

SetSizer(szrCRUDForm);

Produces the following GUI, without requiring any pushing or pulling

enter image description here

Here is an introductory, rather crude, tutorial http://neume.sourceforge.net/sizerdemo/

Here is something more sophisticated http://zetcode.com/tutorials/wxwidgetstutorial/layoutmanagement/

Upvotes: 2

Stefano Mtangoo
Stefano Mtangoo

Reputation: 6550

I am not sure what you mean by blind (Literal or figurative) but I will assume the later. There is no replacement for imagination. Your imagination will always be what you want to achieve. Once you have it in mind you can sketch it in paper or using something like skencil.

Then you can use the tools for building the the GUI using wxWidgets. Few option are there and some of them are shown below. I suggest wxFormbuilder or wxSmith if you want cross platform or even wxDevC++ if you want windows alone. If you can give few bucks then consider support DialogBlocks for is owned by one of wxWidgets core developers. wxCrafter looks promising but still in beta stage.

If you want to hire someone Vadim Zeitlin have such a nice company, consider to support another core developer.

  1. wxFormBuilder
  2. DialogBlocks
  3. wxDevC++ Designer
  4. Code::Block's wxSmith
  5. XRCed Designer
  6. wxDesigner
  7. wxGlade
  8. wxCrafter (In beta stage)

Upvotes: 0

Related Questions