30#include <FL/Fl_Button.H>
32#include <sptk5/db/PoolDatabaseConnection.h>
33#include <sptk5/db/Query.h>
34#include <sptk5/gui/CControl.h>
35#include <sptk5/gui/CDBListView.h>
44class CInternalComboBoxPanel;
57 friend class CInternalComboBoxPanel;
62 Fl_Callback_p m_buttonClicked;
67 std::array<Fl_Button*, 5> m_buttons;
87 void changeControlData(
int changeType,
int intData = 0, std::string stringData =
"");
92 void ctor_init(
const char* label,
int _mode);
97 static void comboButtonPressed(Fl_Widget* btn,
void* data);
169#ifdef __COMPATIBILITY_MODE__
179 CBaseListBox(
int x,
int y,
int w,
int h,
const char *label,
int mode);
217 return m_buttonClicked;
249 bool cvisible =
true);
283 void resize(
int x,
int y,
int w,
int h)
override;
331 return m_list->
findKey(keyValue);
415 int findString(
const std::string& str,
bool select =
true, uint32_t startRow = 0,
unsigned endRow = 0);
471#ifdef __COMPATIBILITY_MODE__
480 CComboBox(
int x,
int y,
int w,
int h,
const char *label = 0);
529#ifdef __COMPATIBILITY_MODE__
538 CListBox(
int,
int,
int,
int,
const char * = 0);
Base list box widget.
Definition: CComboBox.h:56
void columns(const CColumnList &columnList)
CDBListView * m_list
Definition: CComboBox.h:109
int m_buttonSpace
Definition: CComboBox.h:114
Variant data() const override
int findString(const std::string &str, bool select=true, uint32_t startRow=0, unsigned endRow=0)
CPackedStrings * findKey(int keyValue)
Definition: CComboBox.h:329
virtual void dropDownList()
CListViewDataMode dataMode()
Definition: CComboBox.h:309
PoolDatabaseConnection * database() const
void save(Query *) override
Saves data to the Query.
bool preferredSize(int &w, int &h) override
void addRows(std::string columnName, Strings rows)
CPackedStrings * findCaption(const String &caption)
Definition: CComboBox.h:319
void buttonClicked(Fl_Callback *c)
Definition: CComboBox.h:223
void addRow(CPackedStrings *row)
void load(Query *) override
Loads data from the Query.
virtual void button_handle(uint32_t theButtonKind)
bool valid() const override
Definition: CComboBox.h:155
void dataMode(CListViewDataMode dm)
Definition: CComboBox.h:300
void sort()
Definition: CComboBox.h:374
void resize(int x, int y, int w, int h) override
void sortColumn(int sortColumn)
void selectRow(unsigned rowNumber)
QueryParameter & param(const char *paramName)
void save(const xdoc::SNode &node, CLayoutXMLmode xmlMode) const override
Saves control data to XML.
CPackedStrings * selectedRow() const
void load(const xdoc::SNode &node, CLayoutXMLmode xmlMode) override
Loads control data from XML.
uint32_t buttons() const
Definition: CComboBox.h:202
void database(PoolDatabaseConnection *db)
std::string keyField() const
CBaseListBox(const char *label, int layoutSize, CLayoutAlign layoutAlign, int mode)
void keyField(std::string keyFieldName)
CDBDropDownList * m_dropDownWindow
Definition: CComboBox.h:104
void setup(PoolDatabaseConnection *db, std::string sql, std::string keyField)
void addRow(int rowId, const Strings &strings)
void addColumn(std::string cname, VariantDataType type=VariantDataType::VAR_STRING, int16_t cwidth=70, bool cvisible=true)
void data(const Variant &v) override
Fl_Callback_p buttonClicked() const
Definition: CComboBox.h:215
Definition: CColumn.h:178
Combo box widget.
Definition: CComboBox.h:461
CControlKind kind() const override
static CLayoutClient * creator(const xdoc::SNode &node)
Creates a combo box based on the XML node information.
CComboBox(const char *label=nullptr, int layoutSize=10, CLayoutAlign layoutAlign=CLayoutAlign::TOP)
String className() const override
Definition: CComboBox.h:499
Base class for most of SPTK widgets.
Definition: CControl.h:222
Drop-down window with CListView widget inside.
Definition: CDropDownBox.h:95
List view widget with extended database support.
Definition: CDBListView.h:45
Definition: CLayoutClient.h:82
List Box widget.
Definition: CComboBox.h:519
String className() const override
Definition: CComboBox.h:555
CControlKind kind() const override
Definition: CComboBox.h:546
CListBox(const char *label=nullptr, int layoutSize=10, CLayoutAlign layoutAlign=CLayoutAlign::TOP)
CPackedStrings * findCaption(const String &caption)
Finds an item with the caption (a string in the first column).
CPackedStrings * findKey(int keyValue)
Finds an item with the key (an integer associated with the item - argument()).
void sort()
Sorts ListView rows using existing information about sort column and direction.
Definition: CListView.h:1114
void dataMode(CListViewDataMode dm)
Definition: CListView.h:665
Packed strings list.
Definition: PackedStrings.h:58
Definition: PoolDatabaseConnection.h:231
Definition: QueryParameter.h:44
Definition: Variant.h:372
CControlKind
Control kind is the constant to report the internal SPTK RTTI.
Definition: CControl.h:50
CLayoutAlign
Definition: CLayoutClient.h:44
CLayoutXMLmode
Definition: CLayoutClient.h:57
CListViewDataMode
The data mode for the data() methods.
Definition: CListView.h:76
VariantDataType
Definition: VariantData.h:44
@ VAR_STRING
String pointer.