This commit is contained in:
varada%netscape.com 1999-05-19 03:31:11 +00:00
Родитель 098919412e
Коммит 6a4a2228b4
11 изменённых файлов: 281 добавлений и 31 удалений

Просмотреть файл

@ -127,4 +127,13 @@ void CImageDialog::ReadImageFromIniFile()
image.hBitmap = (HBITMAP)LoadImage(NULL, image.name, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE|LR_CREATEDIBSECTION);
}
}
void CImageDialog::OnHelp()
{
CWnd Mywnd;
Mywnd.MessageBox("hello","hello",MB_OK);
// TODO: Add your control notification handler code here
}

Просмотреть файл

@ -63,6 +63,8 @@ public:
IMAGE image;
void ReadImageFromIniFile();
void OnHelp();
protected:
// Generated message map functions

Просмотреть файл

@ -2,43 +2,52 @@
[General Info]
Version=1
LastClass=CProgressDialog
LastClass=CWizHelp
LastTemplate=CDialog
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "WizardMachine.h"
ClassCount=11
ClassCount=15
Class1=CWizardMachineApp
Class2=CWizardMachineDlg
Class3=CAboutDlg
ResourceCount=12
Resource1=IDD_ABOUTBOX
ResourceCount=16
Resource1=IDD_IMG_DLG
Resource2=IDR_MAINFRAME
Resource3=IDD_BASE_DIALOG
Resource4=IDD_CREATE_DIALOG
Resource3=IDD_NEW_DIALOG
Resource4=IDD_HELP_DLG
Class4=CWizardUI
Class5=CPropSheet
Resource5=IDD_WIZARDMACHINE_DIALOG
Resource5=IDD_CREATE_DIALOG
Class6=CImageDialog
Class7=CNavText
Resource6=IDD_IMAGE_DIALOG
Resource7=IDD_NEW_DIALOG
Resource8=IDD_DIALOG112
Resource9=IDD_DIALOG1
Resource6=IDD_WIZARDMACHINE_DIALOG
Resource7=IDD_DIALOG112
Resource8=IDD_ABOUTBOX
Resource9=IDD_PROGRESS_DLG
Class8=CProgressDialog
Class9=CProgDlgThread
Resource10=IDD_PROGRESS_DLG
Resource10=IDD_DIALOG1
Class10=CCreateDialog
Resource11=IDD_NEWCONFIG_DIALOG
Class11=CNewDialog
Class12=CHelpDlg
Class13=CImgDlg
Resource12=1536
Resource13=IDD_IMAGE_DIALOG
Resource14=IDD_SUMMARY
Class14=CSumDlg
Resource15=IDD_BASE_DIALOG
Class15=CWizHelp
Resource16=IDD_WIZ_HELP
[CLS:CWizardMachineApp]
Type=0
HeaderFile=WizardMachine.h
ImplementationFile=WizardMachine.cpp
Filter=N
LastObject=CWizardMachineApp
[CLS:CWizardMachineDlg]
Type=0
@ -54,6 +63,7 @@ Type=0
HeaderFile=WizardMachineDlg.h
ImplementationFile=WizardMachineDlg.cpp
Filter=D
LastObject=CAboutDlg
[DLG:IDD_ABOUTBOX]
Type=1
@ -97,6 +107,7 @@ LastObject=CPropSheet
[DLG:1536]
Type=1
Class=?
ControlCount=7
Control1=1120,listbox,1084297299
Control2=65535,static,1342308352
@ -109,8 +120,9 @@ Control7=IDCANCEL,button,1342373888
[DLG:IDD_IMAGE_DIALOG]
Type=1
Class=CImageDialog
ControlCount=1
ControlCount=2
Control1=IDCANCEL,button,1342242816
Control2=IDC_BUTTON1,button,1342242816
[CLS:CImageDialog]
Type=0
@ -132,6 +144,7 @@ LastObject=CNavText
[DLG:IDD_NEWCONFIG_DIALOG]
Type=1
Class=?
ControlCount=5
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
@ -141,6 +154,7 @@ Control5=IDC_STATIC,static,1342308352
[DLG:IDD_DIALOG112]
Type=1
Class=?
ControlCount=5
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
@ -172,12 +186,6 @@ BaseClass=CWinThread
Filter=N
LastObject=CProgDlgThread
[DLG:IDD_DIALOG1]
Type=1
ControlCount=2
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
[DLG:IDD_CREATE_DIALOG]
Type=1
Class=CCreateDialog
@ -211,3 +219,73 @@ Filter=D
LastObject=CNewDialog
VirtualFilter=dWC
[DLG:IDD_IMG_DLG]
Type=1
Class=CImgDlg
ControlCount=2
Control1=IDC_HELP_BUTTON,button,1342242817
Control2=IDCANCEL,button,1342242816
[CLS:CImgDlg]
Type=0
HeaderFile=ImgDlg.h
ImplementationFile=ImgDlg.cpp
BaseClass=CDialog
Filter=D
VirtualFilter=dWC
LastObject=CImgDlg
[DLG:IDD_HELP_DLG]
Type=1
Class=CHelpDlg
ControlCount=2
Control1=IDCANCEL,button,1342242816
Control2=IDC_EDIT1,edit,1353779332
[DLG:IDD_DIALOG1]
Type=1
Class=?
ControlCount=2
Control1=IDOK,button,1342242817
Control2=IDCANCEL,button,1342242816
[CLS:CHelpDlg]
Type=0
HeaderFile=HelpDlg.h
ImplementationFile=HelpDlg.cpp
BaseClass=CDialog
Filter=D
VirtualFilter=dWC
LastObject=CHelpDlg
[DLG:IDD_SUMMARY]
Type=1
Class=CSumDlg
ControlCount=2
Control1=IDCANCEL,button,1342242816
Control2=IDC_EDIT1,edit,1353779396
[CLS:CSumDlg]
Type=0
HeaderFile=SumDlg.h
ImplementationFile=SumDlg.cpp
BaseClass=CDialog
Filter=D
VirtualFilter=dWC
LastObject=IDC_EDIT1
[DLG:IDD_WIZ_HELP]
Type=1
Class=CWizHelp
ControlCount=1
Control1=IDCANCEL,button,1342242816
[CLS:CWizHelp]
Type=0
HeaderFile=WizHelp.h
ImplementationFile=WizHelp.cpp
BaseClass=CDialog
Filter=D
VirtualFilter=dWC
LastObject=CWizHelp

