Fixups to generatelist & related handling of listbox type widgets

git-svn-id: svn://10.0.0.236/trunk@52826 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
selmer%netscape.com
1999-11-05 00:36:17 +00:00
parent 34a8cb4799
commit c9b01acbd6
9 changed files with 273 additions and 370 deletions

View File

@@ -1405,126 +1405,6 @@ void CWizardMachineApp::BuildWidget(WIDGET* aWidget, CString iniSection, CString
}
void CWizardMachineApp::GenerateList(CString action, WIDGET* targetWidget, CString parentDirPath)
{
WIDGET* curWidget = targetWidget;
CFileFind fileList;
BOOL dirFound = fileList.FindFile(parentDirPath);
if(curWidget->type == "CheckListBox")
{
((CCheckListBox*)curWidget->control)->ResetContent();
}
if(curWidget->type == "ListBox")
{
((CListBox*)curWidget->control)->ResetContent();
}
if(curWidget->type == "ComboBox")
{
((CComboBox*)curWidget->control)->ResetContent();
}
while (dirFound)
{
dirFound = fileList.FindNextFile();
if (action == "GenerateFileList")
{
if (!fileList.IsDirectory()) // skip if this is a dir
{
CString tmpFile = fileList.GetFileName();
if(curWidget->type == "CheckListBox")
{
((CCheckListBox*)curWidget->control)->AddString(tmpFile);
}
if(curWidget->type == "ListBox")
{
((CListBox*)curWidget->control)->AddString(tmpFile);
}
if(curWidget->type == "ComboBox")
{
((CComboBox*)curWidget->control)->AddString(tmpFile);
}
}
}
if (action == "GenerateDirList")
{
if (fileList.IsDirectory()) // skip if this is not a dir
{
CString tmpFile = fileList.GetFileName();
if (!(tmpFile == "." || tmpFile == "..")) {
if(curWidget->type == "CheckListBox")
{
((CCheckListBox*)curWidget->control)->AddString(tmpFile);
}
if(curWidget->type == "ListBox")
{
((CListBox*)curWidget->control)->AddString(tmpFile);
}
if(curWidget->type == "ComboBox")
{
((CComboBox*)curWidget->control)->AddString(tmpFile);
}
}
}
}
}
fileList.Close();
if(curWidget->type == "CheckListBox")
{
if (curWidget->value && curWidget->value != "")
{
char indices[MAX_SIZE];
int i;
strcpy(indices, curWidget->value);
char *s = strtok(indices, ",");
for (; s; s=strtok(NULL, ","))
{
i = ((CCheckListBox*)curWidget->control)->FindString(0, s);
if (i != -1)
((CCheckListBox*)curWidget->control)->SetCheck(i, 1);
}
((CCheckListBox*)curWidget->control)->SetCurSel(0);
}
else
((CCheckListBox*)curWidget->control)->SetCurSel(0);
}
if(curWidget->type == "ListBox")
{
if (curWidget->value && curWidget->value != "")
{
char indices[MAX_SIZE];
strcpy(indices, curWidget->value);
char *s = strtok(indices, ",");
for (; s; s=strtok(NULL, ","))
((CListBox*)curWidget->control)->SelectString(0, s);
}
else
((CListBox*)curWidget->control)->SetCurSel(0);
}
else if(curWidget->type == "ComboBox")
{
if (curWidget->value && curWidget->value != "")
((CComboBox*)curWidget->control)->SelectString(-1, curWidget->value);
else
((CComboBox*)curWidget->control)->SetCurSel(0);
}
}
void CWizardMachineApp::HelpWiz()
{
CString helpvalue = (CurrentNode->localVars->wizbut->help);