GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
StatusBar.cpp
Go to the documentation of this file.
1#line 2 "src/Gui/AccountRegister/StatusBar.cpp"
2
3#include <Wt/WHBoxLayout.h>
4
5#include "../App.h"
6#include "StatusBar.h"
7
8/* * * * * * * * * * * * * * * * * * * * * * * * * * */
9
12{
13 addStyleClass( "StatusBar" );
14
15 auto lw = setLayout( std::make_unique< Wt::WHBoxLayout >() );
16
17 lw-> setSpacing( 0 );
18
19 auto _addWidget = [&]( const std::string & _key, int _spacing = 0 )
20 {
21 lw-> addWidget( std::make_unique< Wt::WText >( TR("gcw.AccountRegister.StatusBar." + _key ) + ":" ) );
22 auto retVal = lw-> addWidget( std::make_unique< Wt::WText >(), _spacing );
23 retVal-> setAttributeValue( "style", "margin-right:10px" );
24 return retVal;
25 };
26
27 m_present = _addWidget( "present" );
28 m_future = _addWidget( "future" );
29 m_cleared = _addWidget( "cleared" );
30 m_reconciled = _addWidget( "reconciled" );
31 m_projected = _addWidget( "projected", 1 );
32 m_rowCount = _addWidget( "rowCount" );
33
34 setPresent ();
35 setFuture ();
36 setCleared ();
38 setProjected ();
39 setRowCount ();
40
41} // endStatusBar()
42
43auto
45setText( Wt::WText * _widget, GCW_NUMERIC _value )-> void
46{
47 _widget-> setText( "$" + toString( _value, GCW::Cfg::decimal_format() ) );
48}
49
50auto
52setText( Wt::WText * _widget, int _value )-> void
53{
54 _widget-> setText( std::to_string( _value ) );
55}
56
57auto GCW::Gui::AccountRegister::StatusBar:: setPresent ( GCW_NUMERIC _value )-> void { setText( m_present , _value ); }
58auto GCW::Gui::AccountRegister::StatusBar:: setFuture ( GCW_NUMERIC _value )-> void { setText( m_future , _value ); }
59auto GCW::Gui::AccountRegister::StatusBar:: setCleared ( GCW_NUMERIC _value )-> void { setText( m_cleared , _value ); }
60auto GCW::Gui::AccountRegister::StatusBar:: setReconciled ( GCW_NUMERIC _value )-> void { setText( m_reconciled , _value ); }
61auto GCW::Gui::AccountRegister::StatusBar:: setProjected ( GCW_NUMERIC _value )-> void { setText( m_projected , _value ); }
62auto GCW::Gui::AccountRegister::StatusBar:: setRowCount ( int _value )-> void { setText( m_rowCount , _value ); }
63
64
65
auto setFuture(GCW_NUMERIC _value=GCW_NUMERIC(0)) -> void
Definition StatusBar.cpp:58
auto setProjected(GCW_NUMERIC _value=GCW_NUMERIC(0)) -> void
Definition StatusBar.cpp:61
auto setRowCount(int _value=0) -> void
Definition StatusBar.cpp:62
auto setCleared(GCW_NUMERIC _value=GCW_NUMERIC(0)) -> void
Definition StatusBar.cpp:59
auto setText(Wt::WText *_widget, GCW_NUMERIC _value) -> void
Definition StatusBar.cpp:45
auto setReconciled(GCW_NUMERIC _value=GCW_NUMERIC(0)) -> void
Definition StatusBar.cpp:60
auto setPresent(GCW_NUMERIC _value=GCW_NUMERIC(0)) -> void
Definition StatusBar.cpp:57
Widget * addNew(Args &&...args)
void setLayout(std::unique_ptr< WLayout > layout)
virtual void addWidget(std::unique_ptr< WWidget > widget)
virtual void setAttributeValue(const std::string &name, const WString &value) override
virtual void addStyleClass(const WString &styleClass, bool force=false) override
#define TR(X)
Definition define.h:17
#define GCW_NUMERIC
Internal Numeric Type.
Definition gcwglobal.h:38
DECIMAL::decimal_format decimal_format()
Decimal Format Specifier.
Definition GnuCashew.cpp:21