diff --git a/Contrib/InstallOptions/InstallerOptions.cpp b/Contrib/InstallOptions/InstallerOptions.cpp index fe6e496d..a19ab545 100644 --- a/Contrib/InstallOptions/InstallerOptions.cpp +++ b/Contrib/InstallOptions/InstallerOptions.cpp @@ -32,34 +32,6 @@ 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) @@ -101,6 +73,8 @@ struct TableEntry { int LookupToken(TableEntry*, char*); int LookupTokens(TableEntry*, char*); +void ConvertNewLines(char *str); + struct FieldType { char *pszText; char *pszState; @@ -377,12 +351,13 @@ bool SaveSettings(void) { return true; } +#define BROWSE_WIDTH 15 + void AddBrowseButtons() { // this function loops through all the controls and if a filerequest or dirrequest // control is found, then it adds the corresponding browse button. // NOTE: this also resizes the text box created to make room for the button. int nIdx; - int nWidth = 15; FieldType *pNewField; for (nIdx = nNumFields - 1; nIdx >= 0; nIdx--) { @@ -403,7 +378,7 @@ void AddBrowseButtons() { //pNewField->pszValidateText = NULL; pNewField->rect.right = pFields[nIdx].rect.right; - pNewField->rect.left = pNewField->rect.right - nWidth; + pNewField->rect.left = pNewField->rect.right - BROWSE_WIDTH; pNewField->rect.bottom = pFields[nIdx].rect.bottom; pNewField->rect.top = pFields[nIdx].rect.top; @@ -514,7 +489,7 @@ bool ReadSettings(void) { // Label Text - convert newline - if (pFields[nIdx].nType == FIELD_LABEL && pFields[nIdx].pszText) { + if (pFields[nIdx].nType == FIELD_LABEL) { ConvertNewLines(pFields[nIdx].pszText); } @@ -1123,3 +1098,33 @@ int LookupTokens(TableEntry* psTable_, char* pszTokens_) } return n; } + +void ConvertNewLines(char *str) { + char *p1, *p2; + if (!str) return; + 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; +} \ No newline at end of file diff --git a/Contrib/InstallOptions/Readme.html b/Contrib/InstallOptions/Readme.html index 253fa010..4b59f022 100644 --- a/Contrib/InstallOptions/Readme.html +++ b/Contrib/InstallOptions/Readme.html @@ -235,7 +235,7 @@ numbers from 1 to NumFields. Each Field section can contain the following values (optional) Specifies the caption of a label, checkbox, or radio button control. For icon and bitmaps control this specifies the path to the image.

- Note: For labels, \r\n will be converted to a newline. + Note: For labels, \r\n will be converted to a newline. To use a back-slash in your text you have to escape it using another back-slash - \\. State @@ -277,10 +277,10 @@ numbers from 1 to NumFields. Each Field section can contain the following values ValidateText (optional) - If a particular field fails the test for + If the field fails the test for "MinLen" or "MaxLen", a messagebox will be displayed with this text.

- Note: \r\n will be converted to a newline. + Note: \r\n will be converted to a newline, two back-slashes will be converted to one - \\. Left
Right
Top
Bottom
(required) diff --git a/Plugins/InstallOptions.dll b/Plugins/InstallOptions.dll index 8abfff94..e9047569 100644 Binary files a/Plugins/InstallOptions.dll and b/Plugins/InstallOptions.dll differ