]> git.saurik.com Git - wxWidgets.git/blobdiff - src/ribbon/gallery.cpp
Let wxMSW report wxDataViewCustomRenderer::LeftClick() report the click position...
[wxWidgets.git] / src / ribbon / gallery.cpp
index 440455e16f75ec9aba7cd5fa7cc5407dfd8da41c..0234762b43b36d0056946147ee22c5de0cd0092d 100644 (file)
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
-#include "wx/ribbon/gallery.h"
-
 #if wxUSE_RIBBON
 
 #if wxUSE_RIBBON
 
+#include "wx/ribbon/gallery.h"
 #include "wx/ribbon/art.h"
 #include "wx/ribbon/bar.h"
 #include "wx/dcbuffer.h"
 #include "wx/ribbon/art.h"
 #include "wx/ribbon/bar.h"
 #include "wx/dcbuffer.h"
@@ -33,6 +32,7 @@
 
 wxDEFINE_EVENT(wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED, wxRibbonGalleryEvent);
 wxDEFINE_EVENT(wxEVT_COMMAND_RIBBONGALLERY_SELECTED, wxRibbonGalleryEvent);
 
 wxDEFINE_EVENT(wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED, wxRibbonGalleryEvent);
 wxDEFINE_EVENT(wxEVT_COMMAND_RIBBONGALLERY_SELECTED, wxRibbonGalleryEvent);
+wxDEFINE_EVENT(wxEVT_COMMAND_RIBBONGALLERY_CLICKED, wxRibbonGalleryEvent);
 
 IMPLEMENT_DYNAMIC_CLASS(wxRibbonGalleryEvent, wxCommandEvent)
 IMPLEMENT_CLASS(wxRibbonGallery, wxRibbonControl)
 
 IMPLEMENT_DYNAMIC_CLASS(wxRibbonGalleryEvent, wxCommandEvent)
 IMPLEMENT_CLASS(wxRibbonGallery, wxRibbonControl)
@@ -357,6 +357,13 @@ void wxRibbonGallery::OnMouseUp(wxMouseEvent& evt)
                     notification.SetGalleryItem(m_selected_item);
                     ProcessWindowEvent(notification);
                 }
                     notification.SetGalleryItem(m_selected_item);
                     ProcessWindowEvent(notification);
                 }
+
+                wxRibbonGalleryEvent notification(
+                    wxEVT_COMMAND_RIBBONGALLERY_CLICKED, GetId());
+                notification.SetEventObject(this);
+                notification.SetGallery(this);
+                notification.SetGalleryItem(m_selected_item);
+                ProcessWindowEvent(notification);
             }
         }
         m_mouse_active_rect = NULL;
             }
         }
         m_mouse_active_rect = NULL;
@@ -458,9 +465,6 @@ void wxRibbonGallery::OnPaint(wxPaintEvent& WXUNUSED(evt))
     if(m_art == NULL)
         return;
 
     if(m_art == NULL)
         return;
 
-    wxSize cur_size = GetSize();
-    wxSize min_size = GetMinSize();
-
     m_art->DrawGalleryBackground(dc, this, GetSize());
 
     int padding_top = m_art->GetMetric(wxRIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE);
     m_art->DrawGalleryBackground(dc, this, GetSize());
 
     int padding_top = m_art->GetMetric(wxRIBBON_ART_GALLERY_BITMAP_PADDING_TOP_SIZE);