static TEXTMETRIC wxGetTextMetrics(const wxWindowMSW *win);
// find the window for the mouse event at the specified position
-static wxWindowMSW *FindWindowForMouseEvent(wxWindow *win, int *x, int *y);
+static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y); //TW:REQ:Univ
// wrapper around BringWindowToTop() API
static inline void wxBringWindowToTop(HWND hwnd)
#ifdef __WXUNIVERSAL__
// no borders, we draw them ourselves
- exstyle = 0;
+ exstyle &= ~(WS_EX_DLGMODALFRAME |
+ WS_EX_STATICEDGE |
+ WS_EX_CLIENTEDGE |
+ WS_EX_WINDOWEDGE);
msflags &= ~WS_BORDER;
#endif // wxUniversal
y = GET_Y_LPARAM(lParam);
// redirect the event to a static control if necessary
- wxWindow *win = FindWindowForMouseEvent(this, &x, &y);
-
- processed = win->HandleMouseEvent(message, x, y, wParam);
+ if (this == GetCapture())
+ {
+ processed = HandleMouseEvent(message, x, y, wParam);
+ }
+ else
+ {
+ wxWindowMSW *win = FindWindowForMouseEvent(this, &x, &y); //TW:REQ:Univ
+ processed = win->HandleMouseEvent(message, x, y, wParam);
+ }
}
}
break;
wxWindow *parent = GetParent();
bool isChild = (style & WS_CHILD) != 0;
HWND hParent;
- if ( GetWindowStyleFlag() & wxPOPUP_WINDOW )
+ if ( (isChild || HasFlag(wxPOPUP_WINDOW) || HasFlag(wxFRAME_TOOL_WINDOW)) )
{
- // popup windows should have desktop as parent because they shouldn't
- // be limited to the parents client area as child windows usually are
- hParent = ::GetDesktopWindow();
+ // this is either a normal child window, a popup window or a top level
+ // window with wxFRAME_TOOL_WINDOW style (see below)
+ hParent = parent ? GetHwndOf(parent) : NULL;
}
- else // !popup
+ else
{
- if ( (isChild || HasFlag(wxFRAME_TOOL_WINDOW)) && parent )
- {
- // this is either a normal child window or a top level window with
- // wxFRAME_TOOL_WINDOW style (see below)
- hParent = GetHwndOf(parent);
- }
- else
- {
- // this is either a window for which no parent was specified (not
- // much we can do then) or a frame without wxFRAME_TOOL_WINDOW
- // style: we should use NULL parent HWND for it or it would be
- // always on top of its parent which is not what we usually want
- // (in fact, we only want it for frames with the special
- // wxFRAME_TOOL_WINDOW as above)
- hParent = NULL;
- }
-
+ // this is a frame without wxFRAME_TOOL_WINDOW style: we should use
+ // NULL parent HWND for it or it would be always on top of its parent
+ // which is not what we usually want (in fact, we only want it for
+ // frames with the special wxFRAME_TOOL_WINDOW as above)
+ hParent = NULL;
}
// controlId is menu handle for the top level windows, so set it to 0
// Notice that this is not done for the mouse move events because this could
// (would?) be too slow, but only for clicks which means that the static texts
// still don't get move, enter nor leave events.
-static wxWindowMSW *FindWindowForMouseEvent(wxWindow *win, int *x, int *y)
+static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y) //TW:REQ:Univ
{
wxCHECK_MSG( x && y, win, _T("NULL pointer in FindWindowForMouseEvent") );