Archive: nsDialogs - NSD_SetTextLimit, NSD_Check


nsDialogs - NSD_SetTextLimit, NSD_Check
  Hi. I'm relatively new to the whole nsDialogs headers thing and there doesn't seem to be much documentation on how to use some of the newer macros. How would I use NSD_SetTextLimit and NSD_Check? I want to use NSD_check to check/uncheck radio buttons and settextlimit to limit the max amount of characters that can be input into a textbox.

Right now, I have this code to have radio button $RB_STATIC checked on load. I'm wondering if I can simplify this with NSD_Check?

${NSD_CreateRadioButton} 50u 8u 20% 8u "Static"

>Pop $RB_STATIC
GetFunctionAddress$0 SelectStatic
nsDialogs::OnClick /NOUNLOAD $RB_STATIC $0
SendMessage $RB_STATIC${BM_SETCHECK} ${BST_CHECKED} 0 ;check this box by default
How would I use NSD_SetTextLimit here?

53u 33u 65u 12u $ipaddr

Pop $TX_IP
>
Also, how can I set up 2 independent sets of radio buttons? (If i check one, it unchecks the other, but I want to have 2 sets of radio buttons)

Thanks in advance...

All macros are documented. If not, it's a bug and should be reported.

NSD_Check replaces ${BM_SETCHECK}. Simlpy use:

${NSD_CHeck} $RB_STATIC
You could also use ${NSD_OnClick} instead of the other 2 lines.
${NSD_OnClick} $RB_STATIC SelectStatic
For NSD_SetTextLimit, simply pass the control and the limit as documented.
${NSD_SetTextLimit} $TX_IP 10
For independent radio buttons, set the WS_GROUP style using the NSD_AddStyle macro to the first radio button of each group.

Oh, sorry! My bad. I had NSIS 2.35 and not 2.36. I see the docs now.

Thanks for your help!