Focus is now set when control initialisation is complete (e.g. after Link control HWNDPROC has been changed)
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3353 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
21d8b1cd46
commit
9298dd089c
2 changed files with 12 additions and 10 deletions
|
@ -1099,21 +1099,11 @@ int WINAPI createCfgDlg()
|
|||
if (hwCtrl) {
|
||||
// Sets the font of IO window to be the same as the main window
|
||||
mySendMessage(hwCtrl, WM_SETFONT, (WPARAM)hFont, TRUE);
|
||||
// Set initial focus to the first appropriate field
|
||||
if (!fFocused && (dwStyle & (WS_TABSTOP | WS_DISABLED)) == WS_TABSTOP) {
|
||||
fFocused = TRUE;
|
||||
mySetFocus(hwCtrl);
|
||||
}
|
||||
// make sure we created the window, then set additional attributes
|
||||
switch (pField->nType) {
|
||||
case FIELD_TEXT:
|
||||
case FIELD_FILEREQUEST:
|
||||
case FIELD_DIRREQUEST:
|
||||
// If multiline-readonly then hold the text back until after the
|
||||
// initial focus has been set. This is so the text is not initially
|
||||
// selected - useful for License Page look-a-likes.
|
||||
if ((pField->nFlags & (FLAG_MULTILINE | FLAG_READONLY)) == (FLAG_MULTILINE | FLAG_READONLY))
|
||||
mySetWindowText(hwCtrl, pField->pszState);
|
||||
mySendMessage(hwCtrl, EM_LIMITTEXT, (WPARAM)pField->nMaxLength, (LPARAM)0);
|
||||
break;
|
||||
|
||||
|
@ -1224,6 +1214,18 @@ int WINAPI createCfgDlg()
|
|||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Set initial focus to the first appropriate field
|
||||
if (!fFocused && (dwStyle & (WS_TABSTOP | WS_DISABLED)) == WS_TABSTOP) {
|
||||
fFocused = TRUE;
|
||||
mySetFocus(hwCtrl);
|
||||
}
|
||||
|
||||
// If multiline-readonly then hold the text back until after the
|
||||
// initial focus has been set. This is so the text is not initially
|
||||
// selected - useful for License Page look-a-likes.
|
||||
if ((pField->nFlags & (FLAG_MULTILINE | FLAG_READONLY)) == (FLAG_MULTILINE | FLAG_READONLY))
|
||||
mySetWindowText(hwCtrl, pField->pszState);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue