Chapter 2. User Interface
Prev |  | Next

# Chapter 2. User Interface

## Main Window

Figure 2.1. Main Window

The main window provides a menu bar, the expression entry, the result display and a calculator keypad, history and conversion view (see the section called “Conversion”) which can be shown/hidden by clicking on Keypad, History and Conversion, respectively. When non-default options for the interpretion of expressions have been selected, the choice will be indicated in a small status area below the expression entry, to the right.

## Expression Entry

The expression entry is the most important part of the Qalculate! user interface. The normal calculation procedure in Qalculate! is to type in a mathematical expression (e.g. “5+5”) and press Enter (or click =). The result (“10”) is then displayed below the expression entry in the result display.

Figure 2.2. Completion

Qalculate! helps out with the expression by giving a list of possible endings to words representing functions, variables and units. The list will narrow with each letter typed. Select an item in the list and the name will be completed. If a function was selected, parenthesis will be added and the position moved for immediate entry of arguments.

As the expression is typed in, the area directly direclty below the expression entry, to the left, will show useful information. By default the calculator's interpretation of the expression is shown (e.g. “5 * meter” for “5m”). The interpretation will be displayed in red (configurable) if there are errors in the expression or in blue for lesser errors (for example too many arguments in a function). If the last typed in text represents a function and arguments are about to be entered, the functions name and its arguments will be displayed. The first argument in the information text is highlighted and includes information about its type and restrictions and when an argument has been entered, the next will be highlighted.

After execution of an expression, the whole expression will be marked. This normally means that if something new is entered, the old expression will be overwritten. If, however, an operator (+, −, *, /, ^) is entered first, the old expression will instead be the target of action. The operator will then apply to the whole expression, which is put in parenthesis. This works on all marked ranges, meaning that this way an expression can conveniently be put in parenthesis. Functions set the selection as their first argument.

The Page Up and Page Down keys will access previously entered expressions. With focus in the expression entry, Page Up traverses backwards in the expression history and Page Down forward. The Up and Down can also be used for the same purpose when the completion list is not shown.

Although the expression entry can display multiple lines of text, the Enter key does not insert a line feed. New lines are automatically created when needed.

The font used for the expression entry can be selected in the preferences dialog (Edit → Preferences).

## Result Display

The result of calculations is displayed in the open area below the expression entry. The font used for the result display can be selected in the preferences dialog (Edit → Preferences). Use of Unicode signs can be turned off in the same dialog. Otherwise Qalculate! will try to make the result as fancy as possible and print π for pi, √ for sqrt, € for euro, and so on. Information about customization of the mathematical result output is available in Chapter 4, Calculator Modes.

In front of the result an equals or approximately equals sign is shown. This indicates whether Qalculate! was able to calculate/display the result exact or only approximate, in the current mode.

The result display has a context menu, which pops up when clicking with the right mouse button anywhere in the field. This menu provides a subset of the display alternatives from the mode menu (Table 2.5, “Mode Menu”) and some actions from the edit menu (Table 2.4, “Edit Menu”). See more info in Chapter 4, Calculator Modes.

If you hold the pointer over the result area a tooltip will show the text representation of the result. To make it more obvious what the result means, abbreviations and implicit multiplication are not used here, and excessive parentheses are shown.

To copy the result, either select Edit → Copy Result, press Ctrl+Alt+C, or copy the text from the history window.

## Keypad

The keypad provides access to a simple traditional number pad and as well as more advanced functionality.

Figure 2.3. Keypad

The top buttons (from left to right) switches between exact and approximate calculation, changes fractional number display, selects display mode and selects number base in result (see Chapter 4, Calculator Modes).

The buttons on the right provides the following sets of functionality:

Numbers (0-9)

  These buttons provides straight forward input of numbers into the expression entry, as the keys on the keyboard. Marked/selected text in the expression entry is overwritten.

Decimal point (. or ,) and argument separator (, or ;)

  The character used for these varies between different locales. The argument separator is used for separation of arguments to functions that takes more than one argument, as well as to separate elements in vectors and matrices (although this is not strictly necessary). Selection is overwritten.

