Old 30th July 2010, 22:38   #1
jrlarkin87
Junior Member
 
Join Date: May 2010
Posts: 14
NSIS OnChange

Hey All,

I am a Java/C# coder that has been pushed into the NSIS world and require some assistance. I currently have an Installer screen that sets values in a Drop box(drop list) during the show page method. When that list is changed I need to use another function to get another value to set for a different field. To Simplify I need to set a new field based off of what the old field is without going to a knew page. I need to simulate an onchange in NSIS I am using the ini pages so I cant use the nsDialog::OnChange. Can someone please help to direct me in the right direction even if its only better documentation.

Thanks,
jrlarkin87 is offline   Reply With Quote
Old 30th July 2010, 22:51   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You have to use nsDialogs.

Stu
Afrow UK is offline   Reply With Quote
Old 30th July 2010, 23:14   #3
jrlarkin87
Junior Member
 
Join Date: May 2010
Posts: 14
Is that possible with the ini visual editor stuff in eclipse?? Can I use nsDialog to take control of a pre-existing field?? Sorry for my lack of knowledge on the subject, but I have yet to find any good references for NSIS other then the forums.
jrlarkin87 is offline   Reply With Quote
Old 30th July 2010, 23:38   #4
jrlarkin87
Junior Member
 
Join Date: May 2010
Posts: 14
So I made a little progress I guess your supposed to use like a NOTIFY flag not sure how to use it yet, but seems to be the key.
jrlarkin87 is offline   Reply With Quote
Old 31st July 2010, 02:23   #5
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
in theory if nothing else you should be able to use the NSD_OnChange functionality with a dialog built originally from InstallOptions(2/Ex) - as long as you set the OnChange event -before- the page is displayed. You can get the hwnd of the control (Which you'll need for the OnChange) out of the INI after initialization

However.. I'd recommend re-building the page with nsDialogs entirely. There's already an example that's similar to the sort of thing you would need:
http://nsis.sourceforge.net/Move_data_between_ListBoxes

If you do insist on continuing with InstallOptions(2/Ex), then you do indeed need the NOTIFY flag on the droplist control. I'm not sure if the original InstallOptions supports it on that control so you might have to switch to InstallOptionsEx. Once the NOTIFY event works correctly, the page's Leave function will be triggered - at which point you'll have to read the INI file and read the state of the page to see which user action triggered that leave event.
Animaether is offline   Reply With Quote
Old 2nd August 2010, 18:25   #6
jrlarkin87
Junior Member
 
Join Date: May 2010
Posts: 14
Hey Guys,

Thanks for the replies so far. So I figured out how to use the flag to an extent. I can then use a switch statement to determine what action to take. I am having a new problem though!? The flag sends me to the Leave Page Function. I read that Choice A was changed, and based on the information from Choice A I write a new selection for Choice B. However, after it shows a message box(which I have used to verify that the function I desired was indeed being called). It doesn't change choice B as it should. Currently the code is simply using the MUI_OPTIONS_WRITE macro... Any Suggestions on what to do in order to get the changes to stick when it aborts the leave page function?
jrlarkin87 is offline   Reply With Quote
Old 2nd August 2010, 19:28   #7
jrlarkin87
Junior Member
 
Join Date: May 2010
Posts: 14
Noticed Something if I set off the flag, it writes the changed value and I hit next. Once I go back to the page it suddenly shows up?
jrlarkin87 is offline   Reply With Quote
Old 2nd August 2010, 23:05   #8
jrlarkin87
Junior Member
 
Join Date: May 2010
Posts: 14
Hey,

Alright I am getting better results using GetDlgItem and then I can set text boxes with SW_SETTEXT. Id like to know what WinMessaging has for populating the droplist and setting its state? Is it as simple as SETState? EW that sounds good ill try that lol if there are any more solid answers please let me know!

P.S: I now know more about NSIS then I ever wanted to know!

Thanks,
J
jrlarkin87 is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

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