]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/choice.h
Reapply wxWeakRef patch again
[wxWidgets.git] / include / wx / gtk / choice.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
853dcc57 2// Name: wx/gtk/choice.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
dbf858b5 5// Id: $Id$
01111366 6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
3c75d8ba
PC
10#ifndef _WX_GTK_CHOICE_H_
11#define _WX_GTK_CHOICE_H_
c801d85f 12
b5dbe15d
VS
13class WXDLLIMPEXP_FWD_BASE wxSortedArrayString;
14class WXDLLIMPEXP_FWD_BASE wxArrayString;
b5f6b52a 15
c801d85f
KB
16//-----------------------------------------------------------------------------
17// wxChoice
18//-----------------------------------------------------------------------------
19
20123d49 20class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase
c801d85f 21{
fd0eed64 22public:
29006414
VZ
23 wxChoice();
24 wxChoice( wxWindow *parent, wxWindowID id,
25 const wxPoint& pos = wxDefaultPosition,
26 const wxSize& size = wxDefaultSize,
27 int n = 0, const wxString choices[] = (const wxString *) NULL,
28 long style = 0,
29 const wxValidator& validator = wxDefaultValidator,
30 const wxString& name = wxChoiceNameStr )
31 {
e01c8145
VZ
32 m_strings = (wxSortedArrayString *)NULL;
33
29006414
VZ
34 Create(parent, id, pos, size, n, choices, style, validator, name);
35 }
584ad2a3
MB
36 wxChoice( wxWindow *parent, wxWindowID id,
37 const wxPoint& pos,
38 const wxSize& size,
39 const wxArrayString& choices,
40 long style = 0,
41 const wxValidator& validator = wxDefaultValidator,
42 const wxString& name = wxChoiceNameStr )
43 {
44 m_strings = (wxSortedArrayString *)NULL;
45
46 Create(parent, id, pos, size, choices, style, validator, name);
47 }
d3c7fc99 48 virtual ~wxChoice();
29006414
VZ
49 bool Create( wxWindow *parent, wxWindowID id,
50 const wxPoint& pos = wxDefaultPosition,
51 const wxSize& size = wxDefaultSize,
52 int n = 0, const wxString choices[] = (wxString *) NULL,
53 long style = 0,
54 const wxValidator& validator = wxDefaultValidator,
55 const wxString& name = wxChoiceNameStr );
584ad2a3
MB
56 bool Create( wxWindow *parent, wxWindowID id,
57 const wxPoint& pos,
58 const wxSize& size,
59 const wxArrayString& choices,
60 long style = 0,
61 const wxValidator& validator = wxDefaultValidator,
62 const wxString& name = wxChoiceNameStr );
c801d85f 63
a2c94110
VZ
64 void SendSelectionChangedEvent(wxEventType evt_type);
65
9abe166a 66 int GetSelection() const;
aa61d352 67 void SetSelection(int n);
29006414 68
aa61d352 69 virtual unsigned int GetCount() const;
853dcc57 70 virtual int FindString(const wxString& s, bool bCase = false) const;
aa61d352
VZ
71 virtual wxString GetString(unsigned int n) const;
72 virtual void SetString(unsigned int n, const wxString& string);
29006414 73
a2c94110
VZ
74 virtual void DisableEvents();
75 virtual void EnableEvents();
76
9d522606
RD
77 static wxVisualAttributes
78 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
79
20e05ffb 80protected:
a2c94110
VZ
81 // this array is only used for controls with wxCB_SORT style, so only
82 // allocate it if it's needed (hence using pointer)
83 wxSortedArrayString *m_strings;
29006414 84
a2c94110
VZ
85 // contains the client data for the items
86 wxArrayPtrVoid m_clientData;
ef5c70f9 87
0662f990 88 virtual wxSize DoGetBestSize() const;
a236aa20
VZ
89 virtual int DoInsertItems(const wxArrayStringsAdapter& items,
90 unsigned int pos,
91 void **clientData, wxClientDataType type);
aa61d352
VZ
92 virtual void DoSetItemClientData(unsigned int n, void* clientData);
93 virtual void* DoGetItemClientData(unsigned int n) const;
a2c94110
VZ
94 virtual void DoClear();
95 virtual void DoDeleteOneItem(unsigned int n);
d6538e2c 96
a2c94110 97 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
5f3565a2
RR
98
99private:
738f9e5a 100 DECLARE_DYNAMIC_CLASS(wxChoice)
c801d85f
KB
101};
102
ce4169a4 103
3c75d8ba 104#endif // _WX_GTK_CHOICE_H_