Operators (+, -, *, /)

  Inserts the character for addition, subtraction, multiplication or division into the expression entry. Text selections are placed in parentheses. This, together with the fact that recently calculated expressions are automatically selected in the entry, means that if you click 5, 9, +, 2, =, * and 2 in order, the result expression is "(59+2)*2". In RPN mode the operators acts on the top two registers in the stack.

EXP

  Inserts the shorthand notation (E or e) for ten raised to the power of x. “2E6” equals “2 * 10^6” (this only applies to digits: “xEy ≠ x*10^y”). Selection is overwritten.

Equals sign

  Calculates the current expression (and adds it to the stack in RPN mode).

AC and DEL

  AC clears the expression entry fully, while DEL deletes one character the to the right or, if the cursor is at the end of the expression, to the left of the cursor.

Parentheses

  The "(x)" button places opening and closing parentheses around the selected text in the expression entry. If no text is selected either the expression to the right of the cursor (if the cursor is at the beginning of the expression or if there is an operator or left parenthesis to the left of the cursor) or to the left of the cursor is put inside parentheses. If the expression is empty, as well as in some other cases (to avoid broken expression), empty parentheses are inserted. The other two buttons insert a single opening or closing parenthesis and overwrites any selection.

ANS

  Inserts the first answer variable. This variable always contains the last calculated result. Selection is overwritten.

Most of the buttons to the left inserts or applies mathematical functions to the expression. All buttons on the left is paired with buttons, with downward arrows, that opens a menu with related functionality (generally more mathematical functions).

The mathematical functions accessed using the keypad buttons (and menus) behave differently depending on the current edited expression. If the cursor is at the end of the expression and there is no operator or parenthesis immediately to left of the cursor (at the end of expression), the whole expression is used as function argument and the expression is immediately calculated using the function (If you type “5+2” and then click sin, “sin(5+2)” will be calculated). If text in the expression is selected, the selection will be used as the function argument. If the whole expression was selected the resulting expression will immediately be calculated. Functions that requires more than one argument do not follow these rules and instead opens a separate dialog for argument input. In RPN mode the function will always be applied to the register(s) at the top of stack, if the current expression is empty and there are enough registers for functions that require more one argument.

Below follows a list of the buttons on the left side (including their menus and associated actions), from left the right, top to bottom:

Table 2.1. New Menu

Button | Action | Menu
--- | --- | ---
STO | Stores the current result in a variable. See the section called “Variable creation/editing”. | A list of created variables. Left click to insert (overwrites selection). Right click for the option to edit or delete the variable, or store the current result in the variable.
f(x) | Creates a new function. See the section called “Function creation/editing”. | Created and recently used (accessed from this menu, the menubar or the function manager) functions. The last item opens the function manager.
0xff | Opens the convert number bases dialog. | shift(), bitXor() and xor() functions.
% | Inserts the percent symbol (overwrites selection). | Open the percentage calculation tool.
x! | Factorial symbol. Puts selection in parentheses and calculates the expression immediately if the whole expression is selected. | Other factorial functions and functions related to combinatorics.
ln | Natural logarithm function. | Other logarithmic functions.
√ | Square root function. | Other root functions.
xy | Inserts exponentiation operator. Text selections are placed in parentheses. | Exponential functions. x2 works as the button xy but inserts “^2”.
mod | Modulus function. | rem(), abs(), gcd() and lcm() functions.
x̄ | Statistical mean function. | A selection of statistical functions.
Σ | Summation function. | Π, for() and if() functions.
| Insert the pi variable (overwrites selection). | e, eulers constant and golden ratio variables, and recently used variables (accessed from this menu, the menubar or the variable manager) and/or a selection of physical constants. The last item opens the variable manager.
sin | Sine function. | sinh(), asin() and asinh() functions.
cos | Cosine function. | cosh(), acos() and acosh() functions.
tan | Tangent function. | tanh(), atan() and atanh() functions.
i | Inserts the imaginary unit (i2 = −1) i (overwrites selection). | Complex number functions.
a(x)b | Factorizes the result (or the current expression). | Functions for derivatives, integrals and equations, and actions for simplification, expansion of partial fractions and replacement of unknowns.
z | Inserts the unknown variable z (overwrites selection). | Assumptions for the z variable.
y | Inserts the unknown variable y (overwrites selection). | Assumptions for the y variable.
x | Inserts the unknown variable x (overwrites selection). | Assumptions for the x variable.
u | Opens the unit manager. | Recently used units and/or a selection of common units, and a selection of prefixes.
kg | Inserts the most recently used unit from the associated menu, or kilogram (overwrites selection). | All SI base units and SI derived units with special names and symbols, plus liter.
€ (or local currency) | Inserts the most recently used unit from the associated menu, or euro/local currency (overwrites selection). | All current currency units (excludes currencies replaced by euro).

