steve8tch Posted September 25, 2005 Posted September 25, 2005 I wrote Menu.au3 some time ago - this included _menu() _menu() allowed users to include simple menus in their scripts. eg #include <menu.au3> $x = _menu(1,"choose a colour","red","blue","green") MsgBox(0,"","You chose - " & $x[1]) I have now added _msgbox() The idea here is that sometimes you want to offer the user more options than the standard MsgBox will allow - different / longer text on each of the buttons, 4 buttons rather than 3. eg #include <menu.au3> $x = _MsgBox("please choose","Carry on deleting these files?","Yes", "No","More options please") MsgBox(0,"","You clicked - " & $x) To see examples of what can be done put menu.au3 into your #includes folder and then run Menu_UDF_test.au3 menu.au3Menu_UDF_test.au3
steve8tch Posted September 28, 2005 Author Posted September 28, 2005 I came across a situation where I couldn't write out the _menu statement because the menu items themselves were the outputs of functions that may or may not be called.....!!!!! - so I needed to add the functionality of being able to pass all the menu items in the form of 1 argument.So the following now works#include <menu.au3>$r = "red"$b = "blue"$g = "green"$all = $r & "," & $b & "," & $g$x = _menu (1, "choose a colour", "red", "blue", "green")$x = _menu (1, "choose a colour", $r, $b ,$g)$x = _menu (1, "choose a colour", $all)MsgBox(0, "", $x[1])To see examples of what can be done put menu.au3 into your #includes folder and then run Menu_UDF_test.au3Menu_UDF_test.au3menu.au3
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now