Skip to content
⌘ NSIS Forum Archive

Problem displaying droplist

5 posts

Andreathered#

Problem displaying droplist

Hello Everyone,

i'm facing a problem with nsDialogs when creating a droplist. I've tried several times but the result is always the same:



As you can see the droplist is drawn like a line and when you mouse over the line it appear (as the second one).

I've tried to create it with NSISDialogDesigner and it works fine, but when i change parameters as x and y it disappear again.

This is the instruction:
${NSD_CreateDropList} 150.86u $1 59.9u 14u ""
where $1 is dynamic (i've tried already with a fixed number).

I hope anyone can help me out.


Bye
r2du-soft#
hello
im testing,But there was no problem...

!include "MUI2.nsh"

Page Custom Welcome_Page
!insertmacro MUI_LANGUAGE English

Function Welcome_Page

nsDialogs::Create 1044 
Pop $R0 
${If} $R0 == error 
    Abort 
${EndIf} 

StrCpy $1 50
${NSD_CreateDropList} 150.86u $1 59.9u 14u ""
Pop $R0

StrCpy $2 80
${NSD_CreateDropList} 150.86u $2 59.9u 14u ""
Pop $R1
nsDialogs::Show 
FunctionEnd

Section

SectionEnd
send here the full code custom page
Anders#
The size does not support fractional numbers (probably a bug in your editor). And the height of a combobox is the dropped height, not the normal height. Change 14u to 100u or something like that. (Not really visible with XPStyle On).
Andreathered#
Hi,

i've tried with a new empty setup to make a single droplist and it works fine too, it seems that the problem is in my code:

[SIZE="1"]
Var drv_op_01
Var drv_op_02

Function nsDialogsPage

	nsDialogs::Create 1018
	Pop $0
	${If} $0 == error
		Abort
	${EndIf}
	
	${NSD_CreateLabel} 0u 0u 100% 12u "ACPI Comp."
	${NSD_CreateLabel} 100u 0u 100% 12u "Status"
	${NSD_CreateLabel} 150u 0 100% 12u "Operation"
	
	StrCpy $1 "6u"
	
	${If} $3 != "0"
		Top:
		Call get_single_dev
		
		${If} $2 == "-01"
			${NSD_CreateLabel} 0u $1 100% 12u "Device 01"
			${NSD_CreateDropList} 150u $1 60u 14u ""
			Pop $drv_op_01
			${If} $4 == "OK"
				StrCpy $4 "Running"
				${NSD_CB_AddString} $drv_op_01 "Update"
				${NSD_CB_AddString} $drv_op_01 "Remove"
			${Else}
				StrCpy $4 "Not Installed"
				${NSD_CB_AddString} $drv_op_01 "Install"
			${EndIf}
			${NSD_CB_AddString} $drv_op_01 "-"
			${NSD_CB_SelectString} $drv_op_01 "-"
		${EndIf}
		
		${If} $2 == "-02"
			${NSD_CreateLabel} 0u $1 100% 12u "Device 02"
			${NSD_CreateDropList} 150.86u $1 59.9u 14u ""
			Pop $drv_op_02
			${If} $4 == "OK"
				StrCpy $4 "Running"
				${NSD_CB_AddString} $drv_op_02 "Update"
				${NSD_CB_AddString} $drv_op_02 "Remove"
			${Else}
				StrCpy $4 "Not Installed"
				${NSD_CB_AddString} $drv_op_02 "Install"
			${EndIf}
			${NSD_CB_AddString} $drv_op_02 "-"
			${NSD_CB_SelectString} $drv_op_02 "-"
		${EndIf}
		
		${If} $3 != ""
			Goto Top ; Repete till $3 contains no data.
		${EndIf}		
	${EndIf}
		
	nsDialogs::Show
FunctionEnd

Function get_single_dev
	StrCpy $2 $3 3
	StrCpy $3 $3 "" 3
	StrCpy $4 $5 3
	StrCpy $4 $4 "" 1
	StrCpy $5 $5 "" 3
	IntOp $1 $1 + 16
	StrCpy $1 "$1 u"
FunctionEnd[/SIZE]
$3 contains a list of value i.e. "-01-02-03" returned from a macro if no ACPI device is found it returns "0".
Andreathered#
SOLVED.

i've found the problem in my code, i've created labels on the same row with 100% width, this means an overlapping of the text label over the droplist object.