29#include <sptk5/xdoc/Node.h>
31#include <sptk5/Strings.h>
32#include <sptk5/gui/CButton.h>
33#include <sptk5/gui/CControlList.h>
34#include <sptk5/gui/CDataControl.h>
35#include <sptk5/gui/CGroup.h>
36#include <sptk5/gui/CScroll.h>
37#include <sptk5/gui/CTabs.h>
38#include <sptk5/gui/CWindow.h>
46class PoolDatabaseConnection;
133 void load(
const xdoc::SNode& node,
CLayoutXMLmode xmlMode)
override
144 void save(
const xdoc::SNode& node,
CLayoutXMLmode xmlMode)
const override
291 CDialog(
int w,
int h,
const char* label =
nullptr);
392 virtual Fl_Group*
newPage(
const char* label,
bool autoColor);
400 virtual Fl_Group*
newScroll(
const char* label,
bool autoColor);
418 return (uint32_t) m_allFields.size();
433 m_queriesBuilt =
false;
434 m_controlsScanned =
false;
442 void load(
const xdoc::SNode& node)
override;
449 void save(
const xdoc::SNode& node)
const override;
458 return m_modalResult;
List of CControl object pointers in Fl_Group.
Definition: CControlList.h:52
Base class for most of SPTK widgets.
Definition: CControl.h:222
void prepareNewPage(Fl_Group *page, bool autoColor) override
CDialogTabs()
Default constructor.
Definition: CDialog.h:109
Definition: CDialog.h:126
String m_tableName
Definition: CDialog.h:168
CGroup * m_buttonGroup
Definition: CDialog.h:193
void table(const String &tableName)
virtual bool cancelPressed()
Query * m_updateQuery
Definition: CDialog.h:208
CButton * m_cancelButton
Definition: CDialog.h:158
bool m_queriesBuilt
Definition: CDialog.h:218
String keyField() const
Definition: CDialog.h:371
CControlList m_allFields
Definition: CDialog.h:188
CButton * addExtraButton(CButtonKind buttonKind, const char *label, Fl_Callback_p callback)
int m_keyValue
Definition: CDialog.h:178
virtual Fl_Group * newScroll(const char *label, bool autoColor)
void load(const xdoc::SNode &node) override
virtual void database(PoolDatabaseConnection *db)
bool m_controlsScanned
Definition: CDialog.h:223
CControl & operator[](const String &fieldName)
Index operator to access controls with defined field name.
PoolDatabaseConnection * database() const
void defaultButton(CButton *btn)
CControlList m_specialProcessingControls
Definition: CDialog.h:228
String className() const override
Returns widget class name (internal SPTK RTTI).
Definition: CDialog.h:464
virtual Fl_Group * newPage(const char *label, bool autoColor)
int handle(int event) override
virtual void scanControls()
uint32_t fieldCount() const
Definition: CDialog.h:416
void table(PoolDatabaseConnection *db, const String &tableName, const String &keyFieldName)
Fast setup of the database connection.
String table() const
Definition: CDialog.h:347
Query * m_insertQuery
Definition: CDialog.h:213
CButton * m_defaultButton
Definition: CDialog.h:163
CControlList m_defaultFields
Definition: CDialog.h:183
void save(const xdoc::SNode &node) const override
virtual bool buildQueries()
CDialog(int w, int h, const char *label=nullptr)
void rescan()
Makes dialog to scan the widgets inside.
Definition: CDialog.h:431
String m_keyField
Definition: CDialog.h:173
CDialogTabs * m_pages
Definition: CDialog.h:198
void keyField(const String &keyFieldName)
void alert(const String &s) const
CButton * m_okButton
Definition: CDialog.h:153
CDialogModalResult modalResult() const
Definition: CDialog.h:456
Query * m_selectQuery
Definition: CDialog.h:203
CDialogModalResult m_modalResult
Definition: CDialog.h:233
SPTK group widget.
Definition: CGroup.h:50
Tabs widget.
Definition: CTabs.h:48
Window widget.
Definition: CWindow.h:57
void load(const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode xmlMode) override
Loads window coordinates and widgets from XML node.
void save(const std::shared_ptr< xdoc::Node > &node, CLayoutXMLmode xmlMode) const override
Saves window coordinates and widgets into XML node.
Definition: PoolDatabaseConnection.h:231
CDialogModalResult
Definition: CDialog.h:67
CLayoutAlign
Definition: CLayoutClient.h:44
CLayoutXMLmode
Definition: CLayoutClient.h:57
CButtonKind
Definition: CButton.h:52
@ CLIENT
Align to the bottom.