// Author: Peter Cawley
// Modified by:
// Created: 2009-05-25
-// RCS-ID: $Id$
// Copyright: (C) Peter Cawley
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#include "wx/msw/private.h"
#endif
-wxDEFINE_EVENT(wxEVT_COMMAND_RIBBONPANEL_EXTBUTTON_ACTIVATED, wxRibbonPanelEvent);
+wxDEFINE_EVENT(wxEVT_RIBBONPANEL_EXTBUTTON_ACTIVATED, wxRibbonPanelEvent);
IMPLEMENT_DYNAMIC_CLASS(wxRibbonPanelEvent, wxCommandEvent)
// for children of the window. The panel wants to be in the hovered state
// whenever the mouse cursor is within its boundary, so the events need to
// be attached to children too.
- child->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)&wxRibbonPanel::OnMouseEnterChild, NULL, this);
- child->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)&wxRibbonPanel::OnMouseLeaveChild, NULL, this);
+ child->Connect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(wxRibbonPanel::OnMouseEnterChild), NULL, this);
+ child->Connect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(wxRibbonPanel::OnMouseLeaveChild), NULL, this);
}
void wxRibbonPanel::RemoveChild(wxWindowBase *child)
{
- child->Disconnect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)&wxRibbonPanel::OnMouseEnterChild, NULL, this);
- child->Disconnect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)&wxRibbonPanel::OnMouseLeaveChild, NULL, this);
+ child->Disconnect(wxEVT_ENTER_WINDOW, wxMouseEventHandler(wxRibbonPanel::OnMouseEnterChild), NULL, this);
+ child->Disconnect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(wxRibbonPanel::OnMouseLeaveChild), NULL, this);
wxRibbonControl::RemoveChild(child);
}
}
else if(IsExtButtonHovered())
{
- wxRibbonPanelEvent notification(wxEVT_COMMAND_RIBBONPANEL_EXTBUTTON_ACTIVATED, GetId());
+ wxRibbonPanelEvent notification(wxEVT_RIBBONPANEL_EXTBUTTON_ACTIVATED, GetId());
notification.SetEventObject(this);
notification.SetPanel(this);
ProcessEvent(notification);
HideExpanded();
// Do not skip event, as the panel has been de-expanded, causing the
// child with focus to be reparented (and hidden). If the event
- // continues propogation then bad things happen.
+ // continues propagation then bad things happen.
}
else
{
return best;
}
+void wxRibbonPanel::HideIfExpanded()
+{
+ wxStaticCast(m_parent, wxRibbonPage)->HideIfExpanded();
+}
+
#endif // wxUSE_RIBBON