]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/textctrl.cpp
Applied gsockmsw.c 1.20 to 1.25 changes
[wxWidgets.git] / src / msw / textctrl.cpp
index 25e2ec905550b32288ebcfd4fa70cfc1e1322165..e742baa4b0c8b1fc4bea4c17392ba488018f504d 100644 (file)
@@ -245,12 +245,9 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
 #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();
 
@@ -1364,7 +1361,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
 }
 
 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;
@@ -1443,11 +1440,8 @@ wxTextCtrl::HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const
     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;
 }
@@ -1932,7 +1926,7 @@ bool wxTextCtrl::AcceptsFocus() const
 wxSize wxTextCtrl::DoGetBestSize() const
 {
     int cx, cy;
-    wxGetCharSize(GetHWND(), &cx, &cy, &GetFont());
+    wxGetCharSize(GetHWND(), &cx, &cy, GetFont());
 
     int wText = DEFAULT_ITEM_WIDTH;