]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/choice.h
created wxBookCtrl which will be tje base class for wxNotebook and wxListbook; moved...
[wxWidgets.git] / include / wx / gtk1 / choice.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: choice.h
3// Purpose:
4// Author: Robert Roebling
dbf858b5 5// Id: $Id$
01111366 6// Copyright: (c) 1998 Robert Roebling
29006414 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKCHOICEH__
11#define __GTKCHOICEH__
12
12028905 13#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
9abe166a 14 #pragma interface "choice.h"
c801d85f
KB
15#endif
16
b5f6b52a
MB
17class WXDLLIMPEXP_BASE wxSortedArrayString;
18
c801d85f
KB
19//-----------------------------------------------------------------------------
20// wxChoice
21//-----------------------------------------------------------------------------
22
9abe166a 23class wxChoice : public wxChoiceBase
c801d85f 24{
fd0eed64 25public:
29006414
VZ
26 wxChoice();
27 wxChoice( wxWindow *parent, wxWindowID id,
28 const wxPoint& pos = wxDefaultPosition,
29 const wxSize& size = wxDefaultSize,
30 int n = 0, const wxString choices[] = (const wxString *) NULL,
31 long style = 0,
32 const wxValidator& validator = wxDefaultValidator,
33 const wxString& name = wxChoiceNameStr )
34 {
e01c8145
VZ
35 m_strings = (wxSortedArrayString *)NULL;
36
29006414
VZ
37 Create(parent, id, pos, size, n, choices, style, validator, name);
38 }
39 ~wxChoice();
40 bool Create( wxWindow *parent, wxWindowID id,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 int n = 0, const wxString choices[] = (wxString *) NULL,
44 long style = 0,
45 const wxValidator& validator = wxDefaultValidator,
46 const wxString& name = wxChoiceNameStr );
c801d85f 47
9abe166a 48 // implement base class pure virtuals
29006414 49 void Delete(int n);
9abe166a
VZ
50 void Clear();
51
52 int GetSelection() const;
53 void SetSelection( int n );
29006414 54
9abe166a 55 virtual int GetCount() const;
6c8a980f 56 int FindString( const wxString& string ) const;
29006414 57 wxString GetString( int n ) const;
6c8a980f 58 void SetString( int n, const wxString& string );
29006414 59
20e05ffb 60protected:
e01c8145 61 wxList m_clientList; // contains the client data for the items
29006414 62
29006414 63 void ApplyWidgetStyle();
9abe166a 64 virtual int DoAppend(const wxString& item);
243dbf1a 65 virtual int DoInsert(const wxString& item, int pos);
9abe166a 66
6c8a980f
VZ
67 virtual void DoSetItemClientData( int n, void* clientData );
68 virtual void* DoGetItemClientData( int n ) const;
69 virtual void DoSetItemClientObject( int n, wxClientData* clientData );
70 virtual wxClientData* DoGetItemClientObject( int n ) const;
d6538e2c 71
f68586e5
VZ
72 virtual wxSize DoGetBestSize() const;
73
3a97d2db 74 virtual bool IsOwnGtkWindow( GdkWindow *window );
738f9e5a 75private:
e01c8145 76 // common part of Create() and DoAppend()
243dbf1a 77 int GtkAddHelper(GtkWidget *menu, int pos, const wxString& item);
e01c8145
VZ
78
79 // this array is only used for controls with wxCB_SORT style, so only
80 // allocate it if it's needed (hence using pointer)
81 wxSortedArrayString *m_strings;
82
738f9e5a 83 DECLARE_DYNAMIC_CLASS(wxChoice)
c801d85f
KB
84};
85
ce4169a4 86
c801d85f 87#endif // __GTKCHOICEH__