Using Custom Control
CustomControl is a widget that can be found on the Additional palette, as of version 3.0.44. The idea behind CustomControl is to make it easy to generate code for a widget that is not yet fully supported in wxFormBuilder. A wxPanel is used in the designer for a visual place-holder.
CustomControl exposes 5 properties, each of which corresponds to a different place in the generated code.
- name
m_genericDirCtrl
- declaration
wxGenericDirCtrl* m_genericDirCtrl;
- construction
m_genericDirCtrl = new wxGenericDirCtrl( this, wxID_ANY, wxT("C:/"), wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER );
- include
#include <wx/dirctrl.h>
- settings
m_genericDirCtrl->ShowHidden( true );
The examples for the properties above can be used to generate the correct code for wxGenericDirCtrl. Because it is not implemented in wxFormBuilder (although it will be soon), CustomControl is the best way to include it in a GUI.
Below are images of the CustomControl in the designer, and the wxGenericDirCtrl in the compiled application.
Here is the source for the example app: Attach:customControlSample.zip
Custom Control in Designer.
Custom Control in compiled application.

