Jump to content



Photo

enhanced MsgBox


  • Please log in to reply
2 replies to this topic

#1 steve8tch

steve8tch

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 288 posts

Posted 25 September 2005 - 11:05 PM

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




Attached File  menu.au3   17.35K   288 downloadsAttached File  Menu_UDF_test.au3   1.25K   246 downloads





#2 Gaboury

Gaboury

    Wayfarer

  • Active Members
  • Pip
  • 75 posts

Posted 26 September 2005 - 11:15 PM

Nice job ;) It may save my time :P

#3 steve8tch

steve8tch

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 288 posts

Posted 28 September 2005 - 06:56 PM

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.au3Attached File  Menu_UDF_test.au3   1.8K   153 downloadsAttached File  menu.au3   17.97K   138 downloads




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users