GnuCashew ~ GnuCash Enabled Web
GCW
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
GCW::Gui::AccountsTreeView Class Reference

AccountsTreeView. More...

#include <AccountsTreeView.h>

Inherits Wt::WContainerWidget.

Classes

class  ColDef
 

Public Types

using Model = GCW::Eng::AccountsTreeViewModel
 

Public Member Functions

 AccountsTreeView (int _columnCount)
 
 AccountsTreeView (const std::string &_selectedAccountGuid, int _columnCount)
 
auto model () const -> std::shared_ptr< Model >
 
auto view () const -> Wt::WTreeView *
 
auto doubleClicked () -> Wt::Signal< std::string > &
 
auto selectedAccount () const -> std::string
 
auto editAccount (const std::string &_accountGuid) -> void
 
auto editSelectedAccount () -> void
 
auto configItem () -> GCW::Dbo::Vars::Item::Ptr
 Config Item. More...
 
auto saveConfig () -> void
 
auto loadConfig () -> void
 
auto toJson () const -> Wt::Json::Object
 
auto fromJson (Wt::Json::Object &_jobj) -> bool
 
auto test () -> void
 

Private Member Functions

auto init () -> void
 
auto setModel () -> void
 
auto on_doubleClicked (const Wt::WModelIndex &index, const Wt::WMouseEvent &event) -> void
 
auto iterate (Wt::Json::Array &_jary, Wt::WModelIndex _parent=Wt::WModelIndex()) const -> bool
 
auto expandNode (const std::string &_accountGuid, Wt::WModelIndex _parent=Wt::WModelIndex()) -> bool
 
auto expandTreeNodes (Wt::Json::Object &_jobj) -> bool
 
auto setSelected (const std::string &_accountGuid) -> bool
 
auto findIndex (const std::string &_accountGuid, Wt::WModelIndex _parentIndex=Wt::WModelIndex()) -> Wt::WModelIndex
 Find Index by AccountGuid. More...
 
auto on_showPopup_triggered (const Wt::WModelIndex &_index, const Wt::WMouseEvent &_event) -> void
 

Private Attributes

int m_columnCount = -1
 
Wt::WGridLayout * m_gridLayout = nullptr
 
Wt::WTreeView * m_view = nullptr
 
std::shared_ptr< Modelm_model
 
std::vector< std::string > m_columns
 
Wt::Signal< std::string > m_doubleClicked
 
GCW::Gui::AccountEditorm_editAccountWidget = nullptr
 

Detailed Description

AccountsTreeView.

The AccountsTreeView is a widget that displays all of the accounts within the system. It displays the accounts in a tree-like format with multiple columns representing other field values such as; 'notes', 'tax info', 'balance remaining' and so on. The view is sortable and browsable, and facilitates gaining access to the individual account registers.

Definition at line 35 of file AccountsTreeView.h.

Member Typedef Documentation

◆ Model

Definition at line 48 of file AccountsTreeView.h.

Constructor & Destructor Documentation

◆ AccountsTreeView() [1/2]

GCW::Gui::AccountsTreeView::AccountsTreeView ( int  _columnCount)

Definition at line 30 of file AccountsTreeView.cpp.

References init().

◆ AccountsTreeView() [2/2]

GCW::Gui::AccountsTreeView::AccountsTreeView ( const std::string &  _selectedAccountGuid,
int  _columnCount 
)

Definition at line 20 of file AccountsTreeView.cpp.

References init(), and setSelected().

Member Function Documentation

◆ configItem()

GCW::Dbo::Vars::Item::Ptr GCW::Gui::AccountsTreeView::configItem ( ) -> GCW::Dbo::Vars::Item::Ptr

Config Item.

This returns the single 'config item' that contains the properties of the tree view.

Definition at line 268 of file AccountsTreeView.cpp.

References GCW::app(), and GCW::Dbo::Vars::get().

◆ doubleClicked()

auto GCW::Gui::AccountsTreeView::doubleClicked ( ) -> Wt::Signal< std::string > &
inline

Definition at line 56 of file AccountsTreeView.h.

References m_doubleClicked.

◆ editAccount()

void GCW::Gui::AccountsTreeView::editAccount ( const std::string &  _accountGuid) -> void

Definition at line 189 of file AccountsTreeView.cpp.

◆ editSelectedAccount()

void GCW::Gui::AccountsTreeView::editSelectedAccount ( ) -> void

Definition at line 245 of file AccountsTreeView.cpp.

◆ expandNode()

bool GCW::Gui::AccountsTreeView::expandNode ( const std::string &  _accountGuid,
Wt::WModelIndex  _parent = Wt::WModelIndex() 
) -> bool
private

Definition at line 394 of file AccountsTreeView.cpp.

References GCW::Gui::BillPay::asString().

◆ expandTreeNodes()

bool GCW::Gui::AccountsTreeView::expandTreeNodes ( Wt::Json::Object &  _jobj) -> bool
private

Definition at line 453 of file AccountsTreeView.cpp.

◆ findIndex()

