2016-07-03 11:36:49 +00:00
|
|
|
#if defined(Hiro_TableView)
|
2016-05-15 10:45:15 +00:00
|
|
|
|
|
|
|
namespace hiro {
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::construct() -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
_setState();
|
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::destruct() -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::setAlignment(Alignment alignment) -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::setBackgroundColor(Color color) -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::setCheckable(bool checkable) -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::setChecked(bool checked) -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
_setState();
|
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::setForegroundColor(Color color) -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::setIcon(const image& icon) -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
_setState();
|
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::setText(const string& text) -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
_setState();
|
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::_grandparent() -> maybe<pTableView&> {
|
2016-05-15 10:45:15 +00:00
|
|
|
if(auto parent = _parent()) return parent->_parent();
|
|
|
|
return nothing;
|
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::_parent() -> maybe<pTableViewItem&> {
|
|
|
|
if(auto parent = self().parentTableViewItem()) {
|
2016-05-15 10:45:15 +00:00
|
|
|
if(auto self = parent->self()) return *self;
|
|
|
|
}
|
|
|
|
return nothing;
|
|
|
|
}
|
|
|
|
|
2016-07-03 11:36:49 +00:00
|
|
|
auto pTableViewCell::_setState() -> void {
|
2016-05-15 10:45:15 +00:00
|
|
|
if(auto parent = _parent()) {
|
|
|
|
if(auto grandparent = _grandparent()) {
|
|
|
|
grandparent->lock();
|
|
|
|
gtk_list_store_set(grandparent->gtkListStore, &parent->gtkIter, 3 * self().offset() + 0, state().checked, -1);
|
|
|
|
gtk_list_store_set(grandparent->gtkListStore, &parent->gtkIter, 3 * self().offset() + 1, CreatePixbuf(state().icon), -1);
|
|
|
|
gtk_list_store_set(grandparent->gtkListStore, &parent->gtkIter, 3 * self().offset() + 2, state().text.data(), -1);
|
|
|
|
grandparent->unlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|