// ---------------------------------------------------------------------------
// the window proc for all our windows
-#ifdef __DIGITALMARS__
-extern "C" LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
- WPARAM wParam, LPARAM lParam);
-#else
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
-#endif
-
+
#ifdef __WXDEBUG__
const char *wxGetMessageName(int message);
#endif //__WXDEBUG__
void wxRemoveHandleAssociation(wxWindowMSW *win);
-#ifdef __DIGITALMARS__
-extern "C" void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
-#else
extern void wxAssociateWinWithHandle(HWND hWnd, wxWindowMSW *win);
-#endif
wxWindow *wxFindWinFromHandle(WXHWND hWnd);
// this magical function is used to translate VK_APPS key presses to right
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
int cshow = show ? SW_SHOW : SW_HIDE;
::ShowWindow(hWnd, cshow);
- if ( show )
+ if ( show && IsTopLevel() )
{
wxBringWindowToTop(hWnd);
}
style |= WS_HSCROLL;
wxBorder border = (wxBorder)(flags & wxBORDER_MASK);
-
+
// Check if we want to automatically give it a sunken style.
// Note than because 'sunken' actually maps to WS_EX_CLIENTEDGE, which
// 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()->IsKindOf(CLASSINFO(wxPanel)) ||
- GetParent()->IsKindOf(CLASSINFO(wxDialog))) &&
+ GetParent() &&
((GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS) != wxUSER_COLOURS))
{
border = (wxBorder)((flags & wxBORDER_MASK) | wxBORDER_SUNKEN);
- }
-
+ }
+
// Only give it WS_BORDER for wxBORDER_SIMPLE
if (border & wxBORDER_SIMPLE)
style |= WS_BORDER;
-
+
// now deal with ext style if the caller wants it
if ( exstyle )
{
long wxWindowMSW::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
if ( m_oldWndProc )
-#ifdef __DIGITALMARS__
- return ::CallWindowProc( (FARPROC) m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
-#else
return ::CallWindowProc(CASTWNDPROC m_oldWndProc, GetHwnd(), (UINT) nMsg, (WPARAM) wParam, (LPARAM) lParam);
-#endif
else
return ::DefWindowProc(GetHwnd(), nMsg, wParam, lParam);
}
bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam)
{
-#if defined (__WXMICROWIN__)
+#if defined (__WXMICROWIN__)
return FALSE;
#else // __WXMICROWIN__
HDROP hFilesInfo = (HDROP) wParam;
#endif
}
-#ifdef __DIGITALMARS__
-extern "C" HCURSOR wxGetCurrentBusyCursor();
-#endif
bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
short nHitTest,
#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
{
// if (GetExtraStyle() & wxWS_EX_THEMED_BACKGROUND)
// return FALSE;
-
+
#ifdef __WIN32__
HRGN hRegion = ::CreateRectRgn(0, 0, 0, 0); // Dummy call to get a handle
if ( !hRegion )
}
}
#endif
-
+
wxDCTemp dc(hdc);
dc.SetHDC(hdc);
{
wxMoveEvent event(rect, m_windowId);
event.SetEventObject(this);
-
+
bool rc = GetEventHandler()->ProcessEvent(event);
if (rc)
rect = event.GetRect();
{
wxSizeEvent event(rect, m_windowId);
event.SetEventObject(this);
-
+
bool rc = GetEventHandler()->ProcessEvent(event);
if (rc)
rect = event.GetRect();