X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/21d6b09b108dd8f4710cf260ee9f344b6bbad704..84d1cd430f9f4cba81737a45cd40fdb7cbac4f7d:/include/wx/combo.h diff --git a/include/wx/combo.h b/include/wx/combo.h index 36d9a720e2..6fb77bd0c3 100644 --- a/include/wx/combo.h +++ b/include/wx/combo.h @@ -297,7 +297,17 @@ public: // Utilies needed by the popups or native implementations // - // Draws focus background (on combo control) in a way typical on platform. + // Returns true if given key combination should toggle the popup. + // NB: This is a separate from other keyboard handling because: + // 1) Replaceability. + // 2) Centralized code (otherwise it'd be split up between + // wxComboCtrl key handler and wxVListBoxComboPopup's + // key handler). + virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const = 0; + + // Prepare background of combo control or an item in a dropdown list + // in a way typical on platform. This includes painting the focus/disabled + // background and setting the clipping region. // Unless you plan to paint your own focus indicator, you should always call this // in your wxComboPopup::PaintComboControl implementation. // In addition, it sets pen and text colour to what looks good and proper @@ -305,7 +315,7 @@ public: // flags: wxRendererNative flags: wxCONTROL_ISSUBMENU: is drawing a list item instead of combo control // wxCONTROL_SELECTED: list item is selected // wxCONTROL_DISABLED: control/item is disabled - virtual void DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) const; + virtual void PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const; // Returns true if focus indicator should be drawn in the control. bool ShouldDrawFocus() const @@ -351,7 +361,7 @@ protected: void CreateTextCtrl( int extraStyle, const wxValidator& validator ); // Installs standard input handler to combo (and optionally to the textctrl) - void InstallInputHandlers( bool alsoTextCtrl = true ); + void InstallInputHandlers(); // Draws dropbutton. Using wxRenderer or bitmaps, as appropriate. void DrawButton( wxDC& dc, const wxRect& rect, bool paintBg = true ); @@ -402,6 +412,7 @@ protected: void OnFocusEvent(wxFocusEvent& event); void OnTextCtrlEvent(wxCommandEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event); + void OnKeyEvent(wxKeyEvent& event); // Set customization flags (directs how wxComboCtrlBase helpers behave) void Customize( wxUint32 flags ) { m_iFlags |= flags; } @@ -432,10 +443,7 @@ protected: // popup interface wxComboPopup* m_popupInterface; - // this is for this control itself - wxEvtHandler* m_extraEvtHandler; - - // this is for text + // this is input etc. handler for the text control wxEvtHandler* m_textEvtHandler; // this is for the top level window