X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0cc1d4ff2a0c78666f35bbfa34fcc609d7862709..4b3feaa75de76963492c4202be04be9bf20b321f:/include/wx/motif/choice.h diff --git a/include/wx/motif/choice.h b/include/wx/motif/choice.h index e2ce50b03c..731a3b8f94 100644 --- a/include/wx/motif/choice.h +++ b/include/wx/motif/choice.h @@ -1,25 +1,25 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: choice.h +// Name: wx/motif/choice.h // Purpose: wxChoice class // Author: Julian Smart // Modified by: // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CHOICE_H_ #define _WX_CHOICE_H_ -#if defined(__GNUG__) && !defined(__APPLE__) -#pragma interface "choice.h" -#endif - #include "wx/clntdata.h" -#include "wx/dynarray.h" -WX_DEFINE_ARRAY(WXWidget, wxWidgetArray); +#ifndef wxWIDGET_ARRAY_DEFINED + #define wxWIDGET_ARRAY_DEFINED + + #include "wx/dynarray.h" + WX_DEFINE_ARRAY_PTR(WXWidget, wxWidgetArray); +#endif // Choice item class WXDLLEXPORT wxChoice: public wxChoiceBase @@ -29,7 +29,7 @@ class WXDLLEXPORT wxChoice: public wxChoiceBase public: wxChoice(); ~wxChoice(); - + wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -41,7 +41,19 @@ public: Init(); Create(parent, id, pos, size, n, choices, style, validator, name); } - + + wxChoice(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr) + { + Init(); + Create(parent, id, pos, size, choices, style, validator, name); + } + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -50,8 +62,16 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxChoiceNameStr); + bool Create(wxWindow *parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + const wxArrayString& choices, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxChoiceNameStr); + // implementation of wxControlWithItems - virtual int GetCount() const; + virtual size_t GetCount() const; virtual int DoAppend(const wxString& item); virtual int DoInsert(const wxString& item, int pos); virtual void DoSetItemClientData(int n, void* clientData); @@ -60,7 +80,6 @@ public: virtual wxClientData* DoGetItemClientObject(int n) const; virtual int GetSelection() const; virtual void Delete(int n); - virtual int FindString(const wxString& s) const; virtual void Clear(); virtual void SetString(int n, const wxString& s); virtual wxString GetString(int n) const; @@ -69,14 +88,14 @@ public: virtual void SetSelection(int n); virtual void SetColumns(int n = 1 ); virtual int GetColumns() const ; - - // Original API + + // Original API virtual void Command(wxCommandEvent& event); - + void SetFocus(); - + // Implementation - virtual void ChangeFont(bool keepOriginalSize = TRUE); + virtual void ChangeFont(bool keepOriginalSize = true); virtual void ChangeBackgroundColour(); virtual void ChangeForegroundColour(); WXWidget GetTopWidget() const { return m_formWidget; } @@ -100,7 +119,7 @@ protected: WXWidget m_formWidget; wxStringList m_stringList; wxClientDataDictionary m_clientDataDict; - + virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);