#endif
// base initialization
- if ( !CreateBase(parent, id, pos, size, style, validator, name) )
+ if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return FALSE;
- if ( parent )
- parent->AddChild(this);
-
// translate wxWin style flags to MSW ones
WXDWORD msStyle = MSWGetCreateWindowFlags();
}
wxTextCtrlHitTestResult
-wxTextCtrl::HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const
+wxTextCtrl::HitTest(const wxPoint& pt, long *posOut) const
{
// first get the position from Windows
LPARAM lParam;
else
rc = wxTE_HT_ON_TEXT;
- // finally translate to column/row
- if ( !PositionToXY(pos, col, row) )
- {
- wxFAIL_MSG( _T("PositionToXY() not expected to fail in HitTest()") );
- }
+ if ( posOut )
+ *posOut = pos;
return rc;
}
void wxTextCtrl::SetMaxLength(unsigned long len)
{
+#if wxUSE_RICHEDIT
+ if (IsRich())
+ ::SendMessage(GetHwnd(), EM_EXLIMITTEXT, 0, (LPARAM) (DWORD) len);
+ else
+#endif
::SendMessage(GetHwnd(), EM_LIMITTEXT, len, 0);
}
{
if (CanRedo())
{
+#if wxUSE_RICHEDIT
+ if (GetRichVersion() > 1)
+ ::SendMessage(GetHwnd(), EM_REDO, 0, 0);
+ else
+#endif
// Same as Undo, since Undo undoes the undo, i.e. a redo.
::SendMessage(GetHwnd(), EM_UNDO, 0, 0);
}
bool wxTextCtrl::CanRedo() const
{
+#if wxUSE_RICHEDIT
+ if (GetRichVersion() > 1)
+ return ::SendMessage(GetHwnd(), EM_CANREDO, 0, 0) != 0;
+ else
+#endif
return ::SendMessage(GetHwnd(), EM_CANUNDO, 0, 0) != 0;
}