to

Inserts the convert to operator (selection is unselected). The expression before “to” (or the previous result if the expressions begins with “to”) is converted to the unit expression after “to”. See the section called “The “to” operator”.

Convert to base units, optimal unit, or optimal prefix. Below is a list of appropriate units (with common units appended) to convert the current result to. If the result does not include any units options to convert the result to different number bases, fraction and factors appear. The current expression (if modified) is calculated when the menu is opened.

## Calculation History

The history view provides access to previous calculation results (50 rows are reloaded on restart). Previous expressions and results, as well as errors and warnings, are listed. The text of one or multiple entries can be copied to the clipboard using the Copy button to the right of the list.

Figure 2.4. Calculation History

Double click an item in the history list or use the Value or the Text button to paste the selected value or expression into the expression entry. The Value button inserts the actual value, using the answer() and expression() functions (for results and parsed expressions, respectively) with the current history index (indicated in the left column of the list), as argument, instead of the text (which might be inexact and is not guaranteed to be parsed correctly). This is not possible for the history entries of previous sessions. When an item is double clicked the the actual value is used for results, but the text for expressions, allowing editing of the expression.

The to right of the list are also buttons for mathematical operations. These acts on the selected history items (the + will calculate the sum of the selected values, while the - will calculated the difference between the first, uppermost, selected value and the rest, in order). If no value is marked the sign for the operator will be inserted into the expression entry (as the buttons on the keypad). If only one item is selected the buttons also uses the current expression (the + button will append “+ [value]” to the current expression). The square root button will however only act on single values.

## Menu Bar

The menus in the menu bar provides access to most of the functionality of Qalculate!. Their contents are listed and described below.

Table 2.2. File Menu

Menu Item | Description
--- | ---
New | Submenu for creation of new objects. See Table 2.3, “New Menu”.
Import CSV File... | Opens a dialog for import of a data file as a matrix or vectors.
Export CSV File... | Opens a dialog for export of a matrix or vector to a data file.
Store Result... (Ctrl+S) | Stores the current result as a variable. See the section called “Variable creation/editing”.
Save Result Image... | Saves the result display to a PNG image.
Save Definitions | Saves all user definitions (variables, functions and units).
Update Exchange Rates | Downloads current exchange rates from the Internet.
Plot Functions/Data | Opens the plot dialog. See Chapter 8, Plotting.
Convert Number Bases (Ctrl+B) | Opens the number bases converter. See the section called “Convert Number Bases Dialog”
Calendar Conversion | Opens a window for conversion of dates between different calendars.
Percentage Calculation Tool | Opens a window for quick and easy percentage calculation.
Periodic Table | Shows a periodic table, with property values which can be inserted in the expression, in a new window.
Quit (Ctrl+Q) | Exits Qalculate!

Table 2.3. New Menu