Wt::WModelIndex GCW::Gui::AccountsTreeView::findIndex ( const std::string &  _accountGuid,
Wt::WModelIndex  _parentIndex = Wt::WModelIndex() 
) -> Wt::WModelIndex
private

Find Index by AccountGuid.

This will loop through the tree and locate a specific index by it's accountGuid value.

Definition at line 473 of file AccountsTreeView.cpp.

References GCW::Gui::BillPay::asString().

◆ fromJson()

bool GCW::Gui::AccountsTreeView::fromJson ( Wt::Json::Object &  _jobj) -> bool

Definition at line 524 of file AccountsTreeView.cpp.

◆ init()

auto GCW::Gui::AccountsTreeView::init ( ) -> void
private

Definition at line 39 of file AccountsTreeView.cpp.

References on_doubleClicked(), on_showPopup_triggered(), saveConfig(), and TR8.

Referenced by AccountsTreeView().

◆ iterate()

bool GCW::Gui::AccountsTreeView::iterate ( Wt::Json::Array &  _jary,
Wt::WModelIndex  _parent = Wt::WModelIndex() 
) const -> bool
private

Definition at line 324 of file AccountsTreeView.cpp.

References GCW::Gui::BillPay::asString(), and iterate().

◆ loadConfig()

void GCW::Gui::AccountsTreeView::loadConfig ( ) -> void

◆ model()

auto GCW::Gui::AccountsTreeView::model ( ) const -> std::shared_ptr< Model >
inline

Definition at line 53 of file AccountsTreeView.h.

References m_model.

◆ on_doubleClicked()

void GCW::Gui::AccountsTreeView::on_doubleClicked ( const Wt::WModelIndex &  index,
const Wt::WMouseEvent &  event 
) -> void
private

Definition at line 547 of file AccountsTreeView.cpp.

References GCW::Gui::BillPay::asString().

Referenced by init().

◆ on_showPopup_triggered()

auto GCW::Gui::AccountsTreeView::on_showPopup_triggered ( const Wt::WModelIndex &  _index,
const Wt::WMouseEvent &  _event 
) -> void
private

Definition at line 104 of file AccountsTreeView.cpp.

References GCW::Gui::BillPay::asString().

Referenced by init().

◆ saveConfig()

void GCW::Gui::AccountsTreeView::saveConfig ( ) -> void

Definition at line 286 of file AccountsTreeView.cpp.

References GCW::app(), GCW::Gui::BillPay::configItem(), and GCW::Core::toJson().

Referenced by init().

◆ selectedAccount()

std::string GCW::Gui::AccountsTreeView::selectedAccount ( ) const -> std::string
Returns
GUID String

Definition at line 163 of file AccountsTreeView.cpp.

References GCW::Gui::BillPay::asString().

◆ setModel()

void GCW::Gui::AccountsTreeView::setModel ( ) -> void
private

Definition at line 254 of file AccountsTreeView.cpp.

References GCW::Dbo::Accounts::load().

◆ setSelected()

bool GCW::Gui::AccountsTreeView::setSelected ( const std::string &  _accountGuid) -> bool
private

Definition at line 511 of file AccountsTreeView.cpp.

Referenced by AccountsTreeView().

◆ test()

void GCW::Gui::AccountsTreeView::test ( ) -> void

Definition at line 536 of file AccountsTreeView.cpp.

References GCW::Core::toJson().

◆ toJson()

Wt::Json::Object GCW::Gui::AccountsTreeView::toJson ( ) const -> Wt::Json::Object

Definition at line 375 of file AccountsTreeView.cpp.

References iterate().

◆ view()

auto GCW::Gui::AccountsTreeView::view ( ) const -> Wt::WTreeView *
inline

Definition at line 54 of file AccountsTreeView.h.

References m_view.

Member Data Documentation

◆ m_columnCount

int GCW::Gui::AccountsTreeView::m_columnCount = -1
private

Definition at line 92 of file AccountsTreeView.h.

◆ m_columns

std::vector< std::string > GCW::Gui::AccountsTreeView::m_columns
private

Definition at line 96 of file AccountsTreeView.h.

◆ m_doubleClicked

Wt::Signal< std::string > GCW::Gui::AccountsTreeView::m_doubleClicked
private

Definition at line 97 of file AccountsTreeView.h.

Referenced by doubleClicked().

◆ m_editAccountWidget

GCW::Gui::AccountEditor* GCW::Gui::AccountsTreeView::m_editAccountWidget = nullptr
private

Definition at line 98 of file AccountsTreeView.h.

◆ m_gridLayout

Wt::WGridLayout* GCW::Gui::AccountsTreeView::m_gridLayout = nullptr
private

Definition at line 93 of file AccountsTreeView.h.

◆ m_model

std::shared_ptr< Model > GCW::Gui::AccountsTreeView::m_model
private

Definition at line 95 of file AccountsTreeView.h.

Referenced by model().

◆ m_view

Wt::WTreeView* GCW::Gui::AccountsTreeView::m_view = nullptr
private

Definition at line 94 of file AccountsTreeView.h.

Referenced by view().


The documentation for this class was generated from the following files: