]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/combobox.h
adding OnLaunched
[wxWidgets.git] / include / wx / os2 / combobox.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/combobox.h
3 // Purpose: wxComboBox class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/13/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_COMBOBOX_H_
13 #define _WX_COMBOBOX_H_
14
15 #include "wx/choice.h"
16 #include "wx/textentry.h"
17
18 #if wxUSE_COMBOBOX
19
20 // Combobox item
21 class WXDLLIMPEXP_CORE wxComboBox : public wxChoice,
22 public wxTextEntry
23 {
24
25 public:
26 inline wxComboBox() {}
27
28 inline wxComboBox( wxWindow* pParent
29 ,wxWindowID vId
30 ,const wxString& rsValue = wxEmptyString
31 ,const wxPoint& rPos = wxDefaultPosition
32 ,const wxSize& rSize = wxDefaultSize
33 ,int n = 0
34 ,const wxString asChoices[] = NULL
35 ,long lStyle = 0
36 ,const wxValidator& rValidator = wxDefaultValidator
37 ,const wxString& rsName = wxComboBoxNameStr
38 )
39 {
40 Create( pParent
41 ,vId
42 ,rsValue
43 ,rPos
44 ,rSize
45 ,n
46 ,asChoices
47 ,lStyle
48 ,rValidator
49 ,rsName
50 );
51 }
52
53 inline wxComboBox( wxWindow* pParent
54 ,wxWindowID vId
55 ,const wxString& rsValue
56 ,const wxPoint& rPos
57 ,const wxSize& rSize
58 ,const wxArrayString& asChoices
59 ,long lStyle = 0
60 ,const wxValidator& rValidator = wxDefaultValidator
61 ,const wxString& rsName = wxComboBoxNameStr
62 )
63 {
64 Create( pParent
65 ,vId
66 ,rsValue
67 ,rPos
68 ,rSize
69 ,asChoices
70 ,lStyle
71 ,rValidator
72 ,rsName
73 );
74 }
75
76 bool Create( wxWindow* pParent
77 ,wxWindowID vId
78 ,const wxString& rsValue = wxEmptyString
79 ,const wxPoint& rPos = wxDefaultPosition
80 ,const wxSize& rSize = wxDefaultSize
81 ,int n = 0
82 ,const wxString asChoices[] = NULL
83 ,long lStyle = 0
84 ,const wxValidator& rValidator = wxDefaultValidator
85 ,const wxString& rsName = wxComboBoxNameStr
86 );
87
88 bool Create( wxWindow* pParent
89 ,wxWindowID vId
90 ,const wxString& rsValue
91 ,const wxPoint& rPos
92 ,const wxSize& rSize
93 ,const wxArrayString& asChoices
94 ,long lStyle = 0
95 ,const wxValidator& rValidator = wxDefaultValidator
96 ,const wxString& rsName = wxComboBoxNameStr
97 );
98
99 // See wxComboBoxBase discussion of IsEmpty().
100 bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
101 bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
102
103 // resolve ambiguities among virtual functions inherited from both base
104 // classes
105 virtual void Clear();
106 virtual wxString GetValue() const;
107 virtual void SetValue(const wxString& value);
108 virtual wxString GetStringSelection() const
109 { return wxChoice::GetStringSelection(); }
110
111 inline virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
112 virtual void SetSelection(long from, long to)
113 { wxTextEntry::SetSelection(from, to); }
114 virtual int GetSelection() const { return wxChoice::GetSelection(); }
115 virtual void GetSelection(long *from, long *to) const
116 { wxTextEntry::GetSelection(from, to); }
117
118 virtual bool IsEditable() const;
119
120 virtual bool OS2Command( WXUINT uParam
121 ,WXWORD wId
122 );
123 bool ProcessEditMsg( WXUINT uMsg
124 ,WXWPARAM wParam
125 ,WXLPARAM lParam
126 );
127
128 private:
129 // implement wxTextEntry pure virtual methods
130 virtual wxWindow *GetEditableWindow() { return this; }
131 virtual WXHWND GetEditHWND() const { return m_hWnd; }
132
133 DECLARE_DYNAMIC_CLASS(wxComboBox)
134 }; // end of CLASS wxComboBox
135
136 #endif // wxUSE_COMBOBOX
137 #endif
138 // _WX_COMBOBOX_H_