diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d4d979b --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +bin/ +Debug/ +Release/ +.vs/ \ No newline at end of file diff --git a/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/AppType.htm b/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/AppType.htm new file mode 100644 index 0000000..210b442 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/AppType.htm @@ -0,0 +1,464 @@ + + + + + 'ATL/WTL Application Wizard' + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+   + +   + +   + +
+ +
+
+   +
+   + + +

Specify the application type and project options.

+
+   +
+ + + + + +
+
+
+ + + + + + + + + + + + + + +
+   +
+   + + + +
+ + + + + + + + + + + + +
+
+ +
+
+
+ + + + + +
+ Application + Type + + +
+
+ + +
+
+ +
+
+ +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+   +
+   + + + Select application type: +

 

+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +         + +
+ +
+
+
+ +   + Select project options: +

 

+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+
+   +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+   +
+   + +   + + + +   + + + +   + + + +   +
+   +
+ +
+ +
+ + + + + + + diff --git a/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/UIFeatures.htm b/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/UIFeatures.htm new file mode 100644 index 0000000..a8dc949 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/UIFeatures.htm @@ -0,0 +1,547 @@ + + + + + 'ATL/WTL Application Wizard' + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+   + +   + +   + +
+ +
+
+   +
+   + + +

Specify features for the selected application type.

+
+   +
+ + + + + +
+
+
+ + + + + + + + + + + + + + +
+   +
+   + + + + +
+ + + + + + + + + + + + +
+
+ +
+
+
+ + + + + +
+ User Interface + Features + + +
+
+ +
+
+ +
+
+ +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+   +
+   + + + Select application features: +

 

+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +

 

+

 

+ + +

 

+ +
+ +
+
+ +

 

+ + +
+ +
+ +

 

+ + +

 

+ +
+ +
+
+ +
+   +
+   +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+   +
+   + +   + + + +   + + + +   + + + +   +
+   +
+ +
+ +
+ + + + + + + diff --git a/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/default.htm b/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/default.htm new file mode 100644 index 0000000..aa4142c --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/HTML/1033/default.htm @@ -0,0 +1,531 @@ + + + + + 'ATL/WTL Application Wizard' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+   + +   + +   + +
+ +
+
+   +
+   + + +

This wizard generates a WTL application project + with the properties you specify.

+
+   +
+ + + + + +
+
+
+ + + + + + + + + + + + + + +
+   +
+   + + +
+ + + + + + + + + + + + +
+
+ +
+
+
+ + + + + +
+ Overview + + +
+
+ + + +
+
+ +
+
+ +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+   +
+   + + These are the current project settings: +
    +
  • + + + +
  • + +
  • + + + +
  • + +
  • + + + +
  • +
+ + Click Finish from any window to accept the current settings. + +

 

