Added support for URLDisplayLength to DynamicText widgets.

Fixes bug 119400
This commit is contained in:
mitchf%netscape.com 2002-06-18 20:36:09 +00:00
Родитель 711b8ec900
Коммит 5a4fc11bdc
12 изменённых файлов: 22 добавлений и 7 удалений

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

@ -83,6 +83,7 @@ Height=15
[Widget 7]
Type=DynamicText
Name=LargeAnimPath
URLDisplayLength=78
Value=
Start_x=11
Start_y=93
@ -92,6 +93,7 @@ Height=15
[Widget 972]
Type=DynamicText
Name=LargeStillPath
URLDisplayLength=78
Value=
Start_x=11
Start_y=125

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

@ -81,6 +81,7 @@ Height=20
[Widget 6]
Type=DynamicText
Name=ShellBgBitmap
URLDisplayLength=47
Value=
Start_x=12
Start_y=86
@ -203,6 +204,7 @@ Height=12
[Widget 15]
Type=DynamicText
Name=ShellInstallTextFile
URLDisplayLength=47
Value=
Start_x=12
Start_y=223

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

@ -64,6 +64,7 @@ Height=13
[Widget 2]
Type=DynamicText
Name=IntSetupBgBitmap
URLDisplayLength=47
Value=
Start_x=11
Start_y=86

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

@ -213,7 +213,7 @@ Start_y=218
Width=47
Height=17
onInit=Enable2(%CustomizationList%)
onCommand=VerifySet(%CustomizationList%,Choose an existing configuration or create a new one);SetGlobal(_FromConfigName,%CustomizationList%);wizard.CopyConfig(_NewConfigName);GenerateDirList(CustomizationList,%Root%Configs\*.*);SelectItem(%_NewConfigName%);CopyDir(%Root%Configs\%_FromConfigName%,%Root%Configs\%_NewConfigName%)
onCommand=VerifySet(%CustomizationList%,Choose an existing configuration or create a new one);SetGlobal(_FromConfigName,%CustomizationList%);wizard.CopyConfig(_NewConfigName);CreateCache();GenerateDirList(CustomizationList,%Root%Configs\*.*);SelectItem(%_NewConfigName%);CopyDir(%Root%Configs\%_FromConfigName%,%Root%Configs\%_NewConfigName%)
; GenerateFileList not required due to the way NewConfigDialog works,
; but this should be changed at some point...

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

@ -122,6 +122,7 @@ Height=8
[Widget 11]
Type=DynamicText
Name=CustomBookmarkFile
URLDisplayLength=47
Value=
Start_x=11
Start_y=126

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

@ -94,6 +94,7 @@ onInit=DisableWidget(%lPlatform%,Mac OS)
[Widget 1910]
Type=DynamicText
Name=ReadMeFile
URLDisplayLength=47
Value=
Start_x=11
Start_y=138

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

@ -1353,6 +1353,10 @@ void CWizardMachineApp::BuildWidget(WIDGET* aWidget, CString iniSection, CString
GetPrivateProfileString(iniSection, "Attrib", "", buffer, MAX_SIZE, iniFile);
aWidget->attrib = buffer;
GetPrivateProfileString(iniSection, "URLDisplayLength", "", buffer, MAX_SIZE, iniFile);
aWidget->URLDisplayLength = atoi(buffer);;
GetPrivateProfileString(iniSection, "Options", "", buffer, MAX_SIZE, iniFile);
aWidget->items = buffer;

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

@ -55,6 +55,7 @@ typedef struct WIDGET
CString target;
CString description;
CString showinsection; // Used in the ShowSection command to show and hide widgets based on selection in a listbox.
int URLDisplayLength;
POINT location;
DIMENSION size;
FIELDLEN fieldlen;

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

@ -678,7 +678,7 @@ void CWizardUI::CreateControls()
else if (widgetType == "DynamicText") {
curWidget->control = new CStatic;
curWidget->display = theInterpreter->GetTrimFile(curWidget->value);
curWidget->display = theInterpreter->GetTrimFile(curWidget->value,curWidget->URLDisplayLength);
rv = ((CStatic*)curWidget->control)->Create(curWidget->display, SS_LEFT, tmpRect, this, ID);
}

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

@ -153,7 +153,7 @@ BOOL CInterpret::BrowseFile(WIDGET *curWidget)
if (tmpWidget->type == "EditBox")
tmpWidget->display = fullFileName;
else
tmpWidget->display = GetTrimFile(fullFileName);
tmpWidget->display = GetTrimFile(fullFileName,tmpWidget->URLDisplayLength);
}
}
((CEdit*)tmpWidget->control)->SetWindowText(tmpWidget->display);
@ -624,15 +624,15 @@ BOOL CInterpret::CallDLL(char *dll, char *proc, char *parms, WIDGET *curWidget)
return TRUE;
}
CString CInterpret::GetTrimFile(CString filePath)
CString CInterpret::GetTrimFile(CString filePath, int URLDisplayLength)
{
int fileLength=0;
int findSlash=0;
fileLength = filePath.GetLength();
if (fileLength > FILEPATHLENGTH)
if (fileLength > URLDisplayLength)
{
findSlash = filePath.Find('\\');
filePath.Delete(findSlash+1,(fileLength - FILEPATHLENGTH));
filePath.Delete(findSlash+1,(fileLength - URLDisplayLength));
filePath.Insert(findSlash+1,"...");
}
return filePath;
@ -891,6 +891,7 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
}
}
else if (strcmp(pcmd, "IsNonAscii") == 0)
{
// check if user agent string contains non-ascii characters
@ -1231,6 +1232,7 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
{
if (curWidget)
NewConfig(curWidget, CString(parms),"Create Copy");
}
#endif
// Delete a configuration

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

@ -53,7 +53,7 @@ public:
BOOL CInterpret::GetRegistryKey( HKEY key, const char *subkey, char *retdata );
BOOL CInterpret::OpenBrowser(const char *url);
BOOL CInterpret::OpenViewer(const char *url);
CString CInterpret::GetTrimFile(CString filePath);
CString CInterpret::GetTrimFile(CString filePath, int URLDisplayLength);
// Overrides
// ClassWizard generated virtual function overrides

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

@ -55,6 +55,7 @@ typedef struct WIDGET
CString target;
CString description;
CString showinsection; // Used in the ShowSection command to show and hide widgets based on selection in a listbox.
int URLDisplayLength;
POINT location;
DIMENSION size;
FIELDLEN fieldlen;