summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/.cvsignore3
-rw-r--r--src/test/dialog.h3
-rw-r--r--src/test/dialog.rc6
-rw-r--r--src/test/w32dtst.cpp79
4 files changed, 75 insertions, 16 deletions
diff --git a/src/test/.cvsignore b/src/test/.cvsignore
index 0ad1fae..f94fa70 100644
--- a/src/test/.cvsignore
+++ b/src/test/.cvsignore
@@ -1,2 +1,3 @@
depend.mak
-w32dtst.exe \ No newline at end of file
+w32dtst.exe
+debug.out \ No newline at end of file
diff --git a/src/test/dialog.h b/src/test/dialog.h
index 6789be0..d70c14c 100644
--- a/src/test/dialog.h
+++ b/src/test/dialog.h
@@ -22,3 +22,6 @@
#define IDPOPUP 22
#define IDPOPUP1 23
#define IDPOPUP2 24
+#define IDRADIO1 25
+#define IDRADIO2 26
+#define IDRADIO3 27
diff --git a/src/test/dialog.rc b/src/test/dialog.rc
index 0f36ecc..8207c9f 100644
--- a/src/test/dialog.rc
+++ b/src/test/dialog.rc
@@ -19,6 +19,10 @@ TESTDLG DIALOG 10, 10, 500, 300
COMBOBOX IDCOMBO, 10, 180, 100, 100, CBS_SIMPLE | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ AUTORADIOBUTTON "Radio 1", IDRADIO1, 120, 180, 100, 18
+ AUTORADIOBUTTON "Radio 2", IDRADIO2, 120, 200, 100, 18
+ AUTORADIOBUTTON "Radio 3", IDRADIO3, 120, 220, 100, 18
+
LTEXT "Text:", IDSTATIC1, 210, 10, 35, 12
EDITTEXT IDTEXT, 250, 10, 100, 100, ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_MULTILINE | ES_WANTRETURN
}
@@ -43,7 +47,7 @@ IDMENU MENU
IDPOPUP MENU
{
- POPUP "File"
+ POPUP "Popup?"
{
MENUITEM "Opt 1", IDPOPUP1
MENUITEM "Opt 2", IDPOPUP2
diff --git a/src/test/w32dtst.cpp b/src/test/w32dtst.cpp
index c06c5ce..e3a55cf 100644
--- a/src/test/w32dtst.cpp
+++ b/src/test/w32dtst.cpp
@@ -29,19 +29,25 @@
class Test : public W32DLib::Dialog
{
public:
- Test() : m_check_data(W32DLib::DataX::eBool)
- , m_combo_data(W32DLib::DataX::eInt)
- , m_text_data(W32DLib::DataX::eString)
- , m_static(this,IDSTATIC1)
+ Test() : m_check_data(true)
+ , m_combo_data(2)
+ , m_text_data("Hello")
+ , m_radio1_data(true)
+ , m_radio2_data(false)
+ , m_radio3_data(false)
+ , m_static(this,IDSTATIC1,0)
, m_text(this,IDTEXT,&m_text_data)
, m_check(this,IDCHECK,&m_check_data)
- , m_button(this,IDBUTTON)
- , m_quit(this,IDQUIT)
- , m_load(this,IDLOADTXT)
- , m_loadbut(this,IDLOADBUT)
- , m_save(this,IDSAVETXT)
- , m_savebut(this,IDSAVEBUT)
+ , m_button(this,IDBUTTON,0)
+ , m_quit(this,IDQUIT,0)
+ , m_load(this,IDLOADTXT,0)
+ , m_loadbut(this,IDLOADBUT,0)
+ , m_save(this,IDSAVETXT,0)
+ , m_savebut(this,IDSAVEBUT,0)
, m_combo(this,IDCOMBO,&m_combo_data)
+ , m_radio1(this,IDRADIO1,IDRADIO1,IDRADIO3,&m_radio1_data)
+ , m_radio2(this,IDRADIO2,IDRADIO1,IDRADIO3,&m_radio2_data)
+ , m_radio3(this,IDRADIO3,IDRADIO1,IDRADIO3,&m_radio3_data)
{
m_button.OnPress
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnButton));
@@ -65,6 +71,13 @@ public:
m_combo.OnTextChanged
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnComboTxt));
+ m_radio1.OnPress
+ (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnRadio));
+ m_radio2.OnPress
+ (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnRadio));
+ m_radio3.OnPress
+ (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnRadio));
+
SetMenuProc
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnMenu));
}
@@ -95,14 +108,12 @@ public:
std::cout << "HWND=" << m_combo.GetHWND() << std::endl;
#ifdef DATAX_TEST
- m_text_data.Set("Hello");
- m_check_data.Set(true);
- m_combo_data.Set(2);
SetData();
#else
m_text.SetText("Hello");
m_check.SetState(W32DLib::AutoCheck::eChecked);
m_combo.SelectedIndex(2);
+ m_radio1.SetState();
#endif
}
@@ -110,6 +121,9 @@ private:
W32DLib::DataX m_check_data;
W32DLib::DataX m_combo_data;
W32DLib::DataX m_text_data;
+ W32DLib::DataX m_radio1_data;
+ W32DLib::DataX m_radio2_data;
+ W32DLib::DataX m_radio3_data;
W32DLib::StaticText m_static;
W32DLib::Text m_text;
@@ -125,6 +139,10 @@ private:
W32DLib::ComboBox m_combo;
+ W32DLib::RadioButton m_radio1;
+ W32DLib::RadioButton m_radio2;
+ W32DLib::RadioButton m_radio3;
+
std::string m_loadpath;
std::string m_savepath;
@@ -152,7 +170,18 @@ private:
m_static.SetText(txt);
SetText(txt+" [Title]");
m_combo.AddString(m_combo.GetText());
- m_text.AppendText(m_combo.GetText()+"\n");
+ m_text.AppendText(m_combo.GetText()+"\r\n");
+
+#ifdef DATAX_TEST
+ GetData();
+ m_radio1_data.Set(false);
+ m_radio2_data.Set(true);
+ m_radio3_data.Set(false);
+ SetData();
+#else
+ m_radio2.SetState();
+#endif
+
return TRUE;
}
@@ -261,6 +290,28 @@ private:
return TRUE;
}
+
+ BOOL OnRadio(UINT msg, WPARAM wp, LPARAM lp)
+ {
+#ifdef DATAX_TEST
+ GetData();
+ bool radio1=m_radio1_data.Bool();
+ bool radio2=m_radio2_data.Bool();
+ bool radio3=m_radio3_data.Bool();
+#else
+ bool radio1=m_radio1.GetState();
+ bool radio2=m_radio2.GetState();
+ bool radio3=m_radio3.GetState();
+#endif
+
+ std::cout << "OnRadio" << std::endl;
+
+ std::cout << "radio1=" << radio1 << std::endl;
+ std::cout << "radio2=" << radio2 << std::endl;
+ std::cout << "radio3=" << radio3 << std::endl;
+
+ return TRUE;
+ }
};
int WINAPI WinMain (HINSTANCE hInstance,