Adding new directory Wizard to form wizard.dll with cck specific functions and resources.

This commit is contained in:
varada%netscape.com 1999-11-08 21:49:18 +00:00
Родитель 9a7af075b2
Коммит 44b5ce4322
8 изменённых файлов: 721 добавлений и 0 удалений

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

@ -0,0 +1,113 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
// NewConfigDialog.cpp : implementation file
//
#include "stdafx.h"
#include "NewConfigDialog.h"
#include "globals.h"
#include <direct.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNewConfigDialog dialog
CNewConfigDialog::CNewConfigDialog(CWnd* pParent /*=NULL*/)
: CDialog(CNewConfigDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewConfigDialog)
m_NewConfig_field = _T("");
//}}AFX_DATA_INIT
}
void CNewConfigDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNewConfigDialog)
DDX_Text(pDX, IDC_EDIT1, m_NewConfig_field);
DDV_Config(pDX, m_NewConfig_field);
//}}AFX_DATA_MAP
}
void CNewConfigDialog::DDV_Config(CDataExchange* pDX, CString value)
{
if(pDX->m_bSaveAndValidate)
{
value.TrimRight();
if(value.IsEmpty())
{
CWnd nbox;
nbox.MessageBox("Please enter a Configuration Name" ,"Error",MB_ICONEXCLAMATION);
pDX->Fail();
}
newConfigName = value;
}
}
BEGIN_MESSAGE_MAP(CNewConfigDialog, CDialog)
//{{AFX_MSG_MAP(CNewConfigDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNewConfigDialog message handlers
BOOL CNewConfigDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CString DlgTitle = GetGlobal("DialogTitle");
if (!DlgTitle.IsEmpty())
{
SetWindowText(DlgTitle);
GetDlgItem(IDC_STATIC1)->SetWindowText("");
GetDlgItem(IDC_STATIC2)->SetWindowText("");
GetDlgItem(IDOK)->SetWindowText(DlgTitle);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CNewConfigDialog::OnOK()
{
// TODO: Add extra validation here
// UpdateData();
// newConfigName = m_NewConfig_field;
CDialog::OnOK();
}
CString CNewConfigDialog::GetConfigName()
{
return newConfigName;
}

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

@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
// NewConfigDialog.h : header file
//
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// CNewConfigDialog dialog
class CNewConfigDialog : public CDialog
{
// Construction
public:
CNewConfigDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CNewConfigDialog)
enum { IDD = IDD_NEWCONFIG_DIALOG };
CString m_NewConfig_field;
//}}AFX_DATA
CString GetConfigName();
void DDV_Config(CDataExchange* pDX, CString value);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNewConfigDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
CString newConfigName;
protected:
// Generated message map functions
//{{AFX_MSG(CNewConfigDialog)
virtual BOOL OnInitDialog();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

123
cck/wizard/NewDialog.cpp Normal file
Просмотреть файл

@ -0,0 +1,123 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
// NewDialog.cpp : implementation file
//
#include "stdafx.h"
#include "NewDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNewDialog dialog
CNewDialog::CNewDialog(CWnd* pParent /*=NULL*/)
: CDialog(CNewDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CNewDialog)
m_EditField = _T("");
//}}AFX_DATA_INIT
}
void CNewDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CNewDialog)
DDX_Text(pDX, IDC_EDIT1, m_EditField);
DDV_INIFile(pDX, m_EditField);
//}}AFX_DATA_MAP
}
void CNewDialog::DDV_INIFile(CDataExchange* pDX, CString value)
{
if(pDX->m_bSaveAndValidate)
{
value.TrimRight();
if(value.IsEmpty())
{
CWnd nbox;
nbox.MessageBox("Please enter a Configuration Name" ,"Error",MB_ICONEXCLAMATION);
pDX->Fail();
}
else if(value.Right(4) != ".nci")
value = value +".nci";
myData = value;
}
}
BEGIN_MESSAGE_MAP(CNewDialog, CDialog)
//{{AFX_MSG_MAP(CNewDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNewDialog message handlers
BOOL CNewDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CNewDialog::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::OnCommand(wParam, lParam);
}
void CNewDialog::OnOK()
{
// TODO: Add extra validation here
// UpdateData();
// myData = m_EditField;
CDialog::OnOK();
}
void CNewDialog::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
CString CNewDialog::GetData()
{
return myData;
}

