Archive: Creating a text area


Creating a text area
I really need to create my own license page and so I would like to know how to create a text area, is it possible to do it ?


does someone know if a command like ${NLS_textarea} exists in NSIS ???


http://forums.winamp.com/showthread....hreadid=283466


Thank you very much it seems to be exactly what I need, I try that tomorrow at work.

Thank you again.


I tried this code to include my text file :

File /oname=$PLUGINSDIR\EULA.txt "EULA.txt"

nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_MULTILINE}|${WS_VSCROLL}|
${WS_HSCROLL} ${__NSD_Text_EXSTYLE} 160 150 290 50

POP $0

CustomLicense::LoadFile "$PLUGINSDIR\EULA.txt" "$0"

But the compiler does not accept the line 'CustomLicense::LoadFile "$PLUGINSDIR\EULA.txt" "$0"'

Does anybody know why ?


OK so, I installed the plugin to the CustomLicense, I defined a variable LicenseText to load my text file and I put this code in my function :

InitPluginsDir

nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_MULTILINE}|${WS_VSCROLL}|${WS_HSCROLL} ${__NSD_Text_EXSTYLE} 160 150 290 50
Pop $2

File /oname=$PLUGINSDIR\${LICENSETEXT} "${LICENSETEXT}"

FindWindow $1 "#32770" "" $HWNDPARENT
GetDlgItem $1 $1 1000

CustomLicense::LoadFile "$PLUGINSDIR\${LICENSETEXT}" $1
Pop $2
SetCtlColors $2 ${LabelTextColor} ${LabelBackgroundColor}
nsDialogs::Show

The compiler compile but there is a big error when I execute the .exe file.

The question is WHY ??


I know have this code with a ${LICENSETEXT} = my text file :

InitPluginsDir
nsDialogs::Create /NOUNLOAD 1018

File /oname=$PLUGINSDIR\${LICENSETEXT} "${LICENSETEXT}"

FindWindow $9 "#32770" "" $HWNDPARENT
GetDlgItem $9 $9 1000
CustomLicense::LoadFile "$PLUGINSDIR\${LICENSETEXT}" $9

nsDialogs::CreateControl /NOUNLOAD ${__NSD_Text_CLASS} ${DEFAULT_STYLES}|${WS_TABSTOP}|${ES_AUTOHSCROLL}|${ES_MULTILINE}|${WS_VSCROLL}|${WS_HSCROLL} ${__NSD_Text_EXSTYLE} 20 45 425 150
Pop $1
nsDialogs::Show

The TextArea appears but not the text from the file, I really not find why.


You need to add a text string at the end of the CreateControl Command, and there is no need for the FindWindow part.
See the other post:
http://forums.winamp.com/showthread....hreadid=283466


At the adress "nsis.sourceforge.net/CustomLicense_plug-in" I found the detail of the CustomLicense plugin, but I need a little bit more explanations (I put my comments after ### on each line I don't understand) :

;--------------------------------
;Include Modern UI

!include "MUI.nsh"

;--------------------------------
;General

;Name and file
Name "BigLicense-Test"
OutFile "biglictest.exe"

; define name of the Licensepage
!define LICENSEPAGE "license.txt"

ReserveFile "${NSISDIR}\${LICENSEPAGE}"

Function CustomLicensePagePre
InitPluginsDir

File /oname=$PLUGINSDIR\${LICENSEPAGE} "${LICENSEPAGE}" ### Am I oblige to put my text file in $PLUGINSDIR ?

FindWindow $0 "#32770" "" $HWNDPARENT ### What makes this line of code ?
GetDlgItem $0 $0 1000 ### What makes this line of code ?

CustomLicense::LoadFile "$PLUGINSDIR\${LICENSEPAGE}" $0

FunctionEnd

;--------------------------------
;Pages

!define MUI_PAGE_CUSTOMFUNCTION_SHOW "CustomLicensePagePre" ### I have steel a page name license.nsh, how can I adapt this line ?
!insertmacro MUI_PAGE_LICENSE "dummy.txt" ### If I understand this line I just create a blank text file ?

!insertmacro MUI_PAGE_INSTFILES

Section

;section ...

SectionEnd

;--------------------------------
;Languages

!insertmacro MUI_LANGUAGE "English"