diff options
author | Ian C <ianc@noddybox.co.uk> | 2005-04-04 00:52:23 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2005-04-04 00:52:23 +0000 |
commit | 3a1bf865b6c1b6b7c096eaf6dab91a465319488a (patch) | |
tree | 3495061e6af6b819b075b6fdaae66dc115bf187e /src/autocheck.cpp | |
parent | 98164e7547f7ea21204e69885158cd0494e08c5d (diff) |
Added DataX
Diffstat (limited to 'src/autocheck.cpp')
-rw-r--r-- | src/autocheck.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/autocheck.cpp b/src/autocheck.cpp index f713c19..fb7de94 100644 --- a/src/autocheck.cpp +++ b/src/autocheck.cpp @@ -21,6 +21,7 @@ #include "w32dlib/window.h" #include "w32dlib/autocheck.h" #include "w32dlib/dialog.h" +#include "w32dlib/datax.h" namespace W32DLib { @@ -28,8 +29,8 @@ namespace W32DLib // ------------------------------------------------------------ // -AutoCheck::AutoCheck(Dialog *parent, int resource_id) : - Control(parent,resource_id) +AutoCheck::AutoCheck(Dialog *parent, int resource_id, DataX *datax) : + Control(parent,resource_id,datax) { } @@ -87,6 +88,44 @@ bool AutoCheck::GetState() } +// ------------------------------------------------------------ +// +void AutoCheck::DoDataExchange(bool set) +{ + if (m_data) + { + switch(m_data->Type()) + { + case DataX::eString: + Control::DoDataExchange(set); + break; + + case DataX::eInt: + if (set) + { + SetFullState(static_cast<EState>(m_data->Int())); + } + else + { + m_data->Set(static_cast<int>(GetFullState())); + } + break; + + case DataX::eBool: + if (set) + { + SetState(m_data->Bool()); + } + else + { + m_data->Set(GetState()); + } + break; + } + } +} + + }; // namespace W32DLib |