Menu Item | Description
--- | ---
Variable | Opens the variable edit dialog for creation of a new variable.
Matrix | Opens a dialog for entry of a new matrix variable.
Vector | Opens a dialog for entry of a new vector variable.
Unknown Variable | Opens the variable edit dialog for creation of a new unknown variable.
Function | Opens the function edit dialog for creation of a new function.
Function (simplified) | Opens a simplified function edit dialog, with fewer options, for creation of a new function.
Data Set | Opens the data set edit dialog for creation of a new data set.
Unit | Opens the unit edit dialog for creation of a new unit.

Table 2.4. Edit Menu

Menu Item | Description
--- | ---
Manage Variables (Ctrl+M) | Opens the variable manager. See the section called “Variable/Function/Unit Managers”.
Manage Functions (Ctrl+F) | Opens the function manager. See the section called “Variable/Function/Unit Managers”.
Manage Units (Ctrl+U) | Opens the unit manager. See the section called “Variable/Function/Unit Managers”.
Manage Data Sets | Opens the data set manager.
Factorize | Factorizes the current result. For multivariate rational polynomials, only square free factorization is supported.
Simplify | Simplifies the current result. Note that easy simplifications are always automatically performed.
Expand Partial Fractions | Applies partial fraction decomposition to the current result.
Set Unknowns... | Opens a dialog where the values of unknown variables in the result can be set and the result recalculated.
Convert To Unit | Submenu with units. Select a unit to convert the current result.
Set Prefix | Submenu for choice of unit prefix in current result.
Convert To Unit Expression (Ctrl+T) | Opens the convert to unit view for conversion of result to custom unit expression. See the section called “Conversion”.
Convert To Base Units | Splits up unit(s) in the current result into base units.
Convert To Optimal Unit | Tries to convert the units in the current result so that as few units as possible is used. Only SI units are used for conversion. If the original units are equally or more optimal, than the automatic alternative, they are kept. Currencies are converted to the local currency, unless deactivated in the preferences dialog.
Convert To Optimal SI Unit | Tries to convert the units in the current result so that as few units as possible is used. Non-SI units are not kept, even if the number of units used increase, and the automatic alternative is prioritized. Currencies are converted to the local currency, unless deactivated in the preferences dialog.
Insert Matrix | Opens a dialog where you can create a matrix in a spreadsheet-like table and insert into the expression entry. If selected expression text is a matrix, then the matrix is edited.
Insert Vector | Opens a dialog where you can create a vector in a spreadsheet-like table and insert into the expression entry. If selected expression text is a vector, then the vector is edited.
Copy Result (Ctrl+Alt+C) | Copies the current result to the clipboard.
Preferences | Opens the preferences dialog, which controls settings for visual appearance and start/exit actions.

Table 2.5. Mode Menu

Menu Item | Description
--- | ---
Number Base | Submenu with a list of number bases (binary, octal, decimal, duodecimal, hexadecimal, sexagesimal, time format, and other bases, and roman numerals) to select for result display, and a menu item (Ctrl+B) for opening a dialog to switch number bases in expression (input) and result (output).
Numerical Display | Submenu which selects numerical display mode. See Chapter 4, Calculator Modes.
Fractional Display | Submenu which selects decimal, fractional or combined fractional display. See Chapter 4, Calculator Modes.
Interval Display | Submenu with options that determines how the result of interval arithmetic are shown. The adaptive option is the same as significant digits display unless an interval has been explicitely specified in the expression.
Unit Display | Submenu which controls the display of units and prefixes. See Chapter 4, Calculator Modes.
Abbreviate Names | Toggles on/off use of abbreviation for unit, prefix, variable and function names in result display.
Enabled Objects | Submenu which enables/disables variables, functions, units and unknowns (will not affect defined unknown variables and quoted unknowns), calculation of variables (if calculation of variables is not on, all variables will be treated as unknown), and units in variables for physical constants. Here you can also disable complex and infinite results.
Approximation | Submenu which switches between different approximation modes.
Angle Unit | Submenu which sets the default angle unit for trigonometric functions.
Assumptions | Submenu which changes default assumptions for unknown variables.

Algebraic Mode

