Salome HOME
Redesign SALOME documentation
[modules/gui.git] / doc / salome / gui / input / using_input_widgets.rst
1 .. _using_input_widgets_page: 
2
3 *******************
4 Using input widgets
5 *******************
6
7 This section contains some hints that might be useful when working
8 with SALOME GUI input widgets.
9
10 Spin boxes
11 ##########
12
13 This type of widgets is used for numeric (integer or floating-point)
14 data input. Spin boxes are used in standard **SALOME** modules if the
15 input value has a clearly defined input range (and precision in
16 case of a floating-point value).
17
18 Input precision has a specific semantics in **SALOME** floating-point
19 spin boxes:
20
21 - Positive precision value means that a number in the fixed-point format (corresponding to the "f" format specifier for C printf function) is expected. Positive precision value is the maximum allowed number of digits after the decimal separator.
22 - Negative precision value means that a number either in the fixed-point or the scientific (exponetial) format is expected. This is similar to the behavior of the "g" format specifier for C printf function. Negative precision value is the maximum allowed number of significant digits in mantissa (note that one digit is always before the decimal separator).
23
24 To make the user aware of an input value constraints applied by some
25 **SALOME** operations, the following basic capabilties are provided by spin boxes:
26
27 - The text input manually in a spin box by the user is checked to be a number of valid type (integer or floating-point).
28 - The text is converted to a number and checked to be within the valid range.
29 - Additionally, for floating-point data the input text is checked against the precision rules described above.
30
31 If the input text in a spin box does not meet the
32 constraints, the user is shown a message in a
33 tooltip near the spin box just as he types in it. The tooltip contains
34 information about the valid data range. For a floating-point input, the
35 tooltip also contains information about the expected precision. 
36
37 In standard **SALOME** modules the precision value can be adjusted through
38 :ref:`setting_preferences_page` of the correspodning  modules, and the tooltip contains a
39 reference to the corresponding parameter in the preferences.
40
41 On-line documentation for each standard SALOME module contains the
42 list of user preferences that can be used for tuning floating-point
43 precision for different types of input quantities.
44
45 Spin boxes and SALOME Notebook
46 ##############################
47
48 Apart from the numeric input, spin boxes in some **SALOME** modules accept
49 the names of **Notebook** variables (see :ref:`using_notebook`  
50 page for more details about **Notebook**).
51
52 If a spin box accepts variable names, then it is
53 additionally checked whether the manually input text represents a variable name. Variable
54 names should comply with the common naming rules for **Python** variables.
55 If the input is neither a valid number nor a variable name,
56 the tooltip informs the user that variable names are also acceptable in this spin box.
57
58
59