aboutsummaryrefslogtreecommitdiff
path: root/CPP/Windows/Control
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/Windows/Control')
-rw-r--r--CPP/Windows/Control/Dialog.cpp1
-rw-r--r--CPP/Windows/Control/Dialog.h19
-rw-r--r--CPP/Windows/Control/PropertyPage.cpp4
3 files changed, 22 insertions, 2 deletions
diff --git a/CPP/Windows/Control/Dialog.cpp b/CPP/Windows/Control/Dialog.cpp
index c8f1bd2..cbb000b 100644
--- a/CPP/Windows/Control/Dialog.cpp
+++ b/CPP/Windows/Control/Dialog.cpp
@@ -93,6 +93,7 @@ bool CDialog::OnButtonClicked(unsigned buttonID, HWND /* buttonHWND */)
93 case IDOK: OnOK(); break; 93 case IDOK: OnOK(); break;
94 case IDCANCEL: OnCancel(); break; 94 case IDCANCEL: OnCancel(); break;
95 case IDCLOSE: OnClose(); break; 95 case IDCLOSE: OnClose(); break;
96 case IDCONTINUE: OnContinue(); break;
96 case IDHELP: OnHelp(); break; 97 case IDHELP: OnHelp(); break;
97 default: return false; 98 default: return false;
98 } 99 }
diff --git a/CPP/Windows/Control/Dialog.h b/CPP/Windows/Control/Dialog.h
index 06be4bf..2510c8f 100644
--- a/CPP/Windows/Control/Dialog.h
+++ b/CPP/Windows/Control/Dialog.h
@@ -8,6 +8,10 @@
8namespace NWindows { 8namespace NWindows {
9namespace NControl { 9namespace NControl {
10 10
11#ifndef IDCONTINUE
12#define IDCONTINUE 11
13#endif
14
11class CDialog: public CWindow 15class CDialog: public CWindow
12{ 16{
13 // Z7_CLASS_NO_COPY(CDialog) 17 // Z7_CLASS_NO_COPY(CDialog)
@@ -64,14 +68,26 @@ public:
64 return window.GetText(s); 68 return window.GetText(s);
65 } 69 }
66 70
71/*
67 bool SetItemInt(unsigned itemID, UINT value, bool isSigned) 72 bool SetItemInt(unsigned itemID, UINT value, bool isSigned)
68 { return BOOLToBool(SetDlgItemInt(_window, (int)itemID, value, BoolToBOOL(isSigned))); } 73 { return BOOLToBool(SetDlgItemInt(_window, (int)itemID, value, BoolToBOOL(isSigned))); }
74*/
75 bool SetItemUInt(unsigned itemID, UINT value)
76 { return BOOLToBool(SetDlgItemInt(_window, (int)itemID, value, FALSE)); }
77/*
69 bool GetItemInt(unsigned itemID, bool isSigned, UINT &value) 78 bool GetItemInt(unsigned itemID, bool isSigned, UINT &value)
70 { 79 {
71 BOOL result; 80 BOOL result;
72 value = GetDlgItemInt(_window, (int)itemID, &result, BoolToBOOL(isSigned)); 81 value = GetDlgItemInt(_window, (int)itemID, &result, BoolToBOOL(isSigned));
73 return BOOLToBool(result); 82 return BOOLToBool(result);
74 } 83 }
84*/
85 bool GetItemUInt(unsigned itemID, UINT &value)
86 {
87 BOOL result;
88 value = GetDlgItemInt(_window, (int)itemID, &result, FALSE);
89 return BOOLToBool(result);
90 }
75 91
76 HWND GetNextGroupItem(HWND control, bool previous) 92 HWND GetNextGroupItem(HWND control, bool previous)
77 { return GetNextDlgGroupItem(_window, control, BoolToBOOL(previous)); } 93 { return GetNextDlgGroupItem(_window, control, BoolToBOOL(previous)); }
@@ -126,6 +142,7 @@ public:
126 142
127 virtual bool OnButtonClicked(unsigned buttonID, HWND buttonHWND); 143 virtual bool OnButtonClicked(unsigned buttonID, HWND buttonHWND);
128 virtual void OnOK() {} 144 virtual void OnOK() {}
145 virtual void OnContinue() {}
129 virtual void OnCancel() {} 146 virtual void OnCancel() {}
130 virtual void OnClose() {} 147 virtual void OnClose() {}
131 virtual bool OnNotify(UINT /* controlID */, LPNMHDR /* lParam */) { return false; } 148 virtual bool OnNotify(UINT /* controlID */, LPNMHDR /* lParam */) { return false; }
@@ -157,6 +174,7 @@ public:
157 bool Create(LPCWSTR templateName, HWND parentWindow); 174 bool Create(LPCWSTR templateName, HWND parentWindow);
158 #endif 175 #endif
159 virtual void OnOK() Z7_override { Destroy(); } 176 virtual void OnOK() Z7_override { Destroy(); }
177 virtual void OnContinue() Z7_override { Destroy(); }
160 virtual void OnCancel() Z7_override { Destroy(); } 178 virtual void OnCancel() Z7_override { Destroy(); }
161 virtual void OnClose() Z7_override { Destroy(); } 179 virtual void OnClose() Z7_override { Destroy(); }
162}; 180};
@@ -172,6 +190,7 @@ public:
172 190
173 bool End(INT_PTR result) { return BOOLToBool(::EndDialog(_window, result)); } 191 bool End(INT_PTR result) { return BOOLToBool(::EndDialog(_window, result)); }
174 virtual void OnOK() Z7_override { End(IDOK); } 192 virtual void OnOK() Z7_override { End(IDOK); }
193 virtual void OnContinue() Z7_override { End(IDCONTINUE); }
175 virtual void OnCancel() Z7_override { End(IDCANCEL); } 194 virtual void OnCancel() Z7_override { End(IDCANCEL); }
176 virtual void OnClose() Z7_override { End(IDCLOSE); } 195 virtual void OnClose() Z7_override { End(IDCLOSE); }
177}; 196};
diff --git a/CPP/Windows/Control/PropertyPage.cpp b/CPP/Windows/Control/PropertyPage.cpp
index f8effe6..9b36cbe 100644
--- a/CPP/Windows/Control/PropertyPage.cpp
+++ b/CPP/Windows/Control/PropertyPage.cpp
@@ -141,7 +141,7 @@ INT_PTR MyPropertySheet(const CObjectVector<CPageInfo> &pagesInfo, HWND hwndPare
141 sheet.pszCaption = titleA; 141 sheet.pszCaption = titleA;
142 sheet.nPages = pagesA.Size(); 142 sheet.nPages = pagesA.Size();
143 sheet.nStartPage = 0; 143 sheet.nStartPage = 0;
144 sheet.ppsp = (LPCPROPSHEETPAGEA)(const void *)&pagesA.Front(); 144 sheet.ppsp = (LPCPROPSHEETPAGEA)(const void *)pagesA.ConstData();
145 sheet.pfnCallback = NULL; 145 sheet.pfnCallback = NULL;
146 return ::PropertySheetA(&sheet); 146 return ::PropertySheetA(&sheet);
147 } 147 }
@@ -156,7 +156,7 @@ INT_PTR MyPropertySheet(const CObjectVector<CPageInfo> &pagesInfo, HWND hwndPare
156 sheet.pszCaption = title; 156 sheet.pszCaption = title;
157 sheet.nPages = pagesW.Size(); 157 sheet.nPages = pagesW.Size();
158 sheet.nStartPage = 0; 158 sheet.nStartPage = 0;
159 sheet.ppsp = (LPCPROPSHEETPAGEW)(const void *)&pagesW.Front(); 159 sheet.ppsp = (LPCPROPSHEETPAGEW)(const void *)pagesW.ConstData();
160 sheet.pfnCallback = NULL; 160 sheet.pfnCallback = NULL;
161 return ::PropertySheetW(&sheet); 161 return ::PropertySheetW(&sheet);
162 } 162 }