X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23645bfa01b6450257f140a30c87565225b1ef4a..c845a1975a3d6d79b19a7ec77bd8e0b8b8850751:/include/wx/univ/combobox.h diff --git a/include/wx/univ/combobox.h b/include/wx/univ/combobox.h index 0217ff8515..13c5302326 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 @@ -36,8 +36,8 @@ #ifndef _WX_UNIV_COMBOBOX_H_ #define _WX_UNIV_COMBOBOX_H_ -#ifdef __GNUG__ - #pragma implementation "univcombobox.h" +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) + #pragma interface "univcombobox.h" #endif class WXDLLEXPORT wxComboControl; @@ -77,12 +77,14 @@ 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 virtual void OnShow() = 0; + virtual wxCoord GetBestWidth() const {return 0; } + protected: wxComboControl *m_combo; }; @@ -135,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 @@ -157,8 +159,12 @@ 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 ); +#endif // wxUSE_TOOLTIPS protected: // override the base class virtuals involved into geometry calculations @@ -174,7 +180,7 @@ protected: const wxString& strArg = wxEmptyString); // event handlers - void OnKey(wxCommandEvent& event); + void OnKey(wxKeyEvent& event); // common part of all ctors void Init(); @@ -215,7 +221,7 @@ 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) @@ -225,6 +231,15 @@ public: (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); bool Create(wxWindow *parent, wxWindowID id, @@ -236,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(); @@ -270,11 +293,14 @@ public: virtual void Select(int n); virtual int GetSelection() const; void SetSelection(int n) { Select(n); } - - void SetStringSelection(const wxString& s) { } + + void SetStringSelection(const wxString& WXUNUSED(s)) { } + + wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST protected: virtual int DoAppend(const wxString& item); + virtual int DoInsert(const wxString& item, int pos); virtual void DoSetItemClientData(int n, void* clientData); virtual void* DoGetItemClientData(int n) const; virtual void DoSetItemClientObject(int n, wxClientData* clientData);