Просмотреть файл

@ -26,6 +26,8 @@
#include <stdlib.h>
#include <string.h>
#include <direct.h>
#include "HelpDlg.h"
#include "WizHelp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@ -38,10 +40,10 @@ static char THIS_FILE[] = __FILE__;
BEGIN_MESSAGE_MAP(CWizardMachineApp, CWinApp)
//{{AFX_MSG_MAP(CWizardMachineApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// NOTE - the Class\ard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
ON_COMMAND(ID_HELP, CWizardMachineApp::HelpWiz)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@ -262,8 +264,11 @@ BOOL CWizardMachineApp::InitInstance()
if (PageReturnValue == IDCANCEL)
{
theApp.CreateNewCache();
// theApp.CreateNewCache();
// CWnd Mywnd;
// Mywnd.MessageBox("hello","hello",MB_OK);
theApp.CreateNewCache();
/**
NODE* tmpNode = WizardTree->childNodes[0];
while (!tmpNode->numWidgets) {
@ -273,7 +278,21 @@ BOOL CWizardMachineApp::InitInstance()
CurrentNode = tmpNode;
**/
}
if (PageReturnValue == ID_HELP)
{
CWnd Mywnd;
Mywnd.MessageBox("hello","hello",MB_OK);
/**
NODE* tmpNode = WizardTree->childNodes[0];
while (!tmpNode->numWidgets) {
tmpNode = tmpNode->childNodes[0];
}
CurrentNode = tmpNode;
**/
}
//
//CreateNewCache();
@ -316,6 +335,7 @@ NODE* CWizardMachineApp::CreateNode(NODE *parentNode, CString iniFile)
CStringArray bufferArray;
NODE* NewNode = (NODE *) GlobalAlloc(0,sizeof(NODE) * 1);
NewNode->parent = parentNode;
iniFile = CString(iniFilePath)+iniFile; //Path+iniFile;
@ -1255,6 +1275,101 @@ void CWizardMachineApp::BuildWidget(WIDGET* aWidget, CString iniSection, CString
}
}
/*
void CWizardMachineApp::BuildHelpWidget(WIDGET* aWidget, CString iniSection, CString iniFile, int pageBaseIndex)
{
static int idCounter = 0;
char buffer[MAX_SIZE] = {'\0'};
char largeBuffer[EXTD_MAX_SIZE] = {'\0'};
idCounter++;
GetPrivateProfileString(iniSection, "Name", "", buffer, MAX_SIZE, iniFile);
aWidget->name = buffer;
GetPrivateProfileString(iniSection, "Type", "", buffer, MAX_SIZE, iniFile);
aWidget->type = buffer;
GetPrivateProfileString(iniSection, "Options", "", buffer, MAX_SIZE, iniFile);
aWidget->items = buffer;
GetPrivateProfileString(iniSection, "Value", "", largeBuffer, EXTD_MAX_SIZE, iniFile);
aWidget->value = largeBuffer;
aWidget->value.TrimRight();
GetPrivateProfileString(iniSection, "Title", "", buffer, MAX_SIZE, iniFile);
aWidget->title = buffer;
GetPrivateProfileString(iniSection, "Group", "", buffer, MAX_SIZE, iniFile);
aWidget->group = buffer;
GetPrivateProfileString(iniSection, "Target", "", buffer, MAX_SIZE, iniFile);
aWidget->target = buffer;
GetPrivateProfileString(iniSection, "Start_x", "", buffer, MAX_SIZE, iniFile);
aWidget->location.x = atoi(buffer);
GetPrivateProfileString(iniSection, "Start_y", "", buffer, MAX_SIZE, iniFile);
aWidget->location.y = atoi(buffer);
//aWidget->size = new DIMENSION;
GetPrivateProfileString(iniSection, "Width", "", buffer, MAX_SIZE, iniFile);
aWidget->size.width = atoi(buffer);
GetPrivateProfileString(iniSection, "Height", "", buffer, MAX_SIZE, iniFile);
aWidget->size.height = atoi(buffer);
GetPrivateProfileString(iniSection, "dll", "", buffer, MAX_SIZE, iniFile);
aWidget->action.dll = buffer;
GetPrivateProfileString(iniSection, "function", "", buffer, MAX_SIZE, iniFile);
aWidget->action.function = buffer;
GetPrivateProfileString(iniSection, "parameters", "", buffer, MAX_SIZE, iniFile);
strcpy(aWidget->action.parameters, buffer);
/// Dynamic ID allocation
aWidget->widgetID = pageBaseIndex + idCounter;
// As the number of entries in the subsection are not known, a generic loop
// has been created to read all existing name/value pairs in the subsection
// and store them in the options component of the control.
GetPrivateProfileString(iniSection, "subsection", "", buffer, MAX_SIZE, iniFile);
if (strcmp(buffer, "") != 0) {
char* subSection;
subSection = new char[sizeof(buffer)];
strcpy(subSection, buffer);
if (aWidget->action.function == "")
{
int counter = 0;
int i = 0;
char* ComponentKey;
char ComponentKeyBuffer[MAX_SIZE];
if (GetPrivateProfileString(subSection, NULL, "", buffer, MAX_SIZE, iniFile) > 0)
{
while (buffer[i] != 0)
{
ComponentKey = &buffer[i];
if (GetPrivateProfileString(subSection, ComponentKey, "", ComponentKeyBuffer, MAX_SIZE, iniFile) > 0)
{
aWidget->options.name[counter] = new char[sizeof(ComponentKey)];
strcpy(aWidget->options.name[counter],ComponentKey);
aWidget->options.value[counter] = new char[sizeof(ComponentKeyBuffer)];
strcpy(aWidget->options.value[counter],ComponentKeyBuffer);
counter++;
}
while (buffer[i] != 0)
i++;
i++;
}
}
aWidget->numOfOptions = counter;
}
else {
aWidget->numOfOptions = 0;
}
}
}
*/
void CWizardMachineApp::GenerateList(CString action, WIDGET* targetWidget, CString parentDirPath)
{
WIDGET* curWidget = targetWidget;
@ -1318,4 +1433,10 @@ void CWizardMachineApp::GenerateList(CString action, WIDGET* targetWidget, CStri
fileList.Close();
}
void CWizardMachineApp::HelpWiz()
{
CWizHelp hlpdlg;
hlpdlg.DoModal();
}

Просмотреть файл

@ -175,8 +175,9 @@ public:
CString GetGlobalOptions(CString theName);
WIDGET* findWidget(char *name);
void BuildWidget(WIDGET* aWidget, CString iniSection, CString iniFile, int pageBaseIndex, BOOL readValue);
// void BuildHelpWidget(WIDGET* aWidget, CString iniSection, CString iniFile, int pageBaseIndex);
void GenerateList(CString action, WIDGET* targetWidget, CString ext);
void HelpWiz();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWizardMachineApp)

