GnuCashew ~ GnuCash Enabled Web
GCW
EmployeesWidget.cpp
Go to the documentation of this file.
1 #line 2 "src/Gui/EmployeesWidget.cpp"
2 
3 #include <Wt/WText.h>
4 #include <Wt/WVBoxLayout.h>
5 
6 #include "../define.h"
7 #include "../GnuCashew.h"
8 #include "EmployeesWidget.h"
9 
12 {
13  addStyleClass( "EmployeesWidget" );
14 
15  /*
16  ** Apply a layout so everything will fit in the window
17  **
18  */
19  auto lw = setLayout( std::make_unique< Wt::WVBoxLayout >() );
20  lw-> setSpacing( 0 );
21 
22  /*
23  ** Standard TableView for now
24  **
25  */
26  auto w = std::make_unique< Wt::WTableView >();
27  m_view = w.get();
28  lw-> addWidget( std::move( w ), 1 );
29 
30  /*
31  ** Setup standard control
32  **
33  */
34  view()-> setSelectionBehavior( Wt::SelectionBehavior::Rows );
35  view()-> setSelectionMode( Wt::SelectionMode::Single );
36  view()-> setAlternatingRowColors( true );
37  view()-> doubleClicked().connect( this, &EmployeesWidget::doubleClicked );
38 
39  /*
40  ** Prepare a column list
41  **
42  */
43  std::vector< Wt::WFormModel::Field > fields =
44  {
49  };
50 
51  /*
52  ** Create the model and apply it to the view
53  **
54  */
55  m_model = std::make_shared< GCW::Eng::EmployeesModel >( fields );
56  view()-> setModel( model() );
57 
58 } // endGCW::Gui::EmployeesWidget::EmployeesWidget()
59 
61 doubleClicked( const Wt::WModelIndex & _index, const Wt::WMouseEvent & _event )
62 {
63 
64 } // endvoid GCW::Gui::CustomersWidget::doubleClicked( const Wt::WModelIndex & _index, const Wt::WMouseEvent & _event )
65 
66 
67 
Wt::WTableView * view() const
std::shared_ptr< Model > model() const
std::shared_ptr< Model > m_model
Wt::Signal< std::string > & doubleClicked()
const Wt::WFormModel::Field username
Definition: Employees.cpp:10
const Wt::WFormModel::Field addr_email
Definition: Employees.cpp:28
const Wt::WFormModel::Field id
Definition: Employees.cpp:11
const Wt::WFormModel::Field addr_phone
Definition: Employees.cpp:26