X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/30be036c6d4990f8aa21af5b86abdc0852e686a0..8e509c4b0c60bc066958574e4122a3db8ffcf491:/include/wx/combo.h diff --git a/include/wx/combo.h b/include/wx/combo.h index e8704a4f66..05ee2d9c3e 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -184,6 +184,10 @@ public: virtual bool Enable(bool enable = true); virtual bool Show(bool show = true); virtual bool SetFont(const wxFont& font); +#if wxUSE_VALIDATORS + virtual void SetValidator(const wxValidator &validator); + virtual wxValidator *GetValidator(); +#endif // wxUSE_VALIDATORS // wxTextCtrl methods - for readonly combo they should return // without errors. @@ -394,6 +398,9 @@ public: wxByte GetPopupWindowState() const { return m_popupWinState; } + // Set value returned by GetMainWindowOfCompositeControl + void SetCtrlMainWnd( wxWindow* wnd ) { m_mainCtrlWnd = wnd; } + protected: // @@ -416,8 +423,14 @@ protected: // Installs standard input handler to combo (and optionally to the textctrl) void InstallInputHandlers(); + // flags for DrawButton() + enum + { + Draw_PaintBg = 1 + }; + // Draws dropbutton. Using wxRenderer or bitmaps, as appropriate. - void DrawButton( wxDC& dc, const wxRect& rect, bool paintBg = true ); + void DrawButton( wxDC& dc, const wxRect& rect, int flags = Draw_PaintBg ); // Call if cursor is on button area or mouse is captured for the button. //bool HandleButtonMouseEvent( wxMouseEvent& event, bool isInside ); @@ -461,6 +474,7 @@ protected: // event handlers void OnSizeEvent( wxSizeEvent& event ); void OnFocusEvent(wxFocusEvent& event); + void OnIdleEvent(wxIdleEvent& event); void OnTextCtrlEvent(wxCommandEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event); void OnKeyEvent(wxKeyEvent& event); @@ -492,6 +506,9 @@ protected: virtual void DoSetToolTip( wxToolTip *tip ); #endif + virtual wxWindow *GetMainWindowOfCompositeControl() + { return m_mainCtrlWnd; } + // This is used when m_text is hidden (readonly). wxString m_valueString; @@ -520,6 +537,9 @@ protected: // this is for the popup window wxEvtHandler* m_popupWinEvtHandler; + // main (ie. topmost) window of a composite control (default = this) + wxWindow* m_mainCtrlWnd; + // used to prevent immediate re-popupping incase closed popup // by clicking on the combo control (needed because of inconsistent // transient implementation across platforms). @@ -583,6 +603,9 @@ protected: // is the popup window currenty shown? wxByte m_popupWinState; + // should the focus be reset to the textctrl in idle time? + bool m_resetFocus; + private: void Init();