summaryrefslogtreecommitdiff
path: root/src/test/w32dtst.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/w32dtst.cpp')
-rw-r--r--src/test/w32dtst.cpp59
1 files changed, 50 insertions, 9 deletions
diff --git a/src/test/w32dtst.cpp b/src/test/w32dtst.cpp
index 5f14a6d..663c63d 100644
--- a/src/test/w32dtst.cpp
+++ b/src/test/w32dtst.cpp
@@ -36,16 +36,8 @@ public:
, m_loadbut(this,IDLOADBUT)
, m_save(this,IDSAVETXT)
, m_savebut(this,IDSAVEBUT)
+ , m_combo(this,IDCOMBO)
{
- AddControl(&m_text);
- AddControl(&m_check);
- AddControl(&m_button);
- AddControl(&m_quit);
- AddControl(&m_load);
- AddControl(&m_loadbut);
- AddControl(&m_save);
- AddControl(&m_savebut);
-
m_button.OnPress
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnButton));
m_quit.OnPress
@@ -57,6 +49,13 @@ public:
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnLoad));
m_savebut.OnPress
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnSave));
+
+ m_combo.OnSelection
+ (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnComboSel));
+ m_combo.OnDoubleClick
+ (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnComboDbl));
+ m_combo.OnTextChanged
+ (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnComboTxt));
}
virtual ~Test()
@@ -74,6 +73,16 @@ public:
m_text.SetText("Hello");
m_check.SetState(W32DLib::AutoCheck::eChecked);
m_quit.Enable(true);
+
+ m_combo.Reset();
+ std::cout << "addstring=" << m_combo.AddString("Entry 1") << std::endl;
+ std::cout << "addstring=" << m_combo.AddString("Entry 2") << std::endl;
+ std::cout << "addstring=" << m_combo.AddString("Entry 3") << std::endl;
+
+ std::cout << "count=" << m_combo.Count() << std::endl;
+ std::cout << "HWND=" << m_combo.GetHWND() << std::endl;
+
+ m_combo.SelectedIndex(2);
}
private:
@@ -89,6 +98,8 @@ private:
W32DLib::Text m_save;
W32DLib::Button m_savebut;
+ W32DLib::ComboBox m_combo;
+
std::string m_loadpath;
std::string m_savepath;
@@ -108,6 +119,7 @@ private:
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());
return TRUE;
}
@@ -147,6 +159,35 @@ private:
return TRUE;
}
+
+ BOOL OnComboSel(UINT msg, WPARAM wp, LPARAM lp)
+ {
+ int sel=m_combo.SelectedIndex();
+ std::string str=m_combo.GetString(sel);
+
+ 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;
+ return TRUE;
+ }
+
+ BOOL OnComboDbl(UINT msg, WPARAM wp, LPARAM lp)
+ {
+ int sel=m_combo.SelectedIndex();
+ std::string str=m_combo.GetString(sel);
+
+ 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;
+ 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;
+ return TRUE;
+ }
};
int WINAPI WinMain (HINSTANCE hInstance,