GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
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 m_view = lw-> addWidget( std::make_unique< Wt::WTableView >(), 1 );
27
28 /*
29 ** Setup standard control
30 **
31 */
32 view()-> setSelectionBehavior( Wt::SelectionBehavior::Rows );
33 view()-> setSelectionMode( Wt::SelectionMode::Single );
34 view()-> setAlternatingRowColors( true );
36
37 /*
38 ** Prepare a column list
39 **
40 */
41 std::vector< Wt::WFormModel::Field > fields =
42 {
47 };
48
49 /*
50 ** Create the model and apply it to the view
51 **
52 */
53 m_model = std::make_shared< GCW::Eng::EmployeesModel >( fields );
54 view()-> setModel( model() );
55
56} // endGCW::Gui::EmployeesWidget::EmployeesWidget()
57
59doubleClicked( const Wt::WModelIndex & _index, const Wt::WMouseEvent & _event )
60{
61
62} // endvoid GCW::Gui::CustomersWidget::doubleClicked( const Wt::WModelIndex & _index, const Wt::WMouseEvent & _event )
63
64
65
Wt::Signal< std::string > & doubleClicked()
std::shared_ptr< Model > model() const
std::shared_ptr< Model > m_model
Wt::WTableView * view() const
virtual Wt::Signals::connection connect(WObject *target, WObject::Method method) override
Widget * addNew(Args &&...args)
void setLayout(std::unique_ptr< WLayout > layout)
virtual void addWidget(std::unique_ptr< WWidget > widget)
virtual void addStyleClass(const WString &styleClass, bool force=false) override
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