InstallOptions 2.1, always \r\n for newline

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2298 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2003-03-15 12:55:31 +00:00
parent 8d97504e76
commit 6b4c318e4b
4 changed files with 63 additions and 43 deletions

View file

@ -1,3 +1,14 @@
DLL version 2.1 (3/15/2003)
* \r\n converts to newline in both label Text and ValidateText
* New browse dialog style (modern)
* Word wrapping for check boxes and radio buttons
* No ugly border for edit fields under XP
* Scroll bar for list boxes
* Works with SetStaticBkColor
* DISABLED dir and file request fields now disable the browse button too
* No more STATE value for labels
* Minor fixes
DLL version 2.0 (1/4/2003)
* Supports custom font and DPI settings (by Joost Verburg)
* INI files should contain dialog units now, no pixels (by Joost Verburg)

View file

@ -32,6 +32,35 @@ char *STRDUP(const char *c)
return t;
}
void ConvertNewLines(char *str) {
char *p1, *p2;
for (p1=p2=str; *p1; p1++, p2++) {
if (*p1 == '\\') {
switch (p1[1]) {
case 'n':
*p2 = '\n';
break;
case 'r':
*p2 = '\r';
break;
case 't':
*p2 = '\t';
break;
case '\\':
*p2 = '\\';
break;
default:
p1--;
p2--;
break;
}
p1++;
}
else *p2 = *p1;
}
*p2 = 0;
}
#define FIELD_LABEL (1)
#define FIELD_ICON (2)
#define FIELD_BITMAP (3)
@ -482,33 +511,11 @@ bool ReadSettings(void) {
pFields[nIdx].nFlags |= LookupToken(FlagTable, szResult);
pFields[nIdx].pszText = myGetProfileStringDup(szField, "TEXT");
// Label Text - convert newline
if (pFields[nIdx].nType == FIELD_LABEL && pFields[nIdx].pszText) {
char *p1, *p2;
for (p1=p2=pFields[nIdx].pszText; *p1; p1++, p2++) {
if (*p1 == '\\') {
switch (p1[1]) {
case 'n':
*p2 = '\n';
break;
case 'r':
*p2 = '\r';
break;
case 't':
*p2 = '\t';
break;
case '\\':
*p2 = '\\';
break;
default:
p1--;
p2--;
break;
}
p1++;
}
else *p2 = *p1;
}
*p2 = 0;
ConvertNewLines(pFields[nIdx].pszText);
}
// pszState cannot be NULL (?)
@ -531,21 +538,11 @@ bool ReadSettings(void) {
pFields[nIdx].nMinLength = GetPrivateProfileInt(szField, "MinLen", 0, pszFilename);
pFields[nIdx].pszValidateText = myGetProfileStringDup(szField, "ValidateText");
// ValidateText - convert newline
if (pFields[nIdx].pszValidateText) {
// translate backslash-n in the input into actual carriage-return/line-feed characters.
for (char *pPos = pFields[nIdx].pszValidateText; *pPos; pPos++) {
if (*pPos == '\\') {
if ((*(pPos + 1) == 'n') || (*(pPos + 1) == 'N')) {
*pPos = '\r';
*(pPos + 1) = '\n';
/*
} else if (*(pPos + 1) == '\\') {
// if it's 2 backslash in a row, then skip the second.
pPos++;
*/
}
}
}
ConvertNewLines(pFields[nIdx].pszValidateText);
}
{

View file

@ -235,7 +235,7 @@ numbers from 1 to NumFields. Each Field section can contain the following values
<td class="lefttable"><span class="italic">(optional)</span></td>
<td class="righttable">Specifies the caption of a label, checkbox, or radio button control.
For icon and bitmaps control this specifies the path to the image.<br /><br />
<span class="bold">Note:</span> \r\n will be replaced by a newline for labels.
<span class="bold">Note:</span> For labels, \r\n will be converted to a newline.
</td></tr>
<tr>
<td class="lefttable"><span class="bold">State</span></td>
@ -280,8 +280,7 @@ numbers from 1 to NumFields. Each Field section can contain the following values
<td class="righttable">If a particular field fails the test for
"<span class="italic">MinLen</span>" or "<span class="italic">MaxLen</span>",
a messagebox will be displayed with this text.<br /><br /><span class="bold">
Note:</span> The only formatting performed on this text is "\n" will be
replaced with a newline in the messagebox.</td></tr>
Note:</span> \r\n will be converted to a newline.</td></tr>
<tr>
<td class="lefttable"><span class="bold">Left<br />Right<br />Top<br />Bottom</span></td>
<td class="lefttable"><span class="italic">(required)</span></td>
@ -511,6 +510,19 @@ FunctionEnd
</pre>
<p class="header">Version history</p>
<ul>
<li>DLL version 2.1 (3/15/2003)
<ul>
<li>\r\n converts to newline in both label Text and ValidateText</li>
<li>New browse dialog style (modern)</li>
<li>Word wrapping for check boxes and radio buttons</li>
<li>No ugly border for edit fields under XP</li>
<li>Scroll bar for list boxes</li>
<li>Works with SetStaticBkColor</li>
<li>DISABLED dir and file request fields now disable the browse button too</li>
<li>No more STATE value for labels</li>
<li>Minor fixes
</ul>
<p class="text"></p>
<li>DLL version 2.0 (1/4/2003)
<ul>
<li>Supports custom font and DPI settings (by Joost Verburg)</li>

Binary file not shown.