27 #ifndef YMGA_CBTable_h
28 #define YMGA_CBTable_h
30 #include <yui/YTable.h>
31 #include <yui/YTypes.h>
32 #include <yui/YSelectionWidget.h>
33 #include <yui/YTableItem.h>
34 #include <yui/YTableHeader.h>
35 #include <yui/YEvent.h>
38 YCBTableCheckBoxOnFirstColumn=2,
39 YCBTableCheckBoxOnLastColumn
68 const std::string & label_1 = std::string(),
69 const std::string & label_2 = std::string(),
70 const std::string & label_3 = std::string(),
71 const std::string & label_4 = std::string(),
72 const std::string & label_5 = std::string(),
73 const std::string & label_6 = std::string(),
74 const std::string & label_7 = std::string(),
75 const std::string & label_8 = std::string(),
76 const std::string & label_9 = std::string() ) :
77 YTableItem(label_0, label_1, label_2, label_3,
78 label_4, label_5, label_6, label_7,
79 label_8, label_9), _checked(false) {}
86 void check(
bool val=
true) {_checked=val;}
87 bool checked() {
return _checked;}
144 virtual const char *
widgetClass()
const {
return "YMGA_CBTable"; }
160 std::string
header(
int column )
const;
165 YAlignmentType
alignment(
int column )
const;
225 virtual void cellChanged(
const YTableCell * cell ) = 0;
236 virtual void checkItem( YItem *
item,
bool checked =
true ) = 0;
248 virtual bool setProperty(
const std::string & propertyName,
249 const YPropertyValue & val );
257 virtual YPropertyValue
getProperty(
const std::string & propertyName );
284 virtual void addItem( YItem * item_disown );
299 virtual YItem*
item(
int index )
const;
323 YItemIterator
nextItem( YItemIterator currentIterator);
340 ImplPtr<YMGA_CBTablePrivate> priv;
344 #endif // YMGA_CBTable_h
virtual void setKeepSorting(bool keepSorting)
Switch between sorting by item insertion order (keepSorting: true) or allowing the user to sort by an...
YCBTableItem * toCBYTableItem(YItem *item)
useful cast for bindings.
virtual const YPropertySet & propertySet()
Return this class's property set.
YMGA_CBTable(YWidget *parent, YTableHeader *header, YCBTableMode mode)
Constructor.
YCBTableMode tableMode()
returns the YCBTable checkbox position mode
virtual void setChangedItem(YCBTableItem *pItem)
When derived classes emit YWidgetEvent with reason ValueChanged they have to set which item is change...
const char * userInputProperty()
The name of the widget property that will return user input.
virtual void cellChanged(const YTableCell *cell)=0
Notification that a cell (its text and/or its icon) was changed from the outside. ...
virtual void addItem(YItem *item_disown)
Add one item.
virtual const char * widgetClass() const
Return a descriptive name of this widget class for logging, debugging etc.
YItem * YItemIteratorToYItem(YItemIterator iter)
useful cast for bindings.
virtual void checkItem(YItem *item, bool checked=true)=0
check/uncheck Item from application.
See document of YMGA_CBTable Table: Selection list with multiple columns.
virtual YPropertyValue getProperty(const std::string &propertyName)
Get a property.
int columns() const
Return the number of columns of this table.
virtual ~YCBTableItem()
Destructor.
virtual YItem * item(int index) const
From YSelectionWidget returns the item at index 'index' (from 0) or 0 if there is no such item...
void setImmediateMode(bool immediateMode=true)
Set immediateMode() on or off.
bool hasColumn(int column) const
Return 'true' if this table has a column no.
bool immediateMode() const
Deliver even more events than with notify() set.
std::string header(int column) const
Return the header text for the specified column.
bool keepSorting() const
Return 'true' if the sort order is to be kept in item insertion order, i.e.
void setTableHeader(YTableHeader *newHeader)
Exchange the previous table header with a new one.
virtual ~YMGA_CBTable()
Destructor.
YItemIterator nextItem(YItemIterator currentIterator)
YSelectionWidget does not implement the increment of iterator and bindings seem not to work with iter...
YAlignmentType alignment(int column) const
Return the alignment for the specified column.
virtual bool setProperty(const std::string &propertyName, const YPropertyValue &val)
Set a property.
bool hasMultiSelection() const
Return 'true' if the user can select multiple items at the same time (e.g., with shift-click or ctrl-...
YCBTableItem()
Default constructor.
virtual YCBTableItem * changedItem()
Return the item which value is changed (e.g.
YCBTableItem(const std::string &label_0, const std::string &label_1=std::string(), const std::string &label_2=std::string(), const std::string &label_3=std::string(), const std::string &label_4=std::string(), const std::string &label_5=std::string(), const std::string &label_6=std::string(), const std::string &label_7=std::string(), const std::string &label_8=std::string(), const std::string &label_9=std::string())
Convenience constructor for table items without any icons.