Fixed flags collisions (thanks Ramon) and added the ONLY_NUMBERS flag

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2597 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-05-30 13:35:47 +00:00
parent ff40948ffa
commit 8dace3977a
3 changed files with 31 additions and 17 deletions

View file

@ -47,24 +47,35 @@ char *STRDUP(const char *c)
#define FIELD_GROUPBOX (12) #define FIELD_GROUPBOX (12)
// general flags // general flags
#define FLAG_BOLD (1) #define FLAG_RIGHT 0x00000001
#define FLAG_RIGHT (2)
#define FLAG_DISABLED (4) // OFN_OVERWRITEPROMPT 0x00000002
#define FLAG_GROUP (8) // OFN_HIDEREADONLY 0x00000004
#define FLAG_NOTABSTOP (16)
#define FLAG_DISABLED 0x00000008
#define FLAG_GROUP 0x00000010
#define FLAG_NOTABSTOP 0x00000020
// text box flags // text box flags
#define FLAG_PASSWORD (32) #define FLAG_PASSWORD 0x00000040
#define FLAG_ONLYNUMBERS 0x00000080
//#define FLAG_MULTILINE 0x00000100
// listbox flags // listbox flags
#define FLAG_MULTISELECT (64) #define FLAG_MULTISELECT 0x00000200
#define FLAG_EXTENDEDSEL (128) #define FLAG_EXTENDEDSEL 0x00000400
// OFN_PATHMUSTEXIST 0x00000800
// OFN_FILEMUSTEXIST 0x00001000
// OFN_CREATEPROMPT 0x00002000
// combobox flags // combobox flags
#define FLAG_DROPLIST (256) #define FLAG_DROPLIST 0x00004000
// bitmap flags // bitmap flags
#define FLAG_RESIZETOFIT (512) #define FLAG_RESIZETOFIT 0x00008000
// OFN_EXPLORER 0x00080000
struct TableEntry { struct TableEntry {
char *pszName; char *pszName;
@ -142,7 +153,7 @@ bool BrowseForFile(int nControlIdx) {
hControl = pThisField->hwnd; hControl = pThisField->hwnd;
ofn.Flags = pThisField->nFlags; ofn.Flags = pThisField->nFlags & (OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_CREATEPROMPT | OFN_EXPLORER);
// ofn.hInstance = m_hInstance; // no templates so we can leave this at NULL; // ofn.hInstance = m_hInstance; // no templates so we can leave this at NULL;
ofn.hwndOwner = hConfigWindow; ofn.hwndOwner = hConfigWindow;
@ -469,12 +480,8 @@ bool ReadSettings(void) {
{ "GROUP", FLAG_GROUP }, { "GROUP", FLAG_GROUP },
{ "DISABLED", FLAG_DISABLED }, { "DISABLED", FLAG_DISABLED },
{ "NOTABSTOP", FLAG_NOTABSTOP }, { "NOTABSTOP", FLAG_NOTABSTOP },
/* { "ONLY_NUMBERS", FLAG_ONLYNUMBERS },
{ "NO_ALPHA", 0 }, //{ "MULTILINE", FLAG_MULTILINE },
{ "NO_NUMBERS", 0 },
{ "NO_SYMBOLS", 0 },
{ "BOLD", FLAG_BOLD },
*/
{ NULL, 0 } { NULL, 0 }
}; };
@ -839,6 +846,10 @@ int createCfgDlg()
case FIELD_TEXT: case FIELD_TEXT:
if (pFields[nIdx].nFlags & FLAG_PASSWORD) if (pFields[nIdx].nFlags & FLAG_PASSWORD)
dwStyle |= ES_PASSWORD; dwStyle |= ES_PASSWORD;
if (pFields[nIdx].nFlags & FLAG_ONLYNUMBERS)
dwStyle |= ES_NUMBER;
/*if (pFields[nIdx].nFlags & FLAG_MULTILINE)
dwStyle |= ES_WANTRETURN | ES_MULTILINE;*/
title = pFields[nIdx].pszState; title = pFields[nIdx].pszState;
break; break;
case FIELD_COMBOBOX: case FIELD_COMBOBOX:

View file

@ -403,6 +403,9 @@ numbers from 1 to NumFields. Each Field section can contain the following values
<tr> <tr>
<td class="righttable">DISABLED</td> <td class="righttable">DISABLED</td>
<td class="righttable">Causes a control to be disabled.</td></tr> <td class="righttable">Causes a control to be disabled.</td></tr>
<tr>
<td class="righttable">ONLY_NUMBERS</td>
<td class="righttable">Used by "<span class="italic">Text</span>" controls. Forces the user to enter only numbers into the edit box.</td></tr>
</table></td></tr></table> </table></td></tr></table>
<p class="header">How to use</p> <p class="header">How to use</p>
<p class="subheader">Modern UI</p> <p class="subheader">Modern UI</p>

Binary file not shown.