[Date Index] [Thread Index] [Author Index]
Re: Dialog boxes
In article <7n6b2n$h9i at smc.vnet.net>, "Sortech Limited" <sortech.limited at virgin.net> writes: > I would be grateful if someone could tell me how to go about creating a > Dialog Box for inputting several parameter values used in my notebooks. I > would like to create something that looks like a standard windows dialog box > where the user inputs data into named boxes and then clicks on a button to > run a particular set of cells, plot graphs etc. Are there any example > workbooks someone can point me to? Or can this only be achieved using a VB > from end? My key objectives are 1) to create intuitive data entry dialogs, > and 2) to create notebooks that are novice/casual user friendly. It's quite > important for me to solve this one having recommended the use of Mathematica > in an engineering design house where I'm now meeting resistance from the > other system fans. Basically, I think I can stave off criticism if I can > demonstrate Mathematica delivers an I/O edge. You may want to look over the ButtonBox HOWTO tutorial notebook here: http://www.mathsource.com/Content/General/Tutorials/Programming/0209-809 It shows you how to create a button that performs a nontrivial task. For accepting input, you can use cells with frames around them to simulate the look of a text input field. To read the contents of the field, you can use a selection movement command like NotebookLocate to place the selection on the cell and then pull the expression using NotebookRead. If you would like to see more sophisticated instances of dialog box constructions in notebooks, you may want to look over the solvers used in Calculus Wiz. http://www.wolfram.com/products/student/calcwiz/examples2.html If you are more familiar with building user interfaces with Visual Basic, then you may want to go this route instead. There is a sample front end that is included in the Mathematica 3.0 and 4 MathLink Developers Kits. It's in the UnsupportedGoodies folder. -- P.J. Hinton Mathematica Programming Group paulh at wolfram.com Wolfram Research, Inc. Disclaimer: Opinions expressed herein are those of the author alone.