Mellau Consulting

UserInterface

With the name Symath we describe the run-time system developed for Mathematica 4.1.2 by Mellau Consulting. This system allows us to create “stand-alone“ applications for Mathematica, i.e. programs that run as usual Windows programs. This manual section contains the explanation of the Symath User Interface system. If you want to learn how to use a Symath program, you should first start with this manual and learn the basics of the Symath User Interface system. The program specific manuals do not explain the basic aspects covered here. The explanations covered here are essential in learning how to use the Symath system.

Symath Worksheet

 

The worksheet is the basic user interface element of the Symath system. In principle, you can think about it as a word processed file (Word document for example) where some information (text, data sets in tables, data plots) is shown. This file can be edited in the way you know from any word processing system and saved in a file “as shown“. As any word processed file, this can be reloaded any time, examined on the monitor or printed on paper. There are basically two new features that will make from such a Word-type document a WorkSheet. The first additional task that Symath can do with this document is that all its visual elements can be created inside the Symath program and pasted in the right place in the document.

The second new feature is that some word processing elements (shown usually as buttons) when clicked with the mouse can start some specific program tasks. We can conclude that a worksheet is a word processed document with some user-active elements.

A WorkSheet is shown in the right figure.All tasks of a Symath program will always run in the same manner: the user clicks some active element of the Worksheet and some program function will be executed after the mouse click. The function which has started can do some manipulation on the kernel data and create or recreate (i.e. rewrite) some elements of the Worksheet. The user always has to wait until the processing of the current function terminates.

This kind of working of the SymathWorksheet is strong related to the basic program elements of Mathematica : FrontEnd, Kernel and Notebook.

Mathematica has two independent parts which are started on a computer as two separate independent programs. The first one is called the FrontEnd (file: Mathematica.exe) and it is the Mathematica user interface system. The second one is the Kernel (file: MathKernel.exe) which is the program that executes any calculations and stores the program variables and constants. These two programs communicate between them in a standard way : The user writes in the FrontEnd a command to be executed in a natural way (2x+2x) and the FrontEnd interprets it and sends to the Kernel the task in a unique mathematical format (Plus[Times[2,x],Times[2,x]). The Kernel calculates the received task and returns to the FrontEnd the result of the calculations (Times[4,x]). The FrontEnd then presents the result of the calculations to the user in a very convenient way (4x).

Buttons, Input fields

 

There are a small number of UserInterface elements used in setting up a WorkSheet. Basically, these user interface elements differ both in form and function from the usual “Windows–like” user interface elements. The following subsections list these user interface elements and explain their use.

Processing buttons

Processing buttons are the simplest SymathUserInterface elements. They are grey coloured and on the button a text or a symbol with the task to be executed is displayed. If the user clicks the button with the mouse then the task described with the button text will be executed. Most of the processing buttons are listed at the end of the worksheet sections but some of them are also shown in the Symath tables.Examples of processing buttons:

         

2 State selection buttons

There are many parameters and options in Symath programs which can have only two possible values. Changing the value of these parameters means to switch from one possible value (one possible state) to another value (another state). Such two state parameters are for example parameters that allow/disable the display of some user interface elements. The state selection buttons change the state of a parameter between these two possible states. The button always displays the current state of the parameter (how it is at present). If clicked, (i.e. switched to the other state) the text displayed on the button changes to some other text describing the new state. The colour of the button also changes if switched from one state to the other state. The state that would correspond to the On state is shown as a red button while the state that would correspond to the Off state is shown as a blue button (for example Show table=On state, Don’t show table= Off state). In some cases the correspondence to On/Off colours is arbitrary. Examples of two state buttons

  changes to  changes to

 changes to  changes to

MULTIPLE State selection buttons

Multiple state selection buttons change the state of parameters to one of more than two possible values. These buttons are used to select one setting from a longer list of possible ones going through all possible values of the parameter. The multiple state selection buttons are shown in the same way as the processing buttons with the single difference that the text shown on the button now defines a given “state“ or selection. If the user clicks the button with the mouse then the next possible value is selected and the corresponding text is displayed on the button.Examples of multiple state selection buttons:

  changes to  changes to  changes to  changes to

EXPRESSION (Formula) input fields

Expression input fields are the “hit” of Symath programs. These are input fields where mathematical formulae can be entered!. Symath will convert them to an evaluable mathematical form and use them in the analysis. As long as in the mathematical sense there is no difference between a formula Sin[x] or a real constant 1.2 or an integer 3, these input fields accept anything that is mathematically correct. The formula input fields are also shown as buttons but are light yellow coloured. The user can move the cursor ON the button, and type the formula on the button. If the formula is entered then he/she has to click the button with the mouse signaling that the formula input is finished and the textual form can be interpreted by the program. Example of a formula input button:

Known Problems : In some cases Mathematica will not accept your formula even if it is clear that there are no typing or definition errors. In most cases it helps to go through the formula and delete additional empty characters between the formula elements.

How to edit input fields

At the very beginning of this chapter we want to emphasize again that you are not allowed to click the input button with the mouse until you haven’t finished editing the formula. In order to move the cursor ON the input field you have to click with the mouse just AFTER the button you want to edit. Now you will see the blinking cursor just after the button. The following figure shows the blinking cursor set just after the input filed that we want to edit.

Now you can move the cursor ON the input field using the move cursor left <- keyboard key. The cursor will blink on the button and you can start editing the pre-defined data value. Another method to move the cursor on the input field is to click with the mouse just above or under the button. In this case the cursor will jump on the input field.

If the formula is very big (could be bigger than a page) then probably the best way to edit the formula is to use a separate notebook. Here you can set up the formula and you can also test it. If you have finished with the set up then you can copy the formula and paste it in the input field. You can also copy out the formula shown in an input field. For this you first have to select the formula (or part of it) and than click on Copy. You can then paste the formula in a new empty notebook.

Text input fields

Text input fields accept some text as input. Text input can be some simple text  as “Hello“  or more complicated input using any known Mathematica typesetting elements . The only difference between “formulae” and “text” is their use. A formula input MUST be a correct mathematical formula to be evaluated somewhere in the program while text input can be anything, even an incorrect formula. Text edited in this input field will be used only for display purposes and never for calculation. String input fields MUST be typed  as  “Hello“ i.e. between two “ ” characters. If you forget this and you click on a string input than Symath will clear this input field and display “Error” to remind you that the input wasn’t correct and you have to retype your input. Text input fields are displayed with a rose background as shown in the next example :

Real number data input fileds

Real number data input fields are similar to the formula input fields. They accept only real numbers as input and for a better visual recognition they have another input field background colour (dark yellow). Example for a real number input data field:

Integer input fields

Integer number data input fields are similar to the formula input fields. They accept only integers as input and for a better visual recognition have another input filed color (dark yellow). Example for an integer input data field :