From a09fb3c85791fc21ff1e114fd3542479eec98def Mon Sep 17 00:00:00 2001 From: "varada%netscape.com" Date: Fri, 15 Oct 1999 22:55:06 +0000 Subject: [PATCH] fixing bug #5987 - introduced three new fields in VARS in the ini files - cancel back and next - use those to change the text on the buttons --- cck/driver/WizardMachine.cpp | 37 ++++++++++++++++++++++++++++++++---- cck/driver/WizardUI.cpp | 11 +++++++++-- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/cck/driver/WizardMachine.cpp b/cck/driver/WizardMachine.cpp index ef04b124b6e..c453e07c354 100644 --- a/cck/driver/WizardMachine.cpp +++ b/cck/driver/WizardMachine.cpp @@ -418,14 +418,39 @@ NODE* CWizardMachineApp::CreateNode(NODE *parentNode, CString iniFile) NewNode->childNodes[i] = NULL; } - NewNode->localVars = new VARS; - GetPrivateProfileString(varSection, "Title", "", buffer, MAX_SIZE, iniFile); - NewNode->localVars->title = buffer; + NewNode->localVars = new VARS; + GetPrivateProfileString(varSection, "Title", "", buffer, MAX_SIZE, iniFile); + NewNode->localVars->title = buffer; + if (NewNode->localVars->title == "") + { + NewNode->localVars->title = parentNode->localVars->title; + } GetPrivateProfileString(varSection, "Caption", "", buffer, MAX_SIZE, iniFile); NewNode->localVars->caption = buffer; GetPrivateProfileString(varSection, "Function", "", buffer, MAX_SIZE, iniFile); NewNode->localVars->functionality = buffer; + NewNode->localVars->wizbut = new WIZBUT; + GetPrivateProfileString(varSection, "Back", "", buffer, MAX_SIZE, iniFile); + NewNode->localVars->wizbut->back = buffer; + if (NewNode->localVars->wizbut->back == "") + { + NewNode->localVars->wizbut->back = parentNode->localVars->wizbut->back; + } + + GetPrivateProfileString(varSection, "Next", "", buffer, MAX_SIZE, iniFile); + NewNode->localVars->wizbut->next = buffer; + if (NewNode->localVars->wizbut->next == "") + { + NewNode->localVars->wizbut->next = parentNode->localVars->wizbut->next; + } + GetPrivateProfileString(varSection, "Cancel", "", buffer, MAX_SIZE, iniFile); + NewNode->localVars->wizbut->cancel = buffer; + if (NewNode->localVars->wizbut->cancel == "") + { + NewNode->localVars->wizbut->cancel = parentNode->localVars->wizbut->cancel; + } + CString tempPageVar = ""; int index = iniFile.ReverseFind('\\'); @@ -584,7 +609,11 @@ void CWizardMachineApp::CreateNode() GlobalDefaults->localVars->caption = "Globals"; GlobalDefaults->localVars->pageName = "Globals"; GlobalDefaults->localVars->image = "Globals"; - + GlobalDefaults->localVars->wizbut = new WIZBUT; + GlobalDefaults->localVars->wizbut->back = "localVars->wizbut->next = "Next>"; + GlobalDefaults->localVars->wizbut->cancel = "Exit"; + GlobalDefaults->localVars->wizbut->back = "Help"; GlobalDefaults->subPages = NULL; GlobalDefaults->navControls = NULL; GlobalDefaults->pageWidgets = NULL; diff --git a/cck/driver/WizardUI.cpp b/cck/driver/WizardUI.cpp index dfefc24b990..b7f88538772 100644 --- a/cck/driver/WizardUI.cpp +++ b/cck/driver/WizardUI.cpp @@ -128,8 +128,15 @@ BOOL CWizardUI::OnSetActive() CPropSheet* pSheet = (CPropSheet*) GetParent(); ASSERT_VALID(pSheet); + pSheet->GetDlgItem(ID_WIZBACK)->SetWindowText(CurrentNode->localVars->wizbut->back); + pSheet->GetDlgItem(ID_WIZNEXT)->SetWindowText(CurrentNode->localVars->wizbut->next); + pSheet->GetDlgItem(IDCANCEL)->SetWindowText(CurrentNode->localVars->wizbut->cancel); + + // Using the ini files to set the value as mentioned above + // instead of using the commented out code below + // !!! Use an OnEnter for this instead !!! - if (CurrentNode->localVars->functionality == "BuildInstallers") +/* if (CurrentNode->localVars->functionality == "BuildInstallers") { pSheet->GetDlgItem(ID_WIZNEXT)->SetWindowText("Build &Installers"); isBuildInstaller = TRUE; @@ -138,7 +145,7 @@ BOOL CWizardUI::OnSetActive() isBuildInstaller = FALSE; pSheet->GetDlgItem(ID_WIZNEXT)->SetWindowText("&Next >"); } - +*/ if (theApp.IsLastNode(CurrentNode)) { pSheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH); }