X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32423dd8248d13625e8eedd10298601e5313a393..a4ea083bbdf710d3234dcbd2eafb5d0e078f8348:/src/common/textcmn.cpp diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index 541f996a32..22d5b7250b 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 13.07.99 -// RCS-ID: $Id$ // Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -103,8 +102,8 @@ wxEND_FLAGS( wxTextCtrlStyle ) wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxTextCtrl, wxControl, "wx/textctrl.h") wxBEGIN_PROPERTIES_TABLE(wxTextCtrl) -wxEVENT_PROPERTY( TextUpdated, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent ) -wxEVENT_PROPERTY( TextEnter, wxEVT_COMMAND_TEXT_ENTER, wxCommandEvent ) +wxEVENT_PROPERTY( TextUpdated, wxEVT_TEXT, wxCommandEvent ) +wxEVENT_PROPERTY( TextEnter, wxEVT_TEXT_ENTER, wxCommandEvent ) wxPROPERTY( Font, wxFont, SetFont, GetFont , wxEMPTY_PARAMETER_VALUE, \ 0 /*flags*/, wxT("Helpstring"), wxT("group") ) @@ -125,10 +124,10 @@ wxCONSTRUCTOR_6( wxTextCtrl, wxWindow*, Parent, wxWindowID, Id, \ IMPLEMENT_DYNAMIC_CLASS(wxTextUrlEvent, wxCommandEvent) -wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent ); -wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_ENTER, wxCommandEvent ); -wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_URL, wxTextUrlEvent ); -wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_MAXLEN, wxCommandEvent ); +wxDEFINE_EVENT( wxEVT_TEXT, wxCommandEvent ); +wxDEFINE_EVENT( wxEVT_TEXT_ENTER, wxCommandEvent ); +wxDEFINE_EVENT( wxEVT_TEXT_URL, wxTextUrlEvent ); +wxDEFINE_EVENT( wxEVT_TEXT_MAXLEN, wxCommandEvent ); IMPLEMENT_ABSTRACT_CLASS(wxTextCtrlBase, wxControl) @@ -915,6 +914,8 @@ bool wxTextAreaBase::DoLoadFile(const wxString& filename, int WXUNUSED(fileType) return true; } } +#else + (void)filename; // avoid compiler warning about unreferenced parameter #endif // wxUSE_FFILE wxLogError(_("File couldn't be loaded.")); @@ -936,6 +937,8 @@ bool wxTextAreaBase::DoSaveFile(const wxString& filename, int WXUNUSED(fileType) return true; } +#else + (void)filename; // avoid compiler warning about unreferenced parameter #endif // wxUSE_FFILE return false; @@ -1139,6 +1142,18 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) return handled; } +// ---------------------------------------------------------------------------- +// Other miscellaneous stuff +// ---------------------------------------------------------------------------- + +bool wxTextCtrlBase::SetHint(const wxString& hint) +{ + wxCHECK_MSG( IsSingleLine(), false, + wxS("Hints can only be set for single line text controls") ); + + return wxTextEntry::SetHint(hint); +} + // do the window-specific processing after processing the update event void wxTextCtrlBase::DoUpdateWindowUI(wxUpdateUIEvent& event) { @@ -1201,6 +1216,6 @@ wxPoint wxTextAreaBase::DoPositionToCoords(long WXUNUSED(pos)) const // define this one even if !wxUSE_TEXTCTRL because it is also used by other // controls (wxComboBox and wxSpinCtrl) -wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent ); +wxDEFINE_EVENT( wxEVT_TEXT, wxCommandEvent ); #endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL