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