X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d90895ac118ad4546eed7ee4c358a3fe644a1ad7..eedb15434a5f0350f4e1a11faaab3391b900cb5b:/src/os2/textctrl.cpp?ds=sidebyside diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index 82022466ef..3ca7f9177c 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -43,7 +43,6 @@ # include #endif -#if !USE_SHARED_LIBRARY // ---------------------------------------------------------------------------- // event tables and other macros @@ -68,7 +67,6 @@ BEGIN_EVENT_TABLE(wxTextCtrl, wxControl) EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo) END_EVENT_TABLE() -#endif // USE_SHARED_LIBRARY // ============================================================================ // implementation @@ -87,7 +85,9 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, +#if wxUSE_VALIDATORS const wxValidator& validator, +#endif const wxString& name) { // base initialization @@ -300,7 +300,8 @@ void wxTextCtrl::Paste() bool wxTextCtrl::CanCopy() const { // Can copy if there's a selection - long from, to; + long from = 0L; + long to = 0L; // GetSelection(& from, & to); return (from != to); } @@ -308,7 +309,8 @@ bool wxTextCtrl::CanCopy() const bool wxTextCtrl::CanCut() const { // Can cut if there's a selection - long from, to; + long from = 0L; + long to = 0L; // GetSelection(& from, & to); return (from != to); } @@ -525,7 +527,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const HWND hWnd = GetHwnd(); // This gets the line number containing the character - int lineNo; + int lineNo = -1; // lineNo = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)pos, 0); if ( lineNo == -1 ) @@ -796,10 +798,10 @@ bool wxTextCtrl::AcceptsFocus() const return IsEditable() && wxControl::AcceptsFocus(); } -wxSize wxTextCtrl::DoGetBestSize() +wxSize wxTextCtrl::DoGetBestSize() const { int cx, cy; - wxGetCharSize(GetHWND(), &cx, &cy, &GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, (wxFont*)&GetFont()); int wText = DEFAULT_ITEM_WIDTH;