X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..a01ada0599acdc11497850c4c8e846d3f237bf91:/include/wx/univ/control.h diff --git a/include/wx/univ/control.h b/include/wx/univ/control.h index bd34f2eb76..74913c6fbc 100644 --- a/include/wx/univ/control.h +++ b/include/wx/univ/control.h @@ -12,9 +12,9 @@ #ifndef _WX_UNIV_CONTROL_H_ #define _WX_UNIV_CONTROL_H_ -class WXDLLEXPORT wxControlRenderer; -class WXDLLEXPORT wxInputHandler; -class WXDLLEXPORT wxRenderer; +class WXDLLIMPEXP_FWD_CORE wxControlRenderer; +class WXDLLIMPEXP_FWD_CORE wxInputHandler; +class WXDLLIMPEXP_FWD_CORE wxRenderer; // we must include it as most/all control classes derive their handlers from // it @@ -38,7 +38,7 @@ typedef wxString wxControlAction; // wxControl: the base class for all GUI controls // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxControl : public wxControlBase, public wxInputConsumer +class WXDLLIMPEXP_CORE wxControl : public wxControlBase, public wxInputConsumer { public: wxControl() { Init(); } @@ -64,15 +64,12 @@ public: // 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); - // wxUniversal-specific methods + // return the current label + virtual wxString GetLabel() const { return m_label; } - // return the accel index in the string or -1 if none and puts the modified - // string intosecond parameter if non NULL - static int FindAccelIndex(const wxString& label, - wxString *labelOnly = NULL); + // wxUniversal-specific methods // return the index of the accel char in the label or -1 if none int GetAccelIndex() const { return m_indexAccel; } @@ -80,7 +77,7 @@ public: // 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; } @@ -89,6 +86,11 @@ protected: // 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;