X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3399051ee9fa4dfa5fa7ac2dd9034062f4414d64..13d843f1c15fe721f03d933c600cd5ca62944003:/include/wx/motif/choice.h?ds=sidebyside diff --git a/include/wx/motif/choice.h b/include/wx/motif/choice.h index 8d1a30846e..32fc35fda6 100644 --- a/include/wx/motif/choice.h +++ b/include/wx/motif/choice.h @@ -1,37 +1,35 @@ ///////////////////////////////////////////////////////////////////////////// -// 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 - -WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr; - #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 +class WXDLLIMPEXP_CORE wxChoice: public wxChoiceBase { DECLARE_DYNAMIC_CLASS(wxChoice) public: wxChoice(); - ~wxChoice(); - + virtual ~wxChoice(); + wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -43,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, @@ -52,33 +62,34 @@ 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 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); - virtual wxClientData* DoGetItemClientObject(int n) const; + virtual unsigned int GetCount() 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; + virtual void DoDeleteOneItem(unsigned int n); + virtual void DoClear(); + virtual void SetString(unsigned int n, const wxString& s); + virtual wxString GetString(unsigned int n) const; // implementation of wxChoiceBase 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; } @@ -95,18 +106,21 @@ protected: // common part of all contructors void Init(); - size_t m_noStrings; + unsigned int m_noStrings; WXWidget m_menuWidget; WXWidget m_buttonWidget; wxWidgetArray m_widgetArray; WXWidget m_formWidget; wxStringList m_stringList; - wxClientDataDictionary m_clientDataDict; - + virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + + // implementation of wxControlWithItems + virtual int DoInsertItems(const wxArrayStringsAdapter& items, + unsigned int pos, + void **clientData, wxClientDataType type); }; -#endif -// _WX_CHOICE_H_ +#endif // _WX_CHOICE_H_