Old 30th August 2011, 16:20   #1
hphantom
Junior Member
 
Join Date: Apr 2011
Posts: 15
Show form in MessageBox?

Hi everyone,

I was wondering if it was possible in NSIS to show a form within MessageBox? I've tried, but my code fails (I can only get strings to show, none of the input boxes). Basically, I wanted the user to click on a button, which would trigger a popup (MessageBox), and that pop-up contained the next form to submit. Am trying to avoid creating another page if at all possible.

Thanks!
hphantom is offline   Reply With Quote
Old 30th August 2011, 17:06   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
The only thing I know of that can do this is the DlgHost plug-in. It is extremely experimental, and should therefore never be used in a commercial product, or anything that needs to adhere to any level of reliability.

One thing you can consider is to add the form to the same page that your button is on, only make it hidden at first. Then make it visible when the button is clicked. This way, you can have many different form fields on the same page, that are disabled and invisible unless they need to be used.
MSG is offline   Reply With Quote
Old 30th August 2011, 17:48   #3
hphantom
Junior Member
 
Join Date: Apr 2011
Posts: 15
Would there be a way to append a new box to the existing one then? So I have the form in the same page, just disabled, and then the size of the existing page will increase/decrease to fit the relevant form, depending on whether or not the button was clicked.
hphantom is offline   Reply With Quote
Old 31st August 2011, 10:47   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Just use nsWindows plug-in and create your own message box.

Stu
Afrow UK is offline   Reply With Quote
Old 31st August 2011, 16:23   #5
hphantom
Junior Member
 
Join Date: Apr 2011
Posts: 15
Thanks for the recommendation, Stu! I managed to figure everything but the ${NSD_CreateText} - it still shows up on the original page rather the new window (every other ${NSD_Create*} seems to work/show up in the new window.) Any idea why this would happen?

If it helps, this is my test code for the new window:
code:
Function OnClickTrial
${NSW_CreateWindow} $WINDOW "Testing" 1044

${NSW_CreateLabel} 10 10 80 20 "Full Name:"
Pop $0

${NSD_CreateText} 85 10 150 20 "$fullName"
Pop $fullNameTextBox

${NSW_Show}
FunctionEnd



EDIT: It seems I got it to work with the INI file instead. Am still wondering why CreateText won't work otherwise; but at least the INI works.
hphantom is offline   Reply With Quote
Old 31st August 2011, 17:12   #6
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You should probably use ${NSW_CreateLabel}, not ${NSD_CreateLabel}..?
MSG is offline   Reply With Quote
Old 31st August 2011, 17:21   #7
hphantom
Junior Member
 
Join Date: Apr 2011
Posts: 15
How embarrassing, that worked! Thank you!
hphantom is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
form, messagebox, nsis

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