]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: srchctrl.h | |
e54c96f1 | 3 | // Purpose: interface of wxSearchCtrl |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxSearchCtrl | |
11 | @wxheader{srchctrl.h} | |
7c913512 FM |
12 | |
13 | A search control is a composite control with a search button, a text | |
23324ae1 | 14 | control, and a cancel button. |
7c913512 | 15 | |
23324ae1 | 16 | @beginStyleTable |
8c6791e4 | 17 | @style{wxTE_PROCESS_ENTER} |
23324ae1 FM |
18 | The control will generate the event wxEVT_COMMAND_TEXT_ENTER |
19 | (otherwise pressing Enter key is either processed internally by the | |
20 | control or used for navigation between dialog controls). | |
8c6791e4 | 21 | @style{wxTE_PROCESS_TAB} |
23324ae1 FM |
22 | The control will receive wxEVT_CHAR events for TAB pressed - |
23 | normally, TAB is used for passing to the next control in a dialog | |
24 | instead. For the control created with this style, you can still use | |
25 | Ctrl-Enter to pass to the next control from the keyboard. | |
8c6791e4 | 26 | @style{wxTE_NOHIDESEL} |
23324ae1 FM |
27 | By default, the Windows text control doesn't show the selection |
28 | when it doesn't have focus - use this style to force it to always | |
29 | show it. It doesn't do anything under other platforms. | |
8c6791e4 | 30 | @style{wxTE_LEFT} |
23324ae1 | 31 | The text in the control will be left-justified (default). |
8c6791e4 | 32 | @style{wxTE_CENTRE} |
23324ae1 FM |
33 | The text in the control will be centered (currently wxMSW and |
34 | wxGTK2 only). | |
8c6791e4 | 35 | @style{wxTE_RIGHT} |
23324ae1 FM |
36 | The text in the control will be right-justified (currently wxMSW |
37 | and wxGTK2 only). | |
8c6791e4 | 38 | @style{wxTE_CAPITALIZE} |
23324ae1 FM |
39 | On PocketPC and Smartphone, causes the first letter to be |
40 | capitalized. | |
41 | @endStyleTable | |
7c913512 | 42 | |
23324ae1 FM |
43 | @library{wxcore} |
44 | @category{FIXME} | |
7c913512 | 45 | |
e54c96f1 | 46 | @see wxTextCtrl::Create, wxValidator |
23324ae1 FM |
47 | */ |
48 | class wxSearchCtrl : public wxTextCtrl | |
49 | { | |
50 | public: | |
671600d8 RR |
51 | /** |
52 | Default constructor | |
53 | */ | |
54 | wxSearchCtrl(); | |
55 | ||
23324ae1 FM |
56 | /** |
57 | Constructor, creating and showing a text control. | |
3c4f71cc | 58 | |
7c913512 | 59 | @param parent |
4cc4bfaf | 60 | Parent window. Should not be @NULL. |
7c913512 | 61 | @param id |
4cc4bfaf | 62 | Control identifier. A value of -1 denotes a default value. |
7c913512 | 63 | @param value |
4cc4bfaf | 64 | Default text value. |
7c913512 | 65 | @param pos |
4cc4bfaf | 66 | Text control position. |
7c913512 | 67 | @param size |
4cc4bfaf | 68 | Text control size. |
7c913512 | 69 | @param style |
4cc4bfaf | 70 | Window style. See wxSearchCtrl. |
7c913512 | 71 | @param validator |
4cc4bfaf | 72 | Window validator. |
7c913512 | 73 | @param name |
4cc4bfaf | 74 | Window name. |
3c4f71cc | 75 | |
4cc4bfaf | 76 | @see wxTextCtrl::Create, wxValidator |
23324ae1 | 77 | */ |
7c913512 FM |
78 | wxSearchCtrl(wxWindow* parent, wxWindowID id, |
79 | const wxString& value = "", | |
80 | const wxPoint& pos = wxDefaultPosition, | |
81 | const wxSize& size = wxDefaultSize, | |
82 | long style = 0, | |
83 | const wxValidator& validator = wxDefaultValidator, | |
84 | const wxString& name = wxSearchCtrlNameStr); | |
23324ae1 FM |
85 | |
86 | /** | |
87 | Destructor, destroying the search control. | |
88 | */ | |
89 | ~wxSearchCtrl(); | |
90 | ||
91 | /** | |
7c913512 | 92 | Returns a pointer to the search control's menu object or @NULL if there is no |
23324ae1 FM |
93 | menu attached. |
94 | */ | |
95 | virtual wxMenu* GetMenu(); | |
96 | ||
97 | /** | |
7c913512 | 98 | Returns the search button visibility value. |
23324ae1 FM |
99 | If there is a menu attached, the search button will be visible regardless of |
100 | the search | |
7c913512 | 101 | button visibility value. |
23324ae1 FM |
102 | This always returns @false in Mac OS X v10.3 |
103 | */ | |
104 | virtual bool IsSearchButtonVisible(); | |
105 | ||
106 | /** | |
107 | Sets the search control's menu object. If there is already a menu associated | |
108 | with | |
109 | the search control it is deleted. | |
3c4f71cc | 110 | |
7c913512 | 111 | @param menu |
4cc4bfaf | 112 | Menu to attach to the search control. |
23324ae1 FM |
113 | */ |
114 | virtual void SetMenu(wxMenu* menu); | |
115 | ||
116 | /** | |
117 | Shows or hides the cancel button. | |
118 | */ | |
119 | virtual void ShowCancelButton(bool show); | |
120 | ||
121 | /** | |
7c913512 | 122 | Sets the search button visibility value on the search control. |
23324ae1 FM |
123 | If there is a menu attached, the search button will be visible regardless of |
124 | the search | |
7c913512 | 125 | button visibility value. |
23324ae1 FM |
126 | This has no effect in Mac OS X v10.3 |
127 | */ | |
128 | virtual void ShowSearchButton(bool show); | |
129 | }; | |
e54c96f1 | 130 |