#include "wx/menu.h"
#include "wx/math.h"
#include "wx/module.h"
+ #include "wx/wxcrtvararg.h"
#endif
#include "wx/sysopt.h"
const wxValidator& validator,
const wxString& name)
{
-#ifdef __WXWINCE__
- if ((style & wxBORDER_MASK) == 0)
- style |= wxBORDER_SIMPLE;
-#endif
-
// base initialization
if ( !CreateControl(parent, id, pos, size, style, validator, name) )
return false;
return true;
}
+// returns true if the platform should explicitly apply a theme border
+bool wxTextCtrl::CanApplyThemeBorder() const
+{
+#ifdef __WXWINCE__
+ return false;
+#else
+ // Standard text control already handles theming
+ return ((GetWindowStyle() & (wxTE_RICH|wxTE_RICH2)) != 0);
+#endif
+}
+
bool wxTextCtrl::MSWCreateText(const wxString& value,
const wxPoint& pos,
const wxSize& size)
valueWin = value;
}
- if ( !MSWCreateControl(windowClass, msStyle, pos, size, valueWin) )
+ if ( !MSWCreateControl(windowClass.wx_str(), msStyle, pos, size, valueWin) )
return false;
#if wxUSE_RICHEDIT
}
#endif // wxUSE_RICHEDIT
+#ifndef __WXWINCE__
+ // Without this, if we pass the size in the constructor and then don't change it,
+ // the themed borders will be drawn incorrectly.
+ SetWindowPos(GetHwnd(), NULL, 0, 0, 0, 0,
+ SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|
+ SWP_FRAMECHANGED);
+#endif
+
return true;
}
#else // !wxUSE_UNICODE_MSLU
wxCSConv conv(encoding);
- const size_t len = conv.MB2WC(NULL, value, value.length());
+ const size_t len = conv.MB2WC(NULL, value.mb_str(), value.length());
#if wxUSE_WCHAR_T
wxWCharBuffer wchBuf(len);
wchar_t *wpc = wchBuf;
#endif
- conv.MB2WC(wpc, value, value.length());
+ conv.MB2WC(wpc, value.mb_str(), value.length());
#endif // wxUSE_UNICODE_MSLU
// finally, stream it in the control
::SendMessage(GetHwnd(), selectionOnly ? EM_REPLACESEL : WM_SETTEXT,
// EM_REPLACESEL takes 1 to indicate the operation should be redoable
- selectionOnly ? 1 : 0, (LPARAM)valueDos.c_str());
+ selectionOnly ? 1 : 0, (LPARAM)valueDos.wx_str());
if ( !ucf.GotUpdate() && (flags & SetValue_SendEvent) )
{