| 23 | using namespace ui; |
| 24 | |
| 25 | DropDownButton::DropDownButton(const char* text) |
| 26 | : HBox() |
| 27 | , m_button(new Button(text)) |
| 28 | , m_dropDown(new Button("")) |
| 29 | { |
| 30 | SkinTheme* theme = SkinTheme::instance(); |
| 31 | |
| 32 | setup_look(m_button, LeftButtonLook); |
| 33 | setup_look(m_dropDown, RightButtonLook); |
| 34 | |
| 35 | m_button->setExpansive(true); |
| 36 | m_button->setAlign(LEFT | MIDDLE); |
| 37 | m_button->Click.connect(&DropDownButton::onButtonClick, this); |
| 38 | m_dropDown->Click.connect(&DropDownButton::onDropDownButtonClick, this); |
| 39 | |
| 40 | addChild(m_button); |
| 41 | addChild(m_dropDown); |
| 42 | |
| 43 | setChildSpacing(0); |
| 44 | |
| 45 | m_dropDown->setIconInterface |
| 46 | (new ButtonIconImpl(theme->parts.comboboxArrowDown(), |
| 47 | theme->parts.comboboxArrowDownSelected(), |
| 48 | theme->parts.comboboxArrowDownDisabled(), |
| 49 | CENTER | MIDDLE)); |
| 50 | } |
| 51 | |
| 52 | void DropDownButton::onButtonClick(Event& ev) |
| 53 | { |
nothing calls this directly
no test coverage detected