X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1169a91932273bc84c23ed9dbd0a2da064d59d66..682214d5c6ec3e56dbdfd0c97d70d87e614b38c2:/include/wx/univ/combobox.h diff --git a/include/wx/univ/combobox.h b/include/wx/univ/combobox.h index 44323ba9ee..9720fe9b76 100644 --- a/include/wx/univ/combobox.h +++ b/include/wx/univ/combobox.h @@ -20,7 +20,7 @@ down list, not just a wxListBox. So we define a base wxComboControl which can use any control as pop down - list and wxComboBox deriving from it which implements the standard wxWindows + list and wxComboBox deriving from it which implements the standard wxWidgets combobox API. wxComboControl needs to be told somehow which control to use and this is done by SetPopupControl(). However, we need something more than just a wxControl in this method as, for example, we need to call @@ -77,7 +77,7 @@ public: // called before showing the control to set the initial selection - notice // that the text passed to this method might not correspond to any valid // item (if the user edited it directly), in which case the method should - // just return FALSE but not emit any errors + // just return false but not emit any errors virtual bool SetSelection(const wxString& value) = 0; // called immediately after the control is shown @@ -99,7 +99,10 @@ class WXDLLEXPORT wxComboControl : public wxControl { public: // construction - wxComboControl(); + wxComboControl() + { + Init(); + } wxComboControl(wxWindow *parent, wxWindowID id, @@ -108,7 +111,12 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxComboBoxNameStr); + const wxString& name = wxComboBoxNameStr) + { + Init(); + + (void)Create(parent, id, value, pos, size, style, validator, name); + } bool Create(wxWindow *parent, wxWindowID id, @@ -129,7 +137,7 @@ public: void ShowPopup(); void HidePopup(); - // return TRUE if the popup is currently shown + // return true if the popup is currently shown bool IsPopupShown() const { return m_isPopupShown; } // get the popup window containing the popup control @@ -151,8 +159,8 @@ public: virtual void OnDismiss(); // forward these functions to all subcontrols - virtual bool Enable(bool enable = TRUE); - virtual bool Show(bool show = TRUE); + virtual bool Enable(bool enable = true); + virtual bool Show(bool show = true); #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ); @@ -205,7 +213,7 @@ class WXDLLEXPORT wxComboBox : public wxComboControl, public wxComboBoxBase { public: // ctors and such - wxComboBox(); + wxComboBox() { Init(); } wxComboBox(wxWindow *parent, wxWindowID id, @@ -213,7 +221,22 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, - const wxString *choices = (const wxString *) NULL, + const wxString choices[] = (const wxString *) NULL, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxComboBoxNameStr) + { + Init(); + + (void)Create(parent, id, value, pos, size, n, choices, + style, validator, name); + } + wxComboBox(wxWindow *parent, + wxWindowID id, + const wxString& value, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); @@ -228,7 +251,15 @@ public: long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); - + bool Create(wxWindow *parent, + wxWindowID id, + const wxString& value, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxComboBoxNameStr); virtual ~wxComboBox(); @@ -246,11 +277,22 @@ public: virtual void SetInsertionPoint(long pos); virtual void SetInsertionPointEnd(); virtual long GetInsertionPoint() const; - virtual long GetLastPosition() const; + virtual wxTextPos GetLastPosition() const; virtual void Replace(long from, long to, const wxString& value); virtual void Remove(long from, long to); virtual void SetSelection(long from, long to); virtual void SetEditable(bool editable); + virtual bool IsEditable() const; + + virtual void Undo(); + virtual void Redo(); + virtual void SelectAll(); + + virtual bool CanCopy() const; + virtual bool CanCut() const; + virtual bool CanPaste() const; + virtual bool CanUndo() const; + virtual bool CanRedo() const; // wxControlWithItems methods virtual void Clear(); @@ -259,11 +301,8 @@ public: virtual wxString GetString(int n) const; virtual void SetString(int n, const wxString& s); virtual int FindString(const wxString& s) const; - virtual void Select(int n); + virtual void SetSelection(int n); virtual int GetSelection() const; - void SetSelection(int n) { Select(n); } - - void SetStringSelection(const wxString& WXUNUSED(s)) { } wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST