Old 12th April 2018, 14:09   #1
scharrca
Junior Member
 
Join Date: Feb 2018
Posts: 5
Checkbox text alignment

Using nsDialogs I have a checkbox control with a long text, so that the text get wraped across three lines.
In this case the square of the checkbox is horizontaly aligned with the text.

Is it possible that the square of the checkbox is aligned with the first row of the text?


Regards
Carsten
scharrca is offline   Reply With Quote
Old 12th April 2018, 16:33   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
The layout you are talking about is probably the Windows default.

Showing us your nsDialogs code would be great so I don't have to waste time trying to replicate whatever you are taking about.

Windows version and selected theme/visual style is also useful information to have...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th April 2018, 08:05   #3
scharrca
Junior Member
 
Join Date: Feb 2018
Posts: 5
Im on Windows 10 (1709) with default theme/visual style and NSIS 3.03

Using MUI2 and the control is on an custom page with the following code:

code:

${NSD_CreateCheckBox} 120u 40u 100u 30u "Just a long label text so\
that it get wraped to more \
then one line."
Pop $HWND_CheckBox
${NSD_OnClick} $HWND_CheckBox Event_OnClick



In this case the checkbox square is aligned with the 2nd row but i would like to achieve alignment with the 1st row.

Thanks
Carsten
scharrca is offline   Reply With Quote
Old 13th April 2018, 14:12   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
https://groups.google.com/d/topic/mi...on/gHgAFaXrXKo claims BS_TOP will work. You can try adding ${BS_TOP} with the NSD_AddStyle macro.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 13th April 2018, 15:07   #5
scharrca
Junior Member
 
Join Date: Feb 2018
Posts: 5
I tried a view button styles beside ${BS_TOP} like ${BS_MULTILINE} and ${BS_TEXT} and a combination of them but now luck yet.

https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

A Workaround would be a seperate label but to get the same behave its more coding.
scharrca is offline   Reply With Quote
Old 14th April 2018, 03:14   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
nsDialogs defaults to center but you can pick your own style:

Quote:
nsDialogs::CreateControl ${__NSD_CheckBox_CLASS} ${DEFAULT_STYLES}|${WS_TABSTOP}|${BS_TEXT}|${BS_TOP}|${BS_AUTOCHECKBOX}|${BS_MULTILINE} ${__NSD_CheckBox_EXSTYLE}" 120u 40u 100u 30u "Just a long label text so\
that it get wraped to more \
then one line."

Pop $HWND_CheckBox

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th April 2018, 07:36   #7
scharrca
Junior Member
 
Join Date: Feb 2018
Posts: 5
Perfect!

Thanks very much!
scharrca 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