Skip to content
⌘ NSIS Forum Archive

Dynamic IO Pages

24 posts

Davion#

Dynamic IO Pages

OK, I searched the forums, but I didn't found anything that fits to my wishes.

I just wanted to create Dynamic IO Dialogs
something Like this

______________________________
|Which Database do you use
|( )ORACLE
|( )SQL
|
|
|
|______________________________

|
V
______________________________
|Which Database do you use
|( )ORACLE
|(X)SQL
|Please enter the Servername:
|
|Please enter the Database:
|______________________________

|
V
______________________________
|Which Database do you use
|(X)ORACLE
|( )SQL
|Please enter the TNS-Names:
|
|
|______________________________



It would be useful, cause the user hasn't to click throught 20 Dialogs when he can make 3 or 4 inputs in only one dynamic Dialog

is there anyway to do this?
Vytautas#
You might be able to achieve this with the new NOTIFY flag. I haven't used it before so I can't be sure, but from what I have read about it it should be possible.

Vytautas
Davion#
thats near to what I'm searching for,
but I would prefer it to hide the fields complete and not just disable them

nevertheless thanks Vytautas

PS.: Wouldn't it be fine to have a Flag or a Property like Visibility?
Vytautas#
You might be able to call a windows message to hide the fields from the callback function of NOTIFY 🧟 I hope.

I think the message you are looking for is something like WM_HIDE or WM_SHOW or something else.

Vytautas
Davion#
Hmm Sorry but I can't understand what you mean 🙁

hmm ok it seems that I have to create those nearly 20 Dialogs
evilO#
Hi Davion 🙂

Well, I hope you didn't start yet to write those 20 dialogs, as there IS a solution to your problem: dselkirk wrote a plugin that can show/hide controls:

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.



I compiled the Dll, and wrote a test script.. try it and let me know it it does work for you.. (tested and working on XP).


evilO/Olive
evilO#
Doh! I forgot to attach the DLL.. (just slept 3 hours last night.. 😁)
evilO#
Shame on me! I forgot the script too 🙁
Davion#
I receive an Error when I try to compile a script... don't really know how to work with this example

sorry I'm still a noob 🙁
Davion#
Damn cool it worked 😁

I just have to modify it a bit, but I'll tell you if it worked as I want it to

Thanks evilO
Davion#
Great Thanks evilO, it works fine - it's a bit confusing code, cause I didn't work with this commands until now, but it works and thats important

Great!

Dave
evilO#
I'm glad it's working 🙂

But sorry I think I didn't put any comment at all in the source code 🙁
So here is a commented version if that can help you or anybody else..

I hope Im forgiven 😁

evilO/Olive
kichik#
ShowWindow can show/hide windows like EnableWindow can enable/disable windows. If you can disable using EnableWindow, you can hide using ShowWindow.
Davion#
I've putted your Script into my Setup

unfortunatly if I click on Oracle or SQL it jumps to the Next page like I've clicked on Next and the I cant make any input into the textbox I defined I'll attach the the Script and the ini, maybe someone has an idea

I know that some parts are not complete yet, but they don't use the script evilO gave me... so they shouldnt be responsible for the error
evilO#
Hi 🙂

Sorry for the delay I had some work to get done..


1) In the function "cp_leave", just replace

ReadIniStr $R0 "$PLUGINSDIR\dynamic.ini" "Settings" "State"

by

ReadIniStr $R0 "$PLUGINSDIR\ioSDBType.ini" "Settings" "State"


"dynamic.ini" was the name of the ini file I used to test the script. So the installer tries to read the user input in a file that does not exist, therefore causing the error.



2) Another point: I've just spotted that in the script I forgot to "Pop $R0" before the two instructions "Abort" , causing values to pile up... fixed.


3) Another issue, about the "NOTIFY" flag : there is a bug if the user changes the selection using the keyboard, the 'leave' function is called around 18 times (put a MessageBox and you'll see that..).

Thread:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.




I think that's all.. Let me know if there are still problems.. 🙂


evilO/Olive
Davion#
Thanks for your fixes evilO, but it still doesn't work

if I click on one of the two options, the next dialog is shown - If I use this script only(without my extensions) it works, but as soon as I complete the script it doesn't work anymore

similar thing with the LangString error - I've another Setup which works, but in this script there's an error...

its confusing

some scripts work with parts of code, but other scripts don't even if I adapt the paths and so on
evilO#
Err, really strange, it's working fine on my computer.. 😱
Same remark for the LangString problem, it's working just fine..

Which version of NSIS do you use?

could you attach the whole script with your last modifications?

evilO/Olive
Davion#
Now it quite works

I defined an own langFile, included it - got an error - included german - and it worked

and the dynamicPage...well it works...but...

there are two inputboxes
i entered some text and clicked next

it copied the files and showed the finishscreen - after pressing finish
it started again o_O

is this what you meant above?
evilO#
I defined an own langFile, included it - got an error - included german - and it worked
Well, you shouldn't have to define you own LangFile to get this working...
it copied the files and showed the finishscreen - after pressing finish it started again
What to you mean by "it started again" ?
is this what you meant above?
Err, which sentence in which post? 😕
If you still have problems, could you please attach your script?


evilO/Olive
Davion#
Another issue, about the "NOTIFY" flag : there is a bug if the user changes the selection using the keyboard, the 'leave' function is called around 18 times (put a MessageBox and you'll see that..).
hmm here is the Script

If I click on FINISH it returns to the welcomepage and I have to click all dialogs a second time, but it works as I want it to... but its nevertheless confusing
evilO#
Ok, no it's not related to the bug about the "NOTIFY" flag I told you about.

If you have to go through all the dialogs a 2nd time, it's because you defined all the pages twice in your script, to get rid of the "LangString problem" I guess.

I have just removed the MUI macros between the functions ".onInit" and "cp_show":
- No LangString warning
- No "Double execution"
- The radiobuttons with the "NOTIFY" flags are working

You can check the examples in "NSIS\Examples\Modern UI" if you are still confused..

evilO/Olive
Davion#
I'm so stupid

thx evilO thx to all others

with your help the worst work is done
I have to keep on working over the weekend, so I may fill the forum a bit more 😁

Thank You very much!

greetz

Dave
evilO#
You are welcome Davion, I'm glad you got it working 👍 !

I have to keep on working over the weekend, so I may fill the forum a bit more
Err, week-end are meant to have fun or to rest 😛 !!!

Anyway have a nice week-end 😁

evilO/Olive
Davion#
hmm maybe something on my system is wrong, but I dont get everything working... expect evilOs function which works fine...