From c5a0acf7c6843e98fb6574069ffa5e540cd21dae Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 29 Mar 2013 16:16:24 -0300 Subject: [PATCH] Add ComboBox::onChange() member function --- src/ui/combobox.cpp | 7 ++++++- src/ui/combobox.h | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ui/combobox.cpp b/src/ui/combobox.cpp index f18bd4ef1..60fbfdb01 100644 --- a/src/ui/combobox.cpp +++ b/src/ui/combobox.cpp @@ -400,7 +400,7 @@ bool ComboBoxListBox::onProcessMessage(Message* msg) { int index = m_comboBox->getSelectedItem(); if (isValidItem(index)) - m_comboBox->Change(); + m_comboBox->onChange(); m_comboBox->closeListBox(); } @@ -510,4 +510,9 @@ JRect ComboBox::getListBoxPos() return rc; } +void ComboBox::onChange() +{ + Change(); +} + } // namespace ui diff --git a/src/ui/combobox.h b/src/ui/combobox.h index 7d668f5b6..677600934 100644 --- a/src/ui/combobox.h +++ b/src/ui/combobox.h @@ -21,8 +21,12 @@ namespace ui { class ListBox; class Window; + class ComboBoxListBox; + class ComboBox : public Widget { + friend class ComboBoxListBox; + public: ComboBox(); ~ComboBox(); @@ -66,6 +70,7 @@ namespace ui { protected: bool onProcessMessage(Message* msg) OVERRIDE; void onPreferredSize(PreferredSizeEvent& ev) OVERRIDE; + virtual void onChange(); private: void onButtonClick(Event& ev);