Old 23rd July 2019, 13:04   #1
DivyaArun
Junior Member
 
Join Date: Jul 2019
Posts: 30
Label with long contents not displayed in multi-line- MU1

Hi,

I have a label with contents set at run-time and the contents is too long , hence needs to be displayed as multi-line. Labels automatically word-wrap, but in my case, the contents gets cropped if it exceeds the width of the label.

The same when statically set in NSISDialogDesigner shows the contents as multi-line.

Please help!!

Thanks,
Divya
DivyaArun is offline   Reply With Quote
Old 23rd July 2019, 13:41   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,169
MUI page (welcome/finish) or a custom page?

Please post some minimal code that recreates the issue.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 24th July 2019, 05:44   #3
DivyaArun
Junior Member
 
Join Date: Jul 2019
Posts: 30
Quote:
Originally Posted by Anders View Post
MUI page (welcome/finish) or a custom page?

Please post some minimal code that recreates the issue.
It's a custom page. Nothing complicated I have done

Function serverConfigPage
!insertmacro MUI_HEADER_TEXT "Confirm Settings" ""

nsDialogs::Create 1018
Pop $serverConfigDialog

${If} $serverConfigDialog == error
Abort
${EndIf}

; === Label6 (type: Label) ===
${NSD_CreateLabel} 89.52u 68.46u 50% 55.38u "$INSTDIR"

nsDialogs::Show

FunctionEnd
DivyaArun is offline   Reply With Quote
Old 24th July 2019, 22:16   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,169
Floating point numbers are not actually supported but everything else looks OK. You could inspect the control with WinSpy++ to make sure it has the expected size.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 25th July 2019, 06:38   #5
DivyaArun
Junior Member
 
Join Date: Jul 2019
Posts: 30
Quote:
Originally Posted by Anders View Post
Floating point numbers are not actually supported but everything else looks OK. You could inspect the control with WinSpy++ to make sure it has the expected size.
Hi,

I was able to find the cause of the issue. I was trying to display my appdata folder in the label, which is a long string without any space EX: C:\Users\....\AppData\Local\.....
When I added space after each '\', the string was displayed in multiple lines.

Thanks
DivyaArun is offline   Reply With Quote
Old 25th July 2019, 09:51   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,169
The style of a label can be modified so that it displays "c:\users\....\lastfolder\file" if the string is too long.

Another alternative is to use a read-only editbox without borders, Explorer does that in some places where it needs to display a path.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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