1 #line 2 "src/Gui/Customer/MainWidget.cpp"
4 #include <Wt/WVBoxLayout.h>
5 #include <Wt/WHBoxLayout.h>
7 #include "../../define.h"
8 #include "../../GnuCashew.h"
15 addStyleClass(
"CustomerWidget" );
21 auto vlw = setLayout( std::make_unique< Wt::WVBoxLayout >() );
22 vlw-> setSpacing( 0 );
28 auto tb_ = std::make_unique< GCW::Gui::Customer::ToolBar >();
29 vlw-> addWidget( std::move( tb_ ) );
31 auto hlw = vlw-> addLayout( std::make_unique< Wt::WHBoxLayout >(), 1 );
38 auto w_ = std::make_unique< Wt::WTableView >();
40 hlw-> addWidget( std::move( w_ ), 1 );
47 view()-> setSelectionBehavior ( Wt::SelectionBehavior::Rows );
48 view()-> setSelectionMode ( Wt::SelectionMode::Single );
49 view()-> setAlternatingRowColors (
true );
56 std::vector< Wt::WFormModel::Field > fields =
68 m_model = std::make_shared< GCW::Eng::CustomersModel >( fields );
72 auto tabWidget_ = std::make_unique< Wt::WTabWidget >();
73 auto m_tabWidget = tabWidget_.get();
74 hlw-> addWidget( std::move( tabWidget_ ), 1 );
77 auto w_ = std::make_unique< GCW::Gui::Customer::Invoices >();
79 m_tabWidget-> addTab( std::move( w_ ),
"Invoices" );
81 hlw-> setResizable( 0,
true,
"25%" );
84 clicked().connect( [&]( Wt::WModelIndex _index, Wt::WMouseEvent _event )
94 doubleClicked(
const Wt::WModelIndex & _index,
const Wt::WMouseEvent & _event )
Wt::Signal< std::string > & doubleClicked()
std::shared_ptr< Model > m_model
Wt::WTableView * view() const
std::shared_ptr< Model > model() const
GCW::Gui::Customer::Invoices * m_invoicesView
const Wt::WFormModel::Field guid
Wt::WFormModel::Field addr_phone
Wt::WFormModel::Field addr_email
Wt::WFormModel::Field name