X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5f54075053e041086bb71f107c3d70faedf0d9b9..fb9521b8f553c4e5fd2df82a54addb3fe121d64c:/include/wx/combo.h diff --git a/include/wx/combo.h b/include/wx/combo.h index 718adde355..2cdb81102a 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -385,6 +385,10 @@ public: const wxBitmap& GetBitmapHover() const { return m_bmpHover; } const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; } + // Hint functions mirrored from TextEntryBase + virtual bool SetHint(const wxString& hint); + virtual wxString GetHint() const; + // Margins functions mirrored from TextEntryBase // (wxComboCtrl does not inherit from wxTextEntry, but may embed a // wxTextCtrl, so we need these). Also note that these functions @@ -427,6 +431,16 @@ public: protected: + // Returns true if hint text should be drawn in the control + bool ShouldUseHintText(int flags = 0) const + { + return ( !m_text && + !(flags & wxCONTROL_ISSUBMENU) && + !m_valueString.length() && + m_hintText.length() && + !ShouldDrawFocus() ); + } + // // Override these for customization purposes // @@ -544,6 +558,9 @@ protected: // This is used when m_text is hidden (readonly). wxString m_valueString; + // This is used when control is unfocused and m_valueString is empty + wxString m_hintText; + // the text control and button we show all the time wxTextCtrl* m_text; wxWindow* m_btn;