2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: srchctrl.h
|
2008-03-10 11:24:38 -04:00
|
|
|
// Purpose: interface of wxSearchCtrl
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxSearchCtrl
|
2008-03-08 09:43:31 -05:00
|
|
|
|
|
|
|
A search control is a composite control with a search button, a text
|
2008-03-08 08:52:38 -05:00
|
|
|
control, and a cancel button.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@beginStyleTable
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTE_PROCESS_ENTER}
|
2008-03-08 08:52:38 -05:00
|
|
|
The control will generate the event wxEVT_COMMAND_TEXT_ENTER
|
|
|
|
(otherwise pressing Enter key is either processed internally by the
|
|
|
|
control or used for navigation between dialog controls).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTE_PROCESS_TAB}
|
2008-03-08 08:52:38 -05:00
|
|
|
The control will receive wxEVT_CHAR events for TAB pressed -
|
|
|
|
normally, TAB is used for passing to the next control in a dialog
|
|
|
|
instead. For the control created with this style, you can still use
|
|
|
|
Ctrl-Enter to pass to the next control from the keyboard.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTE_NOHIDESEL}
|
2008-03-08 08:52:38 -05:00
|
|
|
By default, the Windows text control doesn't show the selection
|
|
|
|
when it doesn't have focus - use this style to force it to always
|
|
|
|
show it. It doesn't do anything under other platforms.
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTE_LEFT}
|
2008-03-08 08:52:38 -05:00
|
|
|
The text in the control will be left-justified (default).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTE_CENTRE}
|
2008-03-08 08:52:38 -05:00
|
|
|
The text in the control will be centered (currently wxMSW and
|
|
|
|
wxGTK2 only).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTE_RIGHT}
|
2008-03-08 08:52:38 -05:00
|
|
|
The text in the control will be right-justified (currently wxMSW
|
|
|
|
and wxGTK2 only).
|
2008-04-06 10:43:04 -04:00
|
|
|
@style{wxTE_CAPITALIZE}
|
2008-03-08 08:52:38 -05:00
|
|
|
On PocketPC and Smartphone, causes the first letter to be
|
|
|
|
capitalized.
|
|
|
|
@endStyleTable
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-10-05 07:24:00 -04:00
|
|
|
@beginEventTable{wxCommandEvent}
|
|
|
|
To retrieve actual search queries, use EVT_TEXT and EVT_TEXT_ENTER events,
|
|
|
|
just as you would with wxTextCtrl.
|
|
|
|
@event{EVT_SEARCHCTRL_SEARCH_BTN(id, func)}
|
|
|
|
Respond to a wxEVT_SEARCHCTRL_SEARCH_BTN event, generated when the
|
|
|
|
search button is clicked. Note that this does not initiate a search.
|
|
|
|
@event{EVT_SEARCHCTRL_CANCEL_BTN(id, func)}
|
|
|
|
Respond to a wxEVT_SEARCHCTRL_CANCEL_BTN event, generated when the
|
|
|
|
cancel button is clicked.
|
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
2008-10-05 07:24:00 -04:00
|
|
|
@category{ctrl}
|
2008-10-15 05:49:58 -04:00
|
|
|
@appearance{searchctrl.png}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
@see wxTextCtrl::Create, wxValidator
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxSearchCtrl : public wxTextCtrl
|
|
|
|
{
|
|
|
|
public:
|
2008-05-29 10:10:52 -04:00
|
|
|
/**
|
|
|
|
Default constructor
|
|
|
|
*/
|
|
|
|
wxSearchCtrl();
|
2008-10-05 07:24:00 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
Constructor, creating and showing a text control.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param parent
|
2008-03-09 08:33:59 -04:00
|
|
|
Parent window. Should not be @NULL.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param id
|
2008-03-09 08:33:59 -04:00
|
|
|
Control identifier. A value of -1 denotes a default value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param value
|
2008-03-09 08:33:59 -04:00
|
|
|
Default text value.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param pos
|
2008-03-09 08:33:59 -04:00
|
|
|
Text control position.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param size
|
2008-03-09 08:33:59 -04:00
|
|
|
Text control size.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param style
|
2008-03-09 08:33:59 -04:00
|
|
|
Window style. See wxSearchCtrl.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param validator
|
2008-03-09 08:33:59 -04:00
|
|
|
Window validator.
|
2008-03-08 09:43:31 -05:00
|
|
|
@param name
|
2008-03-09 08:33:59 -04:00
|
|
|
Window name.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-09 08:33:59 -04:00
|
|
|
@see wxTextCtrl::Create, wxValidator
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
2008-03-08 09:43:31 -05:00
|
|
|
wxSearchCtrl(wxWindow* parent, wxWindowID id,
|
2008-11-13 16:32:53 -05:00
|
|
|
const wxString& value = wxEmptyString,
|
2008-03-08 09:43:31 -05:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxSearchCtrlNameStr);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor, destroying the search control.
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual ~wxSearchCtrl();
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Returns a pointer to the search control's menu object or @NULL if there is no
|
2008-03-08 08:52:38 -05:00
|
|
|
menu attached.
|
|
|
|
*/
|
|
|
|
virtual wxMenu* GetMenu();
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Returns the search button visibility value.
|
2008-03-08 08:52:38 -05:00
|
|
|
If there is a menu attached, the search button will be visible regardless of
|
2008-10-05 07:24:00 -04:00
|
|
|
the search button visibility value.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This always returns @false in Mac OS X v10.3
|
|
|
|
*/
|
2008-09-27 07:21:10 -04:00
|
|
|
virtual bool IsSearchButtonVisible() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
2008-10-05 07:24:00 -04:00
|
|
|
Sets the search control's menu object.
|
|
|
|
If there is already a menu associated with the search control it is deleted.
|
2008-03-20 09:45:17 -04:00
|
|
|
|
2008-03-08 09:43:31 -05:00
|
|
|
@param menu
|
2008-03-09 08:33:59 -04:00
|
|
|
Menu to attach to the search control.
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
virtual void SetMenu(wxMenu* menu);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Shows or hides the cancel button.
|
|
|
|
*/
|
|
|
|
virtual void ShowCancelButton(bool show);
|
|
|
|
|
|
|
|
/**
|
2008-03-08 09:43:31 -05:00
|
|
|
Sets the search button visibility value on the search control.
|
2008-03-08 08:52:38 -05:00
|
|
|
If there is a menu attached, the search button will be visible regardless of
|
2008-10-05 07:24:00 -04:00
|
|
|
the search button visibility value.
|
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
This has no effect in Mac OS X v10.3
|
|
|
|
*/
|
|
|
|
virtual void ShowSearchButton(bool show);
|
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|