summaryrefslogtreecommitdiff
path: root/src/control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/control.cpp')
-rw-r--r--src/control.cpp38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/control.cpp b/src/control.cpp
index a8a221f..fa8e2e7 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -21,6 +21,7 @@
#include "w32dlib/window.h"
#include "w32dlib/control.h"
#include "w32dlib/dialog.h"
+#include "w32dlib/datax.h"
namespace W32DLib
{
@@ -28,10 +29,11 @@ namespace W32DLib
// ------------------------------------------------------------
//
-Control::Control(Dialog *parent, int resource_id) :
+Control::Control(Dialog *parent, int resource_id, DataX *datax) :
Window(),
m_parent(parent),
m_resid(resource_id),
+ m_data(datax),
m_cblist()
{
m_parent->AddControl(this);
@@ -88,6 +90,40 @@ BOOL Control::ProcessMessage(UINT msg, WPARAM wp, LPARAM lp)
// ------------------------------------------------------------
//
+void Control::DoDataExchange(bool set)
+{
+ if (m_data)
+ {
+ if (set)
+ {
+ switch(m_data->Type())
+ {
+ case DataX::eString:
+ SetText(m_data->Str());
+ break;
+
+ default:
+ break;
+ }
+ }
+ else
+ {
+ switch(m_data->Type())
+ {
+ case DataX::eString:
+ m_data->Set(GetText());
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+}
+
+
+// ------------------------------------------------------------
+//
void Control::AddCallback(UINT msg,
UINT notification,
Window *owner,