// ----------------------------------------------------------------------------
// default margins around the image
-static const wxCoord DEFAULT_BTN_MARGIN_X = 0;
+static const wxCoord DEFAULT_BTN_MARGIN_X = 0; // We should give space for the border, at least.
static const wxCoord DEFAULT_BTN_MARGIN_Y = 0;
// ============================================================================
{
public:
wxPopupMenuWindow(wxWindow *parent, wxMenu *menu);
+
+ ~wxPopupMenuWindow();
// override the base class version to select the first item initially
virtual void Popup(wxWindow *focus = NULL);
SetCursor(wxCURSOR_ARROW);
}
+wxPopupMenuWindow::~wxPopupMenuWindow()
+{
+}
+
// ----------------------------------------------------------------------------
// wxPopupMenuWindow current item/node handling
// ----------------------------------------------------------------------------
wxMenu *menu = GetParent();
while ( menu )
{
+ // We are a submenu of a menu of a menubar
+ if (menu->GetMenuBar())
+ return menu->GetMenuBar();
+
win = menu->GetInvokingWindow();
if ( win )
break;
// we're probably going to crash in the caller anyhow, but try to detect
// this error as soon as possible
wxASSERT_MSG( win, _T("menu without any associated window?") );
-
+
// also remember it in this menu so that we don't have to search for it the
// next time
wxConstCast(this, wxMenu)->m_invokingWindow = win;
void wxWindow::DismissPopupMenu()
{
wxCHECK_RET( ms_evtLoopPopup, _T("no popup menu shown") );
+
+ char *crash = NULL;
+ (*crash) = 0;
ms_evtLoopPopup->Exit();
}
tlw = tlw->GetParent();
if (tlw && !tlw->IsEnabled())
return;
-
+
if (event->type == ButtonPress)
{
if ((win != wxWindow::FindFocus()) && win->AcceptsFocus())
{
// This might actually be done in wxWindow::SetFocus()
- // and not here.
+ // and not here. TODO.
g_prevFocus = wxWindow::FindFocus();
g_nextFocus = win;
win->SetFocus();
}
}
-
+
+#if !wxUSE_NANOX
+ if (event->type == LeaveNotify || event->type == EnterNotify)
+ {
+ // Throw out NotifyGrab and NotifyUngrab
+ if (event->xcrossing.mode != NotifyNormal)
+ return;
+ }
+#endif
wxMouseEvent wxevent;
wxTranslateMouseEvent(wxevent, win, window, event);
win->GetEventHandler()->ProcessEvent( wxevent );
+
return;
}
case FocusIn: