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-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
|
|
|
@category{FIXME}
|
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-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,
|
|
|
|
const wxString& value = "",
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
~wxSearchCtrl();
|
|
|
|
|
|
|
|
/**
|
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
|
|
|
|
the search
|
2008-03-08 09:43:31 -05:00
|
|
|
button visibility value.
|
2008-03-08 08:52:38 -05:00
|
|
|
This always returns @false in Mac OS X v10.3
|
|
|
|
*/
|
|
|
|
virtual bool IsSearchButtonVisible();
|
|
|
|
|
|
|
|
/**
|
|
|
|
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
|
|
|
|
the search
|
2008-03-08 09:43:31 -05:00
|
|
|
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
|
|
|
|