+ + + After you create the project, examine the project's files for more information about the classes and resources that are generated. +
+   +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+
+   +
+   + +   + + + +   + + + +   + + + +   +
+   +
+ +
+ +
+ + + + + + + diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Images/WTL10AppWiz.png b/3rd_party/WTL10_1077/AppWizard/Files/Images/WTL10AppWiz.png new file mode 100644 index 0000000..9b02bb1 Binary files /dev/null and b/3rd_party/WTL10_1077/AppWizard/Files/Images/WTL10AppWiz.png differ diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Images/WTL10AppWiz_Background.png b/3rd_party/WTL10_1077/AppWizard/Files/Images/WTL10AppWiz_Background.png new file mode 100644 index 0000000..d1d9e5d Binary files /dev/null and b/3rd_party/WTL10_1077/AppWizard/Files/Images/WTL10AppWiz_Background.png differ diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Images/spacer.gif b/3rd_party/WTL10_1077/AppWizard/Files/Images/spacer.gif new file mode 100644 index 0000000..13acffe Binary files /dev/null and b/3rd_party/WTL10_1077/AppWizard/Files/Images/spacer.gif differ diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Scripts/1033/default.js b/3rd_party/WTL10_1077/AppWizard/Files/Scripts/1033/default.js new file mode 100644 index 0000000..3e46a01 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Scripts/1033/default.js @@ -0,0 +1,592 @@ +// Windows Template Library - WTL version 10.0 +// Copyright (C) Microsoft Corporation, WTL Team. All rights reserved. +// +// This file is a part of the Windows Template Library. +// The use and distribution terms for this software are covered by the +// Microsoft Public License (http://opensource.org/licenses/MS-PL) +// which can be found in the file MS-PL.txt at the root folder. + + +function OnFinish(selProj, selObj) +{ + try + { + var strProjectPath = wizard.FindSymbol('PROJECT_PATH'); + var strProjectName = wizard.FindSymbol('PROJECT_NAME'); + + // Create symbols based on the project name + var strSafeProjectName = CreateSafeName(strProjectName); + wizard.AddSymbol("SAFE_PROJECT_NAME", strSafeProjectName); + wizard.AddSymbol("NICE_SAFE_PROJECT_NAME", strSafeProjectName.substr(0, 1).toUpperCase() + strSafeProjectName.substr(1)) + wizard.AddSymbol("UPPERCASE_SAFE_PROJECT_NAME", strSafeProjectName.toUpperCase()); + + // Set current year symbol + var d = new Date(); + var nYear = 0; + nYear = d.getFullYear(); + if(nYear >= 2003) + wizard.AddSymbol("WTL_CURRENT_YEAR", nYear); + + // Set APPID and LIBID symbols for COM servers + if(wizard.FindSymbol("WTL_COM_SERVER")) + { + var strGuid = wizard.CreateGuid(); + var strVal = wizard.FormatGuid(strGuid, 0); + wizard.AddSymbol("WTL_APPID", strVal); + + strGuid = wizard.CreateGuid(); + strVal = wizard.FormatGuid(strGuid, 0); + wizard.AddSymbol("WTL_LIBID", strVal); + } + + if(wizard.FindSymbol("WTL_SUPPORT_WINXP")) + { + wizard.AddSymbol("WTL_USE_RIBBON", false); + } + + // Set namepaces + if(wizard.FindSymbol("WTL_NO_AUTO_NS")) + { + wizard.AddSymbol("WTL_NS", "WTL::"); + wizard.AddSymbol("ATL_NS", "ATL::"); + } + else + { + wizard.AddSymbol("WTL_NS", ""); + wizard.AddSymbol("ATL_NS", ""); + } + + var strWTL_NS = wizard.FindSymbol("WTL_NS"); + var strATL_NS = wizard.FindSymbol("ATL_NS"); + + wizard.AddSymbol("WTL_FRAME_BASE_CLASS", strWTL_NS + wizard.FindSymbol("WTL_FRAME_BASE_CLASS")); + wizard.AddSymbol("WTL_CHILD_FRAME_BASE_CLASS", strWTL_NS + wizard.FindSymbol("WTL_CHILD_FRAME_BASE_CLASS")); + + wizard.AddSymbol("WTL_MAINDLG_BASE_CLASS", strATL_NS + wizard.FindSymbol("WTL_MAINDLG_BASE_CLASS")); + wizard.AddSymbol("WTL_VIEW_BASE_CLASS", strATL_NS + wizard.FindSymbol("WTL_VIEW_BASE_CLASS")); + wizard.AddSymbol("WTL_VIEW_BASE", strATL_NS + wizard.FindSymbol("WTL_VIEW_BASE")); + + // Set app type symbols + if (wizard.FindSymbol("WTL_APPTYPE_SDI") || wizard.FindSymbol("WTL_APPTYPE_MTSDI") || + wizard.FindSymbol("WTL_APPTYPE_TABVIEW") || wizard.FindSymbol("WTL_APPTYPE_EXPLORER")) + { + if (wizard.FindSymbol("WTL_USE_RIBBON")) + wizard.AddSymbol("WTL_FRAME_BASE_CLASS", strWTL_NS + "CRibbonFrameWindowImpl"); + else + wizard.AddSymbol("WTL_FRAME_BASE_CLASS", strWTL_NS + "CFrameWindowImpl"); + } + else if(wizard.FindSymbol("WTL_APPTYPE_MDI")) + { + wizard.AddSymbol("WTL_FRAME_BASE_CLASS", strWTL_NS + "CMDIFrameWindowImpl"); + wizard.AddSymbol("WTL_CHILD_FRAME_BASE_CLASS", strWTL_NS + "CMDIChildWindowImpl"); + wizard.AddSymbol("WTL_USE_RIBBON", false); + } + else if(wizard.FindSymbol("WTL_APPTYPE_DLG")) + { + wizard.AddSymbol("WTL_MAINDLG_CLASS","CMainDlg"); + if(wizard.FindSymbol("WTL_ENABLE_AX")) + wizard.AddSymbol("WTL_MAINDLG_BASE_CLASS", strATL_NS + "CAxDialogImpl"); + else + wizard.AddSymbol("WTL_MAINDLG_BASE_CLASS", strATL_NS + "CDialogImpl"); + + wizard.AddSymbol("WTL_USE_RIBBON", false); + wizard.AddSymbol("WTL_USE_TOOLBAR", false); + wizard.AddSymbol("WTL_USE_REBAR", false); + wizard.AddSymbol("WTL_USE_CMDBAR", false); + wizard.AddSymbol("WTL_USE_STATUSBAR", false); + wizard.AddSymbol("WTL_USE_VIEW", false); + } + + if (wizard.FindSymbol("WTL_USE_RIBBON")) + { + if (wizard.FindSymbol("WTL_USE_TOOLBAR")) + { + wizard.AddSymbol("WTL_RIBBON_DUAL_UI", true); + wizard.AddSymbol("WTL_RIBBON_SINGLE_UI", false); + } + else + { + wizard.AddSymbol("WTL_RIBBON_DUAL_UI", false); + wizard.AddSymbol("WTL_RIBBON_SINGLE_UI", true); + } + } + else + { + wizard.AddSymbol("WTL_RIBBON_DUAL_UI", false); + wizard.AddSymbol("WTL_RIBBON_SINGLE_UI", false); + } + + // Set view symbols + if(wizard.FindSymbol("WTL_USE_VIEW")) + { + wizard.AddSymbol("WTL_VIEW_FILE", "View"); + wizard.AddSymbol("WTL_VIEW_CLASS", "CView"); + + wizard.AddSymbol("WTL_VIEWTYPE_GENERIC", false); + var strView = wizard.FindSymbol("WTL_COMBO_VIEW_TYPE"); + switch(strView) + { + case "WTL_VIEWTYPE_FORM": + wizard.AddSymbol("WTL_VIEWTYPE_FORM", true); + if(wizard.FindSymbol("WTL_ENABLE_AX") && wizard.FindSymbol("WTL_HOST_AX")) + wizard.AddSymbol("WTL_VIEW_BASE_CLASS", strATL_NS + "CAxDialogImpl"); + else + wizard.AddSymbol("WTL_VIEW_BASE_CLASS", strATL_NS + "CDialogImpl"); + break; + case "WTL_VIEWTYPE_LISTBOX": + wizard.AddSymbol("WTL_VIEWTYPE_LISTBOX", true); + wizard.AddSymbol("WTL_VIEW_BASE", strWTL_NS + "CListBox"); + wizard.AddSymbol("WTL_VIEW_STYLES", "WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LBS_NOINTEGRALHEIGHT | LBS_NOTIFY | LBS_WANTKEYBOARDINPUT"); + break; + case "WTL_VIEWTYPE_EDIT": + wizard.AddSymbol("WTL_VIEWTYPE_EDIT", true); + wizard.AddSymbol("WTL_VIEW_BASE", strWTL_NS + "CEdit"); + wizard.AddSymbol("WTL_VIEW_STYLES", "WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL"); + break; + case "WTL_VIEWTYPE_LISTVIEW": + wizard.AddSymbol("WTL_VIEWTYPE_LISTVIEW", true); + wizard.AddSymbol("WTL_VIEW_BASE", strWTL_NS + "CListViewCtrl"); + wizard.AddSymbol("WTL_VIEW_STYLES", "WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | LVS_REPORT | LVS_SHOWSELALWAYS"); + break; + case "WTL_VIEWTYPE_TREEVIEW": + wizard.AddSymbol("WTL_VIEWTYPE_TREEVIEW", true); + wizard.AddSymbol("WTL_VIEW_BASE", strWTL_NS + "CTreeViewCtrl"); + wizard.AddSymbol("WTL_VIEW_STYLES", "WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS"); + break; + case "WTL_VIEWTYPE_RICHEDIT": + wizard.AddSymbol("WTL_VIEWTYPE_RICHEDIT", true); + wizard.AddSymbol("WTL_VIEW_BASE", strWTL_NS + "CRichEditCtrl"); + wizard.AddSymbol("WTL_VIEW_STYLES", "WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL | ES_SAVESEL"); + break; + case "WTL_VIEWTYPE_HTML": + wizard.AddSymbol("WTL_VIEWTYPE_HTML", true); + wizard.AddSymbol("WTL_VIEW_BASE", strATL_NS + "CAxWindow"); + wizard.AddSymbol("WTL_ENABLE_AX", true); + wizard.AddSymbol("WTL_VIEW_STYLES", "WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL"); + break; + case "WTL_VIEWTYPE_SCROLL": + wizard.AddSymbol("WTL_VIEWTYPE_SCROLL", true); + wizard.AddSymbol("WTL_VIEW_BASE_CLASS", strWTL_NS + "CScrollWindowImpl"); + wizard.AddSymbol("WTL_VIEW_STYLES", "WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_HSCROLL | WS_VSCROLL"); + break; + default: + wizard.AddSymbol("WTL_VIEWTYPE_GENERIC", true); + break; + } + + if(wizard.FindSymbol("WTL_APPTYPE_TABVIEW")) + wizard.AddSymbol("WTL_VIEW_EX_STYLES", "0"); + } + + // Create project and configurations + selProj = CreateCustomProject(strProjectName, strProjectPath); + AddConfigurations(selProj, strProjectName); + AddFilters(selProj); + + var InfFile = CreateCustomInfFile(); + AddFilesToCustomProj(selProj, strProjectName, strProjectPath, InfFile); + AddPchSettings(selProj); + + if (wizard.FindSymbol("WTL_USE_RIBBON")) + AddRibbonSettings(selProj); + + InfFile.Delete(); + + selProj.Object.Save(); + + // Open resource editor if needed + if(wizard.FindSymbol("WTL_APPTYPE_DLG")) + { + var ResHelper = wizard.ResourceHelper; + ResHelper.OpenResourceFile(strProjectPath + "\\" + strProjectName + ".rc"); + ResHelper.OpenResourceInEditor("DIALOG", "IDD_MAINDLG"); + ResHelper.CloseResourceFile(); + } + else if(wizard.FindSymbol("WTL_USE_VIEW") && wizard.FindSymbol("WTL_VIEWTYPE_FORM")) + { + var strDialogID = "IDD_" + wizard.FindSymbol("UPPERCASE_SAFE_PROJECT_NAME") + "_FORM"; + var ResHelper = wizard.ResourceHelper; + ResHelper.OpenResourceFile(strProjectPath + "\\" + strProjectName + ".rc"); + ResHelper.OpenResourceInEditor("DIALOG", strDialogID); + ResHelper.CloseResourceFile(); + } + } + catch(e) + { + if (e.description.length != 0) + SetErrorInfo(e); + return e.number + } +} + +function CreateCustomProject(strProjectName, strProjectPath) +{ + try + { + var strProjTemplatePath = wizard.FindSymbol('PROJECT_TEMPLATE_PATH'); + var strProjTemplate = ''; + var WizardVersion = wizard.FindSymbol('WIZARD_VERSION'); + if(WizardVersion >= 10.0) + strProjTemplate = strProjTemplatePath + '\\default.vcxproj'; + else + strProjTemplate = strProjTemplatePath + '\\default.vcproj'; + + var Solution = dte.Solution; + var strSolutionName = ""; + if (wizard.FindSymbol("CLOSE_SOLUTION")) + { + Solution.Close(); + strSolutionName = wizard.FindSymbol("VS_SOLUTION_NAME"); + if (strSolutionName.length) + { + var strSolutionPath = strProjectPath.substr(0, strProjectPath.length - strProjectName.length); + Solution.Create(strSolutionPath, strSolutionName); + } + } + + var strProjectNameWithExt = ''; + if(WizardVersion >= 10.0) + strProjectNameWithExt = strProjectName + '.vcxproj'; + else + strProjectNameWithExt = strProjectName + '.vcproj'; + + var oTarget = wizard.FindSymbol("TARGET"); + var prj; + if (wizard.FindSymbol("WIZARD_TYPE") == vsWizardAddSubProject) // vsWizardAddSubProject + { + var prjItem = oTarget.AddFromTemplate(strProjTemplate, strProjectNameWithExt); + prj = prjItem.SubProject; + } + else + { + prj = oTarget.AddFromTemplate(strProjTemplate, strProjectPath, strProjectNameWithExt); + } + return prj; + } + catch(e) + { + throw e; + } +} + +function AddFilters(proj) +{ + try + { + // Add the folders to your project + var strSrcFilter = wizard.FindSymbol('SOURCE_FILTER'); + var group = proj.Object.AddFilter('Source Files'); + group.Filter = strSrcFilter; + + strSrcFilter = wizard.FindSymbol('INCLUDE_FILTER'); + group = proj.Object.AddFilter('Header Files'); + group.Filter = strSrcFilter; + + strSrcFilter = wizard.FindSymbol('RESOURCE_FILTER'); + group = proj.Object.AddFilter('Resource Files'); + group.Filter = strSrcFilter; + } + catch(e) + { + throw e; + } +} + +function AddConfigurations(proj, strProjectName) +{ + try + { + for(var i = 0; i < proj.Object.Configurations.Count; i++) + { + var config = proj.Object.Configurations.Item(i + 1); + + // Check if it's Debug configuration + var bDebug = (config.ConfigurationName.search("Debug") != -1); + + // General settings + config.CharacterSet = charSetUnicode; + + var WizardVersion = wizard.FindSymbol('WIZARD_VERSION'); + if(bDebug) + { + if(WizardVersion < 8.0) + { + config.IntermediateDirectory = 'Debug'; + config.OutputDirectory = 'Debug'; + } + + config.ATLMinimizesCRunTimeLibraryUsage = false; + } + else + { + if(WizardVersion < 8.0) + { + config.IntermediateDirectory = 'Release'; + config.OutputDirectory = 'Release'; + } + + config.ATLMinimizesCRunTimeLibraryUsage = false; + } + + if(wizard.FindSymbol("WTL_USE_VIEW") && wizard.FindSymbol("WTL_COMBO_VIEW_TYPE") == "WTL_VIEWTYPE_HTML") + config.UseOfATL = useATLDynamic; + + // Compiler settings + var CLTool = config.Tools('VCCLCompilerTool'); + CLTool.UsePrecompiledHeader = pchUseUsingSpecific; + CLTool.WarningLevel = warningLevel_3; + if(bDebug) + { + CLTool.RuntimeLibrary = rtMultiThreadedDebug; + if(WizardVersion < 15.0) + CLTool.MinimalRebuild = true; + CLTool.DebugInformationFormat = debugEditAndContinue; + CLTool.BasicRuntimeChecks = runtimeBasicCheckAll; + CLTool.Optimization = optimizeDisabled; + } + else + { + CLTool.RuntimeLibrary = rtMultiThreaded; + CLTool.ExceptionHandling = false; + CLTool.DebugInformationFormat = debugDisabled; + } + + var strDefines = GetPlatformDefine(config); + strDefines += "_WINDOWS;STRICT;"; + if(bDebug) + strDefines += "_DEBUG"; + else + strDefines += "NDEBUG"; + CLTool.PreprocessorDefinitions = strDefines; + + // Linker settings + var LinkTool = config.Tools('VCLinkerTool'); + LinkTool.SubSystem = subSystemWindows; + if(bDebug) + { + LinkTool.LinkIncremental = linkIncrementalYes; + LinkTool.GenerateDebugInformation = true; + } + else + { + LinkTool.LinkIncremental = linkIncrementalNo; + } + + if (wizard.FindSymbol("WTL_USE_RIBBON")) + { + LinkTool.DelayLoadDLLs = "propsys.dll;dwmapi.dll"; + } + + // Resource settings + var RCTool = config.Tools("VCResourceCompilerTool"); + RCTool.Culture = rcEnglishUS; + RCTool.AdditionalIncludeDirectories = "$(IntDir)"; + if(bDebug) + RCTool.PreprocessorDefinitions = "_DEBUG"; + else + RCTool.PreprocessorDefinitions = "NDEBUG"; + + // MIDL settings + var MidlTool = config.Tools("VCMidlTool"); + MidlTool.MkTypLibCompatible = false; + if(IsPlatformWin32(config)) + MidlTool.TargetEnvironment = midlTargetWin32; + if(bDebug) + MidlTool.PreprocessorDefinitions = "_DEBUG"; + else + MidlTool.PreprocessorDefinitions = "NDEBUG"; + MidlTool.HeaderFileName = strProjectName + ".h"; + MidlTool.InterfaceIdentifierFileName = strProjectName + "_i.c"; + MidlTool.ProxyFileName = strProjectName + "_p.c"; + MidlTool.GenerateStublessProxies = true; + MidlTool.TypeLibraryName = "$(IntDir)/" + strProjectName + ".tlb"; + MidlTool.DLLDataFileName = ""; + + // Post-build settings + if(wizard.FindSymbol('WTL_COM_SERVER')) + { + var PostBuildTool = config.Tools("VCPostBuildEventTool"); + PostBuildTool.Description = "Performing registration..."; + PostBuildTool.CommandLine = "\"$(TargetPath)\" /RegServer"; + } + } + } + catch(e) + { + throw e; + } +} + +function AddPchSettings(proj) +{ + try + { + var files = proj.Object.Files; + var fStdafx = files("StdAfx.cpp"); + + for(var i = 0; i < fStdafx.FileConfigurations.Count; i++) + { + var config = fStdafx.FileConfigurations.Item(i + 1); + config.Tool.UsePrecompiledHeader = pchCreateUsingSpecific; + } + } + catch(e) + { + throw e; + } +} + +function AddRibbonSettings(proj) +{ + try + { + var files = proj.Object.Files; + var fRibbon = files("Ribbon.xml"); + + for(var i = 0; i < fRibbon.FileConfigurations.Count; i++) + { + var config = fRibbon.FileConfigurations.Item(i + 1); + config.Tool.Description = "Compiling Ribbon.xml"; + config.Tool.CommandLine = "uicc Ribbon.xml Ribbon.bml /header:Ribbon.h /res:Ribbon.rc"; + config.Tool.Outputs = "Ribbon.bml;Ribbon.rc;Ribbon.h"; + } + } + catch(e) + { + throw e; + } +} + +function DelFile(fso, strWizTempFile) +{ + try + { + if (fso.FileExists(strWizTempFile)) + { + var tmpFile = fso.GetFile(strWizTempFile); + tmpFile.Delete(); + } + } + catch(e) + { + throw e; + } +} + +function CreateCustomInfFile() +{ + try + { + var fso, TemplatesFolder, TemplateFiles, strTemplate; + fso = new ActiveXObject('Scripting.FileSystemObject'); + + var TemporaryFolder = 2; + var tfolder = fso.GetSpecialFolder(TemporaryFolder); + + var strWizTempFile = tfolder.Path + "\\" + fso.GetTempName(); + + var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH'); + var strInfFile = strTemplatePath + '\\Templates.inf'; + wizard.RenderTemplate(strInfFile, strWizTempFile); + + var WizTempFile = fso.GetFile(strWizTempFile); + return WizTempFile; + } + catch(e) + { + throw e; + } +} + +function GetTargetName(strName, strProjectName) +{ + try + { + var strTarget = strName; + var strResPath = "res\\"; + + if(strName.substr(0, 4) == "root") + { + var nNameLen = strName.length; + if(strName == "root.ico" || strName == "rootDoc.ico" || strName == "root.exe.manifest") + { + strTarget = strResPath + strProjectName + strName.substr(4, nNameLen - 4); + } + else + { + strTarget = strProjectName + strName.substr(4, nNameLen - 4); + } + } + else if(strName == 'frame.h') + { + strTarget = 'MainFrm.h'; + } + else if(strName == 'frame.cpp') + { + strTarget = 'MainFrm.cpp'; + } + else if(strName == 'view.h') + { + strTarget = 'View.h'; + } + else if(strName == 'view.cpp') + { + strTarget = 'View.cpp'; + } + else if(strName == 'toolbar.bmp') + { + strTarget = strResPath + strName; + } + + return strTarget; + } + catch(e) + { + throw e; + } +} + +function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile) +{ + try + { + var projItems = proj.ProjectItems + + var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH'); + + var strTpl = ''; + var strName = ''; + + var strTextStream = InfFile.OpenAsTextStream(1, -2); + while (!strTextStream.AtEndOfStream) + { + strTpl = strTextStream.ReadLine(); + if (strTpl != '') + { + strName = strTpl; + var strTarget = GetTargetName(strName, strProjectName); + var strTemplate = strTemplatePath + '\\' + strTpl; + var strFile = strProjectPath + '\\' + strTarget; + + var bCopyOnly = false; //"true" will only copy the file from strTemplate to strTarget without rendering/adding to the project + var strExt = strName.substr(strName.lastIndexOf(".")); + if(strExt==".bmp" || strExt==".ico" || strExt==".gif" || strExt==".rtf" || strExt==".css") + bCopyOnly = true; + wizard.RenderTemplate(strTemplate, strFile, bCopyOnly); + + // don't add these files to the project + if(strTarget == strProjectName + ".h" || + strTarget == strProjectName + "ps.mk" || + strTarget == strProjectName + "ps.def") + continue; + + proj.Object.AddFile(strFile); + } + } + strTextStream.Close(); + } + catch(e) + { + throw e; + } +} diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/AboutDlg.cpp b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/AboutDlg.cpp new file mode 100644 index 0000000..c1f285a --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/AboutDlg.cpp @@ -0,0 +1,20 @@ +// aboutdlg.cpp : implementation of the CAboutDlg class +// +///////////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "resource.h" + +#include "aboutdlg.h" + +LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + CenterWindow(GetParent()); + return TRUE; +} + +LRESULT CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + EndDialog(wID); + return 0; +} diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/AboutDlg.h b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/AboutDlg.h new file mode 100644 index 0000000..0788163 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/AboutDlg.h @@ -0,0 +1,42 @@ +// aboutdlg.h : interface of the CAboutDlg class +// +///////////////////////////////////////////////////////////////////////////// + +#pragma once + +class CAboutDlg : public [!output ATL_NS]CDialogImpl +{ +public: + enum { IDD = IDD_ABOUTBOX }; + + BEGIN_MSG_MAP(CAboutDlg) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + COMMAND_ID_HANDLER(IDOK, OnCloseCmd) + COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) + END_MSG_MAP() + +// Handler prototypes (uncomment arguments if needed): +// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) + +[!if WTL_USE_CPP_FILES] + LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) + { + CenterWindow(GetParent()); + return TRUE; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + EndDialog(wID); + return 0; + } +[!endif] +}; diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/ChildFrm.cpp b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/ChildFrm.cpp new file mode 100644 index 0000000..8dacd7f --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/ChildFrm.cpp @@ -0,0 +1,57 @@ +// [!output WTL_CHILD_FRAME_FILE].cpp : implementation of the [!output WTL_CHILD_FRAME_CLASS] class +// +///////////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "resource.h" + +[!if WTL_USE_VIEW] +#include "[!output WTL_VIEW_FILE].h" +[!endif] +#include "[!output WTL_CHILD_FRAME_FILE].h" + +void [!output WTL_CHILD_FRAME_CLASS]::OnFinalMessage(HWND /*hWnd*/) +{ + delete this; +} + +[!if WTL_USE_VIEW] +LRESULT [!output WTL_CHILD_FRAME_CLASS]::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) +{ +[!if WTL_VIEWTYPE_FORM] + m_hWndClient = m_view.Create(m_hWnd); +[!else] +[!if WTL_VIEWTYPE_HTML] + //TODO: Replace with a URL of your choice + m_hWndClient = m_view.Create(m_hWnd, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!else] + m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + m_font = [!output WTL_NS]AtlCreateControlFont(); + m_view.SetFont(m_font); +[!endif] +[!if WTL_VIEWTYPE_SCROLL] + // replace with appropriate values for the app + m_view.SetScrollSize(2000, 1000); +[!endif] +[!endif] +[!endif] + + bHandled = FALSE; + return 1; +} + +[!endif] +LRESULT [!output WTL_CHILD_FRAME_CLASS]::OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) +{ + LPMSG pMsg = (LPMSG)lParam; + +[!if WTL_USE_VIEW] + if([!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>::PreTranslateMessage(pMsg)) + return TRUE; + + return m_view.PreTranslateMessage(pMsg); +[!else] + return [!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>::PreTranslateMessage(pMsg); +[!endif] +} diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/ChildFrm.h b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/ChildFrm.h new file mode 100644 index 0000000..9654a0d --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/ChildFrm.h @@ -0,0 +1,90 @@ +// [!output WTL_CHILD_FRAME_FILE].h : interface of the [!output WTL_CHILD_FRAME_CLASS] class +// +///////////////////////////////////////////////////////////////////////////// + +#pragma once + +class [!output WTL_CHILD_FRAME_CLASS] : public [!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]> +{ +public: + DECLARE_FRAME_WND_CLASS(NULL, IDR_MDICHILD) + +[!if WTL_USE_VIEW] + [!output WTL_VIEW_CLASS] m_view; + +[!endif] +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + [!output WTL_NS]CFont m_font; + +[!endif] +[!if WTL_USE_CPP_FILES] + virtual void OnFinalMessage(HWND /*hWnd*/); +[!else] + virtual void OnFinalMessage(HWND /*hWnd*/) + { + delete this; + } +[!endif] + + BEGIN_MSG_MAP([!output WTL_CHILD_FRAME_CLASS]) +[!if WTL_USE_VIEW] + MESSAGE_HANDLER(WM_CREATE, OnCreate) +[!endif] + MESSAGE_HANDLER(WM_FORWARDMSG, OnForwardMsg) + CHAIN_MSG_MAP([!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>) + END_MSG_MAP() + +// Handler prototypes (uncomment arguments if needed): +// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) + +[!if WTL_USE_VIEW] +[!if WTL_USE_CPP_FILES] + LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled); +[!else] + LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) + { +[!if WTL_VIEWTYPE_FORM] + m_hWndClient = m_view.Create(m_hWnd); +[!else] +[!if WTL_VIEWTYPE_HTML] + //TODO: Replace with a URL of your choice + m_hWndClient = m_view.Create(m_hWnd, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!else] + m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + m_font = [!output WTL_NS]AtlCreateControlFont(); + m_view.SetFont(m_font); +[!endif] +[!if WTL_VIEWTYPE_SCROLL] + // replace with appropriate values for the app + m_view.SetScrollSize(2000, 1000); +[!endif] +[!endif] +[!endif] + + bHandled = FALSE; + return 1; + } + +[!endif] +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/); +[!else] + LRESULT OnForwardMsg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/) + { + LPMSG pMsg = (LPMSG)lParam; + +[!if WTL_USE_VIEW] + if([!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>::PreTranslateMessage(pMsg)) + return TRUE; + + return m_view.PreTranslateMessage(pMsg); +[!else] + return [!output WTL_CHILD_FRAME_BASE_CLASS]<[!output WTL_CHILD_FRAME_CLASS]>::PreTranslateMessage(pMsg); +[!endif] + } +[!endif] +}; diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Frame.cpp b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Frame.cpp new file mode 100644 index 0000000..2add8e0 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Frame.cpp @@ -0,0 +1,436 @@ +// [!output WTL_FRAME_FILE].cpp : implmentation of the [!output WTL_FRAME_CLASS] class +// +///////////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +[!if WTL_USE_RIBBON] +#include "Ribbon.h" +[!endif] +#include "resource.h" + +#include "aboutdlg.h" +[!if WTL_USE_VIEW] +#include "[!output WTL_VIEW_FILE].h" +[!endif] +[!if WTL_APPTYPE_MDI] +#include "[!output WTL_CHILD_FRAME_FILE].h" +[!endif] +#include "[!output WTL_FRAME_FILE].h" + +BOOL [!output WTL_FRAME_CLASS]::PreTranslateMessage(MSG* pMsg) +{ +[!if WTL_APPTYPE_MDI] + if([!output WTL_FRAME_BASE_CLASS]<[!output WTL_FRAME_CLASS]>::PreTranslateMessage(pMsg)) + return TRUE; + + HWND hWnd = MDIGetActive(); + if(hWnd != NULL) + return (BOOL)::SendMessage(hWnd, WM_FORWARDMSG, 0, (LPARAM)pMsg); + + return FALSE; +[!else] +[!if WTL_USE_VIEW] + if([!output WTL_FRAME_BASE_CLASS]<[!output WTL_FRAME_CLASS]>::PreTranslateMessage(pMsg)) + return TRUE; + + return m_view.PreTranslateMessage(pMsg); +[!else] + return [!output WTL_FRAME_BASE_CLASS]<[!output WTL_FRAME_CLASS]>::PreTranslateMessage(pMsg); +[!endif] +[!endif] +} + +BOOL [!output WTL_FRAME_CLASS]::OnIdle() +{ +[!if WTL_USE_TOOLBAR] + UIUpdateToolBar(); +[!endif] + return FALSE; +} + +LRESULT [!output WTL_FRAME_CLASS]::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ +[!if WTL_RIBBON_DUAL_UI] + bool bRibbonUI = [!output WTL_NS]RunTimeHelper::IsRibbonUIAvailable(); + if (bRibbonUI) + UIAddMenu(GetMenu(), true); + else + [!output WTL_NS]CMenuHandle(GetMenu()).DeleteMenu(ID_VIEW_RIBBON, MF_BYCOMMAND); + +[!else] +[!if WTL_RIBBON_SINGLE_UI] + UIAddMenu(GetMenu(), true); +[!endif] +[!endif] +[!if WTL_USE_RIBBON && !WTL_USE_CMDBAR] + m_CmdBar.Create(m_hWnd, rcDefault, NULL, WS_CHILD); + m_CmdBar.AttachMenu(GetMenu()); + m_CmdBar.LoadImages(IDR_MAINFRAME); + +[!endif] +[!if WTL_USE_TOOLBAR] +[!if WTL_USE_REBAR] +[!if WTL_USE_CMDBAR] + // create command bar window + HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE); + // attach menu + m_CmdBar.AttachMenu(GetMenu()); + // load command bar images + m_CmdBar.LoadImages(IDR_MAINFRAME); + // remove old menu + SetMenu(NULL); + +[!endif] + HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE); + + CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE); +[!if WTL_USE_CMDBAR] + AddSimpleReBarBand(hWndCmdBar); + AddSimpleReBarBand(hWndToolBar, NULL, TRUE); +[!else] + AddSimpleReBarBand(hWndToolBar); +[!endif] +[!else] + CreateSimpleToolBar(); +[!endif] +[!endif] +[!if WTL_USE_STATUSBAR] + + CreateSimpleStatusBar(); +[!endif] +[!if WTL_APPTYPE_MDI] + + CreateMDIClient(); +[!if WTL_USE_CMDBAR] + m_CmdBar.SetMDIClient(m_hWndMDIClient); +[!endif] +[!endif] +[!if WTL_APPTYPE_SDI || WTL_APPTYPE_MTSDI] +[!if WTL_USE_VIEW] +[!if WTL_VIEWTYPE_FORM] + + m_hWndClient = m_view.Create(m_hWnd); +[!else] +[!if WTL_VIEWTYPE_HTML] + + //TODO: Replace with a URL of your choice + m_hWndClient = m_view.Create(m_hWnd, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!else] + + m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!endif] +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + m_font = [!output WTL_NS]AtlCreateControlFont(); + m_view.SetFont(m_font); +[!endif] +[!if WTL_VIEWTYPE_SCROLL] + // replace with appropriate values for the app + m_view.SetScrollSize(2000, 1000); +[!endif] +[!endif] +[!endif] +[!endif] +[!if WTL_APPTYPE_TABVIEW] + + m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE); +[!endif] +[!if WTL_APPTYPE_EXPLORER] + + m_hWndClient = m_splitter.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); + + m_pane.SetPaneContainerExtendedStyle(PANECNT_NOBORDER); + m_pane.Create(m_splitter, _T("Tree"), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); + m_treeview.Create(m_pane, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | TVS_SHOWSELALWAYS, WS_EX_CLIENTEDGE); + m_pane.SetClient(m_treeview); +[!if WTL_VIEWTYPE_FORM] + + m_view.Create(m_splitter); +[!else] +[!if WTL_VIEWTYPE_HTML] + + //TODO: Replace with a URL of your choice + m_view.Create(m_splitter, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!else] + + m_view.Create(m_splitter, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!endif] +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + m_font = [!output WTL_NS]AtlCreateControlFont(); + m_view.SetFont(m_font); +[!endif] +[!if WTL_VIEWTYPE_SCROLL] + // replace with appropriate values for the app + m_view.SetScrollSize(2000, 1000); +[!endif] +[!endif] + + m_splitter.SetSplitterPanes(m_pane, m_view); + UpdateLayout(); + m_splitter.SetSplitterPosPct(25); +[!endif] +[!if WTL_USE_TOOLBAR] +[!if WTL_USE_REBAR] + + UIAddToolBar(hWndToolBar); +[!else] + + UIAddToolBar(m_hWndToolBar); +[!endif] + UISetCheck(ID_VIEW_TOOLBAR, 1); +[!endif] +[!if WTL_USE_STATUSBAR] + UISetCheck(ID_VIEW_STATUS_BAR, 1); +[!endif] +[!if WTL_APPTYPE_EXPLORER] + UISetCheck(ID_VIEW_TREEPANE, 1); +[!endif] + + // register object for message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->AddMessageFilter(this); + pLoop->AddIdleHandler(this); + +[!if WTL_USE_RIBBON] +[!if WTL_RIBBON_SINGLE_UI] + ShowRibbonUI(true); + +[!else] + ShowRibbonUI(bRibbonUI); + UISetCheck(ID_VIEW_RIBBON, bRibbonUI); + +[!endif] +[!endif] +[!if WTL_APPTYPE_TABVIEW] +[!if WTL_USE_CMDBAR] + [!output WTL_NS]CMenuHandle menuMain = m_CmdBar.GetMenu(); +[!else] + [!output WTL_NS]CMenuHandle menuMain = GetMenu(); +[!endif] + m_view.SetWindowMenu(menuMain.GetSubMenu(WINDOW_MENU_POSITION)); + +[!endif] + return 0; +} + +[!if WTL_COM_SERVER] +LRESULT [!output WTL_FRAME_CLASS]::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ +[!if WTL_APPTYPE_MDI] +[!if WTL_USE_CMDBAR] + m_CmdBar.AttachMenu(NULL); + +[!endif] +[!endif] + // unregister message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->RemoveMessageFilter(this); + pLoop->RemoveIdleHandler(this); + + // if UI is the last thread, no need to wait + if(_Module.GetLockCount() == 1) + { + _Module.m_dwTimeOut = 0L; + _Module.m_dwPause = 0L; + } + _Module.Unlock(); + +[!if WTL_APPTYPE_MTSDI] + ::PostQuitMessage(1); + +[!endif] + return 0; +} + +[!else] +LRESULT [!output WTL_FRAME_CLASS]::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) +{ +[!if WTL_APPTYPE_MDI] +[!if WTL_USE_CMDBAR] + m_CmdBar.AttachMenu(NULL); + +[!endif] +[!endif] + // unregister message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->RemoveMessageFilter(this); + pLoop->RemoveIdleHandler(this); + + bHandled = FALSE; + return 1; +} + +[!endif] +LRESULT [!output WTL_FRAME_CLASS]::OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + PostMessage(WM_CLOSE); + return 0; +} + +LRESULT [!output WTL_FRAME_CLASS]::OnFileNew(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ +[!if WTL_APPTYPE_TABVIEW] + [!output WTL_VIEW_CLASS]* pView = new [!output WTL_VIEW_CLASS]; +[!if WTL_VIEWTYPE_FORM] + pView->Create(m_view); +[!else] +[!if WTL_VIEWTYPE_HTML] + //TODO: Replace with a URL of your choice + pView->Create(m_view, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!else] + pView->Create(m_view, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!endif] +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + pView->SetFont(m_font); +[!endif] +[!if WTL_VIEWTYPE_SCROLL] + // replace with appropriate values for the app + pView->SetScrollSize(2000, 1000); +[!endif] +[!endif] + m_view.AddPage(pView->m_hWnd, _T("Document")); + +[!endif] +[!if WTL_APPTYPE_MDI] + [!output WTL_CHILD_FRAME_CLASS]* pChild = new [!output WTL_CHILD_FRAME_CLASS]; + pChild->CreateEx(m_hWndClient); + +[!endif] + // TODO: add code to initialize document + + return 0; +} + +[!if WTL_APPTYPE_MTSDI] +LRESULT [!output WTL_FRAME_CLASS]::OnFileNewWindow(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + ::PostThreadMessage(_Module.m_dwMainThreadID, WM_USER, 0, 0L); + return 0; +} + +[!endif] +[!if WTL_USE_TOOLBAR] +LRESULT [!output WTL_FRAME_CLASS]::OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ +[!if WTL_USE_REBAR] + static BOOL bVisible = TRUE; // initially visible + bVisible = !bVisible; + [!output WTL_NS]CReBarCtrl rebar = m_hWndToolBar; +[!if WTL_USE_CMDBAR] + int nBandIndex = rebar.IdToIndex(ATL_IDW_BAND_FIRST + 1); // toolbar is 2nd added band +[!else] + int nBandIndex = rebar.IdToIndex(ATL_IDW_BAND_FIRST); // toolbar is first 1st band +[!endif] + rebar.ShowBand(nBandIndex, bVisible); +[!else] + BOOL bVisible = !::IsWindowVisible(m_hWndToolBar); + ::ShowWindow(m_hWndToolBar, bVisible ? SW_SHOWNOACTIVATE : SW_HIDE); +[!endif] + UISetCheck(ID_VIEW_TOOLBAR, bVisible); + UpdateLayout(); + return 0; +} + +[!endif] +[!if WTL_USE_STATUSBAR] +LRESULT [!output WTL_FRAME_CLASS]::OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + BOOL bVisible = !::IsWindowVisible(m_hWndStatusBar); + ::ShowWindow(m_hWndStatusBar, bVisible ? SW_SHOWNOACTIVATE : SW_HIDE); + UISetCheck(ID_VIEW_STATUS_BAR, bVisible); + UpdateLayout(); + return 0; +} + +[!endif] +[!if WTL_RIBBON_DUAL_UI] +LRESULT [!output WTL_FRAME_CLASS]::OnViewRibbon(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + ShowRibbonUI(!IsRibbonUI()); + UISetCheck(ID_VIEW_RIBBON, IsRibbonUI()); +[!if !WTL_USE_CMDBAR] + if (!IsRibbonUI()) + SetMenu([!output WTL_NS]AtlLoadMenu(IDR_MAINFRAME)); +[!endif] + return 0; +} + +[!endif] +LRESULT [!output WTL_FRAME_CLASS]::OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + CAboutDlg dlg; + dlg.DoModal(); + return 0; +} +[!if WTL_APPTYPE_MDI] + +LRESULT [!output WTL_FRAME_CLASS]::OnWindowCascade(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + MDICascade(); + return 0; +} + +LRESULT [!output WTL_FRAME_CLASS]::OnWindowTile(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + MDITile(); + return 0; +} + +LRESULT [!output WTL_FRAME_CLASS]::OnWindowArrangeIcons(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + MDIIconArrange(); + return 0; +} +[!endif] +[!if WTL_APPTYPE_TABVIEW] + +LRESULT [!output WTL_FRAME_CLASS]::OnWindowClose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + int nActivePage = m_view.GetActivePage(); + if(nActivePage != -1) + m_view.RemovePage(nActivePage); + else + ::MessageBeep((UINT)-1); + + return 0; +} + +LRESULT [!output WTL_FRAME_CLASS]::OnWindowCloseAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + m_view.RemoveAllPages(); + + return 0; +} + +LRESULT [!output WTL_FRAME_CLASS]::OnWindowActivate(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + int nPage = wID - ID_WINDOW_TABFIRST; + m_view.SetActivePage(nPage); + + return 0; +} +[!endif] +[!if WTL_APPTYPE_EXPLORER] + +LRESULT [!output WTL_FRAME_CLASS]::OnViewTreePane(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + bool bShow = (m_splitter.GetSinglePaneMode() != SPLIT_PANE_NONE); + m_splitter.SetSinglePaneMode(bShow ? SPLIT_PANE_NONE : SPLIT_PANE_RIGHT); + UISetCheck(ID_VIEW_TREEPANE, bShow); + + return 0; +} + +LRESULT [!output WTL_FRAME_CLASS]::OnTreePaneClose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/) +{ + if(hWndCtl == m_pane.m_hWnd) + { + m_splitter.SetSinglePaneMode(SPLIT_PANE_RIGHT); + UISetCheck(ID_VIEW_TREEPANE, 0); + } + + return 0; +} +[!endif] diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Frame.h b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Frame.h new file mode 100644 index 0000000..a0c0667 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Frame.h @@ -0,0 +1,615 @@ +// [!output WTL_FRAME_FILE].h : interface of the [!output WTL_FRAME_CLASS] class +// +///////////////////////////////////////////////////////////////////////////// + +#pragma once + +[!if WTL_APPTYPE_TABVIEW] +#define WINDOW_MENU_POSITION 3 + +[!endif] +class [!output WTL_FRAME_CLASS] : + public [!output WTL_FRAME_BASE_CLASS]<[!output WTL_FRAME_CLASS]>, +[!if !WTL_USE_RIBBON] + public [!output WTL_NS]CUpdateUI<[!output WTL_FRAME_CLASS]>, +[!endif] + public [!output WTL_NS]CMessageFilter, public [!output WTL_NS]CIdleHandler +{ +public: + DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME) + +[!if WTL_APPTYPE_TABVIEW] + CTabView m_view; +[!endif] +[!if WTL_APPTYPE_EXPLORER] + [!output WTL_NS]CSplitterWindow m_splitter; + [!output WTL_NS]CPaneContainer m_pane; + [!output WTL_NS]CTreeViewCtrl m_treeview; + [!output WTL_VIEW_CLASS] m_view; +[!endif] +[!if WTL_APPTYPE_SDI || WTL_APPTYPE_MTSDI] +[!if WTL_USE_VIEW] + [!output WTL_VIEW_CLASS] m_view; +[!endif] +[!endif] +[!if WTL_USE_CMDBAR || WTL_USE_RIBBON] +[!if WTL_APPTYPE_MDI] + [!output WTL_NS]CMDICommandBarCtrl m_CmdBar; +[!else] + [!output WTL_NS]CCommandBarCtrl m_CmdBar; +[!endif] +[!endif] +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] +[!if !WTL_APPTYPE_MDI] + [!output WTL_NS]CFont m_font; +[!endif] +[!endif] +[!if WTL_USE_RIBBON] + + //TODO: Declare ribbon controls + + // Ribbon control map + BEGIN_RIBBON_CONTROL_MAP(CMainFrame) + END_RIBBON_CONTROL_MAP() +[!endif] + +[!if WTL_USE_CPP_FILES] + virtual BOOL PreTranslateMessage(MSG* pMsg); +[!else] + virtual BOOL PreTranslateMessage(MSG* pMsg) + { +[!if WTL_APPTYPE_MDI] + if([!output WTL_FRAME_BASE_CLASS]<[!output WTL_FRAME_CLASS]>::PreTranslateMessage(pMsg)) + return TRUE; + + HWND hWnd = MDIGetActive(); + if(hWnd != NULL) + return (BOOL)::SendMessage(hWnd, WM_FORWARDMSG, 0, (LPARAM)pMsg); + + return FALSE; +[!else] +[!if WTL_USE_VIEW] + if([!output WTL_FRAME_BASE_CLASS]<[!output WTL_FRAME_CLASS]>::PreTranslateMessage(pMsg)) + return TRUE; + + return m_view.PreTranslateMessage(pMsg); +[!else] + return [!output WTL_FRAME_BASE_CLASS]<[!output WTL_FRAME_CLASS]>::PreTranslateMessage(pMsg); +[!endif] +[!endif] + } + +[!endif] +[!if WTL_USE_CPP_FILES] + virtual BOOL OnIdle(); +[!else] + virtual BOOL OnIdle() + { +[!if WTL_USE_TOOLBAR] + UIUpdateToolBar(); +[!endif] + return FALSE; + } +[!endif] + +[!if !WTL_RIBBON_SINGLE_UI] + BEGIN_UPDATE_UI_MAP([!output WTL_FRAME_CLASS]) +[!if WTL_USE_TOOLBAR] + UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP) +[!endif] +[!if WTL_USE_STATUSBAR] + UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP) +[!endif] +[!if WTL_APPTYPE_EXPLORER] + UPDATE_ELEMENT(ID_VIEW_TREEPANE, UPDUI_MENUPOPUP) +[!endif] + END_UPDATE_UI_MAP() +[!endif] + + BEGIN_MSG_MAP([!output WTL_FRAME_CLASS]) + MESSAGE_HANDLER(WM_CREATE, OnCreate) + MESSAGE_HANDLER(WM_DESTROY, OnDestroy) + COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit) + COMMAND_ID_HANDLER(ID_FILE_NEW, OnFileNew) +[!if WTL_APPTYPE_MTSDI] + COMMAND_ID_HANDLER(ID_FILE_NEW_WINDOW, OnFileNewWindow) +[!endif] +[!if WTL_USE_TOOLBAR] + COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar) +[!endif] +[!if WTL_USE_STATUSBAR] + COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar) +[!endif] +[!if WTL_RIBBON_DUAL_UI] + COMMAND_ID_HANDLER(ID_VIEW_RIBBON, OnViewRibbon) +[!endif] + COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) +[!if WTL_APPTYPE_MDI] + COMMAND_ID_HANDLER(ID_WINDOW_CASCADE, OnWindowCascade) + COMMAND_ID_HANDLER(ID_WINDOW_TILE_HORZ, OnWindowTile) + COMMAND_ID_HANDLER(ID_WINDOW_ARRANGE, OnWindowArrangeIcons) +[!endif] +[!if WTL_APPTYPE_TABVIEW] + COMMAND_ID_HANDLER(ID_WINDOW_CLOSE, OnWindowClose) + COMMAND_ID_HANDLER(ID_WINDOW_CLOSE_ALL, OnWindowCloseAll) + COMMAND_RANGE_HANDLER(ID_WINDOW_TABFIRST, ID_WINDOW_TABLAST, OnWindowActivate) +[!endif] +[!if WTL_APPTYPE_EXPLORER] + COMMAND_ID_HANDLER(ID_VIEW_TREEPANE, OnViewTreePane) + COMMAND_ID_HANDLER(ID_PANE_CLOSE, OnTreePaneClose) +[!endif] +[!if !WTL_USE_RIBBON] + CHAIN_MSG_MAP([!output WTL_NS]CUpdateUI<[!output WTL_FRAME_CLASS]>) +[!endif] + CHAIN_MSG_MAP([!output WTL_FRAME_BASE_CLASS]<[!output WTL_FRAME_CLASS]>) + END_MSG_MAP() + +// Handler prototypes (uncomment arguments if needed): +// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) + +[!if WTL_USE_CPP_FILES] + LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) + { +[!if WTL_RIBBON_DUAL_UI] + bool bRibbonUI = [!output WTL_NS]RunTimeHelper::IsRibbonUIAvailable(); + if (bRibbonUI) + UIAddMenu(GetMenu(), true); + else + [!output WTL_NS]CMenuHandle(GetMenu()).DeleteMenu(ID_VIEW_RIBBON, MF_BYCOMMAND); + +[!else] +[!if WTL_RIBBON_SINGLE_UI] + UIAddMenu(GetMenu(), true); +[!endif] +[!endif] +[!if WTL_USE_RIBBON && !WTL_USE_CMDBAR] + m_CmdBar.Create(m_hWnd, rcDefault, NULL, WS_CHILD); + m_CmdBar.AttachMenu(GetMenu()); + m_CmdBar.LoadImages(IDR_MAINFRAME); + +[!endif] +[!if WTL_USE_TOOLBAR] +[!if WTL_USE_REBAR] +[!if WTL_USE_CMDBAR] + // create command bar window + HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE); + // attach menu + m_CmdBar.AttachMenu(GetMenu()); + // load command bar images + m_CmdBar.LoadImages(IDR_MAINFRAME); + // remove old menu + SetMenu(NULL); + +[!endif] + HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE); + + CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE); +[!if WTL_USE_CMDBAR] + AddSimpleReBarBand(hWndCmdBar); + AddSimpleReBarBand(hWndToolBar, NULL, TRUE); +[!else] + AddSimpleReBarBand(hWndToolBar); +[!endif] +[!else] + CreateSimpleToolBar(); +[!endif] +[!endif] +[!if WTL_USE_STATUSBAR] + + CreateSimpleStatusBar(); +[!endif] +[!if WTL_APPTYPE_MDI] + + CreateMDIClient(); +[!if WTL_USE_CMDBAR] + m_CmdBar.SetMDIClient(m_hWndMDIClient); +[!endif] +[!endif] +[!if WTL_APPTYPE_SDI || WTL_APPTYPE_MTSDI] +[!if WTL_USE_VIEW] +[!if WTL_VIEWTYPE_FORM] + + m_hWndClient = m_view.Create(m_hWnd); +[!else] +[!if WTL_VIEWTYPE_HTML] + + //TODO: Replace with a URL of your choice + m_hWndClient = m_view.Create(m_hWnd, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!else] + + m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!endif] +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + m_font = [!output WTL_NS]AtlCreateControlFont(); + m_view.SetFont(m_font); +[!endif] +[!if WTL_VIEWTYPE_SCROLL] + // replace with appropriate values for the app + m_view.SetScrollSize(2000, 1000); +[!endif] +[!endif] +[!endif] +[!endif] +[!if WTL_APPTYPE_TABVIEW] + + m_hWndClient = m_view.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE); +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + + m_font = [!output WTL_NS]AtlCreateControlFont(); +[!endif] +[!endif] +[!if WTL_APPTYPE_EXPLORER] + + m_hWndClient = m_splitter.Create(m_hWnd, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); + + m_pane.SetPaneContainerExtendedStyle(PANECNT_NOBORDER); + m_pane.Create(m_splitter, _T("Tree"), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN); + m_treeview.Create(m_pane, rcDefault, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | TVS_SHOWSELALWAYS, WS_EX_CLIENTEDGE); + m_pane.SetClient(m_treeview); +[!if WTL_VIEWTYPE_FORM] + + m_view.Create(m_splitter); +[!else] +[!if WTL_VIEWTYPE_HTML] + + //TODO: Replace with a URL of your choice + m_view.Create(m_splitter, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!else] + + m_view.Create(m_splitter, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!endif] +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + m_font = [!output WTL_NS]AtlCreateControlFont(); + m_view.SetFont(m_font); +[!endif] +[!if WTL_VIEWTYPE_SCROLL] + // replace with appropriate values for the app + m_view.SetScrollSize(2000, 1000); +[!endif] +[!endif] + + m_splitter.SetSplitterPanes(m_pane, m_view); + UpdateLayout(); + m_splitter.SetSplitterPosPct(25); +[!endif] +[!if WTL_USE_TOOLBAR] +[!if WTL_USE_REBAR] + + UIAddToolBar(hWndToolBar); +[!else] + + UIAddToolBar(m_hWndToolBar); +[!endif] + UISetCheck(ID_VIEW_TOOLBAR, 1); +[!endif] +[!if WTL_USE_STATUSBAR] + UISetCheck(ID_VIEW_STATUS_BAR, 1); +[!endif] +[!if WTL_APPTYPE_EXPLORER] + UISetCheck(ID_VIEW_TREEPANE, 1); +[!endif] + + // register object for message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->AddMessageFilter(this); + pLoop->AddIdleHandler(this); + +[!if WTL_USE_RIBBON] +[!if WTL_RIBBON_SINGLE_UI] + ShowRibbonUI(true); + +[!else] + ShowRibbonUI(bRibbonUI); + UISetCheck(ID_VIEW_RIBBON, bRibbonUI); + +[!endif] +[!endif] +[!if WTL_APPTYPE_TABVIEW] +[!if WTL_USE_CMDBAR] + [!output WTL_NS]CMenuHandle menuMain = m_CmdBar.GetMenu(); +[!else] + [!output WTL_NS]CMenuHandle menuMain = GetMenu(); +[!endif] + m_view.SetWindowMenu(menuMain.GetSubMenu(WINDOW_MENU_POSITION)); + +[!endif] + return 0; + } +[!endif] +[!if WTL_COM_SERVER] +[!if WTL_USE_CPP_FILES] + LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) + { +[!if WTL_APPTYPE_MDI] +[!if WTL_USE_CMDBAR] + m_CmdBar.AttachMenu(NULL); + +[!endif] +[!endif] + // unregister message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->RemoveMessageFilter(this); + pLoop->RemoveIdleHandler(this); + + // if UI is the last thread, no need to wait + if(_Module.GetLockCount() == 1) + { + _Module.m_dwTimeOut = 0L; + _Module.m_dwPause = 0L; + } + _Module.Unlock(); + +[!if WTL_APPTYPE_MTSDI] + ::PostQuitMessage(1); + +[!endif] + return 0; + } +[!endif] +[!else] +[!if WTL_USE_CPP_FILES] + LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled); +[!else] + + LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled) + { +[!if WTL_APPTYPE_MDI] +[!if WTL_USE_CMDBAR] + m_CmdBar.AttachMenu(NULL); + +[!endif] +[!endif] + // unregister message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->RemoveMessageFilter(this); + pLoop->RemoveIdleHandler(this); + + bHandled = FALSE; + return 1; + } +[!endif] +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + PostMessage(WM_CLOSE); + return 0; + } +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnFileNew(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnFileNew(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { +[!if WTL_APPTYPE_TABVIEW] + [!output WTL_VIEW_CLASS]* pView = new [!output WTL_VIEW_CLASS]; +[!if WTL_VIEWTYPE_FORM] + pView->Create(m_view); +[!else] +[!if WTL_VIEWTYPE_HTML] + //TODO: Replace with a URL of your choice + pView->Create(m_view, rcDefault, _T("http://www.microsoft.com"), [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!else] + pView->Create(m_view, rcDefault, NULL, [!output WTL_VIEW_STYLES], [!output WTL_VIEW_EX_STYLES]); +[!endif] +[!if WTL_VIEWTYPE_LISTBOX || WTL_VIEWTYPE_EDIT || WTL_VIEWTYPE_RICHEDIT] + pView->SetFont(m_font); +[!endif] +[!if WTL_VIEWTYPE_SCROLL] + // replace with appropriate values for the app + pView->SetScrollSize(2000, 1000); +[!endif] +[!endif] + m_view.AddPage(pView->m_hWnd, _T("Document")); + +[!endif] +[!if WTL_APPTYPE_MDI] + [!output WTL_CHILD_FRAME_CLASS]* pChild = new [!output WTL_CHILD_FRAME_CLASS]; + pChild->CreateEx(m_hWndClient); + +[!endif] + // TODO: add code to initialize document + + return 0; + } +[!endif] +[!if WTL_APPTYPE_MTSDI] +[!if WTL_USE_CPP_FILES] + LRESULT OnFileNewWindow(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnFileNewWindow(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + ::PostThreadMessage(_Module.m_dwMainThreadID, WM_USER, 0, 0L); + return 0; + } +[!endif] +[!endif] +[!if WTL_USE_TOOLBAR] +[!if WTL_USE_CPP_FILES] + LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { +[!if WTL_USE_REBAR] + static BOOL bVisible = TRUE; // initially visible + bVisible = !bVisible; + [!output WTL_NS]CReBarCtrl rebar = m_hWndToolBar; +[!if WTL_USE_CMDBAR] + int nBandIndex = rebar.IdToIndex(ATL_IDW_BAND_FIRST + 1); // toolbar is 2nd added band +[!else] + int nBandIndex = rebar.IdToIndex(ATL_IDW_BAND_FIRST); // toolbar is first 1st band +[!endif] + rebar.ShowBand(nBandIndex, bVisible); +[!else] + BOOL bVisible = !::IsWindowVisible(m_hWndToolBar); + ::ShowWindow(m_hWndToolBar, bVisible ? SW_SHOWNOACTIVATE : SW_HIDE); +[!endif] + UISetCheck(ID_VIEW_TOOLBAR, bVisible); + UpdateLayout(); + return 0; + } +[!endif] +[!endif] +[!if WTL_USE_STATUSBAR] +[!if WTL_USE_CPP_FILES] + LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + BOOL bVisible = !::IsWindowVisible(m_hWndStatusBar); + ::ShowWindow(m_hWndStatusBar, bVisible ? SW_SHOWNOACTIVATE : SW_HIDE); + UISetCheck(ID_VIEW_STATUS_BAR, bVisible); + UpdateLayout(); + return 0; + } +[!endif] +[!endif] +[!if WTL_RIBBON_DUAL_UI] +[!if WTL_USE_CPP_FILES] + LRESULT OnViewRibbon(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnViewRibbon(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + ShowRibbonUI(!IsRibbonUI()); + UISetCheck(ID_VIEW_RIBBON, IsRibbonUI()); +[!if !WTL_USE_CMDBAR] + if (!IsRibbonUI()) + SetMenu([!output WTL_NS]AtlLoadMenu(IDR_MAINFRAME)); +[!endif] + return 0; + } +[!endif] +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + CAboutDlg dlg; + dlg.DoModal(); + return 0; + } +[!endif] +[!if WTL_APPTYPE_MDI] +[!if WTL_USE_CPP_FILES] + LRESULT OnWindowCascade(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnWindowCascade(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + MDICascade(); + return 0; + } +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnWindowTile(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnWindowTile(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + MDITile(); + return 0; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnWindowArrangeIcons(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnWindowArrangeIcons(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + MDIIconArrange(); + return 0; + } +[!endif] +[!endif] +[!if WTL_APPTYPE_TABVIEW] +[!if WTL_USE_CPP_FILES] + LRESULT OnWindowClose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnWindowClose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + int nActivePage = m_view.GetActivePage(); + if(nActivePage != -1) + m_view.RemovePage(nActivePage); + else + ::MessageBeep((UINT)-1); + + return 0; + } +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnWindowCloseAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnWindowCloseAll(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + m_view.RemoveAllPages(); + + return 0; + } +[!endif] +[!if WTL_USE_CPP_FILES] +LRESULT OnWindowActivate(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + +LRESULT OnWindowActivate(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + int nPage = wID - ID_WINDOW_TABFIRST; + m_view.SetActivePage(nPage); + + return 0; +} +[!endif] +[!endif] +[!if WTL_APPTYPE_EXPLORER] +[!if WTL_USE_CPP_FILES] + LRESULT OnViewTreePane(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + + LRESULT OnViewTreePane(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + bool bShow = (m_splitter.GetSinglePaneMode() != SPLIT_PANE_NONE); + m_splitter.SetSinglePaneMode(bShow ? SPLIT_PANE_NONE : SPLIT_PANE_RIGHT); + UISetCheck(ID_VIEW_TREEPANE, bShow); + + return 0; + } +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnTreePaneClose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/); +[!else] + + LRESULT OnTreePaneClose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/) + { + if(hWndCtl == m_pane.m_hWnd) + { + m_splitter.SetSinglePaneMode(SPLIT_PANE_RIGHT); + UISetCheck(ID_VIEW_TREEPANE, 0); + } + + return 0; + } +[!endif] +[!endif] +}; diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/MainDlg.cpp b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/MainDlg.cpp new file mode 100644 index 0000000..4d75d26 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/MainDlg.cpp @@ -0,0 +1,164 @@ +// [!output WTL_MAINDLG_FILE].cpp : implementation of the [!output WTL_MAINDLG_CLASS] class +// +///////////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "resource.h" + +[!if WTL_APPTYPE_DLG && !WTL_APPTYPE_DLG_MODAL] +#include "aboutdlg.h" +[!endif] +#include "[!output WTL_MAINDLG_FILE].h" + +[!if WTL_APPTYPE_DLG && !WTL_APPTYPE_DLG_MODAL] +BOOL [!output WTL_MAINDLG_CLASS]::PreTranslateMessage(MSG* pMsg) +{ +[!if WTL_HOST_AX] + if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) && + (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST)) + return FALSE; + + HWND hWndCtl = ::GetFocus(); + if(IsChild(hWndCtl)) + { + // find a direct child of the dialog from the window that has focus + while(::GetParent(hWndCtl) != m_hWnd) + hWndCtl = ::GetParent(hWndCtl); + + // give control a chance to translate this message + if(::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg) != 0) + return TRUE; + } + +[!endif] + return [!output ATL_NS]CWindow::IsDialogMessage(pMsg); +} + +BOOL [!output WTL_MAINDLG_CLASS]::OnIdle() +{ + UIUpdateChildWindows(); + return FALSE; +} + +LRESULT [!output WTL_MAINDLG_CLASS]::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + // center the dialog on the screen + CenterWindow(); + + // set icons + HICON hIcon = [!output WTL_NS]AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + SetIcon(hIcon, TRUE); + HICON hIconSmall = [!output WTL_NS]AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)); + SetIcon(hIconSmall, FALSE); + + // register object for message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->AddMessageFilter(this); + pLoop->AddIdleHandler(this); + + UIAddChildWindowContainer(m_hWnd); + + return TRUE; +} + +LRESULT [!output WTL_MAINDLG_CLASS]::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + // unregister message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->RemoveMessageFilter(this); + pLoop->RemoveIdleHandler(this); +[!if WTL_COM_SERVER] + + // if UI is the last thread, no need to wait + if(_Module.GetLockCount() == 1) + { + _Module.m_dwTimeOut = 0L; + _Module.m_dwPause = 0L; + } + _Module.Unlock(); +[!endif] + + return 0; +} + +LRESULT [!output WTL_MAINDLG_CLASS]::OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + CAboutDlg dlg; + dlg.DoModal(); + return 0; +} + +LRESULT [!output WTL_MAINDLG_CLASS]::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + // TODO: Add validation code + CloseDialog(wID); + return 0; +} + +LRESULT [!output WTL_MAINDLG_CLASS]::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + CloseDialog(wID); + return 0; +} + +void [!output WTL_MAINDLG_CLASS]::CloseDialog(int nVal) +{ + DestroyWindow(); + ::PostQuitMessage(nVal); +} +[!endif] +[!if WTL_APPTYPE_DLG && WTL_APPTYPE_DLG_MODAL] +LRESULT [!output WTL_MAINDLG_CLASS]::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ +[!if WTL_COM_SERVER] + _Module.Lock(); + +[!endif] + // center the dialog on the screen + CenterWindow(); + + // set icons + HICON hIcon = [!output WTL_NS]AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + SetIcon(hIcon, TRUE); + HICON hIconSmall = [!output WTL_NS]AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)); + SetIcon(hIconSmall, FALSE); + + return TRUE; +} + +[!if WTL_COM_SERVER] +LRESULT [!output WTL_MAINDLG_CLASS]::OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +{ + // if UI is the last thread, no need to wait + if(_Module.GetLockCount() == 1) + { + _Module.m_dwTimeOut = 0L; + _Module.m_dwPause = 0L; + } + _Module.Unlock(); + return 0; +} + +[!endif] +LRESULT [!output WTL_MAINDLG_CLASS]::OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + [!output ATL_NS]CSimpleDialog dlg; + dlg.DoModal(); + return 0; +} + +LRESULT [!output WTL_MAINDLG_CLASS]::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + // TODO: Add validation code + EndDialog(wID); + return 0; +} + +LRESULT [!output WTL_MAINDLG_CLASS]::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +{ + EndDialog(wID); + return 0; +} +[!endif] diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/MainDlg.h b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/MainDlg.h new file mode 100644 index 0000000..a6c34b8 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/MainDlg.h @@ -0,0 +1,256 @@ +// [!output WTL_MAINDLG_FILE].h : interface of the [!output WTL_MAINDLG_CLASS] class +// +///////////////////////////////////////////////////////////////////////////// + +#pragma once + +[!if WTL_APPTYPE_DLG && !WTL_APPTYPE_DLG_MODAL] +class [!output WTL_MAINDLG_CLASS] : public [!output WTL_MAINDLG_BASE_CLASS]<[!output WTL_MAINDLG_CLASS]>, public [!output WTL_NS]CUpdateUI<[!output WTL_MAINDLG_CLASS]>, + public [!output WTL_NS]CMessageFilter, public [!output WTL_NS]CIdleHandler +{ +public: + enum { IDD = IDD_MAINDLG }; + +[!if WTL_USE_CPP_FILES] + virtual BOOL PreTranslateMessage(MSG* pMsg); +[!else] + virtual BOOL PreTranslateMessage(MSG* pMsg) + { +[!if WTL_HOST_AX] + if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) && + (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST)) + return FALSE; + + HWND hWndCtl = ::GetFocus(); + if(IsChild(hWndCtl)) + { + // find a direct child of the dialog from the window that has focus + while(::GetParent(hWndCtl) != m_hWnd) + hWndCtl = ::GetParent(hWndCtl); + + // give control a chance to translate this message + if(::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg) != 0) + return TRUE; + } + +[!endif] + return [!output ATL_NS]CWindow::IsDialogMessage(pMsg); + } + +[!endif] +[!if WTL_USE_CPP_FILES] + virtual BOOL OnIdle(); +[!else] + virtual BOOL OnIdle() + { + UIUpdateChildWindows(); + return FALSE; + } +[!endif] + + BEGIN_UPDATE_UI_MAP([!output WTL_MAINDLG_CLASS]) + END_UPDATE_UI_MAP() + + BEGIN_MSG_MAP([!output WTL_MAINDLG_CLASS]) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + MESSAGE_HANDLER(WM_DESTROY, OnDestroy) + COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) + COMMAND_ID_HANDLER(IDOK, OnOK) + COMMAND_ID_HANDLER(IDCANCEL, OnCancel) + END_MSG_MAP() + +// Handler prototypes (uncomment arguments if needed): +// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) + +[!if WTL_USE_CPP_FILES] + LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) + { + // center the dialog on the screen + CenterWindow(); + + // set icons + HICON hIcon = [!output WTL_NS]AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + SetIcon(hIcon, TRUE); + HICON hIconSmall = [!output WTL_NS]AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)); + SetIcon(hIconSmall, FALSE); + + // register object for message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->AddMessageFilter(this); + pLoop->AddIdleHandler(this); + + UIAddChildWindowContainer(m_hWnd); + + return TRUE; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) + { + // unregister message filtering and idle updates + [!output WTL_NS]CMessageLoop* pLoop = _Module.GetMessageLoop(); + ATLASSERT(pLoop != NULL); + pLoop->RemoveMessageFilter(this); + pLoop->RemoveIdleHandler(this); +[!if WTL_COM_SERVER] + + // if UI is the last thread, no need to wait + if(_Module.GetLockCount() == 1) + { + _Module.m_dwTimeOut = 0L; + _Module.m_dwPause = 0L; + } + _Module.Unlock(); +[!endif] + + return 0; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + CAboutDlg dlg; + dlg.DoModal(); + return 0; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + // TODO: Add validation code + CloseDialog(wID); + return 0; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + CloseDialog(wID); + return 0; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + + void CloseDialog(int nVal); +[!else] + void CloseDialog(int nVal) + { + DestroyWindow(); + ::PostQuitMessage(nVal); + } +[!endif] +}; +[!endif] +[!if WTL_APPTYPE_DLG && WTL_APPTYPE_DLG_MODAL] +class [!output WTL_MAINDLG_CLASS] : public [!output WTL_MAINDLG_BASE_CLASS]<[!output WTL_MAINDLG_CLASS]> +{ +public: + enum { IDD = IDD_MAINDLG }; + + BEGIN_MSG_MAP([!output WTL_MAINDLG_CLASS]) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) +[!if WTL_COM_SERVER] + MESSAGE_HANDLER(WM_DESTROY, OnDestroy) +[!endif] + COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) + COMMAND_ID_HANDLER(IDOK, OnOK) + COMMAND_ID_HANDLER(IDCANCEL, OnCancel) + END_MSG_MAP() + +// Handler prototypes (uncomment arguments if needed): +// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) +// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) + +[!if WTL_USE_CPP_FILES] + LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) + { +[!if WTL_COM_SERVER] + _Module.Lock(); + +[!endif] + // center the dialog on the screen + CenterWindow(); + + // set icons + HICON hIcon = [!output WTL_NS]AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); + SetIcon(hIcon, TRUE); + HICON hIconSmall = [!output WTL_NS]AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)); + SetIcon(hIconSmall, FALSE); + + return TRUE; + } + +[!endif] +[!if WTL_COM_SERVER] +[!if WTL_USE_CPP_FILES] + LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) + { + // if UI is the last thread, no need to wait + if(_Module.GetLockCount() == 1) + { + _Module.m_dwTimeOut = 0L; + _Module.m_dwPause = 0L; + } + _Module.Unlock(); + + return 0; + } + +[!endif] +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + [!output ATL_NS]CSimpleDialog dlg; + dlg.DoModal(); + return 0; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + // TODO: Add validation code + EndDialog(wID); + return 0; + } + +[!endif] +[!if WTL_USE_CPP_FILES] + LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); +[!else] + LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) + { + EndDialog(wID); + return 0; + } +[!endif] +}; +[!endif] diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Ribbon.h b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Ribbon.h new file mode 100644 index 0000000..61d82c4 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Ribbon.h @@ -0,0 +1,39 @@ +// ***************************************************************************** +// * This is an automatically generated header file for UI Element definition * +// * resource symbols and values. Please do not modify manually. * +// ***************************************************************************** + +#pragma once + +#define ID_FILE_NEW 0xE100 +#define ID_FILE_OPEN 0xE101 +#define ID_FILE_CLOSE 0xE102 +#define ID_FILE_SAVE 0xE103 +#define ID_FILE_SAVE_AS 0xE104 +#define ID_FILE_PAGE_SETUP 0xE105 +#define ID_FILE_PRINT_SETUP 0xE106 +#define ID_FILE_PRINT 0xE107 +#define ID_FILE_PRINT_DIRECT 0xE108 +#define ID_FILE_PRINT_PREVIEW 0xE109 +#define ID_EDIT_COPY 0xE122 +#define ID_EDIT_CUT 0xE123 +#define ID_EDIT_FIND 0xE124 +#define ID_EDIT_PASTE 0xE125 +#define ID_EDIT_SELECT_ALL 0xE12A +#define ID_EDIT_UNDO 0xE12B +#define ID_EDIT_REDO 0xE12C +#define ID_VIEW_TOOLBAR 0xE800 +#define ID_VIEW_STATUS_BAR 0xE801 +#define ID_VIEW_RIBBON 0xE804 +#define ID_APP_ABOUT 0xE140 +#define ID_APP_EXIT 0xE141 +#define ID_TAB_HOME 2 +#define ID_TAB_HOME_LabelTitle_RESID 60001 +#define ID_GROUP_CLIPBOARD 3 +#define ID_GROUP_CLIPBOARD_LabelTitle_RESID 60002 +#define ID_GROUP_VIEW 4 +#define ID_GROUP_VIEW_LabelTitle_RESID 60003 +#define ID_RIBBON_APP_MENU 5 +#define ID_SAVEMORE 6 +#define ID_PRINTMORE 7 +#define ID_RIBBON_QAT 8 diff --git a/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Ribbon.xml b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Ribbon.xml new file mode 100644 index 0000000..028bc16 --- /dev/null +++ b/3rd_party/WTL10_1077/AppWizard/Files/Templates/1033/Ribbon.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +