applied patch #1634704 - FOCUS flag for InstallOptions Plugin

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4864 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-01-23 17:33:31 +00:00
parent bd86ee1bfc
commit 31154c4424
2 changed files with 19 additions and 4 deletions

View file

@ -120,6 +120,7 @@ char *WINAPI STRDUP(const char *c)
// WS_HSCROLL 0x00100000 // *ALL*
// WS_VSCROLL 0x00200000 // *ALL*
// WS_DISABLED 0x08000000 // *ALL*
#define FLAG_FOCUS 0x10000000 // Controls that can receive focus
struct TableEntry {
char *pszName;
@ -481,6 +482,7 @@ int WINAPI ReadSettings(void) {
{ "VSCROLL", WS_VSCROLL },
{ "DISABLED", WS_DISABLED },
{ "TRANSPARENT", TRANSPARENT_BMP },
{ "FOCUS", FLAG_FOCUS },
{ NULL, 0 }
};
FieldType *pField = pFields + nIdx;
@ -949,6 +951,7 @@ int WINAPI createCfgDlg()
}
BOOL fFocused = FALSE;
BOOL fFocusedByFlag = FALSE;
#define DEFAULT_STYLES (WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS)
#define RTL_EX_STYLES (WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR)
@ -1339,10 +1342,15 @@ int WINAPI createCfgDlg()
#endif
}
// Set initial focus to the first appropriate field
if (!fFocused && (dwStyle & (WS_TABSTOP | WS_DISABLED)) == WS_TABSTOP && pField->nType >= FIELD_SETFOCUS) {
fFocused = TRUE;
mySetFocus(hwCtrl);
// Set initial focus to the first appropriate field ( with FOCUS flag)
if (!fFocusedByFlag && (dwStyle & (WS_TABSTOP | WS_DISABLED)) == WS_TABSTOP && pField->nType >= FIELD_SETFOCUS) {
if (pField->nFlags & FLAG_FOCUS) {
fFocusedByFlag = TRUE;
}
if (!fFocused || fFocusedByFlag) {
fFocused = TRUE;
mySetFocus(hwCtrl);
}
}
// If multiline-readonly then hold the text back until after the

View file

@ -507,6 +507,13 @@ create multiple groups of radio button and makes keyboard
navigation using arrow keys easier.</td>
</tr>
<tr>
<td class="righttable">FOCUS</td>
<td class="righttable">Sets focus on the specified control,
instead of the first focusable control. If more than one field
is specified with this flag, only the last one will receive
focus.</td>
</tr>
<tr>
<td class="righttable">NOTABSTOP</td>
<td class="righttable">Do not stop on the control when the user
pressed the Tab key. Add NOTABSTOP to all controls of a group