65
cck/wizard/NewDialog.h Normal file
Просмотреть файл

@ -0,0 +1,65 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "resource.h"
// NewDialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CNewDialog dialog
class CNewDialog : public CDialog
{
// Construction
public:
CNewDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CNewDialog)
enum { IDD = IDD_NEW_DIALOG };
CString m_DataField;
CString m_EditField;
//}}AFX_DATA
CString myData;
CString GetData();
void DDV_INIFile(CDataExchange* pDX, CString value);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNewDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CNewDialog)
virtual BOOL OnInitDialog();
virtual void OnOK();
virtual void OnCancel();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};

87
cck/wizard/makefile.win Normal file
Просмотреть файл

@ -0,0 +1,87 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..\..
include <$(DEPTH)\config\config.mak>
LIBRARY_NAME=wizard
MODULE=wizard
MAPFILE = $(MODULE).map
RESFILE = wizard.res
OBJS= \
.\$(OBJDIR)\NewConfigDialog.obj \
.\$(OBJDIR)\NewDialog.obj \
.\$(OBJDIR)\wizard.obj \
$(NULL)
LINCS= $(LINCS) \
-I..\include \
-I$(DIST)\$(OBJDIR)\include \
-I$(DEPTH)\xpinstall\wizard\windows\setup \
$(NULL)
MAKE_OBJ_TYPE = DLL
DLLNAME =wizard
DLL=.\$(OBJDIR)\$(DLLNAME).dll
CFLAGS = \
-W3 \
-GX \
-DWIN32 \
-D_WINDOWS \
-D_AFXDLL \
-D_MBCS \
-FD \
-c \
$(CFLAGS)
LCFLAGS = $(LCFLAGS) \
$(DEFINES) \
$(NULL)
# These are the libraries we need to link with to create the dll
LLIBS= $(LLIBS) \
../lib/globals.lib \
$(NULL)
!ifdef MOZ_NO_DEBUG_RTL
LLFLAGS= /NODEFAULTLIB msvcirt.lib msvcrt.lib
#LLFLAGS= /NODEFAULTLIB
!endif
include <$(DEPTH)\config\rules.mak>
include <$(DEPTH)\cck\InitDist.win>
libs:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(CCKDIST)\CCKTool
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib ..\lib
export::
$(MAKE_INSTALL) script.ib $(CCKDIST)\CCKTool
#clobber::
# rm -f $(DIST)\bin\$(DLLNAME).dll
# rm -f $(DIST)\lib\$(DLLNAME).lib

46
cck/wizard/resource.h Normal file
Просмотреть файл

@ -0,0 +1,46 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by WizardMachine.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_WIZARDMACHINE_DIALOG 102
#define IDS_STRING102 102
#define IDS_STRING103 103
#define IDR_MAINFRAME 128
#define IDD_BASE_DIALOG 129
#define IDD_IMAGE_DIALOG 136
#define IDD_DIALOG1 137
#define IDD_CREATE_DIALOG 138
#define IDD_NEW_DIALOG 140
#define IDD_IMG_DLG 141
#define IDR_ACCELERATOR1 142
#define IDD_PROGRESS_DLG 146
#define IDD_DIALOG112 153
#define IDD_NEWCONFIG_DIALOG 159
#define IDD_DIALOG131 161
#define IDC_EDIT1 1001
#define IDC_TITLE_TEXT 1003
#define IDC_BASE_TEXT 1004
#define IDC_HELP_BUTTON 1005
#define IDC_BUTTON1 1007
#define ID_HELP_EDIT 1007
#define IDC_STATIC1 1008
#define IDC_STATIC2 1009
#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 143
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1010
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

80
cck/wizard/wizard.cpp Normal file
Просмотреть файл

