X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e4821c39c43133f7b48588a51d96cfdfeff79f6f..9e9574fe45b176ee74bba8fad7574cf9906145d1:/interface/wx/srchctrl.h diff --git a/interface/wx/srchctrl.h b/interface/wx/srchctrl.h index a0ccf76145..571082dcf8 100644 --- a/interface/wx/srchctrl.h +++ b/interface/wx/srchctrl.h @@ -2,8 +2,7 @@ // Name: srchctrl.h // Purpose: interface of wxSearchCtrl // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -14,11 +13,11 @@ @beginStyleTable @style{wxTE_PROCESS_ENTER} - The control will generate the event wxEVT_COMMAND_TEXT_ENTER + The control will generate the event @c wxEVT_TEXT_ENTER (otherwise pressing Enter key is either processed internally by the control or used for navigation between dialog controls). @style{wxTE_PROCESS_TAB} - The control will receive wxEVT_CHAR events for TAB pressed - + The control will receive @c 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. @@ -39,20 +38,23 @@ capitalized. @endStyleTable - @beginEventTable{wxCommandEvent} + @beginEventEmissionTable{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. + Respond to a @c 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 @code event.GetString() @endcode to retrieve the + string to search for in the event handler code. @event{EVT_SEARCHCTRL_CANCEL_BTN(id, func)} - Respond to a wxEVT_SEARCHCTRL_CANCEL_BTN event, generated when the + Respond to a @c wxEVT_SEARCHCTRL_CANCEL_BTN event, generated when the cancel button is clicked. @endEventTable @library{wxcore} @category{ctrl} - @appearance{searchctrl.png} + @appearance{searchctrl} @see wxTextCtrl::Create, wxValidator */ @@ -87,7 +89,7 @@ public: @see wxTextCtrl::Create, wxValidator */ wxSearchCtrl(wxWindow* parent, wxWindowID id, - const wxString& value = "", + const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, @@ -99,6 +101,15 @@ public: */ virtual ~wxSearchCtrl(); + + bool Create(wxWindow* parent, wxWindowID id, + const wxString& value = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxSearchCtrlNameStr); + /** Returns a pointer to the search control's menu object or @NULL if there is no menu attached. @@ -114,6 +125,11 @@ public: */ virtual bool IsSearchButtonVisible() const; + /** + Returns the cancel button's visibility state. + */ + virtual bool IsCancelButtonVisible() const; + /** Sets the search control's menu object. If there is already a menu associated with the search control it is deleted. @@ -136,5 +152,19 @@ public: This has no effect in Mac OS X v10.3 */ virtual void ShowSearchButton(bool show); + + /** + Set the text to be displayed in the search control when the user has + not yet typed anything in it. + */ + void SetDescriptiveText(const wxString& text); + + /** + Return the text displayed when there is not yet any user input. + */ + wxString GetDescriptiveText() const; }; + +wxEventType wxEVT_SEARCHCTRL_CANCEL_BTN; +wxEventType wxEVT_SEARCHCTRL_SEARCH_BTN;