Copy wxCrafter forms

Post here wxCrafter related issues / features / bugs
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Copy wxCrafter forms

Post by iwbnwif »

Hi, firstly thank you for a great IDE and RAD tool

I am developing a series of panels that will be dynamically added to a wxAuiNotebook as tabs. The panels are essentially similar but not similar enough to create a generic one and subclass it.

Therefore I would like to design one in wxCrafter and make several copies of it to use as a base for the rest of the panels. Is this possible?

Currently I have only been able to export the XRC and then try and import it back in, but this puts the panels in separate wxcp files each time.

Thanks for all help!
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Copy wxCrafter forms

Post by eranif »

If I understand correctly, you want to achieve this:

- Design a base panel in wxC
- Generate N subclasses from the base panel

Atm, wxC only allows you to define 1 derived class, which you define it under the "Inherited C++ class Properties" of that panel.

If you want to generate multiple instances:
1. Create the top level panel
2. Set the name of the derived C++ class name and file
3. Generate the code
4. Repeat step 2 until you created all the instances you need

Note that one caveat of this approach:
When you connect an event to the base panel in the designer, it will be connected only to the current inherited c++ class (the one that is set in the "Inherited C++ class Properties" section of the base panel)
So you will have to repeat steps 2-4 to make sure that the code is generated for all the derived classes.

Another option to update event handlers (the way I used to do it when I was working with wxFB):

1) Open the derived class in codelite
2) right click inside the class definition and select: Code Generation / Refactoring -> Implement inherited virtual functions

codelite should now offer you all the new handlers (if it does not, do a quick retag: workspace -> retag workspace (quick))

Please open a FR for this to work natively in wxC

Eran
Make sure you have read the HOW TO POST thread
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Copy wxCrafter forms

Post by iwbnwif »

If I understand correctly, you want to achieve this:
- Design a base panel in wxC
- Generate N subclasses from the base panel
Sorry for not being clear, I don't want to create N subclasses. I want to design a panel and then use it as a basis for other panels also to be designed in wxC.
- Create the top level panel
- Create a second wxPanel (as top level) with only main sizer
- Copy the content of the 1st panel and paste it into the second panel's main sizer
Yes this works, but my main sizer has four elements, it is a little tedious (of course not too bad!) to copy them all.
please open a bug for this
Done #886
frank_frl
CodeLite Expert
Posts: 176
Joined: Sun Aug 17, 2008 2:45 pm
Contact:

Re: Copy wxCrafter forms

Post by frank_frl »

Hi,

I missed this feature as well. I made a mixing panel with 8 channels. Each channel is a panel with fader, a meter and several buttons. The way wxCrafter works now, I had to build all 8 channels one after the other.
The way it should work would be, that I generate one channel panel and than just copy/paste the other 7.

Regards

Frank
Post Reply