///////////////////////////////////////////////////////////////////////////////
// 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
#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)
WXDWORD spiner_style = WS_VISIBLE |
UDS_ALIGNRIGHT |
UDS_EXPANDABLE |
- UDS_NOSCROLL;
+ UDS_NOSCROLL;
if ( !IsVertical(style) )
spiner_style |= UDS_HORZ;
if ( (value.length() > 0x400) || (value != GetValue()) )
{
DoWriteText(value, false);
-
+
// for compatibility, don't move the cursor when doing SetValue()
SetInsertionPoint(0);
}
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)
// 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
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
}
}
-#endif // wxUSE_TEXTCTRL && __SMARTPHONE__
+#endif // wxUSE_TEXTCTRL && __SMARTPHONE__ && __WXWINCE__