summaryrefslogtreecommitdiff
path: root/src/control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/control.cpp')
-rw-r--r--src/control.cpp48
1 files changed, 4 insertions, 44 deletions
diff --git a/src/control.cpp b/src/control.cpp
index 392c72e..75f96a1 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -18,6 +18,7 @@
//
// -------------------------------------------------------------------------
//
+#include "w32dlib/window.h"
#include "w32dlib/control.h"
#include "w32dlib/dialog.h"
@@ -28,6 +29,7 @@ namespace W32DLib
// ------------------------------------------------------------
//
Control::Control(Dialog *parent, int resource_id) :
+ Window(),
m_parent(parent),
m_resid(resource_id),
m_cblist()
@@ -52,48 +54,6 @@ int Control::ResourceID()
// ------------------------------------------------------------
//
-void Control::SetText(const char *text)
-{
- SetDlgItemText(m_parent->GetHWND(),m_resid,text);
-}
-
-
-// ------------------------------------------------------------
-//
-std::string Control::GetText(int maxlen)
-{
- char *buff=new char[maxlen+1];
- std::string res;
-
- if (GetDlgItemText(m_parent->GetHWND(),m_resid,buff,maxlen))
- {
- res=buff;
- }
-
- delete[] buff;
-
- return res;
-}
-
-
-// ------------------------------------------------------------
-//
-HWND Control::GetHWND()
-{
- return m_wnd;
-}
-
-
-// ------------------------------------------------------------
-//
-void Control::Enable(bool enable)
-{
- EnableWindow(m_wnd,enable);
-}
-
-
-// ------------------------------------------------------------
-//
BOOL Control::ProcessMessage(UINT msg, WPARAM wp, LPARAM lp)
{
if (msg==WM_INITDIALOG)
@@ -104,7 +64,7 @@ BOOL Control::ProcessMessage(UINT msg, WPARAM wp, LPARAM lp)
if (m_cblist.count(msg)>0)
{
CallbackDetails details=m_cblist[msg];
- W32DLibCallbackInterface *owner=details.owner;
+ Window *owner=details.owner;
W32DLibCallback cb=details.cb;
return (owner->*cb)(msg,wp,lp);
@@ -117,7 +77,7 @@ BOOL Control::ProcessMessage(UINT msg, WPARAM wp, LPARAM lp)
// ------------------------------------------------------------
//
void Control::AddCallback(UINT msg,
- W32DLibCallbackInterface *owner,
+ Window *owner,
W32DLibCallback callback)
{
CallbackDetails details;