#ifndef _WX_UNIV_CONTROL_H_
#define _WX_UNIV_CONTROL_H_
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma interface "control.h"
-#endif
-
class WXDLLEXPORT wxControlRenderer;
class WXDLLEXPORT wxInputHandler;
class WXDLLEXPORT wxRenderer;
class WXDLLEXPORT wxControl : public wxControlBase, public wxInputConsumer
{
public:
- wxControl();
+ wxControl() { Init(); }
wxControl(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
- const wxString& name = wxControlNameStr);
+ const wxString& name = wxControlNameStr)
+ {
+ Init();
+
+ Create(parent, id, pos, size, style, validator, name);
+ }
bool Create(wxWindow *parent,
wxWindowID id,
// this function will filter out '&' characters and will put the
// accelerator char (the one immediately after '&') into m_chAccel
- virtual void SetLabel(const wxString &label);
- virtual wxString GetLabel() const;
+ virtual void SetLabel(const wxString& label);
+
+ // return the current label
+ virtual wxString GetLabel() const { return m_label; }
// wxUniversal-specific methods
// return the accel index in the string or -1 if none and puts the modified
- // string intosecond parameter if non NULL
+ // string into second parameter if non NULL
static int FindAccelIndex(const wxString& label,
wxString *labelOnly = NULL);
// return the accel char itself or 0 if none
wxChar GetAccelChar() const
{
- return m_indexAccel == -1 ? _T('\0') : m_label[m_indexAccel];
+ return m_indexAccel == -1 ? _T('\0') : (wxChar)m_label[m_indexAccel];
}
virtual wxWindow *GetInputWindow() const { return (wxWindow*)this; }
// common part of all ctors
void Init();
+ // set m_label and m_indexAccel and refresh the control to show the new
+ // label (but, unlike SetLabel(), don't call the base class SetLabel() thus
+ // avoiding to change wxControlBase::m_labelOrig)
+ void UnivDoSetLabel(const wxString& label);
+
private:
// label and accel info
wxString m_label;