I'm writing specific own Gauge, derived from wxControl...
For the moment, I just try to see my control before continue. I use WxSmith into Code::Blocks with xrc.
For the moment, the code is (see at bottom).
I put a custom control into my GUI under wxSmith (under wxs), it appears with "

?".
In class name, I put wxETKGauge
Style is 0, Xml Data is empty.
Running my app, my class is never created (adding breakpoints on constructors) and my control never appears...
How to add own specific control into wxSmith interface ?
My code is :.h
#ifndef WX_ETK_GAUGE_INCLUDE_H
#define WX_ETK_GAUGE_INCLUDE_H
#include <wx/control.h>
#include "wxETKTypes.h"
/**
* Gauge.
*
* This class is used to display cusom gauge.
*
* @author Stéphane Château
* @version Nom : wxETK<br>
* Révision : <b>1.0</b>
*/
class EXPORT_IMPORT wxETKGauge : public wxControl
{
private:
/**
* Actual value of the gauge.
*/
unsigned long m_lValue;
/**
* Value max of the gauge.
*/
unsigned long m_lRange;
public:
/// @name Constructor / Destructor.
//@{
wxETKGauge();
/**
* Constructor.
*
* @param _pParent Parent window.
* @param _wId Identifier.
* @param _rPos Position.
* @param _rSize Size.
* @param _lStyle Style
* @param _rValidator Validator.
* @param _rName Name of the control.
*
*/
wxETKGauge(wxWindow *_pParent,wxWindowID _wId,const wxPoint& _rPos = wxDefaultPosition,const wxSize& _rSize = wxDefaultSize,
long _lStyle = 0,const wxValidator& _rValidator = wxDefaultValidator,const wxString& _rName = wxControlNameStr);
virtual ~wxETKGauge();
//@}
/**
* Get the current value.
*
* By default, the value is initalized with 0.
*
* @return The current value.
*/
unsigned long GetValue() const;
/**
* Set the current value.
*
* @param _lValue The current value to set.
*/
void SetValue(unsigned long _lValue);
/**
* Get the current range value.
*
* The current range is the max value allowed for value.
* By default, the range is initalized with 100.
*
* @return The current range.
*/
unsigned long GetRange() const;
/**
* Set the current range value.
*
* The current range is the max value allowed for value.
*
* @param _lRange The new current range.
*/
void SetRange(unsigned long _lRange);
void OnPaint(wxPaintEvent& _rEvent);
private:
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxGauge)
};
#endif // WX_ETK_GAUGE_INCLUDE_H
.cpp :
#include "wxETKGauge.h"
BEGIN_EVENT_TABLE(wxETKGauge, wxControl)
EVT_PAINT(wxETKGauge::OnPaint)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxETKGauge, wxControl)
wxETKGauge::wxETKGauge()
{
}
wxETKGauge::wxETKGauge(wxWindow *_pParent,wxWindowID _wId,const wxPoint& _rPos,const wxSize& _rSize,
long _lStyle,const wxValidator& _rValidator,const wxString& _rName)
: wxControl(_pParent,_wId,_rPos,_rSize,_lStyle,_rValidator,_rName)
, m_lValue(0)
, m_lRange(100)
{
}
wxETKGauge::~wxETKGauge()
{
}
unsigned long wxETKGauge::GetValue() const
{
return m_lValue;
}
void wxETKGauge::SetValue(unsigned long _lValue)
{
m_lValue = _lValue;
}
unsigned long wxETKGauge::GetRange() const
{
return m_lRange;
}
void wxETKGauge::SetRange(unsigned long _lRange)
{
m_lRange = _lRange;
}
void wxETKGauge::OnPaint(wxPaintEvent& _rEvent)
{
wxRect rect = GetClientRect();
wxWindowDC dc(this);
dc.SetBrush(*wxCYAN_BRUSH);
dc.SetPen(*wxTRANSPARENT_PEN);
dc.DrawRectangle(rect);
}