Old 3rd May 2019, 14:42   #1
Andreathered
Junior Member
 
Join Date: May 2019
Posts: 3
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:
code:
${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
Attached Thumbnails
Click image for larger version

Name:	droplist_err.png
Views:	142
Size:	6.5 KB
ID:	54442  
Andreathered is offline   Reply With Quote
Old 3rd May 2019, 16:02   #2
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 334
hello
im testing,But there was no problem...

HTML Code:
!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
r2du-soft is offline   Reply With Quote
Old 3rd May 2019, 16:03   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,097
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).

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 8th May 2019, 08:58   #4
Andreathered
Junior Member
 
Join Date: May 2019
Posts: 3
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:

HTML 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 is offline   Reply With Quote
Old 8th May 2019, 12:48   #5
Andreathered
Junior Member
 
Join Date: May 2019
Posts: 3
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.
Andreathered is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
droplist, nsdialogs, nsis

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump