Jump to content

How do you get information from a dialog box?


This topic is 4424 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

The scriptmaster dialog example allow you to have a dialog with dynamic buttons (Formatted Dialog with Dynamic Buttons), but in the example, it is unclear how to use the dialog to obtain user information as one can with Filemakers show custom dialog.

I want to use the dialog box and have the user enter a name and other information.

Is there any documentation anyone can point me to, on how to use this feature in the scriptmaster dialog.

Thanks

Abel

Link to comment
Share on other sites

Here is a simple single field entry box


// SwingInput ( message ; title ; type )

// 12_02_21 JR

// v1.0

// 'type' is 0 to 3 and controls the icon





import groovy.swing.SwingBuilder



type = type.toInteger()

if( type < 0 || type > 3){type = 0}

swing = new SwingBuilder()

swing.edt{

result = optionPane().showInputDialog(swing.frame(), message, title, type)

}



return result

Link to comment
Share on other sites

  • 3 weeks later...
  • Newbies

Here is me generated plugin code:


RegisterGroovy( "FormattedDialogWithDynamicButtons( message ; title ; option1 ; option2 )" ; "import groovy.swing.SwingBuilder¶

¶

SwingBuilder swing = new SwingBuilder()¶

def dialog = swing.optionPane(¶

  message:message,¶

  options:[option1, option2]¶

)¶

¶

dialog.createDialog(null, title).show()¶

return dialog.getValue()" )

At the last line it says return dialog.getvalue(). I don't know how to get that.

In the built-in function there is the get(lastmessagechoice), what is the equibalent of that in scriptmaster?

thanks :logik:

Link to comment
Share on other sites

Once you have registered the function it is available under the external functions drop down

Set a variable to this function with its parameters and whatever is returned in the code will be placed in your variable

I think thats all in th documentation.....

Link to comment
Share on other sites

  • Newbies

How do you call the plugin function?

Hi Thanks for replying.

Here is my script to display the dialog


FormattedDialogWithDynamicButtons( "HELLO" ; "REQUIRED INPUT" ; "YES" ; "NO" )

The dialog box displays correctly. How do I get the result of the button thatw as pressed?

Thanks in advance

Once you have registered the function it is available under the external functions drop down Set a variable to this function with its parameters and whatever is returned in the code will be placed in your variable I think thats all in th documentation.....

Okay I got it now!!!.

Thanks!

Link to comment
Share on other sites

This topic is 4424 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.