]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/choice.h
support retina display
[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
c272f12f
RR
20class wxGtkCollatedArrayString;
21
20123d49 22class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase
c801d85f 23{
fd0eed64 24public:
e78c1d78
RR
25 wxChoice()
26 {
27 Init();
28 }
29006414
VZ
29 wxChoice( wxWindow *parent, wxWindowID id,
30 const wxPoint& pos = wxDefaultPosition,
31 const wxSize& size = wxDefaultSize,
32 int n = 0, const wxString choices[] = (const wxString *) NULL,
33 long style = 0,
34 const wxValidator& validator = wxDefaultValidator,
35 const wxString& name = wxChoiceNameStr )
36 {
e78c1d78 37 Init();
29006414
VZ
38 Create(parent, id, pos, size, n, choices, style, validator, name);
39 }
584ad2a3
MB
40 wxChoice( wxWindow *parent, wxWindowID id,
41 const wxPoint& pos,
42 const wxSize& size,
43 const wxArrayString& choices,
44 long style = 0,
45 const wxValidator& validator = wxDefaultValidator,
46 const wxString& name = wxChoiceNameStr )
47 {
e78c1d78 48 Init();
584ad2a3
MB
49 Create(parent, id, pos, size, choices, style, validator, name);
50 }
d3c7fc99 51 virtual ~wxChoice();
29006414
VZ
52 bool Create( wxWindow *parent, wxWindowID id,
53 const wxPoint& pos = wxDefaultPosition,
54 const wxSize& size = wxDefaultSize,
d3b9f782 55 int n = 0, const wxString choices[] = NULL,
29006414
VZ
56 long style = 0,
57 const wxValidator& validator = wxDefaultValidator,
58 const wxString& name = wxChoiceNameStr );
584ad2a3
MB
59 bool Create( wxWindow *parent, wxWindowID id,
60 const wxPoint& pos,
61 const wxSize& size,
62 const wxArrayString& choices,
63 long style = 0,
64 const wxValidator& validator = wxDefaultValidator,
65 const wxString& name = wxChoiceNameStr );
c801d85f 66
9abe166a 67 int GetSelection() const;
aa61d352 68 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
3f16e52c
RR
75 virtual void SetColumns(int n=1);
76 virtual int GetColumns() const;
77
bce926c5
VZ
78 virtual void GTKDisableEvents();
79 virtual void GTKEnableEvents();
a2c94110 80
9d522606
RD
81 static wxVisualAttributes
82 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
83
20e05ffb 84protected:
a2c94110
VZ
85 // this array is only used for controls with wxCB_SORT style, so only
86 // allocate it if it's needed (hence using pointer)
c272f12f 87 wxGtkCollatedArrayString *m_strings;
29006414 88
a2c94110
VZ
89 // contains the client data for the items
90 wxArrayPtrVoid m_clientData;
ef5c70f9 91
e78c1d78
RR
92 // index to GtkListStore cell which displays the item text
93 int m_stringCellIndex;
94
0662f990 95 virtual wxSize DoGetBestSize() const;
7a78a937 96 virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const;
a236aa20
VZ
97 virtual int DoInsertItems(const wxArrayStringsAdapter& items,
98 unsigned int pos,
99 void **clientData, wxClientDataType type);
aa61d352
VZ
100 virtual void DoSetItemClientData(unsigned int n, void* clientData);
101 virtual void* DoGetItemClientData(unsigned int n) const;
a2c94110
VZ
102 virtual void DoClear();
103 virtual void DoDeleteOneItem(unsigned int n);
d6538e2c 104
a2c94110 105 virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
c2193ac9 106 virtual void DoApplyWidgetStyle(GtkRcStyle *style);
5f3565a2 107
e78c1d78
RR
108 // in derived classes, implement this to insert list store entry
109 // with all items default except text
110 virtual void GTKInsertComboBoxTextItem( unsigned int n, const wxString& text );
111
5f3565a2 112private:
e78c1d78
RR
113 void Init();
114
738f9e5a 115 DECLARE_DYNAMIC_CLASS(wxChoice)
c801d85f
KB
116};
117
ce4169a4 118
3c75d8ba 119#endif // _WX_GTK_CHOICE_H_