X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/302e251b4df575dc60eb5bfafc931652dad165ec..b9efe021b554fa3967d1442cf758435c5cd5ae8f:/src/msw/wince/textctrlce.cpp?ds=sidebyside diff --git a/src/msw/wince/textctrlce.cpp b/src/msw/wince/textctrlce.cpp index 5fce03dcf1..5f29aa7f81 100644 --- a/src/msw/wince/textctrlce.cpp +++ b/src/msw/wince/textctrlce.cpp @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // Name: src/msw/wince/textctrlce.cpp -// Purpose: wxTextCtrl implementation for Smartphones +// Purpose: wxTextCtrl implementation for smart phones driven by WinCE // Author: Wlodzimierz ABX Skiba // Modified by: // Created: 30.08.2004 @@ -40,7 +40,7 @@ #include "wx/msw/missing.h" #include "wx/msw/winundef.h" -#if wxUSE_TEXTCTRL && defined(__SMARTPHONE__) +#if wxUSE_TEXTCTRL && defined(__SMARTPHONE__) && defined(__WXWINCE__) #define GetBuddyHwnd() (HWND)(m_hwndBuddy) @@ -167,7 +167,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ; wxSize sizeText(size), sizeBtn(size); - sizeBtn.x = GetBestSpinerSize(IsVertical(style)).x / 2; + sizeBtn.x = GetBestSpinnerSize(IsVertical(style)).x / 2; if ( sizeText.x == wxDefaultCoord ) { @@ -232,7 +232,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, WXDWORD spiner_style = WS_VISIBLE | UDS_ALIGNRIGHT | UDS_EXPANDABLE | - UDS_NOSCROLL; + UDS_NOSCROLL; if ( !IsVertical(style) ) spiner_style |= UDS_HORZ; @@ -409,7 +409,7 @@ void wxTextCtrl::SetValue(const wxString& value) if ( (value.length() > 0x400) || (value != GetValue()) ) { DoWriteText(value, false); - + // for compatibility, don't move the cursor when doing SetValue() SetInsertionPoint(0); } @@ -546,7 +546,7 @@ bool wxTextCtrl::CanPaste() const void wxTextCtrl::SetEditable(bool editable) { - SendMessage(GetBuddyHwnd(), EM_SETREADONLY, (WPARAM)!editable, (LPARAM)0L); + ::SendMessage(GetBuddyHwnd(), EM_SETREADONLY, (WPARAM)!editable, (LPARAM)0L); } void wxTextCtrl::SetInsertionPoint(long pos) @@ -566,7 +566,7 @@ long wxTextCtrl::GetInsertionPoint() const return Pos & 0xFFFF; } -long wxTextCtrl::GetLastPosition() const +wxTextPos wxTextCtrl::GetLastPosition() const { int numLines = GetNumberOfLines(); long posStartLastLine = XYToPosition(0, numLines - 1); @@ -740,9 +740,9 @@ wxTextCtrl::HitTest(const wxPoint& pt, long *posOut) const // double check that we really are where it pretends POINTL ptReal; - LRESULT lRc = SendMessage(GetBuddyHwnd(), EM_POSFROMCHAR, pos, 0); + LRESULT lRc = ::SendMessage(GetBuddyHwnd(), EM_POSFROMCHAR, pos, 0); - if ( lRc == -1 ) + if ( lRc == -1 ) { // this is apparently returned when pos corresponds to the last // position @@ -779,7 +779,7 @@ void wxTextCtrl::ShowPosition(long pos) int linesToScroll = specifiedLineLineNo - currentLineLineNo; if (linesToScroll != 0) - (void)::SendMessage(GetBuddyHwnd(), EM_LINESCROLL, 0, (LPARAM)linesToScroll); + (void)::SendMessage(GetBuddyHwnd(), EM_LINESCROLL, 0, (LPARAM)linesToScroll); } long wxTextCtrl::GetLengthOfLineContainingPos(long pos) const @@ -1040,40 +1040,6 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) return true; } -WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND WXUNUSED(pWnd), WXUINT WXUNUSED(nCtlColor), -#if wxUSE_CTL3D - WXUINT message, - WXWPARAM wParam, - WXLPARAM lParam -#else - WXUINT WXUNUSED(message), - WXWPARAM WXUNUSED(wParam), - WXLPARAM WXUNUSED(lParam) -#endif - ) -{ -#if wxUSE_CTL3D - if ( m_useCtl3D ) - { - HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam); - return (WXHBRUSH) hbrush; - } -#endif // wxUSE_CTL3D - - HDC hdc = (HDC)pDC; - wxColour colBack = GetBackgroundColour(); - - if (!IsEnabled() && (GetWindowStyle() & wxTE_MULTILINE) == 0) - colBack = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); - - ::SetBkColor(hdc, wxColourToRGB(colBack)); - ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour())); - - wxBrush *brush = wxTheBrushList->FindOrCreateBrush(colBack, wxSOLID); - - return (WXHBRUSH)brush->GetResourceHandle(); -} - bool wxTextCtrl::AdjustSpaceLimit() { unsigned int limit = ::SendMessage(GetBuddyHwnd(), EM_GETLIMITTEXT, 0, 0); @@ -1122,7 +1088,7 @@ bool wxTextCtrl::AcceptsFocus() const void wxTextCtrl::DoMoveWindow(int x, int y, int width, int height) { - int widthBtn = GetBestSpinerSize(IsVertical(GetWindowStyle())).x / 2; + int widthBtn = GetBestSpinnerSize(IsVertical(GetWindowStyle())).x / 2; int widthText = width - widthBtn - MARGIN_BETWEEN; if ( widthText <= 0 ) { @@ -1250,4 +1216,4 @@ void wxTextCtrl::OnSetFocus(wxFocusEvent& WXUNUSED(event)) } } -#endif // wxUSE_TEXTCTRL && __SMARTPHONE__ +#endif // wxUSE_TEXTCTRL && __SMARTPHONE__ && __WXWINCE__