DLL version 2.4 (1/4/2004)

* Initial focus is set in "initDialog" making it possible to override it from NSIS prior to calling "show"
- When initial focus is to a Text field InstallOptions now follows standard Windows behaviour by having the text selected
- Label and other static fields no longer have State= written to the INI file when leaving the dialog
- NOTIFY flag can now be used with Link fields (State should be omitted in this case)
- Likewise, State can now be used with Button fields (behaves the same as with Link fields)
- NOTIFY flag can also now be used with ListBox and DropList fields to have NSIS notified when the selection changes
- Meaning of RIGHT flag is now reversed in right-to-left language mode
- HSCROLL and VSCROLL flags are no longer restricted to Text fields
- Various Link field fixes
- Text box colour bug fix


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3350 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
eccles 2004-01-04 14:06:39 +00:00
parent 1b2abf06de
commit e1c4b80991
7 changed files with 372 additions and 273 deletions

View file

@ -30,6 +30,8 @@ Page custom ShowCustom LeaveCustom ": Testing InstallOptions"
Function ShowCustom
; Initialise the dialog but don't show it yet
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Test the right-to-left version?" IDNO +2
WriteINIStr "$PLUGINSDIR\test.ini" "Settings" "RTL" "1"
InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\test.ini"
; In this mode InstallOptions returns the window handle so we can use it
Pop $hwnd
@ -45,9 +47,10 @@ Function LeaveCustom
; At this point the user has either pressed Next or one of our custom buttons
; We find out which by reading from the INI file
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Settings" "State"
StrCmp $0 0 validate ; Next button?
StrCmp $0 2 supportx ; "Install support for X"?
StrCmp $0 9 clearbtn ; "Clear" button?
StrCmp $0 0 validate ; Next button?
StrCmp $0 2 supportx ; "Install support for X"?
StrCmp $0 9 clearbtn ; "Clear" button?
StrCmp $0 11 droplist ; "Show|Hide" drop-list?
Abort ; Return to the page
supportx:
@ -65,10 +68,23 @@ clearbtn:
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
GetDlgItem $1 $hwnd 1206 ; DirRequest control (1200 + field 6 - 1 + 1 browse button)
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
GetDlgItem $1 $hwnd 1209 ; DirRequest control (1200 + field 8 - 1 + 2 browse buttons)
GetDlgItem $1 $hwnd 1209 ; Multiline control (1200 + field 8 - 1 + 2 browse buttons)
SendMessage $1 ${WM_SETTEXT} 0 "STR:"
Abort ; Return to the page
droplist:
; Make the DirRequest field depend on the droplist
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 11" "State"
StrCmp $0 "Show" +3
StrCpy $0 0
Goto +2
StrCpy $0 1
GetDlgItem $1 $hwnd 1206 ; DirRequest control (1200 + field 6 - 1 + 1 browse button)
EnableWindow $1 $0
GetDlgItem $1 $hwnd 1207 ; ... button (the following control)
EnableWindow $1 $0
Abort ; Return to the page
validate:
; At this point we know the Next button was pressed, so perform any validation
ReadINIStr $0 "$PLUGINSDIR\test.ini" "Field 2" "State"