A search control is a composite control with a search button, a text control, and a cancel button.
This class supports the following styles:
Handlers bound for the following event types will receive one of the CommandEvent TextCtrl. parameters.
EVT_SEARCHCTRL_SEARCH_BTN: Respond to a wxEVT_SEARCHCTRL_SEARCH_BTN event, generated when the search button is clicked. Note that this does not initiate a search on its own, you need to perform the appropriate action in your event handler. You may use
event.GetString()
to retrieve the string to search for in the event handler code. - EVT_SEARCHCTRL_CANCEL_BTN: Respond to a wxEVT_SEARCHCTRL_CANCEL_BTN event, generated when the cancel button is clicked.
See also
__init__ | Default constructor. |
Create | Creates the text control for two-step construction. |
GetDescriptiveText | Return the text displayed when there is not yet any user input. |
GetMenu | Returns a pointer to the search control’s menu object or None if there is no menu attached. |
IsCancelButtonVisible | Returns the cancel button’s visibility state. |
IsSearchButtonVisible | Returns the search button visibility value. |
SetCancelBitmap | |
SetDescriptiveText | Set the text to be displayed in the search control when the user has not yet typed anything in it. |
SetMenu | Sets the search control’s menu object. |
SetSearchBitmap | |
SetSearchMenuBitmap | |
ShowCancelButton | Shows or hides the cancel button. |
ShowSearchButton | Sets the search button visibility value on the search control. |
A search control is a composite control with a search button, a text control, and a cancel button.
Possible constructors:
SearchCtrl()
SearchCtrl(parent, id=ID_ANY, value='', pos=DefaultPosition,
size=DefaultSize, style=0, validator=DefaultValidator,
name=SearchCtrlNameStr)
Overloaded Implementations:
__init__ (self)
Default constructor.
__init__ (self, parent, id=ID_ANY, value=’‘, pos=DefaultPosition, size=DefaultSize, style=0, validator=DefaultValidator, name=SearchCtrlNameStr)
Constructor, creating and showing a text control.
Parameters: |
|
---|
See also
Creates the text control for two-step construction.
This method should be called if the default constructor was used for the control creation. Its parameters have the same meaning as for the non-default constructor.
Parameters: | |
---|---|
Return type: | bool |
Return the text displayed when there is not yet any user input.
Return type: | string |
---|
Returns a pointer to the search control’s menu object or None if there is no menu attached.
Return type: | Menu |
---|
Returns the cancel button’s visibility state.
Return type: | bool |
---|
Returns the search button visibility value.
If there is a menu attached, the search button will be visible regardless of the search button visibility value.
This always returns False in Mac OS X v10.3
Return type: | bool |
---|
Set the text to be displayed in the search control when the user has not yet typed anything in it.
Parameters: | text (string) – |
---|
Sets the search control’s menu object.
If there is already a menu associated with the search control it is deleted.
Parameters: | menu (Menu) – Menu to attach to the search control. |
---|
Shows or hides the cancel button.
Parameters: | show (bool) – |
---|
Sets the search button visibility value on the search control.
If there is a menu attached, the search button will be visible regardless of the search button visibility value.
This has no effect in Mac OS X v10.3
Parameters: | show (bool) – |
---|
See GetDescriptiveText and SetDescriptiveText