]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/choice.h
No real changes, just make wxWindow::CanScroll() virtual.
[wxWidgets.git] / include / wx / gtk1 / choice.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
8ef94bfc 2// Name: wx/gtk1/choice.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
01111366 5// Copyright: (c) 1998 Robert Roebling
65571936 6// Licence: wxWindows licence
c801d85f
KB
7/////////////////////////////////////////////////////////////////////////////
8
c801d85f
KB
9#ifndef __GTKCHOICEH__
10#define __GTKCHOICEH__
11
b5dbe15d
VS
12class WXDLLIMPEXP_FWD_BASE wxSortedArrayString;
13class WXDLLIMPEXP_FWD_BASE wxArrayString;
b5f6b52a 14
c801d85f
KB
15//-----------------------------------------------------------------------------
16// wxChoice
17//-----------------------------------------------------------------------------
18
20123d49 19class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase
c801d85f 20{
fd0eed64 21public:
29006414
VZ
22 wxChoice();
23 wxChoice( wxWindow *parent, wxWindowID id,
24 const wxPoint& pos = wxDefaultPosition,
25 const wxSize& size = wxDefaultSize,
26 int n = 0, const wxString choices[] = (const wxString *) NULL,
27 long style = 0,
28 const wxValidator& validator = wxDefaultValidator,
29 const wxString& name = wxChoiceNameStr )
30 {
d3b9f782 31 m_strings = NULL;
e01c8145 32
29006414
VZ
33 Create(parent, id, pos, size, n, choices, style, validator, name);
34 }
584ad2a3
MB
35 wxChoice( wxWindow *parent, wxWindowID id,
36 const wxPoint& pos,
37 const wxSize& size,
38 const wxArrayString& choices,
39 long style = 0,
40 const wxValidator& validator = wxDefaultValidator,
41 const wxString& name = wxChoiceNameStr )
42 {
d3b9f782 43 m_strings = NULL;
584ad2a3
MB
44
45 Create(parent, id, pos, size, choices, style, validator, name);
46 }
d3c7fc99 47 virtual ~wxChoice();
29006414
VZ
48 bool Create( wxWindow *parent, wxWindowID id,
49 const wxPoint& pos = wxDefaultPosition,
50 const wxSize& size = wxDefaultSize,
d3b9f782 51 int n = 0, const wxString choices[] = NULL,
29006414
VZ
52 long style = 0,
53 const wxValidator& validator = wxDefaultValidator,
54 const wxString& name = wxChoiceNameStr );
584ad2a3
MB
55 bool Create( wxWindow *parent, wxWindowID id,
56 const wxPoint& pos,
57 const wxSize& size,
58 const wxArrayString& choices,
59 long style = 0,
60 const wxValidator& validator = wxDefaultValidator,
61 const wxString& name = wxChoiceNameStr );
c801d85f 62
9abe166a 63 // implement base class pure virtuals
a236aa20
VZ
64 void DoDeleteOneItem(unsigned int n);
65 void DoClear();
9abe166a
VZ
66
67 int GetSelection() const;
aa61d352 68 virtual void SetSelection(int n);
29006414 69
aa61d352 70 virtual unsigned int GetCount() const;
853dcc57 71 virtual int FindString(const wxString& s, bool bCase = false) const;
aa61d352
VZ
72 virtual wxString GetString(unsigned int n) const;
73 virtual void SetString(unsigned int n, const wxString& string);
29006414 74
9d522606
RD
75 static wxVisualAttributes
76 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
77
20e05ffb 78protected:
e01c8145 79 wxList m_clientList; // contains the client data for the items
29006414 80
f40fdaa3 81 void DoApplyWidgetStyle(GtkRcStyle *style);
a236aa20
VZ
82 virtual int DoInsertItems(const wxArrayStringsAdapter& items,
83 unsigned int pos,
84 void **clientData, wxClientDataType type);
9abe166a 85
aa61d352
VZ
86 virtual void DoSetItemClientData(unsigned int n, void* clientData);
87 virtual void* DoGetItemClientData(unsigned int n) const;
d6538e2c 88
f68586e5
VZ
89 virtual wxSize DoGetBestSize() const;
90
3a97d2db 91 virtual bool IsOwnGtkWindow( GdkWindow *window );
9d522606 92
738f9e5a 93private:
a236aa20 94 // DoInsertItems() helper
aa61d352 95 int GtkAddHelper(GtkWidget *menu, unsigned int pos, const wxString& item);
e01c8145
VZ
96
97 // this array is only used for controls with wxCB_SORT style, so only
98 // allocate it if it's needed (hence using pointer)
99 wxSortedArrayString *m_strings;
100
5f3565a2 101public:
853dcc57
WS
102 // this circumvents a GTK+ 2.0 bug so that the selection is
103 // invalidated properly
16edee16 104 int m_selection_hack;
5f3565a2
RR
105
106private:
738f9e5a 107 DECLARE_DYNAMIC_CLASS(wxChoice)
c801d85f
KB
108};
109
ce4169a4 110
c801d85f 111#endif // __GTKCHOICEH__