void wxWindowMSW::SetFocusFromKbd()
{
- wxWindowBase::SetFocusFromKbd();
-
// when the focus is given to the control with DLGC_HASSETSEL style from
// keyboard its contents should be entirely selected: this is what
// ::IsDialogMessage() does and so we should do it as well to provide the
{
::SendMessage(GetHwnd(), EM_SETSEL, 0, -1);
}
+
+ // do this after (maybe) setting the selection as like this when
+ // wxEVT_SET_FOCUS handler is called, the selection would have been already
+ // set correctly -- this may be important
+ wxWindowBase::SetFocusFromKbd();
}
// Get the window with the focus
// is a more neutral term, we don't necessarily get a sunken effect in
// Windows XP. Instead we get the appropriate style for the theme.
- if (border == wxBORDER_DEFAULT && wxTheApp->GetAuto3D() &&
+ if (border == wxBORDER_DEFAULT &&
IsKindOf(CLASSINFO(wxControl)) &&
GetParent() &&
((GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS) != wxUSER_COLOURS))
#if wxUSE_CONTROLS
- wxWindow *item = FindItem(id);
#if wxUSE_OWNER_DRAWN
+ wxWindow *item = FindItem(id);
if ( item && item->IsKindOf(CLASSINFO(wxControl)) )
return ((wxControl *)item)->MSWOnDraw(itemStruct);
-#else
+#elif !defined(__WXUNIVERSAL__)
+ // we may still have owner-drawn buttons internally because we have to make
+ // them owner-drawn to support colour change
+ wxWindow *item = FindItem(id);
if ( item && item->IsKindOf(CLASSINFO(wxButton)) )
return ((wxButton *)item)->MSWOnDraw(itemStruct);
#endif // USE_OWNER_DRAWN