added wxTextCtrl::GetSelection() returning a wxString - useful for multiline controls under Windows
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -244,6 +244,20 @@ void wxTextCtrlBase::SelectAll()
|
||||
SetSelection(0, GetLastPosition());
|
||||
}
|
||||
|
||||
wxString wxTextCtrlBase::GetSelection() const
|
||||
{
|
||||
long from, to;
|
||||
GetSelection(&from, &to);
|
||||
|
||||
wxString sel;
|
||||
if ( from < to )
|
||||
{
|
||||
sel = GetValue().Mid(from, to - from);
|
||||
}
|
||||
|
||||
return sel;
|
||||
}
|
||||
|
||||
#else // !wxUSE_TEXTCTRL
|
||||
|
||||
// define this one even if !wxUSE_TEXTCTRL because it is also used by other
|
||||
|
Reference in New Issue
Block a user