m_isModified = false;
m_isEditable = true;
+ m_wrapLines = false;
m_posLast =
m_curPos =
// create data object for normal multiline or for controls with line
// wrap as needed
if ( style & wxHSCROLL )
+ {
m_data.mdata = new wxTextMultiLineData;
- else
+ }
+ else // we must wrap lines if we don't have horizontal scrollbar
+ {
+ // NB: we can't rely on HasFlag(wxHSCROLL) as the flags can change
+ // later and even wxWindow::Create() itself temporarily resets
+ // wxHSCROLL in wxUniv, so remember that we have a wrapped data
+ // and not just a multi line data in a separate variable
+ m_wrapLines = true;
m_data.wdata = new wxTextWrappedData;
+ }
}
else
{
void wxTextCtrl::SetSelection(wxTextPos from, wxTextPos to)
{
// selecting till -1 is the same as selecting to the end
- if ( to == -1 && from != -1 )
+ if ( to == -1 )
{
+ // and selecting (-1, -1) range is the same as selecting everything, by
+ // convention
+ if ( from == -1 )
+ from = 0;
to = GetLastPosition();
}