GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
|
Date Delegate. More...
#include <DelegateDate.h>
Public Member Functions | |
DelegateDate () | |
~DelegateDate () | |
virtual auto | createEditor (const Wt::WModelIndex &_index, Wt::WFlags< Wt::ViewItemRenderFlag > _flags) const -> std::unique_ptr< Wt::WWidget > |
virtual auto | editState (Wt::WWidget *_editor, const Wt::WModelIndex &_index) const -> Wt::cpp17::any override |
Edit State. | |
virtual auto | setEditState (Wt::WWidget *_editor, const Wt::WModelIndex &_index, const Wt::cpp17::any &_value) const -> void |
virtual auto | setModelData (const Wt::cpp17::any &_editState, Wt::WAbstractItemModel *_model, const Wt::WModelIndex &_index) const -> void |
auto | doCloseEditor (Wt::WDateEdit *_dateEdit, bool _save) const -> void |
auto | doTabAction (Wt::WKeyEvent _keyEvent) const -> void |
![]() | |
DelegateBase () | |
Base Delegate. | |
~DelegateBase () | |
virtual auto | update (Wt::WWidget *_widget, const Wt::WModelIndex &_index, Wt::WFlags< Wt::ViewItemRenderFlag > _flags) -> std::unique_ptr< Wt::WWidget > |
virtual auto | updateModelIndex (Wt::WWidget *_widget, const Wt::WModelIndex &_index) -> void |
virtual auto | validate (const Wt::WModelIndex &_index, const Wt::cpp17::any &_editState) const -> Wt::ValidationState |
![]() | |
WItemDelegate () | |
void | setTextFormat (const WString &format) |
const WString & | textFormat () const |
virtual void | setModelData (const cpp17::any &editState, WAbstractItemModel *model, const WModelIndex &index) const override |
virtual void | setEditState (WWidget *editor, const WModelIndex &index, const cpp17::any &value) const override |
![]() | |
WAbstractItemDelegate () | |
virtual | ~WAbstractItemDelegate () |
virtual ValidationState | validate (const WModelIndex &index, const cpp17::any &editState) const |
Signal< WWidget *, bool > & | closeEditor () |
const Signal< WWidget *, bool > & | closeEditor () 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 const std::string | id () const |
virtual void | setObjectName (const std::string &name) |
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 | setDate (Wt::WDateEdit *_dateEdit, Wt::cpp17::any _value) const -> void |
Additional Inherited Members | |
![]() | |
typedef void(WObject::* | Method) () |
![]() | |
virtual WStatelessSlot * | getStateless (Method method) |
Date Delegate.
The date delegate handles the WDateTime value from the model. Even though a 'transaction' is posted on a 'date' and not particularly a time, the gnucash system still is sensitive to time values in date-only fields. In the case of the transactions, the 'time' component is set to 10:59:00. There is a macro that contains this value 'GCW_DATE_DEFAULT_TIME' which should be used to reference the correct time-value. The time-component is important since when reading items out of the database, gnucash responds poorly to posted dates that have a 00:00:00 time component set, it must be set to the 10:59:00 value. This delegate makes sure that happens (probably shouldn't be done here).
Definition at line 28 of file DelegateDate.h.
GCW::Gui::AccountRegister::DelegateDate::DelegateDate | ( | ) |
Definition at line 11 of file DelegateDate.cpp.
References GCW_DATE_FORMAT_DISPLAY, and Wt::WItemDelegate::setTextFormat().
GCW::Gui::AccountRegister::DelegateDate::~DelegateDate | ( | ) |
Definition at line 26 of file DelegateDate.cpp.
|
virtual |
Reimplemented from GCW::Gui::AccountRegister::DelegateBase.
Definition at line 33 of file DelegateDate.cpp.
References Wt::asString(), GCW::Cfg::date_format(), and Wt::ItemDataRole::Edit.
auto GCW::Gui::AccountRegister::DelegateDate::doCloseEditor | ( | Wt::WDateEdit * | _dateEdit, |
bool | _save | ||
) | const -> void |
Definition at line 110 of file DelegateDate.cpp.
auto GCW::Gui::AccountRegister::DelegateDate::doTabAction | ( | Wt::WKeyEvent | _keyEvent | ) | const -> void |
Definition at line 122 of file DelegateDate.cpp.
|
overridevirtual |
Edit State.
A thing about editState, setEditState, setModelData. Each of these use 'cpp17::any' data for handling data. When you 'editState' you can return anything you want that will also be digested by 'setEditState'. Then, also, therefore, setModelData will also receive anything from 'editState'. So, this can be a handy tool for passing around different editor info that is specifically tied to a row or item that is being edited. Right now we just return the date value, since that's what we're using and poking straight in to the model and what not, but we could be passing around any object/date/type... just sayin.
Reimplemented from GCW::Gui::AccountRegister::DelegateBase.
Definition at line 132 of file DelegateDate.cpp.
References GCW_DATE_DEFAULT_TIME, Wt::WDateTime::setDate(), and Wt::WDateTime::setTime().
|
private |
Definition at line 83 of file DelegateDate.cpp.
References Wt::asString(), and GCW::Cfg::date_format().
|
virtual |
Reimplemented from GCW::Gui::AccountRegister::DelegateBase.
Definition at line 162 of file DelegateDate.cpp.
References Wt::asString().
|
virtual |
Reimplemented from GCW::Gui::AccountRegister::DelegateBase.
Definition at line 187 of file DelegateDate.cpp.
References Wt::asString(), and GCW::Gui::AccountRegister::DelegateBase::setModelData().