Archive: nsDialog CreateControl Negative Height


nsDialog CreateControl Negative Height
NSIS 2.35

I am in the process of replacing all INI custom page logic to the new (and improved IMO) nsDialogs. I have no problem creating the controls, but I can't seem to use a negative height on an EDIT control without it becoming clipped at the bottom:

http://isupport.srpcs.com/kevin/NSIS_NegHeight.png

I tried changing the height from -1 to -30, but it doesn't seem to have any effect. Here is my complete custom page logic


Function DocMagicSettingsPage

!insertmacro MUI_HEADER_TEXT "Start Copying Files" "Review settings before copying files."

; set the install path
${If} $ExistingDSIDir != ""
StrCpy $INSTDIR $ExistingDSIDir
${EndIf}

; application information
StrCpy $R9 "Application Name: ${PRODUCT_NAME}$\r$\n$\r$\nDocMagic Directory: $INSTDIR$\r$\n$\r$\nClick <Install> to start client installation."

; create the dialog
nsDialogs::Create /NOUNLOAD 1018
Pop $R0
${If} $R0 == error
Abort
${EndIf}

; create Label 1
${NSD_CreateLabel} 0u 0u -1u 24u "Setup has enough information to start copying the program files If you want to review or change any settings, click Back. If you are satisfied with the settings, click Install to begin copying files."
Pop $R0

; create Label 2
${NSD_CreateLabel} 0u 32u -1u 8u "Current Settings:"
Pop $R0

; create text box
nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${__NSD_Text_STYLE}|${WS_VSCROLL}|${ES_MULTILINE}|${ES_READONLY} ${__NSD_Text_EXSTYLE} 0u 41u -1u -1u $R9
Pop $R0

; show it
nsDialogs::Show

FunctionEnd


Any help would be greatly appreciated.

you're extending the area of 1018, but you can resize it using a resource hacker to modify the ui.exe


I don't follow. How does setting the height of the control affect the size of 1018? Am I wrong, or does a negative height compute from the bottom of 1018?


Okay, I see now. When specifying a negative height, it calculates the height by subtracting the negative value from the total height. So, to have my text box stop at the very bottom, I have to specify -42u, to get 140 - 42.

This is not consistent with the behavior I see when setting the Width to -1u. In that case, the control goes to the far right side of 1018.

So, width set to -1u does not provide the same results of height set to -1u? Can someone confirm or clarify this?


i should've read more carefully.. tiiired :)


No problem. This isn't a show stopper as I can get around it by specifying absolute values. Still, if some can take a deeper look into this, I'd be very cursious to know if it's a bug or if I'm just missing something.


Specifying -1u for width worked because the control started at 0u. Unlike InstallOptions, it's not the point where the control ends, it's its actual width.