Page 1 of 1

GUI Builder

Posted: Thu Apr 08, 2010 6:52 pm
by DrOptix
CodeLite is great and the integration with wxFormBuilder is great but is it possible for CodeLite to have it's own GUI builder?

I ask because when using wxFB and I change the GUI I lose all the event handlers.

Ex:

I design a form with 2 buttons
Export the code
Add implementation for both OnClick events, for button 1 and 2
Then when I add Button 3 and regenerate the code i lose the implementation for OnClick button 1 and 2.

This behaviour is ok for small apps but when the buttons do complicated stuff it's hard to rewrite the implementations each time.

Please note that I'm a beginner with CodeLite so I might not discovered all the features

Re: GUI Builder

Posted: Thu Apr 08, 2010 10:45 pm
by eranif
This is the best approach that I find for using codelite with wxFB (this is how I use it):

- When you generate the classes from the wxFB, make sure you also generate an inherited class (Keyboard shortcut F6) - you should only generate them once.
- The inherited class is the files where you should place all your logic - do not edit the base classes generated from wxFB (since as you know they will overriden each time)
- When u need to add new events or new controls -> add them to the base classes - but this time only generate the code but without the inherited class (since you dont want them to override your code)
- Next, switch to codelite, right click on the project and select 'retag project' this step is necessary, since codelite will not detect the changes done to the base class (unless the base class files are opened inside the editor)
- Now, go to the inherited class header file, and right click inside it and select 'Code Generation / Refactoing -> Implement inherited virtual methods' - and codelite will add all the new methods which were added to the base class by wxFB

HTH,
Eran