GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
|
#include <AccountsTreeView.h>
Classes | |
class | ColDef |
Public Types | |
using | Model = GCW::Eng::AccountsTreeViewModel |
![]() | |
typedef void(WObject::* | Method) () |
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. | |
auto | saveConfig () -> void |
auto | loadConfig () -> void |
auto | toJson () const -> Wt::Json::Object |
auto | fromJson (Wt::Json::Object &_jobj) -> bool |
auto | test () -> void |
![]() | |
WContainerWidget () | |
~WContainerWidget () | |
void | setLayout (std::unique_ptr< WLayout > layout) |
Layout * | setLayout (std::unique_ptr< Layout > layout) |
WLayout * | layout () const |
virtual void | addWidget (std::unique_ptr< WWidget > widget) |
Widget * | addWidget (std::unique_ptr< Widget > widget) |
Widget * | addNew (Args &&...args) |
virtual void | insertBefore (std::unique_ptr< WWidget > widget, WWidget *before) |
Widget * | insertBefore (std::unique_ptr< Widget > widget, WWidget *before) |
virtual void | insertWidget (int index, std::unique_ptr< WWidget > widget) |
Widget * | insertWidget (int index, std::unique_ptr< Widget > widget) |
Widget * | insertNew (int index, Args &&...args) |
virtual std::unique_ptr< WWidget > | removeWidget (WWidget *widget) override |
virtual void | clear () |
virtual int | indexOf (WWidget *widget) const |
virtual WWidget * | widget (int index) const |
virtual int | count () const |
void | setContentAlignment (WFlags< AlignmentFlag > contentAlignment) |
void | setPadding (const WLength &padding, WFlags< Side > sides=AllSides) |
WLength | padding (Side side) const |
WFlags< AlignmentFlag > | contentAlignment () const |
void | setOverflow (Overflow overflow, WFlags< Orientation > orientation=(Orientation::Horizontal|Orientation::Vertical)) |
void | setList (bool list, bool ordered=false) |
bool | isList () const |
bool | isUnorderedList () const |
bool | isOrderedList () const |
EventSignal< WScrollEvent > & | scrolled () |
int | scrollTop () const |
int | scrollLeft () const |
virtual std::unique_ptr< WWidget > | removeWidget (WWidget *widget) |
std::unique_ptr< Widget > | removeWidget (Widget *widget) |
![]() | |
WInteractWidget () | |
EventSignal< WKeyEvent > & | keyWentDown () |
EventSignal< WKeyEvent > & | keyPressed () |
EventSignal< WKeyEvent > & | keyWentUp () |
EventSignal & | enterPressed () |
EventSignal & | escapePressed () |
EventSignal< WMouseEvent > & | clicked () |
EventSignal< WMouseEvent > & | doubleClicked () |
EventSignal< WMouseEvent > & | mouseWentDown () |
EventSignal< WMouseEvent > & | mouseWentUp () |
EventSignal< WMouseEvent > & | mouseWentOut () |
EventSignal< WMouseEvent > & | mouseWentOver () |
EventSignal< WMouseEvent > & | mouseMoved () |
EventSignal< WMouseEvent > & | mouseDragged () |
EventSignal< WMouseEvent > & | mouseWheel () |
EventSignal< WTouchEvent > & | touchStarted () |
EventSignal< WTouchEvent > & | touchEnded () |
EventSignal< WTouchEvent > & | touchMoved () |
EventSignal< WGestureEvent > & | gestureStarted () |
EventSignal< WGestureEvent > & | gestureChanged () |
EventSignal< WGestureEvent > & | gestureEnded () |
void | setDraggable (const std::string &mimeType, WWidget *dragWidget=nullptr, bool isDragWidgetOnly=false, WObject *sourceWidget=nullptr) |
void | unsetDraggable () |
void | setMouseOverDelay (int delay) |
int | mouseOverDelay () const |
virtual void | setPopup (bool popup) override |
virtual void | load () override |
virtual bool | isEnabled () const override |
![]() | |
WWebWidget () | |
virtual std::vector< WWidget * > | children () const override |
Signal & | childrenChanged () |
virtual void | setPositionScheme (PositionScheme scheme) override |
virtual PositionScheme | positionScheme () const override |
virtual void | setOffsets (const WLength &offset, WFlags< Side > sides=AllSides) override |
virtual WLength | offset (Side s) const override |
virtual void | resize (const WLength &width, const WLength &height) override |
virtual WLength | width () const override |
virtual WLength | height () const override |
virtual void | setMinimumSize (const WLength &width, const WLength &height) override |
virtual WLength | minimumWidth () const override |
virtual WLength | minimumHeight () const override |
virtual void | setMaximumSize (const WLength &width, const WLength &height) override |
virtual WLength | maximumWidth () const override |
virtual WLength | maximumHeight () const override |
virtual void | setLineHeight (const WLength &height) override |
virtual WLength | lineHeight () const override |
virtual void | setFloatSide (Side s) override |
virtual Side | floatSide () const override |
virtual void | setClearSides (WFlags< Side > sides) override |
virtual WFlags< Side > | clearSides () const override |
virtual void | setMargin (const WLength &margin, WFlags< Side > sides=AllSides) override |
virtual WLength | margin (Side side) const override |
virtual void | setHiddenKeepsGeometry (bool enabled) override |
virtual bool | hiddenKeepsGeometry () const override |
virtual void | setHidden (bool hidden, const WAnimation &animation=WAnimation()) override |
virtual bool | isHidden () const override |
virtual bool | isVisible () const override |
virtual void | setDisabled (bool disabled) override |
virtual bool | isDisabled () const override |
virtual bool | isPopup () const override |
virtual void | setInline (bool isInline) override |
virtual bool | isInline () const override |
virtual void | setDecorationStyle (const WCssDecorationStyle &style) override |
virtual WCssDecorationStyle & | decorationStyle () override |
virtual void | setStyleClass (const WString &styleClass) override |
virtual WString | styleClass () const override |
virtual void | addStyleClass (const WString &styleClass, bool force=false) override |
virtual void | removeStyleClass (const WString &styleClass, bool force=false) override |
virtual bool | hasStyleClass (const WString &styleClass) const override |
virtual void | setVerticalAlignment (AlignmentFlag alignment, const WLength &length=WLength()) override |
virtual AlignmentFlag | verticalAlignment () const override |
virtual WLength | verticalAlignmentLength () const override |
virtual void | setToolTip (const WString &text, TextFormat textFormat=TextFormat::Plain) override |
virtual void | setDeferredToolTip (bool enable, TextFormat textFormat=TextFormat::Plain) override |
virtual WString | toolTip () const override |
virtual void | refresh () override |
virtual void | setAttributeValue (const std::string &name, const WString &value) override |
virtual WString | attributeValue (const std::string &name) const override |
virtual void | setJavaScriptMember (const std::string &name, const std::string &value) override |
virtual std::string | javaScriptMember (const std::string &name) const override |
virtual void | callJavaScriptMember (const std::string &name, const std::string &args) override |
virtual bool | loaded () const override |
virtual void | setId (const std::string &id) override |
virtual WWidget * | find (const std::string &name) override |
virtual WWidget * | findById (const std::string &id) override |
virtual void | setSelectable (bool selectable) override |
virtual void | doJavaScript (const std::string &javascript) override |
virtual const std::string | id () const override |
void | setLoadLaterWhenInvisible (bool) |
std::string | htmlTagName () const |
void | setHtmlTagName (const std::string &tag) |
virtual void | setCanReceiveFocus (bool enabled) override |
virtual bool | canReceiveFocus () const override |
virtual bool | setFirstFocus () override |
virtual void | setFocus (bool focus) override |
virtual bool | hasFocus () const override |
virtual void | setTabIndex (int index) override |
virtual int | tabIndex () const override |
EventSignal & | blurred () |
EventSignal & | focussed () |
virtual bool | scrollVisibilityEnabled () const final override |
virtual void | setScrollVisibilityEnabled (bool enabled) final override |
virtual int | scrollVisibilityMargin () const final override |
virtual void | setScrollVisibilityMargin (int margin) final override |
virtual Signal< bool > & | scrollVisibilityChanged () final override |
virtual bool | isScrollVisible () const final override |
virtual void | setThemeStyleEnabled (bool enabled) final override |
virtual bool | isThemeStyleEnabled () const final override |
virtual void | setObjectName (const std::string &name) override |
void | setFocus () |
virtual void | setFocus (bool focus)=0 |
![]() | |
virtual | ~WWidget () |
WWidget * | parent () const |
std::unique_ptr< Widget > | removeWidget (Widget *widget) |
std::unique_ptr< WWidget > | removeFromParent () |
void | setWidth (const WLength &width) |
void | setHeight (const WLength &height) |
virtual void | positionAt (const WWidget *widget, Orientation orientation=Orientation::Vertical) |
virtual void | toggleStyleClass (const WString &styleClass, bool add, bool force=false) |
std::string | jsRef () const |
void | setFocus () |
virtual void | acceptDrops (const std::string &mimeType, const WString &hoverStyleClass=WString()) |
virtual void | stopAcceptDrops (const std::string &mimeType) |
virtual void | htmlText (std::ostream &out) |
bool | isRendered () const |
void | hide () |
void | animateHide (const WAnimation &animation) |
void | show () |
void | animateShow (const WAnimation &animation) |
void | enable () |
void | disable () |
bool | layoutSizeAware () const |
![]() | |
void | addChild (std::unique_ptr< WObject > child) |
Child * | addChild (std::unique_ptr< Child > child) |
std::unique_ptr< WObject > | removeChild (WObject *child) |
std::unique_ptr< Child > | removeChild (Child *child) |
virtual std::string | objectName () const |
void | resetLearnedSlots () |
void | resetLearnedSlot (void(T::*method)()) |
WStatelessSlot * | implementStateless (void(T::*method)()) |
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)()) |
void | isNotStateless () |
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode) |
![]() | |
observable () noexcept | |
virtual | ~observable () |
auto | bindSafe (void(C::*method)(Args...)) noexcept |
auto | bindSafe (void(C::*method)(Args...) const) const noexcept |
auto | bindSafe (const Function &function) noexcept |
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. | |
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< Model > | m_model |
std::vector< std::string > | m_columns |
Wt::Signal< std::string > | m_doubleClicked |
GCW::Gui::AccountEditor * | m_editAccountWidget = nullptr |
Additional Inherited Members | |
![]() | |
static std::string | jsStringLiteral (const std::string &v, char delimiter='\'') |
![]() | |
static WString | tr (const char *key) |
![]() | |
virtual void | propagateSetEnabled (bool enabled) override |
![]() | |
virtual void | enableAjax () override |
virtual WStatelessSlot * | getStateless (Method method) override |
virtual void | render (WFlags< RenderFlag > flags) override |
![]() | |
void | setLayoutSizeAware (bool sizeAware) |
virtual void | layoutSizeChanged (int width, int height) |
WWidget () | |
virtual void | dropEvent (WDropEvent dropEvent) |
virtual int | boxPadding (Orientation orientation) const |
virtual int | boxBorder (Orientation orientation) const |
void | scheduleRender (WFlags< RepaintFlag > flags=None) |
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.
Definition at line 48 of file AccountsTreeView.h.
GCW::Gui::AccountsTreeView::AccountsTreeView | ( | int | _columnCount | ) |
Definition at line 30 of file AccountsTreeView.cpp.
References init().
GCW::Gui::AccountsTreeView::AccountsTreeView | ( | const std::string & | _selectedAccountGuid, |
int | _columnCount | ||
) |
Definition at line 20 of file AccountsTreeView.cpp.
References Wt::WContainerWidget::addNew(), init(), and setSelected().
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 264 of file AccountsTreeView.cpp.
References GCW::app(), and GCW::Dbo::Vars::get().
|
inline |
Definition at line 56 of file AccountsTreeView.h.
References m_doubleClicked.
Definition at line 187 of file AccountsTreeView.cpp.
References dialog, and Wt::WWidget::show().
Definition at line 241 of file AccountsTreeView.cpp.
|
private |
Definition at line 390 of file AccountsTreeView.cpp.
References Wt::asString(), Wt::WString::toUTF8(), and Wt::ItemDataRole::User.
|
private |
Definition at line 449 of file AccountsTreeView.cpp.
References Wt::Json::Object::get(), and Wt::Json::Value::orIfNull().
|
private |
Find Index by AccountGuid.
This will loop through the tree and locate a specific index by it's accountGuid value.
Definition at line 469 of file AccountsTreeView.cpp.
References Wt::asString(), Wt::WModelIndex::data(), and Wt::ItemDataRole::User.
bool GCW::Gui::AccountsTreeView::fromJson | ( | Wt::Json::Object & | _jobj | ) | -> bool |
Definition at line 520 of file AccountsTreeView.cpp.
References Wt::Json::Object::get(), and Wt::Json::Value::orIfNull().
Definition at line 39 of file AccountsTreeView.cpp.
References on_doubleClicked(), on_showPopup_triggered(), saveConfig(), and TR8.
Referenced by AccountsTreeView(), and AccountsTreeView().
|
private |
Definition at line 320 of file AccountsTreeView.cpp.
References Wt::asString(), Wt::WModelIndex::data(), iterate(), and Wt::ItemDataRole::User.
Definition at line 294 of file AccountsTreeView.cpp.
References GCW::app(), and Wt::Json::parse().
Definition at line 53 of file AccountsTreeView.h.
References m_model.
|
private |
Definition at line 543 of file AccountsTreeView.cpp.
References Wt::asString(), Wt::WModelIndex::row(), and Wt::ItemDataRole::User.
Referenced by init().
|
private |
Definition at line 102 of file AccountsTreeView.cpp.
References Wt::asString(), and Wt::WString::toUTF8().
Referenced by init().
Definition at line 282 of file AccountsTreeView.cpp.
References GCW::app(), and Wt::Json::serialize().
Referenced by init().
std::string GCW::Gui::AccountsTreeView::selectedAccount | ( | ) | const -> std::string |
Definition at line 161 of file AccountsTreeView.cpp.
References Wt::asString(), Wt::WString::toUTF8(), and Wt::ItemDataRole::User.
Definition at line 250 of file AccountsTreeView.cpp.
References Wt::Ascending.
Definition at line 507 of file AccountsTreeView.cpp.
Referenced by AccountsTreeView().
Definition at line 532 of file AccountsTreeView.cpp.
References Wt::Json::serialize().
Wt::Json::Object GCW::Gui::AccountsTreeView::toJson | ( | ) | const -> Wt::Json::Object |
Definition at line 371 of file AccountsTreeView.cpp.
References Wt::WString::arg(), iterate(), and Wt::WString::toUTF8().
|
inline |
Definition at line 54 of file AccountsTreeView.h.
References m_view.
|
private |
Definition at line 92 of file AccountsTreeView.h.
|
private |
Definition at line 96 of file AccountsTreeView.h.
|
private |
Definition at line 97 of file AccountsTreeView.h.
Referenced by doubleClicked().
|
private |
Definition at line 98 of file AccountsTreeView.h.
|
private |
Definition at line 93 of file AccountsTreeView.h.
|
private |
Definition at line 95 of file AccountsTreeView.h.
Referenced by model().
|
private |
Definition at line 94 of file AccountsTreeView.h.
Referenced by view().