| 1 | ///////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: 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 | |
| 17 | #if wxUSE_COMBOBOX |
| 18 | |
| 19 | // Combobox item |
| 20 | class WXDLLEXPORT wxComboBox : public wxChoice |
| 21 | { |
| 22 | |
| 23 | public: |
| 24 | inline wxComboBox() {} |
| 25 | |
| 26 | inline wxComboBox( wxWindow* pParent |
| 27 | ,wxWindowID vId |
| 28 | ,const wxString& rsValue = wxEmptyString |
| 29 | ,const wxPoint& rPos = wxDefaultPosition |
| 30 | ,const wxSize& rSize = wxDefaultSize |
| 31 | ,int n = 0 |
| 32 | ,const wxString asChoices[] = NULL |
| 33 | ,long lStyle = 0 |
| 34 | ,const wxValidator& rValidator = wxDefaultValidator |
| 35 | ,const wxString& rsName = wxComboBoxNameStr |
| 36 | ) |
| 37 | { |
| 38 | Create( pParent |
| 39 | ,vId |
| 40 | ,rsValue |
| 41 | ,rPos |
| 42 | ,rSize |
| 43 | ,n |
| 44 | ,asChoices |
| 45 | ,lStyle |
| 46 | ,rValidator |
| 47 | ,rsName |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | inline wxComboBox( wxWindow* pParent |
| 52 | ,wxWindowID vId |
| 53 | ,const wxString& rsValue |
| 54 | ,const wxPoint& rPos |
| 55 | ,const wxSize& rSize |
| 56 | ,const wxArrayString& asChoices |
| 57 | ,long lStyle = 0 |
| 58 | ,const wxValidator& rValidator = wxDefaultValidator |
| 59 | ,const wxString& rsName = wxComboBoxNameStr |
| 60 | ) |
| 61 | { |
| 62 | Create( pParent |
| 63 | ,vId |
| 64 | ,rsValue |
| 65 | ,rPos |
| 66 | ,rSize |
| 67 | ,asChoices |
| 68 | ,lStyle |
| 69 | ,rValidator |
| 70 | ,rsName |
| 71 | ); |
| 72 | } |
| 73 | |
| 74 | bool Create( wxWindow* pParent |
| 75 | ,wxWindowID vId |
| 76 | ,const wxString& rsValue = wxEmptyString |
| 77 | ,const wxPoint& rPos = wxDefaultPosition |
| 78 | ,const wxSize& rSize = wxDefaultSize |
| 79 | ,int n = 0 |
| 80 | ,const wxString asChoices[] = NULL |
| 81 | ,long lStyle = 0 |
| 82 | ,const wxValidator& rValidator = wxDefaultValidator |
| 83 | ,const wxString& rsName = wxComboBoxNameStr |
| 84 | ); |
| 85 | |
| 86 | bool Create( wxWindow* pParent |
| 87 | ,wxWindowID vId |
| 88 | ,const wxString& rsValue |
| 89 | ,const wxPoint& rPos |
| 90 | ,const wxSize& rSize |
| 91 | ,const wxArrayString& asChoices |
| 92 | ,long lStyle = 0 |
| 93 | ,const wxValidator& rValidator = wxDefaultValidator |
| 94 | ,const wxString& rsName = wxComboBoxNameStr |
| 95 | ); |
| 96 | |
| 97 | // |
| 98 | // List functions: see wxChoice |
| 99 | // |
| 100 | virtual wxString GetValue(void) const; |
| 101 | virtual void SetValue(const wxString& rsValue); |
| 102 | |
| 103 | // |
| 104 | // Clipboard operations |
| 105 | // |
| 106 | virtual void Copy(); |
| 107 | virtual void Cut(); |
| 108 | virtual void Paste(); |
| 109 | |
| 110 | virtual void SetInsertionPoint(long lPos); |
| 111 | virtual void SetInsertionPointEnd(void); |
| 112 | virtual long GetInsertionPoint(void) const; |
| 113 | virtual wxTextPos GetLastPosition(void) const; |
| 114 | virtual void Replace( long lFrom |
| 115 | ,long lTo |
| 116 | ,const wxString& rsValue |
| 117 | ); |
| 118 | virtual void Remove( long lFrom |
| 119 | ,long lTo |
| 120 | ); |
| 121 | inline virtual void SetSelection(int n) { wxChoice::SetSelection(n); } |
| 122 | virtual void SetSelection( long lFrom |
| 123 | ,long lTo |
| 124 | ); |
| 125 | virtual void SetEditable(bool bEditable); |
| 126 | |
| 127 | virtual bool OS2Command( WXUINT uParam |
| 128 | ,WXWORD wId |
| 129 | ); |
| 130 | bool ProcessEditMsg( WXUINT uMsg |
| 131 | ,WXWPARAM wParam |
| 132 | ,WXLPARAM lParam |
| 133 | ); |
| 134 | |
| 135 | private: |
| 136 | DECLARE_DYNAMIC_CLASS(wxComboBox) |
| 137 | }; // end of CLASS wxComboBox |
| 138 | |
| 139 | #endif // wxUSE_COMBOBOX |
| 140 | #endif |
| 141 | // _WX_COMBOBOX_H_ |