]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/choice.h
synched Clear() and SetBackgroundColour()
[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
c801d85f
KB
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKCHOICEH__
11#define __GTKCHOICEH__
12
13#ifdef __GNUG__
14#pragma interface
15#endif
16
17#include "wx/defs.h"
18#include "wx/object.h"
19#include "wx/list.h"
20#include "wx/control.h"
21
22//-----------------------------------------------------------------------------
23// classes
24//-----------------------------------------------------------------------------
25
26class wxChoice;
27
28//-----------------------------------------------------------------------------
29// global data
30//-----------------------------------------------------------------------------
31
32extern const char *wxChoiceNameStr;
33
34//-----------------------------------------------------------------------------
35// wxChoice
36//-----------------------------------------------------------------------------
37
38class wxChoice: public wxControl
39{
40 DECLARE_DYNAMIC_CLASS(wxChoice)
41
fd0eed64 42public:
c801d85f 43
fd0eed64
RR
44 wxChoice();
45 inline wxChoice( wxWindow *parent, wxWindowID id,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 int n = 0, const wxString choices[] = (const wxString *) NULL,
49 long style = 0,
50 const wxValidator& validator = wxDefaultValidator,
51 const wxString& name = wxChoiceNameStr )
52 {
6de97a3b 53 Create(parent, id, pos, size, n, choices, style, validator, name);
fd0eed64
RR
54 }
55 ~wxChoice();
56 bool Create( wxWindow *parent, wxWindowID id,
57 const wxPoint& pos = wxDefaultPosition,
58 const wxSize& size = wxDefaultSize,
59 int n = 0, const wxString choices[] = (wxString *) NULL,
60 long style = 0,
61 const wxValidator& validator = wxDefaultValidator,
62 const wxString& name = wxChoiceNameStr );
63
64 void Append( const wxString &item );
65 void Append( const wxString &item, void* clientData );
66 void Append( const wxString &item, wxClientData* clientData );
67
68 void SetClientData( int n, void* clientData );
69 void* GetClientData( int n );
70 void SetClientObject( int n, wxClientData* clientData );
71 wxClientData* GetClientObject( int n );
72
73 void Clear();
74 void Delete(int n);
75
76 int FindString( const wxString &string ) const;
77 int GetColumns() const;
78 int GetSelection();
79 wxString GetString( int n ) const;
80 wxString GetStringSelection() const;
81 int Number() const;
82 void SetColumns( int n = 1 );
83 void SetSelection( int n );
84 void SetStringSelection( const wxString &string );
b4071e91 85
fd0eed64 86// implementation
58614078 87
f5e27805
RR
88 wxList m_clientDataList;
89 wxList m_clientObjectList;
fd0eed64
RR
90
91 void AppendCommon( const wxString &item );
92 void ApplyWidgetStyle();
c801d85f
KB
93};
94
95#endif // __GTKCHOICEH__