Old 11th November 2012, 21:35   #1
sss123next
Junior Member
 
Join Date: Oct 2012
Posts: 28
Conversion between pixels/dialog units/percents

Is here exists any way to convert percents to pixels, dialog units to pixels, e.t.c. ?
sss123next is offline   Reply With Quote
Old 11th November 2012, 23:19   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
For nsDialogs or something else? nsDialogs allows you to specify measurements in dialog units by using the "u" suffix. For example:

code:
${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
Pop $Label


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 12th November 2012, 00:14   #3
sss123next
Junior Member
 
Join Date: Oct 2012
Posts: 28
for nsdialogs, let me explain, i have completely dynamic data with values in percents, i need to make link in check/radio box text label, i trying to use multiple label/link control for this, i have found gettextextent function macros, but it giving pixels, so i need to convert percents which i have in data to pixels for properly assign positions to windows, i have already asked about link in checkbox label here http://forums.winamp.com/showthread.php?t=350860
sss123next is offline   Reply With Quote
Old 12th November 2012, 03:26   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,153
You can call user32::GetClientRect on the inner dialog hwnd, then calculate the percent based on that

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 12th November 2012, 05:12   #5
sss123next
Junior Member
 
Join Date: Oct 2012
Posts: 28
thx for info.
sss123next 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