2 |
|
// |
3 |
|
// Douglas Thrift |
4 |
|
// |
5 |
< |
// $Id: ScanUtility.cxx,v 1.2 2003/08/17 03:55:39 douglas Exp $ |
5 |
> |
// $Id: ScanUtility.cxx,v 1.3 2003/08/19 04:39:38 douglas Exp $ |
6 |
|
|
7 |
|
#include "ScanUtility.h" |
8 |
|
|
9 |
+ |
ScanUtility::ScanUtility() |
10 |
+ |
{ |
11 |
+ |
number = count++; |
12 |
+ |
utilities.insert(pair<unsigned, ScanUtility*>(number, this)); |
13 |
+ |
title = new char[programName.length() + 16]; |
14 |
+ |
|
15 |
+ |
sprintf(title, "%s - Scan Utility", programName.c_str()); |
16 |
+ |
|
17 |
+ |
PROPSHEETPAGE page; |
18 |
+ |
|
19 |
+ |
// start |
20 |
+ |
page.dwSize = sizeof(page); |
21 |
+ |
page.dwFlags = PSP_DEFAULT | PSP_USEHICON | PSP_USETITLE | |
22 |
+ |
PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; |
23 |
+ |
page.hInstance = gui.instance; |
24 |
+ |
page.pszTemplate = MAKEINTRESOURCE(IDD_SCAN_START); |
25 |
+ |
page.hIcon = gui.icon; |
26 |
+ |
page.pszTitle = title; |
27 |
+ |
page.pfnDlgProc = start; |
28 |
+ |
page.lParam = number; |
29 |
+ |
page.pszHeaderTitle = "Start"; |
30 |
+ |
page.pszHeaderSubTitle = "Change any settings before scanning."; |
31 |
+ |
|
32 |
+ |
wizard[0] = CreatePropertySheetPage(&page); |
33 |
+ |
} |
34 |
+ |
|
35 |
+ |
ScanUtility::~ScanUtility() |
36 |
+ |
{ |
37 |
+ |
utilities.erase(number); |
38 |
+ |
delete [] title; |
39 |
+ |
} |
40 |
+ |
|
41 |
|
void ScanUtility::run(void) |
42 |
|
{ |
43 |
< |
multimap<unsigned, string> clients; |
43 |
> |
PROPSHEETHEADER header; |
44 |
|
|
45 |
< |
clients.insert(pair<unsigned, string>(12345, "Thrift, Douglas W.")); |
46 |
< |
clients.insert(pair<unsigned, string>(123, "McConica, John")); |
47 |
< |
clients.insert(pair<unsigned, string>(456, "MacDonald, Joe")); |
48 |
< |
clients.insert(pair<unsigned, string>(789, "O'Neil, Paul")); |
49 |
< |
clients.insert(pair<unsigned, string>(100, "Haley, Robert Jr.")); |
50 |
< |
clients.insert(pair<unsigned, string>(99, "Haley, Robert Sr.")); |
51 |
< |
clients.insert(pair<unsigned, string>(567, "Woodburn, Douglas II.")); |
52 |
< |
clients.insert(pair<unsigned, string>(567, "Woodburn, Douglas III.")); |
53 |
< |
clients.insert(pair<unsigned, string>(897, "De Groote, Fred IV.")); |
45 |
> |
// header |
46 |
> |
header.dwSize = sizeof(header); |
47 |
> |
header.dwFlags = PSH_DEFAULT | PSH_USEICONID | PSH_WIZARD97; |
48 |
> |
header.hwndParent = NULL; |
49 |
> |
header.hInstance = gui.instance; |
50 |
> |
header.pszIcon = MAKEINTRESOURCE(IDI_VTB_ICON); |
51 |
> |
header.nPages = 1; |
52 |
> |
header.nStartPage = 0; |
53 |
> |
header.phpage = wizard; |
54 |
|
|
55 |
< |
for (multimap<unsigned, string>::iterator itor = clients.begin(); itor != |
56 |
< |
clients.end(); itor++) |
57 |
< |
{ |
58 |
< |
IndividualClient client; |
55 |
> |
PropertySheet(&header); |
56 |
> |
} |
57 |
> |
|
58 |
> |
unsigned ScanUtility::count = 0; |
59 |
> |
map<unsigned, ScanUtility*> ScanUtility::utilities; |
60 |
> |
map<HWND, ScanUtility*> ScanUtility::windows; |
61 |
|
|
62 |
< |
client.setNumber(itor->first); |
63 |
< |
client.setName(itor->second); |
64 |
< |
client.setFile(client.getFile()); |
62 |
> |
INT_PTR ScanUtility::start(HWND dialog, UINT msg, WPARAM w, LPARAM l) |
63 |
> |
{ |
64 |
> |
map<HWND, ScanUtility*>::iterator itor = windows.find(dialog); |
65 |
> |
ScanUtility* data = itor->second; |
66 |
|
|
67 |
< |
cout << client.getName() << "\n" |
68 |
< |
<< client.getNumber() << "\n"; |
67 |
> |
switch (msg) |
68 |
> |
{ |
69 |
> |
case WM_INITDIALOG: |
70 |
> |
{ |
71 |
> |
map<unsigned, ScanUtility*>::iterator itor = utilities.find(l); |
72 |
> |
|
73 |
> |
windows.insert(pair<HWND, ScanUtility*>(dialog, itor->second)); |
74 |
> |
} |
75 |
> |
break; |
76 |
|
} |
77 |
+ |
|
78 |
+ |
return FALSE; |
79 |
|
} |