Pawel
9th October 2009 13:51 UTC
[nsdialogs] Text control border
Hello,
Have a problem creating text control using nsDialogs.
I want to have a border, like on the screenshot. Have no idea what style I need to use. Someone knows?
I use this code to create control... but there is no border... WS_BORDER doeasnt work in nsis...
Var /Global SN_Edit1
${NSD_CreateText} 20u 50u 45u 12u "1234"
Pop $SN_Edit1
${NSD_SetTextLimit} $SN_Edit1 "4"
${NSD_AddStyle} $SN_Edit1 ${WS_CHILD}|${WS_VISIBLE}|${WS_TABSTOP}|${ES_CENTER}
-Pawel
Yathosho
9th October 2009 14:36 UTC
think you can use WS_BORDER, don't think there's something like BS_FLAT for text inputs. however, i'm not sure if you can specify the thickness of the border.
http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx
Anders
9th October 2009 17:31 UTC
WS_BORDER and _not_ WS_EX_CLIENTEDGE
Pawel
9th October 2009 21:22 UTC
hi, thanks.
${NSD_AddStyle} $SN_Edit1 ${WS_CHILD}|${WS_VISIBLE}|${WS_TABSTOP}|${ES_CENTER}|${WS_BORDER}
NSIS says that ${WS_BORDER} is unknown variable/constant...
What should I include to script?
I use:
!include "MUI2.nsh"
!include "Sections.nsh"
!include "nsDialogs.nsh"
!include "WordFunc.nsh"
!include "FileFunc.nsh"
-Pawel
Yathosho
9th October 2009 22:01 UTC
!define WS_BORDER 0x00800000
Pawel
10th October 2009 09:49 UTC
NSIS compiles code properly, with that definition.
But, the result is not what I want. Control has no black (dark) border...
Thank you guys.
-Pawel
Anders
10th October 2009 16:09 UTC
I thought you were a programmer Pawel?
Something like this maybe:
${NSD_CreateText} 20u 50u 45u 12u "1234"
pop $1
System::Call "user32::GetWindowLong(i r1, i ${GWL_EXSTYLE}) i .r0"
IntOp $2 ${WS_EX_CLIENTEDGE} !
IntOp $0 $0 & $2
System::Call "user32::SetWindowLong(i r1, i ${GWL_EXSTYLE}, i $0)"
${NSD_AddStyle} $1 0x00800000
Pawel
10th October 2009 18:17 UTC
Thanks Anders,
It is something I wanted to see...
Regards,
-Pawel
Ps: I am not a programmer :p (I am an engineer, but not IT)