]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/choice.h
Applied fix for VC++ 7 which treats __LINE__ slightly differently, apparently.
[wxWidgets.git] / include / wx / motif / choice.h
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 WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
20
21 // Choice item
22 class WXDLLEXPORT wxChoice: public wxChoiceBase
23 {
24 DECLARE_DYNAMIC_CLASS(wxChoice)
25
26 public:
27 wxChoice();
28 ~wxChoice();
29
30 wxChoice(wxWindow *parent, wxWindowID id,
31 const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxDefaultSize,
33 int n = 0, const wxString choices[] = NULL,
34 long style = 0,
35 const wxValidator& validator = wxDefaultValidator,
36 const wxString& name = wxChoiceNameStr)
37 {
38 Create(parent, id, pos, size, n, choices, style, validator, name);
39 }
40
41 bool Create(wxWindow *parent, wxWindowID id,
42 const wxPoint& pos = wxDefaultPosition,
43 const wxSize& size = wxDefaultSize,
44 int n = 0, const wxString choices[] = NULL,
45 long style = 0,
46 const wxValidator& validator = wxDefaultValidator,
47 const wxString& name = wxChoiceNameStr);
48
49 // Virtual functions required by wxControlWithItems.
50 // They are not all implemented yet :-(
51 virtual int GetCount() const;
52 virtual int DoAppend(const wxString& item);
53 virtual void DoInsertItems(const wxArrayString& items, int pos);
54 virtual void DoSetItems(const wxArrayString& items, void **clientData);
55 virtual void DoSetFirstItem(int n);
56 virtual void DoSetItemClientData(int n, void* clientData);
57 virtual void* DoGetItemClientData(int n) const;
58 virtual void DoSetItemClientObject(int n, wxClientData* clientData);
59 virtual wxClientData* DoGetItemClientObject(int n) const;
60 virtual void Select(int n);
61 virtual void SetString(int n, const wxString& s);
62
63 // Original API
64 // virtual void Append(const wxString& item);
65 virtual void Delete(int n);
66 virtual void Clear();
67 virtual int GetSelection() const ;
68 virtual void SetSelection(int n);
69 virtual int FindString(const wxString& s) const;
70 virtual wxString GetString(int n) const ;
71
72 virtual wxString GetStringSelection() const ;
73 virtual bool SetStringSelection(const wxString& sel);
74
75 virtual int Number() const { return m_noStrings; }
76 virtual void Command(wxCommandEvent& event);
77
78 virtual void SetColumns(int n = 1 );
79 virtual int GetColumns() const ;
80
81 void SetFocus();
82
83 // Implementation
84 virtual void ChangeFont(bool keepOriginalSize = TRUE);
85 virtual void ChangeBackgroundColour();
86 virtual void ChangeForegroundColour();
87 WXWidget GetTopWidget() const { return m_formWidget; }
88 WXWidget GetMainWidget() const { return m_buttonWidget; }
89
90 protected:
91 int m_noStrings;
92 WXWidget m_menuWidget;
93 WXWidget m_buttonWidget;
94 WXWidget* m_widgetList ;
95 WXWidget m_formWidget;
96 wxStringList m_stringList;
97 wxList m_clientList; // contains the client data for the items
98
99 virtual void DoSetSize(int x, int y,
100 int width, int height,
101 int sizeFlags = wxSIZE_AUTO);
102 };
103
104 #endif
105 // _WX_CHOICE_H_