summaryrefslogtreecommitdiff
path: root/src/test/w32dtst.cpp
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-03-29 01:22:42 +0000
committerIan C <ianc@noddybox.co.uk>2005-03-29 01:22:42 +0000
commiteffc648f262bd3bd7b57d4e76db2f768510be55c (patch)
treed77a2e04e58847a3517649ffa83f86b066de08f6 /src/test/w32dtst.cpp
parent82f1d860690dc0a2d0210db12344f7ea5e88b6a4 (diff)
Tweaks to Text controls and text handling.
Diffstat (limited to 'src/test/w32dtst.cpp')
-rw-r--r--src/test/w32dtst.cpp39
1 files changed, 26 insertions, 13 deletions
diff --git a/src/test/w32dtst.cpp b/src/test/w32dtst.cpp
index 663c63d..0e09ea2 100644
--- a/src/test/w32dtst.cpp
+++ b/src/test/w32dtst.cpp
@@ -45,6 +45,9 @@ public:
m_check.OnPress
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnCheck));
+ m_text.OnTextChanged
+ (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnText));
+
m_loadbut.OnPress
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnLoad));
m_savebut.OnPress
@@ -75,7 +78,7 @@ public:
m_quit.Enable(true);
m_combo.Reset();
- std::cout << "addstring=" << m_combo.AddString("Entry 1") << std::endl;
+ std::cout << "addstring=" << m_combo.AddString(std::string("Entry 1")) << std::endl;
std::cout << "addstring=" << m_combo.AddString("Entry 2") << std::endl;
std::cout << "addstring=" << m_combo.AddString("Entry 3") << std::endl;
@@ -112,24 +115,27 @@ private:
BOOL OnButton(UINT msg, WPARAM wp, LPARAM lp)
{
- std::string txt=m_text.GetText(512);
+ std::string txt=m_text.GetText();
std::cout << "Called OnButton()" << std::endl;
std::cout << "text=" << txt << std::endl;
std::cout << "check=" << m_check.GetState() << std::endl;
- m_static.SetText(txt.c_str());
- SetText((txt+" [Title]").c_str());
- m_combo.AddString(m_combo.GetText().c_str());
+ m_static.SetText(txt);
+ SetText(txt+" [Title]");
+ m_combo.AddString(m_combo.GetText());
+ m_text.AppendText(m_combo.GetText()+"\n");
return TRUE;
}
BOOL OnCheck(UINT msg, WPARAM wp, LPARAM lp)
{
- W32DLib::AutoCheck::EState state=m_check.GetState();
+ bool checked=m_check.GetState();
- std::cout << "Called OnCheck() - state " << state << std::endl;
+ std::cout << "Called OnCheck() - state " << checked << std::endl;
- m_quit.Enable(state==W32DLib::AutoCheck::eChecked);
+ m_quit.Enable(checked);
+ m_load.ReadOnly(checked);
+ m_save.Enable(!checked);
return TRUE;
}
@@ -141,7 +147,7 @@ private:
m_loadpath,
"CPP Files\0*.cpp\0Any File\0*.*\0"))
{
- m_load.SetText(m_loadpath.c_str());
+ m_load.SetText(m_loadpath);
}
return TRUE;
@@ -154,7 +160,7 @@ private:
m_savepath,
NULL))
{
- m_save.SetText(m_savepath.c_str());
+ m_save.SetText(m_savepath);
}
return TRUE;
@@ -167,7 +173,7 @@ private:
std::cout << "Called OnComboSel()" << std::endl;
std::cout << "Sel:selection=" << sel << " (" << str << ")" << std::endl;
- std::cout << "Sel:Window::GetText=" << m_combo.GetText(512) << std::endl;
+ std::cout << "Sel:Window::GetText=" << m_combo.GetText() << std::endl;
return TRUE;
}
@@ -178,14 +184,21 @@ private:
std::cout << "Called OnComboDbl()" << std::endl;
std::cout << "Dbl:selection=" << sel << " (" << str << ")" << std::endl;
- std::cout << "Dbl:Window::GetText=" << m_combo.GetText(512) << std::endl;
+ std::cout << "Dbl:Window::GetText=" << m_combo.GetText() << std::endl;
return TRUE;
}
BOOL OnComboTxt(UINT msg, WPARAM wp, LPARAM lp)
{
std::cout << "Called OnComboSel()" << std::endl;
- std::cout << "Txt:Window::GetText=" << m_combo.GetText(512) << std::endl;
+ std::cout << "Txt:Window::GetText=" << m_combo.GetText() << std::endl;
+ return TRUE;
+ }
+
+ BOOL OnText(UINT msg, WPARAM wp, LPARAM lp)
+ {
+ std::cout << "Called OnText()" << std::endl;
+ std::cout << ":GetText=" << m_text.GetText() << std::endl;
return TRUE;
}
};