]> git.saurik.com Git - wxWidgets.git/blame - include/wx/motif/choice.h
For wxMSW, split XPM handler into separate file (please add handler explicitly in...
[wxWidgets.git] / include / wx / motif / choice.h
CommitLineData
9b6dbb09
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: choice.h
3// Purpose: wxChoice class
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_CHOICE_H_
13#define _WX_CHOICE_H_
14
15#ifdef __GNUG__
16#pragma interface "choice.h"
17#endif
18
19#include "wx/control.h"
20
21WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
22
23// Choice item
24class WXDLLEXPORT wxChoice: public wxControl
25{
26 DECLARE_DYNAMIC_CLASS(wxChoice)
27
28 public:
f97c9854
JS
29 wxChoice();
30 ~wxChoice();
9b6dbb09
JS
31
32 inline wxChoice(wxWindow *parent, wxWindowID id,
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize,
35 int n = 0, const wxString choices[] = NULL,
36 long style = 0,
37 const wxValidator& validator = wxDefaultValidator,
38 const wxString& name = wxChoiceNameStr)
39 {
40 Create(parent, id, pos, size, n, choices, style, validator, name);
41 }
42
43 bool Create(wxWindow *parent, wxWindowID id,
44 const wxPoint& pos = wxDefaultPosition,
45 const wxSize& size = wxDefaultSize,
46 int n = 0, const wxString choices[] = NULL,
47 long style = 0,
48 const wxValidator& validator = wxDefaultValidator,
49 const wxString& name = wxChoiceNameStr);
50
51 virtual void Append(const wxString& item);
52 virtual void Delete(int n);
53 virtual void Clear();
54 virtual int GetSelection() const ;
55 virtual void SetSelection(int n);
56 virtual int FindString(const wxString& s) const;
57 virtual wxString GetString(int n) const ;
4fabb575 58
9b6dbb09 59 virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
4fabb575
JS
60 virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
61 { wxWindow::SetSize(rect, sizeFlags); }
62 virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); }
63
9b6dbb09
JS
64 virtual wxString GetStringSelection() const ;
65 virtual bool SetStringSelection(const wxString& sel);
66
67 virtual inline int Number() const { return m_noStrings; }
68 virtual void Command(wxCommandEvent& event);
69
f97c9854
JS
70 virtual void SetColumns(int n = 1 );
71 virtual int GetColumns() const ;
72
73 void SetFocus();
74
0d57be45 75// Implementation
4b5f3fe6 76 virtual void ChangeFont(bool keepOriginalSize = TRUE);
0d57be45
JS
77 virtual void ChangeBackgroundColour();
78 virtual void ChangeForegroundColour();
f97c9854
JS
79 WXWidget GetTopWidget() const { return m_formWidget; }
80 WXWidget GetMainWidget() const { return m_buttonWidget; }
9b6dbb09
JS
81
82protected:
f97c9854
JS
83 int m_noStrings;
84 WXWidget m_menuWidget;
85 WXWidget m_buttonWidget;
86 WXWidget* m_widgetList ;
87 WXWidget m_formWidget;
88 wxStringList m_stringList;
9b6dbb09
JS
89};
90
91#endif
92 // _WX_CHOICE_H_