summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/dialog.rc13
-rw-r--r--src/test/w32dtst.cpp20
2 files changed, 28 insertions, 5 deletions
diff --git a/src/test/dialog.rc b/src/test/dialog.rc
index 8207c9f..233389c 100644
--- a/src/test/dialog.rc
+++ b/src/test/dialog.rc
@@ -1,7 +1,7 @@
#include <windows.h>
#include "dialog.h"
-TESTDLG DIALOG 10, 10, 500, 300
+TESTDLG DIALOG 10, 10, 500, 340
STYLE WS_POPUP | WS_BORDER
CAPTION "Test Dialog"
FONT 8,"MS Shell Dlg"
@@ -17,11 +17,14 @@ TESTDLG DIALOG 10, 10, 500, 300
EDITTEXT IDSAVETXT, 10, 140, 200, 12, ES_READONLY
PUSHBUTTON "Save ...",IDSAVEBUT, 10, 155, 100, 18
- COMBOBOX IDCOMBO, 10, 180, 100, 100, CBS_SIMPLE | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDDIRTXT, 10, 180, 200, 12, ES_READONLY
+ PUSHBUTTON "Dir ...",IDDIRBUT, 10, 195, 100, 18
- AUTORADIOBUTTON "Radio 1", IDRADIO1, 120, 180, 100, 18
- AUTORADIOBUTTON "Radio 2", IDRADIO2, 120, 200, 100, 18
- AUTORADIOBUTTON "Radio 3", IDRADIO3, 120, 220, 100, 18
+ COMBOBOX IDCOMBO, 10, 220, 100, 100, CBS_SIMPLE | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+
+ AUTORADIOBUTTON "Radio 1", IDRADIO1, 120, 220, 100, 18
+ AUTORADIOBUTTON "Radio 2", IDRADIO2, 120, 240, 100, 18
+ AUTORADIOBUTTON "Radio 3", IDRADIO3, 120, 260, 100, 18
LTEXT "Text:", IDSTATIC1, 210, 10, 35, 12
EDITTEXT IDTEXT, 250, 10, 100, 100, ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_MULTILINE | ES_WANTRETURN
diff --git a/src/test/w32dtst.cpp b/src/test/w32dtst.cpp
index e3a55cf..94245ba 100644
--- a/src/test/w32dtst.cpp
+++ b/src/test/w32dtst.cpp
@@ -44,6 +44,8 @@ public:
, m_loadbut(this,IDLOADBUT,0)
, m_save(this,IDSAVETXT,0)
, m_savebut(this,IDSAVEBUT,0)
+ , m_dir(this,IDDIRTXT,0)
+ , m_dirbut(this,IDDIRBUT,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)
@@ -63,6 +65,8 @@ public:
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnLoad));
m_savebut.OnPress
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnSave));
+ m_dirbut.OnPress
+ (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnDir));
m_combo.OnSelection
(this,static_cast<W32DLib::W32DLibCallback>(&Test::OnComboSel));
@@ -137,6 +141,9 @@ private:
W32DLib::Text m_save;
W32DLib::Button m_savebut;
+ W32DLib::Text m_dir;
+ W32DLib::Button m_dirbut;
+
W32DLib::ComboBox m_combo;
W32DLib::RadioButton m_radio1;
@@ -145,6 +152,7 @@ private:
std::string m_loadpath;
std::string m_savepath;
+ std::string m_dirpath;
BOOL OnQuit(UINT msg, WPARAM wp, LPARAM lp)
{
@@ -231,6 +239,18 @@ private:
return TRUE;
}
+ BOOL OnDir(UINT msg, WPARAM wp, LPARAM lp)
+ {
+ if (W32DLib::Common::SelectDir(this->GetHWND(),
+ "Select a directory",
+ m_dirpath))
+ {
+ m_dir.SetText(m_dirpath);
+ }
+
+ return TRUE;
+ }
+
BOOL OnComboSel(UINT msg, WPARAM wp, LPARAM lp)
{
int sel=m_combo.SelectedIndex();