IS there a gui designer for wxwidgets in linux wit

2019-01-24 15:33发布

问题:

I want to build a GUI application using C++ and wxWidgets. The problem is that I can not find an IDE with GUI (Form Designer) to use. I hope if eclipse has some thing like the QT designer.

any solutions ???

回答1:

wxFormBuilder is pretty good. It is stable and has support for most of the standard widgets.



回答2:

While I'm not sure of integrating with Eclipse, you can run wxGlade for designing interfaces, then export the code.



回答3:

The wxsmith plugin for Code::Blocks is worth checking out. It would mean switching IDEs, but C::B is cross-platform just like Eclipse.



回答4:

As ravenspoint indicated - it is most likely much better to code your forms. This works quite well with eclipse (for those interested). run wx-config --cppflags and paste the directories/headers into your eclipse project's settings then run wx-configure --libs and paste the -L and -l into your eclipse project settings and you are ready to go.

Make sure you also set the flags showed by the wx-config.



回答5:

If you are looking for an IDE with visual form editor right way is Code::Blocks. It has integrated wxSmith plugin. Work it this way is seamless. I don't know if there is some plugin for Eclipse, but Eclipse + wxFormBuilder is one of the best choices as for me.



回答6:

Philasmicos has a free wxWidgets GUI Designer for Windows and Linux.

You can find it here

I don't know, why it is only on the german website.



回答7:

IMO, using such 'form designer' tools should be avoided. They are like crutches for people who do not know what they are doing. The snag is that they generate vast amounts of code which the user does not understand. They are great for rapidly developing a quick prototype of a toy application. However, one day one of your applications may grow up into a successful product which needs to be maintained. Guess what? The tools are limited and buggy, and cannot be used to maintain a GUI of any real complexity or sophistication. So, all that un-maintainable code generated by the tool has to be rewrittenn by someone who has been using the tool and so has not learnt how to write GUI code!

This process happened to me a couple of times, back in the days when GUIs first became popular. Then I learnt that there is no substitute for learning how to code a GUI, and the only way to do that is to roll up your sleeves and write the code.

I understand why form builder tools are so popular. Many GUI frameworks are a major pain to code for: requiring reams of code specifying the top left and bottom right pixel position of every last control - all of which have to be changed whenever anything is moved around. ( MFC and .NET spring to mind here )

This is where wxWidgets scores big. If you learn to use sizers, then you never have to specify a pixel position again. So, this is my answer to the original question: avoid all these form builders tools of dubious quality and questionable integration with Eclipse, but instead learn to use sizers so you can code your GUIs directly in the Eclipse editor window.

As a simple example, here is the code for a form.

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

Produces the following GUI

Here is a sizer tutorial http://zetcode.com/tutorials/wxwidgetstutorial/layoutmanagement/