@ -0,0 +1,80 @@
#include "stdafx.h"
#include <Winbase.h>
#include <direct.h>
#include "globals.h"
#include "NewConfigDialog.h"
#include "NewDialog.h"
extern "C" __declspec(dllexport)
void NewNCIDialog(CString parms, WIDGET* curWidget)
{
CString entryName;
CNewDialog newDlg;
newDlg.DoModal();
entryName = newDlg.GetData();
SetGlobal("_NewNCIFileName", entryName);
}
extern "C" __declspec(dllexport)
BOOL Config(CString globalsName, CString DialogTitle, WIDGET* curWidget)
{
// This doesn't really belong here...
WIN32_FIND_DATA data;
HANDLE d;
CNewConfigDialog newDlg;
if (!DialogTitle.IsEmpty())
SetGlobal("DialogTitle", "Create Copy");
newDlg.DoModal();
CString configField = newDlg.GetConfigName();
CString rootpath = GetGlobal("Root");
CString newDir = rootpath + "Configs\\" ;
CString Clist = GetGlobal("CustomizationList");
newDir += configField;
CString Template = rootpath + "WSTemplate" ;
CString FooCopy = rootpath + "Configs\\";
FooCopy += Clist ;
d = FindFirstFile((const char *) newDir, &data);
if (d == INVALID_HANDLE_VALUE)
{
if (!DialogTitle.IsEmpty())
CopyDir(FooCopy,newDir,NULL, FALSE);
else
CopyDir(Template,newDir,NULL, FALSE);
}
else
{
CWnd myWnd;
myWnd.MessageBox("That configuration already exists.", "Error", MB_OK);
return FALSE;
}
CString targetWid = curWidget->target;
WIDGET* tmpWidget = findWidget((char*) (LPCTSTR)curWidget->target);
if (!tmpWidget)
return FALSE;
SetGlobal(globalsName, configField);
SetGlobal(targetWid, configField);
IsSameCache = FALSE;
return TRUE;
}
extern "C" __declspec(dllexport)
void NewConfig(CString configname, WIDGET* curWidget)
{
Config(configname,"",curWidget);
}
extern "C" __declspec(dllexport)
void CopyConfig(CString configname, WIDGET* curWidget)
{
Config(configname,"Create a Copy",curWidget);
}

145
cck/wizard/wizard.rc Normal file
Просмотреть файл

@ -0,0 +1,145 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#endif\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_NEWCONFIG_DIALOG DIALOG DISCARDABLE 0, 0, 266, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Create New Configuration"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_EDIT1,7,20,218,13,ES_AUTOHSCROLL
DEFPUSHBUTTON "Create New Configuration",IDOK,109,98,94,14
PUSHBUTTON "Cancel",IDCANCEL,209,98,50,14
LTEXT "Name of new configuration:",IDC_STATIC,7,7,173,13
LTEXT "The CCK tool creates a new configuration directory in C:\\CCK\\Configs. Within your new configuration directory, the CCK tool creates a \\Workspace directory, for example, C:\\CCK\\Configs\\CustomBuild01\\Workspace.",
IDC_STATIC1,7,39,253,26
LTEXT "You can use the Workspace directory as a convenient place in which to store your custom files.",
IDC_STATIC2,7,69,248,17
END
IDD_NEW_DIALOG DIALOG DISCARDABLE 0, 0, 187, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "New Dialog"
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_EDIT1,7,20,152,13,ES_AUTOHSCROLL
DEFPUSHBUTTON "Create",IDOK,77,74,50,14
PUSHBUTTON "Cancel",IDCANCEL,130,74,50,14
LTEXT "Please provide a name for the NCI file:",IDC_TITLE_TEXT,
7,7,173,13
LTEXT "Please note that the file name must end with .nci",
IDC_BASE_TEXT,7,39,173,17
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_NEWCONFIG_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 259
TOPMARGIN, 7
BOTTOMMARGIN, 112
END
IDD_NEW_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 180
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif
#include "afxres.rc" // Standard components
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED