46 #include <Wt/WItemDelegate.h> 47 #include <Wt/WPopupMenu.h> 49 #include "TableView.h" 52 :
public Wt::WItemDelegate
57 : Wt::WItemDelegate(),
61 virtual std::unique_ptr<Wt::WWidget> update( Wt::WWidget *widget,
const Wt::WModelIndex& index, Wt::WFlags< Wt::ViewItemRenderFlag > flags )
63 auto w = Wt::WItemDelegate::update( widget, index, flags );
65 Wt::WInteractWidget *iw =
dynamic_cast< Wt::WInteractWidget*
>( w.get() );
66 iw-> mouseWentUp().connect(
this, &HeaderDelegate::showHeaderPopup );
71 void showHeaderPopup(
const Wt::WMouseEvent& event )
73 m_tableView-> showHeaderPopup( event );
83 Wtx::TableView::~TableView()
87 Wtx::TableView::TableView()
90 setHeaderItemDelegate( std::make_shared<HeaderDelegate>(
this ) );
95 "event.cancelBubble = true; event.returnValue = false; return false;" 100 void Wtx::TableView::showHeaderPopup(
const Wt::WMouseEvent & event )