summaryrefslogtreecommitdiff
path: root/src/combobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/combobox.cpp')
-rw-r--r--src/combobox.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/combobox.cpp b/src/combobox.cpp
index f16b619..fbf2a6c 100644
--- a/src/combobox.cpp
+++ b/src/combobox.cpp
@@ -20,14 +20,15 @@
//
#include "w32dlib/window.h"
#include "w32dlib/combobox.h"
+#include "w32dlib/datax.h"
namespace W32DLib
{
// ------------------------------------------------------------
//
-ComboBox::ComboBox(Dialog *parent, int resource_id) :
- Control(parent,resource_id)
+ComboBox::ComboBox(Dialog *parent, int resource_id, DataX *datax) :
+ Control(parent,resource_id,datax)
{
}
@@ -181,6 +182,34 @@ void ComboBox::SelectedIndex(int index)
}
+// ------------------------------------------------------------
+//
+void ComboBox::DoDataExchange(bool set)
+{
+ if (m_data)
+ {
+ switch(m_data->Type())
+ {
+ case DataX::eString:
+ case DataX::eBool:
+ Control::DoDataExchange(set);
+ break;
+
+ case DataX::eInt:
+ if (set)
+ {
+ SelectedIndex(m_data->Int());
+ }
+ else
+ {
+ m_data->Set(SelectedIndex());
+ }
+ break;
+ }
+ }
+}
+
+
}; // namespace W32DLib
// END OF FILE