Archive: ComboBox Craze


ComboBox Craze
I am tearing my hair out trying to figure out how to do a simple (really simple) combo box. All it has to do is have a few selections and whichever the user selects needs to be accessible in the nsi file. Here's the .ini file I'm trying to do this with:

_____________________________________________________
; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=1
Title=ComboBox
CancelShow=0
BackEnabled=0

[Field 1]
Type=Combobox
Text=Select Dog
ListItems=MyDog1|MyDog2|MyDog3
Left=144
Right=308
Top=76
Bottom=99
_____________________________________________________

The code is where I get in trouble. The doc confused my little brain... Here's what I've tried (and many other things):

_____________________________________________________
;NSIS Script For Testing ComboBoxes

;Backgound Colors
BGGradient 800080 000000 FFFFFF
BrandingText " "

;Title Of Your Application
Name "Test"

;---------------------
;Include Modern UI

!include "MUI.nsh"

;Do A CRC Check
CRCCheck On

;Output File Name
OutFile "Test.exe"

;The Default Installation Directory
InstallDir "D:\Dir"

;The text to prompt the user to enter a directory
DirText "Please select the folder below"


Section "Install"

Page custom DogComboBox
!insertmacro MUI_PAGE_COMPONENTS

SectionEnd

Function .onInit

InitPluginsDir
File /oname=D:\Test\DogsComboBox.ini DogsComboBox.ini

FunctionEnd

Function SetCustom ;FunctionName defined with Page command

;Display the Install Options dialog

Push $R0

InstallOptions::dialog D:\Test\DogsComboBox.ini
Pop $R0

FunctionEnd

_____________________________________________________

Thanks for any help!!!

Eric


Your code always extracts DogsComboBox.ini to D:\Test. That's not a good idea. Some users might not even have a D: drive. Did you take a look at the examples in Contrib\InstallOptions?


Thanks for the reply kichik. We hadn't seen those examples. Only the one in C:\Program Files\NSIS\Examples\Modern UI\InstallOptions.nsi and it had no combobox. Is the "DropList" in TestNotify.ini the same basic thing as a combobox? Thanks -Eric


As the InstallOptions readme states:

A "Combobox" allows the user to type text not in the popup list, a "Droplist" only allows selection of items in the list.