Changed interpretation & initialization to use onInit and onCommand INI file directives
git-svn-id: svn://10.0.0.236/trunk@51094 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
0bbf0c1cfd
commit
e654e9fdbb
@ -125,16 +125,7 @@ Width=106
|
||||
|
||||
Height=67
|
||||
|
||||
dll=NULL
|
||||
|
||||
; Need to use this function because it inits the screen
|
||||
function=GenerateFileList
|
||||
|
||||
parameters=%Root%\NCIFiles\*.NCI
|
||||
|
||||
;function=command
|
||||
|
||||
;parameters=GenerateFileList(self,NCIFiles\*.NCI)
|
||||
onInit=GenerateFileList(self,Root%\NCIFiles\*.NCI)
|
||||
|
||||
|
||||
|
||||
@ -243,11 +234,7 @@ Width=51
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
parameters=NewNCIDialog(_NewNCIFileName);command(cmd.exe /c copy %Root%\NCItemplate "%Root%\NCIFiles\%_NewNCIFileName%");command(%NCIFileEditor% "%Root%\NCIFiles\%_NewNCIFileName%");inform(_NewNCIFileName,%Root%\NCIFiles);GenerateFileList(NCIFileList,%Root%\NCIFiles\*.NCI)
|
||||
onCommand=NewNCIDialog(_NewNCIFileName);command(cmd.exe /c copy %Root%\NCItemplate "%Root%\NCIFiles\%_NewNCIFileName%");command(%NCIFileEditor% "%Root%\NCIFiles\%_NewNCIFileName%");inform(_NewNCIFileName,%Root%\NCIFiles);GenerateFileList(NCIFileList,%Root%\NCIFiles\*.NCI)
|
||||
|
||||
Target=NCIFileList
|
||||
|
||||
@ -269,12 +256,7 @@ Width=51
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
;parameters=%NCIFileEditor% %NCIFileList%
|
||||
parameters=IterateListBox(NCIFileList,SHOW,%NCIFileEditor% "%Root%\NCIFiles\%%")
|
||||
onCommand=IterateListBox(NCIFileList,SHOW,%NCIFileEditor% "%Root%\NCIFiles\%%")
|
||||
|
||||
Target=NCIFileList
|
||||
|
||||
@ -296,11 +278,7 @@ Width=51
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
parameters=IterateListBox(NCIFileList,HIDE,cmd.exe /c del "%Root%\NCIFiles\%%");GenerateFileList(NCIFileList,%Root%\NCIFiles\*.NCI)
|
||||
onCommand=IterateListBox(NCIFileList,HIDE,cmd.exe /c del "%Root%\NCIFiles\%%");GenerateFileList(NCIFileList,%Root%\NCIFiles\*.NCI)
|
||||
|
||||
Target=NCIFileList
|
||||
|
||||
@ -321,11 +299,7 @@ Width=51
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=
|
||||
|
||||
|
||||
|
||||
[Widget 9]
|
||||
|
||||
@ -461,10 +435,8 @@ Width=60
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
parameters=BrowseFile()
|
||||
onCommand=BrowseFile()
|
||||
Target=NCIFileEditor
|
||||
|
||||
|
||||
@ -486,11 +458,5 @@ Width=60
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
;function=DisplayImage
|
||||
;parameters=loc.ini
|
||||
|
||||
function=command
|
||||
|
||||
parameters=DisplayImage(loc.ini)
|
||||
onCommand=DisplayImage(loc.ini)
|
||||
|
||||
@ -144,9 +144,6 @@ Width=40
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=
|
||||
|
||||
|
||||
[Widget 8]
|
||||
@ -159,9 +156,7 @@ Start_y=144
|
||||
|
||||
Width=50
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
Target=SmallStillPath
|
||||
|
||||
|
||||
@ -205,10 +200,7 @@ Width=40
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=
|
||||
|
||||
|
||||
[Widget 11]
|
||||
Type=Button
|
||||
@ -222,9 +214,7 @@ Width=50
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
Target=SmallAnimPath
|
||||
|
||||
[Widget 968]
|
||||
@ -269,10 +259,7 @@ Width=40
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=
|
||||
|
||||
|
||||
[Widget 970]
|
||||
Type=Button
|
||||
@ -284,9 +271,7 @@ Start_y=111
|
||||
|
||||
Width=50
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
Target=LargeAnimPath
|
||||
|
||||
[Widget 19]
|
||||
@ -299,9 +284,7 @@ Start_y=57
|
||||
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(button.ini)
|
||||
onCommand=DisplayImage(button.ini)
|
||||
|
||||
|
||||
[Widget 12]
|
||||
@ -346,9 +329,6 @@ Width=40
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=
|
||||
|
||||
|
||||
|
||||
@ -376,9 +356,7 @@ Start_y=159
|
||||
Width=50
|
||||
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
Target=LargeStillPath
|
||||
|
||||
;[Widget 15]
|
||||
@ -443,8 +421,6 @@ Start_x=336
|
||||
Start_y=227
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(coname.ini)
|
||||
onCommand=DisplayImage(coname.ini)
|
||||
|
||||
|
||||
|
||||
@ -94,9 +94,7 @@ Start_x=275
|
||||
Start_y=83
|
||||
Width=50
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
Target=ShellBgBitmap
|
||||
|
||||
[Widget 768]
|
||||
@ -107,8 +105,6 @@ Start_x=230
|
||||
Start_y=83
|
||||
Width=40
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=
|
||||
|
||||
|
||||
[Widget 21]
|
||||
@ -119,9 +115,7 @@ Start_x=330
|
||||
Start_y=83
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(shell1.ini)
|
||||
onCommand=DisplayImage(shell1.ini)
|
||||
|
||||
[Widget 3]
|
||||
Type=Text
|
||||
@ -149,9 +143,7 @@ Start_x=330
|
||||
Start_y=160
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(shell2.ini)
|
||||
onCommand=DisplayImage(shell2.ini)
|
||||
|
||||
|
||||
[Widget 8]
|
||||
@ -221,8 +213,6 @@ Start_x=230
|
||||
Start_y=223
|
||||
Width=40
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=
|
||||
|
||||
|
||||
[Widget 16]
|
||||
@ -233,9 +223,7 @@ Start_x=275
|
||||
Start_y=223
|
||||
Width=50
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
Target=ShellInstallTextFile
|
||||
|
||||
[Widget 22]
|
||||
@ -246,9 +234,7 @@ Start_x=330
|
||||
Start_y=223
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(shell4.ini)
|
||||
onCommand=DisplayImage(shell4.ini)
|
||||
|
||||
|
||||
|
||||
|
||||
@ -72,8 +72,6 @@ Start_x=226
|
||||
Start_y=86
|
||||
Width=50
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=
|
||||
|
||||
|
||||
[Widget 3]
|
||||
@ -84,9 +82,7 @@ Start_x=280
|
||||
Start_y=86
|
||||
Width=50
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
Target=IntSetupBgBitmap
|
||||
|
||||
[Widget 15]
|
||||
@ -97,9 +93,7 @@ Start_x=334
|
||||
Start_y=86
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(accnt1.ini)
|
||||
onCommand=DisplayImage(accnt1.ini)
|
||||
|
||||
|
||||
[Widget 4]
|
||||
@ -139,9 +133,7 @@ Start_x=334
|
||||
Start_y=152
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(accnt3.ini)
|
||||
onCommand=DisplayImage(accnt3.ini)
|
||||
|
||||
[Widget 689]
|
||||
Type=Text
|
||||
@ -189,9 +181,7 @@ Start_x=335
|
||||
Start_y=218
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(accnt2.ini)
|
||||
onCommand=DisplayImage(accnt2.ini)
|
||||
|
||||
|
||||
[Widget 6435]
|
||||
|
||||
@ -157,10 +157,6 @@ Width=40
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=
|
||||
|
||||
|
||||
|
||||
|
||||
@ -271,11 +267,7 @@ Width=60
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
parameters=DisplayImage(inst.ini)
|
||||
onCommand=DisplayImage(inst.ini)
|
||||
|
||||
|
||||
[Widget 507]
|
||||
@ -294,14 +286,10 @@ Width=50
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
onCommand=BrowseFile()
|
||||
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
Target=InstallerCustomBitmapPath
|
||||
|
||||
parameters=
|
||||
|
||||
|
||||
[Widget 200]
|
||||
|
||||
@ -319,10 +307,6 @@ Width=60
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
parameters=DisplayImage(splash.ini)
|
||||
onCommand=DisplayImage(splash.ini)
|
||||
|
||||
|
||||
|
||||
@ -43,9 +43,7 @@ Start_x=210
|
||||
Start_y=218
|
||||
Width=77
|
||||
Height=17
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=NewConfigDialog(_NewConfigName)
|
||||
onCommand=NewConfigDialog(_NewConfigName)
|
||||
target=CustomizationList
|
||||
|
||||
[Widget 1]
|
||||
@ -77,9 +75,7 @@ Start_y=220
|
||||
Width=185
|
||||
Height=99
|
||||
subsection=Options for ComboBox1
|
||||
dll=NULL
|
||||
function=GenerateDirList
|
||||
parameters=%Root%\Configs\*.*
|
||||
onInit=GenerateDirList(self,%Root%\Configs\*.*)
|
||||
[Options for ComboBox1]
|
||||
|
||||
|
||||
@ -210,9 +206,7 @@ Start_x=300
|
||||
Start_y=218
|
||||
Width=77
|
||||
Height=17
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=VerifySet(%CustomizationList%,Choose an existing configuration or create a new one);SetGlobal(_FromConfigName,%CustomizationList%);NewConfigDialog(_NewConfigName);CopyDir(%Root%\Configs\%_FromConfigName%,%Root%\Configs\%_NewConfigName%);Reload(%Root%\Configs\%_NewConfigName%)
|
||||
onCommand=VerifySet(%CustomizationList%,Choose an existing configuration or create a new one);SetGlobal(_FromConfigName,%CustomizationList%);NewConfigDialog(_NewConfigName);CopyDir(%Root%\Configs\%_FromConfigName%,%Root%\Configs\%_NewConfigName%);Reload(%Root%\Configs\%_NewConfigName%)
|
||||
|
||||
; GenerateFileList not required due to the way NewConfigDialog works,
|
||||
; but this should be changed at some point...
|
||||
|
||||
@ -80,9 +80,7 @@ Start_x=339
|
||||
Start_y=78
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(home.ini)
|
||||
onCommand=DisplayImage(home.ini)
|
||||
|
||||
[Widget 4]
|
||||
Type=GroupBox
|
||||
@ -131,9 +129,7 @@ Start_x=340
|
||||
Start_y=221
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(help.ini)
|
||||
onCommand=DisplayImage(help.ini)
|
||||
|
||||
[Widget 7]
|
||||
Type=Text
|
||||
@ -199,8 +195,6 @@ Start_x=240
|
||||
Start_y=137
|
||||
Width=40
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=
|
||||
|
||||
|
||||
[Widget 12]
|
||||
@ -211,9 +205,7 @@ Start_x=285
|
||||
Start_y=137
|
||||
Width=50
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
Target=CustomBookmarkFile
|
||||
|
||||
[Widget 21]
|
||||
@ -224,9 +216,7 @@ Start_x=340
|
||||
Start_y=137
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(bkmk.ini)
|
||||
onCommand=DisplayImage(bkmk.ini)
|
||||
|
||||
|
||||
|
||||
|
||||
@ -93,9 +93,7 @@ Start_x=259
|
||||
Start_y=112
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(string.ini)
|
||||
onCommand=DisplayImage(string.ini)
|
||||
|
||||
|
||||
[Widget 6]
|
||||
|
||||
@ -255,10 +255,7 @@ Width=50
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
|
||||
Target=ReadMeFile
|
||||
|
||||
@ -298,11 +295,7 @@ Width=60
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
parameters=DisplayImage(start.ini)
|
||||
onCommand=DisplayImage(start.ini)
|
||||
|
||||
|
||||
|
||||
@ -341,11 +334,7 @@ Width=60
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
parameters=DisplayImage(readme.ini)
|
||||
onCommand=DisplayImage(readme.ini)
|
||||
|
||||
|
||||
[Widget 118]
|
||||
@ -363,9 +352,3 @@ Start_y=190
|
||||
Width=40
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=
|
||||
|
||||
|
||||
|
||||
@ -63,9 +63,7 @@ Start_x=6
|
||||
Start_y=71
|
||||
Width=330
|
||||
Height=13
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=toggleEnabled(%Network%,Text103,Text10389,FTPLocation)
|
||||
onCommand=toggleEnabled(%Network%,Text103,Text10389,FTPLocation)
|
||||
|
||||
|
||||
[Widget 3]
|
||||
@ -86,9 +84,7 @@ Start_x=25
|
||||
Start_y=104
|
||||
Width=148
|
||||
Height=15
|
||||
dll=NULL
|
||||
function=Enable
|
||||
parameters=%Network%
|
||||
onInit=Enable(%Network%)
|
||||
|
||||
[Widget 5509]
|
||||
Type=EditBox
|
||||
@ -98,9 +94,7 @@ Start_x=175
|
||||
Start_y=101
|
||||
Width=188
|
||||
Height=15
|
||||
dll=NULL
|
||||
function=Enable
|
||||
parameters=%Network%
|
||||
onInit=Enable(%Network%)
|
||||
|
||||
[Widget 472]
|
||||
Type=Text
|
||||
@ -110,9 +104,7 @@ Start_x=25
|
||||
Start_y=84
|
||||
Width=370
|
||||
Height=20
|
||||
dll=NULL
|
||||
function=Enable
|
||||
parameters=%Network%
|
||||
onInit=Enable(%Network%)
|
||||
|
||||
|
||||
[Widget 4937]
|
||||
@ -144,9 +136,7 @@ Start_x=329
|
||||
Start_y=206
|
||||
Width=62
|
||||
Height=15
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(string.ini)
|
||||
onCommand=DisplayImage(string.ini)
|
||||
|
||||
|
||||
[Widget 6]
|
||||
|
||||
@ -42,8 +42,6 @@ Title=Installer Information
|
||||
|
||||
Caption=1st level node
|
||||
|
||||
Function=BuildInstallers
|
||||
|
||||
|
||||
|
||||
[Navigation Controls]
|
||||
@ -207,10 +205,7 @@ Width=36
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
|
||||
Target=CustomComponent1
|
||||
|
||||
@ -250,10 +245,7 @@ Width=36
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
|
||||
Target=CustomComponent2
|
||||
|
||||
@ -506,9 +498,7 @@ Start_x=260
|
||||
Start_y=181
|
||||
Width=60
|
||||
Height=14
|
||||
dll=NULL
|
||||
function=command
|
||||
parameters=DisplayImage(net.ini)
|
||||
onCommand=DisplayImage(net.ini)
|
||||
|
||||
|
||||
|
||||
@ -636,10 +626,7 @@ Height=9
|
||||
|
||||
;Height=15
|
||||
|
||||
;dll=IBEngine.dll
|
||||
|
||||
;function=command
|
||||
;parameters=BrowseFile
|
||||
;onCommand=BrowseFile()
|
||||
|
||||
;Target=???
|
||||
|
||||
|
||||
@ -42,8 +42,6 @@ Title=Netscape Client Customization Kit - Page 10 of 10 %CustomizationList%
|
||||
|
||||
Caption=1st level node
|
||||
|
||||
Function=BuildInstallers
|
||||
|
||||
|
||||
|
||||
[Navigation Controls]
|
||||
@ -225,11 +223,7 @@ Width=50
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
|
||||
target=CustomComponent1
|
||||
|
||||
@ -356,11 +350,7 @@ Width=50
|
||||
|
||||
Height=14
|
||||
|
||||
dll=NULL
|
||||
|
||||
function=command
|
||||
|
||||
parameters=BrowseFile
|
||||
onCommand=BrowseFile()
|
||||
|
||||
target=CustomComponent137
|
||||
|
||||
@ -520,10 +510,8 @@ Width=75
|
||||
|
||||
Height=15
|
||||
|
||||
dll=NULL
|
||||
onCommand=ShowSum()
|
||||
|
||||
function=command
|
||||
parameters=ShowSum()
|
||||
;Type=ProgressBar
|
||||
|
||||
;Name=myProgBar
|
||||
|
||||
@ -429,8 +429,10 @@ NODE* CWizardMachineApp::CreateNode(NODE *parentNode, CString iniFile)
|
||||
}
|
||||
GetPrivateProfileString(varSection, "Caption", "", buffer, MAX_SIZE, iniFile);
|
||||
NewNode->localVars->caption = buffer;
|
||||
/* Obsolete...
|
||||
GetPrivateProfileString(varSection, "Function", "", buffer, MAX_SIZE, iniFile);
|
||||
NewNode->localVars->functionality = buffer;
|
||||
*/
|
||||
|
||||
NewNode->localVars->wizbut = new WIZBUT;
|
||||
GetPrivateProfileString(varSection, "Back", "", buffer, MAX_SIZE, iniFile);
|
||||
@ -1348,12 +1350,18 @@ void CWizardMachineApp::BuildWidget(WIDGET* aWidget, CString iniSection, CString
|
||||
else
|
||||
aWidget->fieldlen.length = MAX_SIZE;
|
||||
|
||||
/* Obsolete...
|
||||
GetPrivateProfileString(iniSection, "dll", "", buffer, MAX_SIZE, iniFile);
|
||||
aWidget->action.dll = buffer;
|
||||
GetPrivateProfileString(iniSection, "function", "", buffer, MAX_SIZE, iniFile);
|
||||
aWidget->action.function = buffer;
|
||||
GetPrivateProfileString(iniSection, "parameters", "", buffer, MAX_SIZE, iniFile);
|
||||
strcpy(aWidget->action.parameters, buffer);
|
||||
*/
|
||||
GetPrivateProfileString(iniSection, "onInit", "", buffer, MAX_SIZE, iniFile);
|
||||
aWidget->action.onInit = buffer;
|
||||
GetPrivateProfileString(iniSection, "onCommand", "", buffer, MAX_SIZE, iniFile);
|
||||
aWidget->action.onCommand = buffer;
|
||||
|
||||
/// Dynamic ID allocation
|
||||
aWidget->widgetID = pageBaseIndex + idCounter;
|
||||
@ -1368,8 +1376,10 @@ void CWizardMachineApp::BuildWidget(WIDGET* aWidget, CString iniSection, CString
|
||||
subSection = new char[sizeof(buffer)];
|
||||
strcpy(subSection, buffer);
|
||||
|
||||
/* Don't tie options to functions...
|
||||
if (aWidget->action.function == "")
|
||||
{
|
||||
*/
|
||||
int counter = 0;
|
||||
int i = 0;
|
||||
char* ComponentKey;
|
||||
@ -1393,10 +1403,12 @@ void CWizardMachineApp::BuildWidget(WIDGET* aWidget, CString iniSection, CString
|
||||
}
|
||||
}
|
||||
aWidget->numOfOptions = counter;
|
||||
/*
|
||||
}
|
||||
else {
|
||||
aWidget->numOfOptions = 0;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -21,6 +21,8 @@ typedef struct ACTIONSET
|
||||
CString dll;
|
||||
CString function;
|
||||
char parameters[MAX_SIZE];
|
||||
CString onInit;
|
||||
CString onCommand;
|
||||
}ACTIONSET;
|
||||
|
||||
typedef struct DIMENSION
|
||||
|
||||
@ -274,249 +274,6 @@ void CWizardUI::OnPaint()
|
||||
|
||||
BOOL CWizardUI::ActCommand(WIDGET *curWidget)
|
||||
{
|
||||
#ifdef USETHEOLDMETHODOFHANDLINGCOMMANDS
|
||||
char params[MAX_SIZE];
|
||||
|
||||
UpdateGlobals();
|
||||
|
||||
CString function;
|
||||
strcpy(params, curWidget->action.parameters);
|
||||
int numCommands=0;
|
||||
char target[MID_SIZE] = {'\0'};
|
||||
char baseCommand[MID_SIZE] = {'\0'};
|
||||
char *args[MAX_SIZE];
|
||||
BOOL informAct = FALSE;
|
||||
|
||||
|
||||
char *commands[MIN_SIZE];
|
||||
|
||||
|
||||
commands[0] = (char *) GlobalAlloc(0, MAX_SIZE * sizeof(char));
|
||||
commands[0] = strtok(params, ";");
|
||||
|
||||
int i=0;
|
||||
while (commands[i])
|
||||
{
|
||||
i++;
|
||||
commands[i] = strtok(NULL, ";");
|
||||
if (commands[i])
|
||||
{
|
||||
if(!(strcmp(commands[i], "inform")))
|
||||
{
|
||||
informAct = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
numCommands = i;
|
||||
|
||||
if (curWidget->target != "")
|
||||
{
|
||||
strcpy(target, curWidget->target);
|
||||
}
|
||||
|
||||
WIDGET* tmpWidget = theApp.findWidget((char*) (LPCTSTR)curWidget->target);
|
||||
CString tmpFunction = tmpWidget->action.function;
|
||||
CString tmpParams = CString(tmpWidget->action.parameters);
|
||||
|
||||
char localPath[MAX_SIZE] = {'\0'};
|
||||
|
||||
if (strrchr(tmpParams,'\\')) {
|
||||
strncpy(localPath, tmpParams, strlen(tmpParams) - strlen(strrchr(tmpParams,'\\')));
|
||||
}
|
||||
|
||||
|
||||
char *commandList[MIN_SIZE];
|
||||
int commandListLength = 0;
|
||||
BOOL abortProcessing = FALSE;
|
||||
BOOL newEntry = FALSE;
|
||||
BOOL commandBuilt = FALSE;
|
||||
CString entryName;
|
||||
|
||||
for (int j=0; j < numCommands; j++)
|
||||
{
|
||||
commandListLength = 0;
|
||||
if (!abortProcessing)
|
||||
{
|
||||
// Need to replace this gunk with replaceVars() call, but listbox iterator needs
|
||||
// to be solved first.
|
||||
int numArgs = 0;
|
||||
|
||||
|
||||
int x=0;
|
||||
args[x] = (char *) GlobalAlloc(0, MAX_SIZE * sizeof(char));
|
||||
args[x] = strtok((char *)(LPCTSTR) commands[j], " ");
|
||||
|
||||
commandList[commandListLength] = (char *) GlobalAlloc(0, MAX_SIZE * sizeof(char));
|
||||
|
||||
while (args[x])
|
||||
{
|
||||
x++;
|
||||
args[x] = strtok(NULL, " ");
|
||||
}
|
||||
|
||||
numArgs = x;
|
||||
|
||||
if ((strstr(args[0], "ConfigDialog")))
|
||||
{
|
||||
CNewDialog newDlg;
|
||||
newDlg.DoModal();
|
||||
entryName = newDlg.GetData();
|
||||
newEntry = TRUE;
|
||||
}
|
||||
if (newEntry && entryName == "")
|
||||
{
|
||||
abortProcessing = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!newEntry)
|
||||
{
|
||||
for (int k=0; k < numArgs; k++)
|
||||
{
|
||||
if (!(strstr(args[k], "%")))
|
||||
{
|
||||
if (!commandBuilt)
|
||||
{
|
||||
strcpy(commandList[commandListLength], args[k]);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(commandList[commandListLength], args[k]);
|
||||
}
|
||||
strcat(commandList[commandListLength]," ");
|
||||
commandBuilt = TRUE;
|
||||
|
||||
if (k+1 == numArgs)
|
||||
commandListLength++;
|
||||
}
|
||||
else
|
||||
{
|
||||
args[k]++;
|
||||
args[k][strlen(args[k])-1] = '\0';
|
||||
|
||||
WIDGET* aWidget = theApp.findWidget(args[k]);
|
||||
|
||||
if (aWidget)
|
||||
{
|
||||
if (aWidget->type == "ListBox")
|
||||
{
|
||||
/* --- Broken at the moment due to listbox value overhaul ---
|
||||
|
||||
// Listbox iterator: apply command to each selected value
|
||||
//
|
||||
// Use this index value to find the string from the listbox
|
||||
// If the index is a ',' separated list, iterate over each value
|
||||
CString valueSet = aWidget->value;
|
||||
|
||||
char *values[MIN_SIZE];
|
||||
|
||||
int numValues=0;
|
||||
values[numValues] = (char *) GlobalAlloc(0, MAX_SIZE * sizeof(char));
|
||||
values[numValues] = strtok((char *)(LPCTSTR)valueSet, ",");
|
||||
while (values[numValues])
|
||||
{
|
||||
numValues++;
|
||||
values[numValues] = strtok(NULL, ",");
|
||||
}
|
||||
|
||||
if (strstr(commandList[0]," ")) {
|
||||
strncpy(baseCommand, commandList[0], strlen(commandList[0]) - (strlen(strstr(commandList[0]," "))) );
|
||||
strcat(baseCommand, " ");
|
||||
}
|
||||
|
||||
for (int index=0; index < numValues; index++)
|
||||
{
|
||||
|
||||
char valueBuffer[MAX_SIZE] = {'\0'};
|
||||
((CListBox*)aWidget->control)->GetText(atoi(values[index]), valueBuffer);
|
||||
|
||||
if (index >0)
|
||||
{
|
||||
commandList[commandListLength] = (char *) GlobalAlloc(0, MAX_SIZE * sizeof(char));
|
||||
strcpy(commandList[commandListLength], baseCommand);
|
||||
strcat(commandList[commandListLength], currDirPath);
|
||||
if (localPath) {
|
||||
strcat(commandList[commandListLength], localPath);
|
||||
}
|
||||
strcat(commandList[commandListLength], "\\");
|
||||
strcat(commandList[commandListLength], valueBuffer);
|
||||
strcat(commandList[commandListLength], " ");
|
||||
commandListLength++;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(commandList[commandListLength], currDirPath);
|
||||
if (localPath) {
|
||||
strcat(commandList[commandListLength], localPath);
|
||||
}
|
||||
strcat(commandList[commandListLength], "\\");
|
||||
strcat(commandList[commandListLength], valueBuffer);
|
||||
strcat(commandList[commandListLength], " ");
|
||||
|
||||
if (k+1 == numArgs)
|
||||
{
|
||||
commandListLength++;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(commandList[commandListLength], (char *) (LPCTSTR) aWidget->value);
|
||||
strcat(commandList[commandListLength], " ");
|
||||
|
||||
if (k+1 == numArgs)
|
||||
{
|
||||
commandListLength++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (CString(args[k]) == "newEntry")
|
||||
{
|
||||
// Funky reference to newEntry as value just prompted for
|
||||
strcat(commandList[commandListLength], currDirPath);
|
||||
if (localPath) {
|
||||
strcat(commandList[commandListLength], localPath);
|
||||
}
|
||||
strcat(commandList[commandListLength], "\\");
|
||||
strcat(commandList[commandListLength], (char *) (LPCTSTR) entryName);
|
||||
|
||||
if (k+1 == numArgs)
|
||||
{
|
||||
commandListLength++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newEntry = FALSE;
|
||||
for (int listNum =0; listNum < commandListLength; listNum++)
|
||||
theApp.ExecuteCommand(commandList[listNum]);
|
||||
|
||||
// This is the list of the target widget, but assumes the function
|
||||
theApp.GenerateList(tmpFunction, tmpWidget, tmpParams);
|
||||
}
|
||||
|
||||
// Special dialog to show where the file was saved. Should be replaced with interpreted call in INI file
|
||||
if (informAct)
|
||||
{
|
||||
CWnd myWnd;
|
||||
char infoPath[MAX_SIZE] = {'\0'};
|
||||
strcpy(infoPath, currDirPath);
|
||||
if (localPath) {
|
||||
strcat(infoPath, localPath);
|
||||
}
|
||||
|
||||
if (entryName != "") {
|
||||
myWnd.MessageBox( entryName + " is saved in " + CString(infoPath), "Information", MB_OK);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -578,9 +335,13 @@ BOOL CWizardUI::NewConfig(WIDGET *curWidget, CString globalsName)
|
||||
if (!tmpWidget)
|
||||
return FALSE;
|
||||
|
||||
/*
|
||||
CString tmpFunction = tmpWidget->action.function;
|
||||
CString params = theInterpreter->replaceVars(tmpWidget->action.parameters,NULL);
|
||||
theApp.GenerateList(tmpFunction, tmpWidget, params);
|
||||
*/
|
||||
if (tmpWidget->action.onInit)
|
||||
theInterpreter->interpret(tmpWidget->action.onInit, curWidget);
|
||||
|
||||
((CComboBox*)tmpWidget->control)->SelectString(0, configField);
|
||||
|
||||
@ -715,13 +476,8 @@ BOOL CWizardUI::OnCommand(WPARAM wParam, LPARAM lParam)
|
||||
if (curWidget->widgetID != (int)wParam)
|
||||
continue;
|
||||
|
||||
if (curWidget->action.dll == "NULL")
|
||||
{
|
||||
if (curWidget->action.function == "command")
|
||||
theInterpreter->interpret(curWidget->action.parameters, curWidget);
|
||||
}
|
||||
else
|
||||
Progress();
|
||||
if (curWidget->action.onCommand)
|
||||
theInterpreter->interpret(curWidget->action.onCommand, curWidget);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -813,10 +569,11 @@ void CWizardUI::EnableWidget(WIDGET *curWidget)
|
||||
{
|
||||
// all controls are enabled by default, only do something if not enabled...
|
||||
int enabled = TRUE;
|
||||
if (curWidget->action.function == "Enable")
|
||||
if (curWidget->action.onInit)
|
||||
{
|
||||
CString enableStr = theInterpreter->replaceVars(curWidget->action.parameters,NULL);
|
||||
if (enableStr != "1")
|
||||
CString enableStr = theInterpreter->replaceVars(curWidget->action.onInit,NULL);
|
||||
// Cheat the interpret overhead since this is called a lot!
|
||||
if (enableStr == "Enable(0)")
|
||||
enabled = FALSE;
|
||||
curWidget->control->EnableWindow(enabled);
|
||||
}
|
||||
@ -980,12 +737,16 @@ void CWizardUI::CreateControls()
|
||||
((CListBox*)curWidget->control)->Create(LBS_STANDARD | LBS_MULTIPLESEL | WS_HSCROLL | WS_VSCROLL | WS_TABSTOP, tmpRect, this, ID);
|
||||
((CListBox*)curWidget->control)->ModifyStyleEx(NULL, WS_EX_CLIENTEDGE, 0);
|
||||
|
||||
if (curWidget->action.function == "GenerateFileList" ||
|
||||
curWidget->action.function == "GenerateDirList")
|
||||
/*
|
||||
if (curWidget->action.onInit == "GenerateFileList" ||
|
||||
curWidget->action.onInit == "GenerateDirList")
|
||||
{
|
||||
CString ext = theInterpreter->replaceVars(curWidget->action.parameters,NULL);
|
||||
theApp.GenerateList(curWidget->action.function, curWidget, ext);
|
||||
theApp.GenerateList(curWidget->action.onInit, curWidget, ext);
|
||||
}
|
||||
*/
|
||||
if (curWidget->action.onInit)
|
||||
theInterpreter->interpret(curWidget->action.onInit, curWidget);
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < curWidget->numOfOptions; i++)
|
||||
@ -1018,12 +779,16 @@ void CWizardUI::CreateControls()
|
||||
WS_TABSTOP, tmpRect, this, ID);
|
||||
((CCheckListBox*)curWidget->control)->ModifyStyleEx(NULL, WS_EX_CLIENTEDGE, 0);
|
||||
|
||||
if (curWidget->action.function == "GenerateFileList" ||
|
||||
curWidget->action.function == "GenerateDirList")
|
||||
/*
|
||||
if (curWidget->action.onInit == "GenerateFileList" ||
|
||||
curWidget->action.onInit == "GenerateDirList")
|
||||
{
|
||||
CString ext = theInterpreter->replaceVars(curWidget->action.parameters, NULL);
|
||||
theApp.GenerateList(curWidget->action.function, curWidget, ext);
|
||||
theApp.GenerateList(curWidget->action.onInit, curWidget, ext);
|
||||
}
|
||||
*/
|
||||
if (curWidget->action.onInit)
|
||||
theInterpreter->interpret(curWidget->action.onInit, curWidget);
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < curWidget->numOfOptions; i++)
|
||||
@ -1054,12 +819,16 @@ void CWizardUI::CreateControls()
|
||||
curWidget->control = new CComboBox;
|
||||
((CComboBox*)curWidget->control)->Create(CBS_DROPDOWNLIST | WS_TABSTOP, tmpRect, this, ID);
|
||||
|
||||
if (curWidget->action.function == "GenerateFileList" ||
|
||||
curWidget->action.function == "GenerateDirList")
|
||||
/*
|
||||
if (curWidget->action.onInit == "GenerateFileList" ||
|
||||
curWidget->action.onInit == "GenerateDirList")
|
||||
{
|
||||
CString ext = theInterpreter->replaceVars(curWidget->action.parameters,NULL);
|
||||
theApp.GenerateList(curWidget->action.function, curWidget, ext);
|
||||
theApp.GenerateList(curWidget->action.onInit, curWidget, ext);
|
||||
}
|
||||
*/
|
||||
if (curWidget->action.onInit)
|
||||
theInterpreter->interpret(curWidget->action.onInit, curWidget);
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < curWidget->numOfOptions; i++)
|
||||
|
||||
@ -163,6 +163,12 @@ BOOL CInterpret::IterateListBox(char *parms)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
CString CInterpret::replaceVars(CString str, char *listval)
|
||||
{
|
||||
char *theStr = (char *) (LPCTSTR) str;
|
||||
return replaceVars(theStr, listval);
|
||||
}
|
||||
|
||||
CString CInterpret::replaceVars(char *str, char *listval)
|
||||
{
|
||||
char buf[MIN_SIZE];
|
||||
@ -267,6 +273,12 @@ BOOL CInterpret::CallDLL(char *dll, char *proc, char *parms)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CInterpret::interpret(char *cmds, WIDGET *curWidget)
|
||||
{
|
||||
CString commands(cmds);
|
||||
return interpret(commands, curWidget);
|
||||
}
|
||||
|
||||
BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
|
||||
{
|
||||
// Make modifiable copy of string's buffer
|
||||
|
||||
@ -36,8 +36,10 @@ public:
|
||||
void CopyDir(CString from, CString to);
|
||||
void ExecuteCommand(char *command, int showflag);
|
||||
BOOL IterateListBox(char *parms);
|
||||
CString replaceVars(CString str, char *listval);
|
||||
CString replaceVars(char *str, char *listval);
|
||||
BOOL CallDLL(char *dll, char *proc, char *parms);
|
||||
BOOL interpret(char *cmds, WIDGET *curWidget);
|
||||
BOOL interpret(CString cmds, WIDGET *curWidget);
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user