Submenu with options to automatically simplify or factorize the final result. Note that even if this is set to none, easy simplifications will be performed. In this menu, the option toggle on/off use of the assumption that unknown denominators not are zero is also found. This alternative makes it possible to avoid the situation where expressions such as “(x-1)/(x-1)” can not be further simplified because the denominator might be zero (if x equals 1).

Parsing Mode

Submenu with options to control how expressions are parsed (read/interpreted). There are three different modes to choose from. In addition the “read precision” option enables/disables interpretation of input numbers with decimals as approximate with a precision equal to the number of digits (after preceding zeroes), and “limit implicit multiplication” limits the use of implicit multiplication for parsing and display of expressions. For more information see the section called “Implicit Multiplication and Parsing Modes”. In this menu you also find the option to switch to RPN syntax for expression parsing.

RPN Mode (Ctrl+R) | (De)activates the Reverse Polish Notation stack (not RPN syntax). For details see the section called “The RPN Mode”
Precision | Opens a dialog to change precision in calculations.
Decimals | Opens a dialog to change displayed number of decimals.
Meta Modes | Provides a list of available meta modes for loading and menu items to save and delete modes.
Save Default Mode | Saves the current calculator mode as the startup default.

Table 2.6. Functions Menu

Menu Item | Description
--- | ---
(Recent functions list) | Select a function to open the insert function dialog.
(Function list) | Select a function to open the insert function dialog.

Table 2.7. Variables Menu

Menu Item | Description
--- | ---
(Recent variables list) | Select a variable to insert it into the expression entry.
(Variable list) | Select a variable to insert it into the expression entry.

Table 2.8. Units Menu

Menu Item | Description
--- | ---
(Recent units list) | Select a unit to insert it into the expression entry.
(Unit list) | Select a unit to insert it into the expression entry.

Table 2.9. Help Menu

Menu Item | Description
--- | ---
Contents (F1) | Opens this help.
About | Info about Qalculate!

## Variable/Function/Unit Managers

The manager windows provide a structural way of working with variables, functions and units (collectively referred to as objects). The managers for the three different objects are essentially similar. They can be opened from the edit menu and the keypad. Ctrl+M, Ctrl+F and Ctrl+U can also be used for variables, functions and units respectively. The function manager can also be opened with the f(x) button in the keypad.

Figure 2.5. Variable Manager

To the left is a category tree and beside that is a list of all objects in the selected category, including all subcategories. Objects without a category are put under “Uncategorized”. The top category, “All”, provides a list of all objects, except those that are deactivated and available in the second top-level category — “Inactive”. The object list does, in addition to descriptive names, for variables have an extra column for values of variables, and units have additional columns for abbreviation/singular/plural and base unit.

The buttons on the right work on the selected object in the list. New opens a dialog for creation of a new object, while Edit opens the same dialog to edit the selected unit. Insert inserts the object into the expression entry in the main window, Delete removes the object and (De)activate toggles recognition in expressions on/off. The unit manager has an additional button for conversion of the current result and the variable manager a button for export to a data file.

Figure 2.6. Function Manager

The function manager has a description box at the bottom, which shows the syntax, description and arguments of the selected function.

Figure 2.7. Unit Manager

The unit manager has an area for quick conversion between units. This converts between the selected unit in the list and the selected unit in the menu. Both the menu and the list filters the units as you type. Units are converted by specification of a quantity, in the entry next to the unit to convert from, followed by Enter.

For more information about variables, functions and units, see Chapter 5, Variables, Chapter 6, Functions and Chapter 7, Units.

## Convert Number Bases Dialog

The number bases dialog, accessible from the File Menu, is an efficient and convenient tool for conversion between binary, octal, decimal, dudecimal, hexadecimal and Roman numbers. This dialog contains entries for each number base. When a number is typed in any of the entries, the others are automatically updated to display the current number in their format. Numbers, or expressions, entered follow the same rules as expressions in the main expression entry.

Figure 2.8. Convert Number Bases Dialog

Prev |  | Next
Chapter 1. Introduction | Home | Chapter 3. Expressions