Двоичные данные
cck/driver/WizardMachine.mdp

Двоичный файл не отображается.

Двоичные данные
cck/driver/WizardMachine.ncb

Двоичный файл не отображается.

Просмотреть файл

@ -21,7 +21,8 @@
#include "stdafx.h"
#include "WizardMachine.h"
#include "ImageDialog.h"
//#include "ImageDialog.h"
#include "ImgDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@ -139,6 +140,16 @@ BOOL CWizardMachineDlg::OnInitDialog()
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
// Hide "Help" button
// CWnd* pWnd = GetDlgItem(IDHELP);
// ASSERT_VALID(pWnd);
// pWnd = GetDlgItem(IDHELP);
// ASSERT_VALID(pWnd);
// if (pWnd)
// {
// pWnd->ShowWindow(SW_HIDE);
// }
return TRUE; // return TRUE unless you set the focus to a control
}
@ -325,3 +336,4 @@ in the ChangeTextColor() function
return hbr;
}

Просмотреть файл

@ -23,7 +23,9 @@
#include "stdafx.h"
#include "WizardMachine.h"
#include "fstream.h"
#include "ImageDialog.h"
//#include "ImageDialog.h"
#include "ImgDlg.h"
#include "SumDlg.h"
#include "NavText.h"
#include "NewDialog.h"
#include "NewConfigDialog.h"
@ -104,7 +106,8 @@ END_MESSAGE_MAP()
BOOL CWizardUI::OnSetActive()
{
if (!(CurrentNode->isWidgetsSorted)) {
if (!(CurrentNode->isWidgetsSorted)) {
SortWidgetsForTabOrder();
}
@ -135,6 +138,7 @@ BOOL CWizardUI::OnSetActive()
}
// TODO: Add your specialized code here and/or call the base class
// SetModified(1);
return CPropertyPage::OnSetActive();
}
@ -497,9 +501,19 @@ BOOL CWizardUI::OnCommand(WPARAM wParam, LPARAM lParam)
}
else if (curWidget->action.function == "DisplayImage") {
// This is to dsiplay an image in a separate dialog
CImageDialog imgDlg(curWidget->action.parameters);
CImgDlg imgDlg(curWidget->action.parameters);
int retVal = imgDlg.DoModal();
}
else if (curWidget->action.function == "ShowSum") {
// This is to see if this works
// CWnd Mywnd;
// Mywnd.MessageBox("hello","hello",MB_OK);
CSumDlg sumdlg;
int retVal = sumdlg.DoModal();
}
else if (curWidget->action.function == "BrowseFile") {
// This is to browse to a file
CFileDialog fileDlg(TRUE, NULL, NULL, OFN_OVERWRITEPROMPT, NULL, NULL);
@ -1297,3 +1311,10 @@ BOOL CWizardUI::OnWizardFinish()
return CPropertyPage::OnWizardFinish();
}
BOOL CWizardUI::OnApply()
{
// TODO: Add your specialized code here and/or call the base class
return CPropertyPage::OnApply();
}

