1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#if defined(Hiro_ComboButton)
namespace hiro {
auto pComboButtonItem::construct() -> void {
}
auto pComboButtonItem::destruct() -> void {
}
auto pComboButtonItem::setIcon(const image& icon) -> void {
}
auto pComboButtonItem::setSelected() -> void {
if(auto parent = _parent()) {
[(CocoaComboButton*)(parent->cocoaView) selectItemAtIndex:self().offset()];
}
}
auto pComboButtonItem::setText(const string& text) -> void {
if(auto parent = _parent()) {
[[(CocoaComboButton*)(parent->cocoaView) itemAtIndex:self().offset()] setTitle:[NSString stringWithUTF8String:text]];
}
}
auto pComboButtonItem::_parent() -> maybe<pComboButton&> {
if(auto parent = self().parentComboButton()) {
if(auto self = parent->self()) return *self;
}
return nothing;
}
}
#endif
|