Graphically laying out wx app

别等时光非礼了梦想. 提交于 2019-12-11 07:39:49

问题


Being really new to wx, I'm wondering if there is an IDE (especially for Linux) which would help me lay out a frame or dialog or whatever just to help me see what I'm doing. That means also creating the code for those changes.

I remember way back when using resource compilers for OS/2 and Windows that produced binaries that would then create the window, and was hoping for something similar (though obviously not binary if wx doesn't support that).


回答1:


I use wxFormBuilder. It is written in wxWidgets, so it works on Linux quite well. It can generate C++ code or XRC files. Make sure you understand its philosophy, and use it like this:

  • generate C++ code for the GUI
  • don't edit the code wxFormBuilder generated, but create new files
  • in new files, derive new classes from the classes it generated
  • implement event handlers in you own class (wxFB creates virtual function for each event handler you wish to use)

I usually name the wxFormBuilder generated classes/files like, for example, MainFrameGUI, and one with implementation (derived one in which I write all my code) would be just MainFrame. This enables you to change the visual layout and regenerate C++ files from wxFB at any time without overwriting your code.




回答2:


DialogBlocks works quite well for me, although sometimes you need to edit the code to fix errors manually. It has a property editor that seems advanced enough.




回答3:


Just another options is wxGlade. It does not have the that much features as the others mentioned seem to have, but it works just good enough for me to not daring to switch.




回答4:


I use Code::Blocks IDE from http://www.codeblocks.org which has - built-in GUI editor - Cross compilable, so you can use it under Linux, OSX and Windows.

But I still use wxFormBuilder with it instead of built-in wxSmith editor. But they are compatible with internal wxSmith.




回答5:


For windows you've got "wx-devcpp" which is Blodsheed Dev C++ with some addons providing what you looking for

Here is project page http://wxdsgn.sourceforge.net/



来源:https://stackoverflow.com/questions/224547/graphically-laying-out-wx-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!