Просмотреть файл

@ -32,7 +32,7 @@ class CWizardUI : public CPropertyPage
public:
CWizardUI();
~CWizardUI();
// void SetModified(BOOL how =TRUE);
// Dialog Data
//{{AFX_DATA(CWizardUI)
@ -51,6 +51,7 @@ public:
virtual LRESULT OnWizardBack();
virtual LRESULT OnWizardNext();
virtual BOOL OnWizardFinish();
virtual BOOL OnApply();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);

Просмотреть файл

@ -14,6 +14,7 @@
#define IDD_DIALOG1 137
#define IDD_CREATE_DIALOG 138
#define IDD_NEW_DIALOG 140
#define IDD_IMG_DLG 141
#define IDD_PROGRESS_DLG 146
#define IDD_DIALOG112 153
#define IDD_NEWCONFIG_DIALOG 159
@ -21,17 +22,21 @@
#define IDC_EDIT1 1001
#define IDC_TITLE_TEXT 1003
#define IDC_BASE_TEXT 1004
#define IDC_HELP_BUTTON 1005
#define IDC_BUTTON1 1007
#define IDC_PROGRESS1 1036
#define IDC_PROGESSTEXT_STATIC 1037
#define IDD_HELP_DLG 1537
#define IDD_SUMMARY 1538
#define IDD_WIZ_HELP 1539
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 141
#define _APS_NEXT_RESOURCE_VALUE 142
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1005
#define _APS_NEXT_CONTROL_VALUE 1007
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif