// show/hide popup window
virtual void ShowPopup();
- virtual void HidePopup();
+ virtual void HidePopup(bool generateEvent=false);
// Override for totally custom combo action
virtual void OnButtonClick();
const wxBitmap& bmpHover = wxNullBitmap,
const wxBitmap& bmpDisabled = wxNullBitmap );
-#if WXWIN_COMPATIBILITY_2_6
+#if WXWIN_COMPATIBILITY_2_8
//
// This will set the space in pixels between left edge of the control and the
// text, regardless whether control is read-only (ie. no wxTextCtrl) or not.
// Platform-specific default can be set with value-1.
// Remarks
// * This method may do nothing on some native implementations.
- wxDEPRECTED( void SetTextIndent( int indent ) );
+ wxDEPRECATED( void SetTextIndent( int indent ) );
// Returns actual indentation in pixels.
- wxDEPRECTED( wxCoord GetTextIndent() const );
+ wxDEPRECATED( wxCoord GetTextIndent() const );
#endif
// Returns area covered by the text field.
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
bool IsCreated() const { return m_iFlags & wxCC_IFLAG_CREATED ? true : false; }
// common code to be called on popup hide/dismiss
- void OnPopupDismiss();
+ void OnPopupDismiss(bool generateEvent);
// PopupShown states
enum
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
//
// override the base class virtuals involved in geometry calculations
virtual wxSize DoGetBestSize() const;
+ // also set the embedded wxTextCtrl colours
+ virtual bool SetForegroundColour(const wxColour& colour);
+ virtual bool SetBackgroundColour(const wxColour& colour);
+
// NULL popup can be used to indicate default in a derived class
virtual void DoSetPopupControl(wxComboPopup* popup);
void OnTextCtrlEvent(wxCommandEvent& event);
void OnSysColourChanged(wxSysColourChangedEvent& event);
void OnKeyEvent(wxKeyEvent& event);
+ void OnCharEvent(wxKeyEvent& event);
// Set customization flags (directs how wxComboCtrlBase helpers behave)
void Customize( wxUint32 flags ) { m_iFlags |= flags; }
// 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;
// Default implementation draws value as string.
virtual void PaintComboControl( wxDC& dc, const wxRect& rect );
- // Receives key events from the parent wxComboCtrl.
+ // Receives wxEVT_KEY_DOWN key events from the parent wxComboCtrl.
// Events not handled should be skipped, as usual.
virtual void OnComboKeyEvent( wxKeyEvent& event );
+ // Receives wxEVT_CHAR key events from the parent wxComboCtrl.
+ // Events not handled should be skipped, as usual.
+ virtual void OnComboCharEvent( wxKeyEvent& event );
+
// Implement if you need to support special action when user
// double-clicks on the parent wxComboCtrl.
virtual void OnComboDoubleClick();