[SCM] Packaging for udav branch, master, updated. debian/0.5.2-2-1-g8488bbd

Salvatore Bonaccorso salvatore.bonaccorso at gmail.com
Fri Aug 20 13:25:14 UTC 2010


The following commit has been merged in the master branch:
commit 8488bbde494efd88ad9bbca04fa684e5e848a73b
Author: Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
Date:   Fri Aug 20 15:24:45 2010 +0200

    Imported Upstream version 0.6.3

diff --git a/ChangeLog.txt b/ChangeLog.txt
index a2590c4..1de24ba 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,45 @@
+0.6.3 Released ?? March 2010
+	- Add shortcuts: Meta+C for new command, Meta+N for fitting, Meta+P for file path.
+	- Start column/row enumeration from 0 in data tables.
+	- Add initial column sorting in "Memory" window.
+	- Add Hints in NewCommand dialog.
+	- Add "Copy click coor" menu and popup item
+
+0.6.2 Released 22 March 2010
+	- Update graph and help window after Properties closing.
+	- Improve file loading in win32 mode.
+	- Now animation setup and reloading (F9) reset animation counter (start animation from beginning).
+	- Calculator now always use '.' as decimal point.
+	- Add zoom in/out for help browser.
+	- Add labels for grid of absolute coordinates.
+	- Display also absolute coordinates on mouse click.
+	- Change shortcut for pure Alt+something to Ctrl+something or Meta+something.
+
+0.6.1 Released 5 March 2010
+	- Add Russian translation of the interface.
+	- Add grid drawing for absolute coordinates.
+	- Add graphics raising when it is redrawn.
+	- Add path selection for Help and Fonts (in Property dialog).
+	- Add option for default image size.
+	- Data tables are updated now then data is changed.
+	- Filename for animated GIF is produced now from script name (the same as other exports).
+	- Remove unused menu item "Close".
+
+0.6 Released 25 December 2009
+	- New interface based on MDI for most of windows.
+	- Add dialog for entering new MGL command.
+	- Add calculator for typing and evaluating formulas which can contain the data variables too.
+	- Add dialog for selecting the method of data file loading.
+	- Double-click on picture now locate the code line for plot/drawing.
+	- Add menu items:
+		* for inserting file name;
+		* for inserting folder name;
+		* for last fitted formula;
+		* for numerical value of selection.
+	- Add color highlighting for several commands in line.
+	- Add click (sort data) and double-click (edit data) events handling for data list
+	- Minor bugs correction (in widget layot).
+
 0.5.2 Released 15 June 2009
 	- Mostly new set of toolbutton icons are used
 	- Help and table windows are closed automatically now when all plotting windows are closed
diff --git a/TODO b/TODO
index 7745734..3e4ef4a 100644
--- a/TODO
+++ b/TODO
@@ -1,24 +1,19 @@
-For version 0.6
+For version 0.7
 
-1. Origin-like plot properties (script lines as a set of objects + properties for each object)
-a) sort commands if it is possible (i.e. settings first, after it axis/box, after it curves, after it surfaces and 3D)!
-b) each command -> line in list at first as text and later to option
-c) add tree node for each subplot/inplot/columnplot/for/if/else/ifelse/next/endif and so on
-d) try to find the object by color and place and switch to it:
-* use mouse position + colors (for lines, text)
-* order: lines, text, surface, (sub-|in-)plot
-* if no object then try find closest color (due to smoothing)
-* the command should return the bounding box. 
-* there are 3 common: subplot && bounding box && z-plane
-* 'text', '?label' can be difficult (->Width() ->Height())
-* for axis the bounding box is subplot
+-----
+
+b. Show sample output if possible (+ by check box)
+	Options: Auto ranges (anal [XYZC]dat); Show box; Show axis;
+a. Dialog for entry data -- including subdata, suffixies, and so on
+0. Parse current line when call NewCmd
 
+-----
 
-3. Calculator ??? + like PocketMK ???
-* keyword is 'calc data' && 'endcalc' text inside is PocketMK program for specified data
-* should support numbers as is!!!
+0. Help about UDAV -- dialogs, hotkeys !!!
+
+1. Origin-like plot properties (script lines as a set of objects + properties for each object)
+a) add tree node for each subplot/inplot/columnplot/for/if/else/ifelse/next/endif and so on
 
-4. splash screen at opening (especcially during font loading!) ???
-5. User-defined commands (Linux only ?!) ???
-6. Installer under windows ???
-7. Dialog for insert filename ??? -- not need -- to be in plot properties
+2. User-defined commands (Linux only ?!) ???
+3. Installer under windows ???
+4. Handling arrays by elements -- replace of 'put' command ???
diff --git a/UDAV.desktop b/UDAV.desktop
new file mode 100755
index 0000000..83d0560
--- /dev/null
+++ b/UDAV.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Icon=/usr/local/share/udav/udav.png
+Name=UDAV
+Exec=udav
+Comment[en_US]=Data handling and plotting tool
+Comment[ru_RU]=Обработка и отображение данных
+Categories=Education;Science;Math;
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index d46dfce..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,20 +0,0 @@
-udav (0.5.2-2) unstable; urgency=low
-
-  * Change Section to science as by debian-science packaging policy.
-  * Move package under the Debian Science umbrella: Add Debian Science
-    Maintainers to Maintainer control field and move myself to
-    Uploaders.
-  * Add Vcs-Git and Vcs-Browser control fields.
-  * debian/copyright: Update debian/* packaging years and refresh format
-    to revision 135 of DEP5 format-specification for machine-readable
-    copyright files.
-  * Bump Standards-Version to 3.9.1 (no changes).
-  * Convert to '3.0 (quilt)' source package format.
-
- -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Thu, 19 Aug 2010 14:46:54 +0200
-
-udav (0.5.2-1) unstable; urgency=low
-
-  * Initial release (Closes: #510377)
-
- -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Thu, 02 Jul 2009 20:01:04 +0200
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7f8f011..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-7
diff --git a/debian/control b/debian/control
deleted file mode 100644
index cd8e4ee..0000000
--- a/debian/control
+++ /dev/null
@@ -1,38 +0,0 @@
-Source: udav
-Section: science
-Priority: optional
-Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
-Uploaders: Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
-DM-Upload-Allowed: yes
-Build-Depends: debhelper (>= 7.0.50), libmgl-dev, libqt4-dev, libhdf5-serial-dev, imagemagick
-Standards-Version: 3.9.1
-Homepage: http://udav.sourceforge.net/
-Vcs-Git: git://git.debian.org/git/debian-science/packages/udav.git
-Vcs-Browser: http://git.debian.org/?p=debian-science/packages/udav.git
-
-Package: udav
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: application for data visualization based on MathGL
- UDAV provides a graphical environment for Data Array 
- Visualization based on the MathGL library. It allows easy 
- viewing, manipulation and plotting of datasets, and supports 
- a wide range of graphical effects with a simple scripting 
- language, MGL. It can also execute MGL scripts. Features 
- include:
- .
-  * Simple and fast plotting of data and formulas;
-  * One-click interface - just open the datafile in UDAV;
-  * Scripts and graphical output both shown at the same time;
-  * Rotate, pan, and zoom controls (via buttons or mouse);
-  * Toggleable lighting and transparency;
-  * GIF animation;
-  * Support for smoothed lighting, transparency, arbitrary 
-    curvilinear coordinates, and TeX symbols and formulas;
-  * Tables for data editing, with support for 3-dimensional 
-    arrays;
-  * Basic toolset for data handling (smoothing, resizing, 
-    cropping, filling by formula, summation, differentiation, 
-    histogram creation, and so on);
-  * Export to bitmap and vector formats (PNG, JPEG, EPS, or 
-    SVG).
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 5fc2bc5..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,30 +0,0 @@
-Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
-Name: udav
-Maintainer: Alexey Balakin <mathgl.abalakin at gmail.com>
-Source: http://udav.sourceforge.net/download.html
-
-Files: *
-Copyright: Copyright 2008-2009, Alexey Balakin <mathgl.abalakin at gmail.com>
-License: GPL-2+
-
-Files: debinstall/*
-Copyright: Copyright 2007, Dmitry I. Kulagin <dik at kulagin.nnov.ru> 
-License: GPL-2+
-
-Files: debian/*
-Copyright: 2009, 2010, Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>
-License: GPL-2+
-
-License: GPL-2+
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- .
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty or
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
- .
- On Debian systems the full text of the GNU General Public License can be found
- in the `/usr/share/common-licenses/GPL-2' file.
diff --git a/debian/dirs b/debian/dirs
deleted file mode 100644
index a95ad47..0000000
--- a/debian/dirs
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/bin
-usr/share/icons/hicolor/32x32/apps
-usr/share/icons/hicolor/16x16/apps
diff --git a/debian/docs b/debian/docs
deleted file mode 100644
index 1333ed7..0000000
--- a/debian/docs
+++ /dev/null
@@ -1 +0,0 @@
-TODO
diff --git a/debian/menu b/debian/menu
deleted file mode 100644
index 3426b21..0000000
--- a/debian/menu
+++ /dev/null
@@ -1,4 +0,0 @@
-?package(udav):needs="X11" section="Applications/Science/Mathematics"\
-  title="udav" command="/usr/bin/udav" \
-  icon16x16="/usr/share/icons/hicolor/16x16/apps/udav.xpm" \
-  icon32x32="/usr/share/icons/hicolor/32x32/apps/udav.xpm"
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 5a33c63..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-
-# export MGLDODIR path
-export MGLDOCDIR=/usr/share/doc/udav/help/
-
-%:
-	dh $@
-
-override_dh_auto_configure:
-	qmake $(CURDIR)/udav.pro
-
-override_dh_auto_install:
-	# install binaries and documentation
-	install -d $(CURDIR)/debian/udav/usr/bin
-	install $(CURDIR)/bin/udav $(CURDIR)/debian/udav/usr/bin
-	install -d $(CURDIR)/debian/udav/usr/share/doc/udav
-	cp -rf $(CURDIR)/help $(CURDIR)/debian/udav/usr/share/doc/udav
-	
-	# convert and scale udav.png
-	convert -scale 16x16 src/udav.png $(CURDIR)/debian/udav/usr/share/icons/hicolor/16x16/apps/udav.xpm
-	convert -scale 32x32 src/udav.png $(CURDIR)/debian/udav/usr/share/icons/hicolor/32x32/apps/udav.png
-	convert -scale 32x32 src/udav.png $(CURDIR)/debian/udav/usr/share/icons/hicolor/32x32/apps/udav.xpm
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/udav.desktop b/debian/udav.desktop
deleted file mode 100644
index 74c6908..0000000
--- a/debian/udav.desktop
+++ /dev/null
@@ -1,10 +0,0 @@
-[Desktop Entry]
-Name=Udav
-GenericName=Universal Data Arrays Visualization
-Comment=data visualization based on MathGL
-Icon=udav
-Type=Application
-Categories=Education;Science;Math;
-Exec=udav
-StartupNotify=false
-Terminal=false
diff --git a/debian/udav.install b/debian/udav.install
deleted file mode 100644
index c1cc54a..0000000
--- a/debian/udav.install
+++ /dev/null
@@ -1,2 +0,0 @@
-src/udav.png usr/share/icons/hicolor/64x64/apps
-debian/udav.desktop usr/share/applications
diff --git a/debian/udav.manpages b/debian/udav.manpages
deleted file mode 100644
index 6a76a82..0000000
--- a/debian/udav.manpages
+++ /dev/null
@@ -1 +0,0 @@
-udav.1
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index 8fba483..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,2 +0,0 @@
-version=3
-http://sf.net/udav/udav-(.*)\.tgz
diff --git a/debinstall/changelog b/debinstall/changelog
index 942d2ed..eba8849 100644
--- a/debinstall/changelog
+++ b/debinstall/changelog
@@ -1,3 +1,10 @@
+udav (0.5.2ufp) unstable; urgency=low
+
+  * Upstream update
+  * Fixes for debian ID: 2816327
+
+ -- Dmitry I. Kulagin <dik at kulagin.nnov.ru>  Mon, 06 Jul 2009 13:08:00 +0300
+
 udav (0.4.1.1) unstable; urgency=low
 
   * Upstream update
diff --git a/debinstall/control b/debinstall/control
index dc7f383..40f48fb 100644
--- a/debinstall/control
+++ b/debinstall/control
@@ -2,14 +2,14 @@ Source: udav
 Section: math
 Priority: extra
 Maintainer: Dmitry I. Kulagin <dik at kulagin.nnov.ru>
-Build-Depends: cdbs, debhelper (>= 5), libmgl-dev (>= 1.7), libqt4-dev
+Build-Depends: cdbs, debhelper (>= 5), libmgl-dev (>= 1.9), libqt4-dev, libhdf5-lam-dev | libhdf5-mpich-dev | libhdf5-openmpi-dev | libhdf5-serial-dev
 Standards-Version: 3.7.2
 
 Package: udav
 Architecture: any
 Section: math
 Priority: extra
-Depends: libmgl (>=1.7), ${shlibs:Depends}
+Depends: libmgl5 (>=1.9), ${shlibs:Depends}
 Description: UDAV is program for data visualization based on MathGL.
  UDAV is program for data arrays visualization based on MathGL library.
  It support wide spectrum of graphics, simple script language and
diff --git a/debinstall/rules b/debinstall/rules
index b8c327e..ba7be4a 100755
--- a/debinstall/rules
+++ b/debinstall/rules
@@ -4,7 +4,7 @@ include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/class/makefile.mk
 # Add here any variable or target overrides you need.
 #DEB_CONFIGURE_EXTRA_FLAGS = CXXFLAGS="-O2"
-DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) make -C $(DEB_BUILDDIR)
+DEB_MAKE_INVOKE = qmake && $(DEB_MAKE_ENVVARS) make -C $(DEB_BUILDDIR)
 DEB_MAKE_CLEAN_TARGET   = clean
 DEB_MAKE_BUILD_TARGET   = MGLDOCDIR="/usr/share/doc/udav/help/"
 #DEB_MAKE_INSTALL_TARGET = install INSTALL_ROOT=$(CURDIR)/debian/tmp/ MGLDOCDIR="/usr/share/doc/udav" UDAVBINDIR="/usr/bin"
diff --git a/help/example_mgl_eng.html b/help/example_mgl_eng.html
index 81840c0..715d19c 100644
--- a/help/example_mgl_eng.html
+++ b/help/example_mgl_eng.html
@@ -9,7 +9,7 @@
 <div style="text-align: center;">
 <h1>MGL script language</h1>
 <h2>Examples and Hints</h2>
-<h2>Alexey Balakin, 2007</h2>
+<h2>Alexey Balakin, 2007-2009</h2>
 </div>
 
 <h2><a name="contents"></a>Contents</h2><ol>
@@ -295,7 +295,7 @@ box
 <p>Below I shall show the features of 1D plotting on base of <strong>plot</strong> command. Let us start from sinus plot:</p>
 <div style="margin-left: 40px; font-family: monospace;">
 new y0 50<br>
-modify y0 'sin(pi*(2*x-1)'<br>
+fill y0 'sin(pi*x)'<br>
 subplot 2 2 0<br>
 plot y0<br>
 box
diff --git a/help/script_mgl_eng.html b/help/script_mgl_eng.html
index 63f2e56..b18b53d 100644
--- a/help/script_mgl_eng.html
+++ b/help/script_mgl_eng.html
@@ -7,8 +7,8 @@
 
 <div style="text-align: center;">
 <h1>MGL script language</h1>
-<h2>Reference manual for v.1.8</h2>
-<h2>Alexey Balakin, 2007</h2>
+<h2>Reference manual for v.1.10</h2>
+<h2>Alexey Balakin, 2007-2009</h2>
 </div>
 
 <h2><a name="s0"></a>Contents</h2>
@@ -16,7 +16,7 @@
 	<li> <a href="#s1">Introduction</a></li>
 	<li> <a href="#s2">Graphics setup</a></li>
 	<li> <a href="#s3">Scaling, moving and rotating</a></li>
-	<li> <a href="#s4">Axis functions</a></li>
+	<li> <a href="#s4">Axis and Colorbar</a></li>
 	<li> <a href="#s5">Primitive drawing functions</a></li>
 	<li> <a href="#s6">1d plotting commands</a></li>
 	<li> <a href="#s7">2d plotting commands</a></li>
@@ -41,7 +41,7 @@
 
 <p>MathGL library supports (from version 1.3) the simplest scripts for data handling and plotting. These scripts can be used independently (with the help of mgl2png, mgl2eps, mgl2svg programs and others) or in the frame of the library using.</p>
 
-<p>MGL script language is rather simple. Each string is a command. First word of string is the name of command. Other words are command arguments. Command may have up to 1000 arguments (at least for now). Words are separated from each other by space or tabulation symbol. The upper or lower case of words is suficient, i.e. variables a and A are different variables. Symbol <code>#</code> starts the comment (all characters after <code>#</code> will be ignored). The exception is situation when <code>#</code> is a part of some string. Also options can be specified at the end of string (after symbol '<code>;</code>', see Sec. <a href="#s20">Command options</a>).</p>
+<p>MGL script language is rather simple. Each string is a command. First word of string is the name of command. Other words are command arguments. Command may have up to 1000 arguments (at least for now). Words are separated from each other by space or tabulation symbol. The upper or lower case of words is suficient, i.e. variables a and A are different variables. Symbol <code>#</code> starts the comment (all characters after <code>#</code> will be ignored). The exception is situation when <code>#</code> is a part of some string. Also options can be specified at the end of string (after symbol '<code>;</code>', see Sec. <a href="#s20">Command options</a>). Symbol '<code>:</code>' starts new command (like new line character) if it is not placed inside a string or inside brackets.</p>
 
 <p>If string contain references to external parameters (substrings "$0", "$1" ... "$9") then before execution the values of parameter will be substituted instaed of reference. It allows to use the same MGL script for different parameters (filenames, paths, condition and so on).</p>
 
@@ -52,9 +52,12 @@
 
 If names for data columns was specified (by <a href="#set_id">set_id</a> command or in the file at string started with <code>##</code>) then it is possible to use any column combinations defined by formulas, like <code>a('n*w^2/exp(t)')</code>.<br>
 
-Also, any expression (without spaces) of existed variables produce temporary variable. For example, <code>sqrt(dat(:,5)+1)</code> will produce temporary variable with data values equal to <em>tmp[i,j] = sqrt(dat[i,5,j]+1)</em>. Such variables can not be used as 1st argument for commands which create (return) the data (like <a href="#new">new</a>, <a href="#read">read</a>, <a href="#hist">hist</a> and so on).</li>
+Also, any expression (without spaces) of existed variables produce temporary variable. For example, <code>sqrt(dat(:,5)+1)</code> will produce temporary variable with data values equal to <em>tmp[i,j] = sqrt(dat[i,5,j]+1)</em>. Such variables can not be used as 1st argument for commands which create (return) the data (like <a href="#new">new</a>, <a href="#read">read</a>, <a href="#hist">hist</a> and so on).
 
-<li>Special variables <code>nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1</code> are treated as number if they were not redefined by user. Variables with <a href="#s21">suffixes</a> are treated as numbers.  Also results of formulas with sizes 1x1x1 are treated as number (for example, <code>pi/dat.nx</code>).</li></ul>
+Finally, you can put code for making new data inside {}. For example, <code>{sum dat 'x'}</code> produce temporary variable which contain result of summation of <i>dat</i> along direction 'x'. This is the same array <i>tmp</i> as produced by command <code>sum tmp dat 'x'</code>. You can use nested constructions, like <code>{sum {max dat 'z'} 'x'}</code>.
+</li>
+
+<li>Special variables <code>nan=#QNAN, pi=3.1415926..., on=1, off=0, :=-1</code> are treated as number if they were not redefined by user. Variables with <a href="#s21">suffixes</a> are treated as numbers. Names defined by <code>define</code> command are treated as number. Also results of formulas with sizes 1x1x1 are treated as number (for example, <code>pi/dat.nx</code>).</li></ul>
 
 Before the first using all variables must bedefined with the help of commands <a href="#new">new</a>, <a href="#var">var</a>, <a href="#list">list</a>, <a href="#copy">copy</a> or <a href="#read">read</a>.</p>
 
@@ -65,81 +68,150 @@ Before the first using all variables must bedefined with the help of commands <a
 <h2> <a name="s2"></a>2. Graphics setup</h2>
 
 Commands in this group influences on overall graphics appearance. So all of them should placed before any actual plotting commands.
+
+<h3>2.1. Transparency </h3>
+There are several commands for setup transparency. The general command is <code>alpha</code> which switch on/off the transparency for overall plot. It influence only for graphics which created after <code>alpha</code> call. Command <code>alphadef</code> specify the default value of alpha-channel. You may switch off transparency of selected plot by command <code>transparent</code>. Finally, command <code>transptype</code> set the kind of transparency.
 <ul>
 	<li><strong><a name="alpha"></a>alpha</strong> [<code>val=on</code>] <br>
 	Sets the transparency on/off. It is recommended to call this function before any plotting command. Initial value is <code>off</code>. Use command <a href="#transparent">transparent</a> <code>off</code> in particular plot to disable its transparency. </li>
-
 	<li><strong><a name="alphadef"></a>alphadef</strong> <code>val</code> <br>
 	Default value of alpha channel for transparency for all plotting functions. Initial value is 0.5. </li>
+	<li><strong><a name="transparent"></a>transparent</strong> <code>val</code> <br>
+	Flag that temporarily switches transparency on/off for the plot. Initial value is <code>on</code>.</li>
+	<li><strong><a name="transptype"></a>transptype</strong> <code>val</code><br>
+	Type of transparency: 0 &ndash; normal transparency (below things is less visible than upper ones), 1 &ndash; glass-like transparency ( below and upper things are commutable and just decrease light intensity), 2 &ndash; light-like transparency (below and upper things are commutable and are the source of some additional light). Initial value is <code>0</code>.</li>
+</ul>
 
+<h3>2.2. Lighting</h3>
+There are several commands for setup lighting. The general command is <code>light</code> which switch on/off the lighting for overall plot. It influence only for graphics which created after <code>light</code> call. You can specify up to 10 independent light sources. By default only one light source is active. It is source number <code>0</code> with white color, located at top of the plot.
+<ul>
 	<li><strong><a name="ambient"></a>ambient</strong> <code>val</code> <br>
 	Sets the brightness of an ambient light. The value should be in range [0,1]. It is recommended to call this function before any plotting command. Initial value is 0.5. </li>
-
-	<li><strong><a name="axialdir"></a>axialdir</strong> 'dir' <br>
-	Sets the direction around which curve rotated in <a href="#axial">axial</a> and <a href="#torus">torus</a> commands. Initial value is 'z'. </li>
-
-	<li><strong><a name="arrowsize"></a>arrowsize</strong> <code>val</code><br>
-	Base size for all arrows. Initial value is 1.</li>
-
-	<li><strong><a name="ctick"></a>ctick</strong> 'template' <br>
-	Set template (like '%g') for tick labels on colorbar. </li>
-
-	<li><strong><a name="fog"></a>fog</strong> <code>val [dist=0.25]</code> <br>
-	Set the density of fog <code>val</code> for the picture. If <code>val=0</code> then fog is absent. Fog will start from relative distance <code>dist</code> from the leading edge.</li>
-
-	<li><strong><a name="font"></a>font</strong> 'fnt' [<code>val=6</code>]<br>
-	Font style for text and labels (see <a href="#textn">text</a>). Initial style is 'fnt'='rC' &ndash; Roman font with centerin. Parameter <code>val</code> sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. For more detail see Sec. <a href="#s18">Text and font specification</a>. </li>
-
-	<li><strong><a name="legendbox"></a>legendbox</strong> <code>val</code> <br>
-	Switches on/off the drawing of a box near <a href="#legend">legend</a>. By default, the box is drawn. </li>
-
 	<li><strong><a name="light"></a>light</strong> [<code>val=on</code>]<br>
 	Sets the using of light on/off. It is recommended to call this function before any plotting command. Initial value is lightning off.</li>
-
 	<li><strong>light</strong> <code>num xpos ypos zpos</code> ['col'='w' <code>br=0.5</code> ]<br>
 	The function adds a light source with identification <code>num</code> at position {<code>xpos, ypos, zpos</code>}. The color of light is 'col' (white by default). The brightness of light is <code>br</code> in [0,1]. It is recommended to call this function before any plotting command. </li>
-
 	<li><strong>light</strong> <code>num val</code> <br>
 	Switches on/off <em>n</em>-th light source separately depending on parameter <code>val</code>.</li>
+</ul>
+
+<h3>2.3. Fog</h3>
+<ul>
+	<li><strong><a name="fog"></a>fog</strong> <code>val [dist=0.25]</code> <br>
+	Set the density of fog <code>val</code> for the picture. If <code>val=0</code> then fog is absent. Fog will start from relative distance <code>dist</code> from the leading edge.</li>
+</ul>
 
+<h3>2.4. Default sizes</h3>
+These commands control the default (initial) values for most graphics parameters including sizes of markers, arrows, linewidth and so on. As any other settings these ones will influence only on plots created after the settings change.
+<ul>
+	<li><strong><a name="arrowsize"></a>arrowsize</strong> <code>val</code><br>
+	Base size for all arrows. Initial value is 1.</li>
+	<li><strong><a name="barwidth"></a>barwidth</strong> <code>val</code><br>
+	Sets relative width of rectangles in <code>bars, barh, boxplot</code>. Default value is 0.7.</li>
 	<li> <strong><a name="linewidth"></a>linewidth</strong> <code>val</code> <br>
 	Base line width for all lines. Should be larger or equal to 1.</li>
-
 	<li><strong><a name="marksize"></a>marksize</strong> <code>val</code><br>
 	Base size for all marks. Initial value is 1.</li>
+	<li> <strong><a name="ticklen"></a>ticklen</strong> <code>val [stt=1]</code> <br>
+	The relative length of axis ticks. Default value is 0.1. Parameter <code>stt</code>&gt;0 set relative length of subticks which is in <code>sqrt(1+stt)</code> times smaller.</li>
+	<li> <strong><a name="tickstl"></a>tickstl</strong> 'stl' ['sub'='']<br>
+	The line style of axis ticks ('stl') and subticks ('sub'). If 'stl'='' then default style is used (<code>'k'</code> or <code>'w'</code> depending on transparency type). If 'sub'='' then ticks style is used (i.e. 'sub'='stl').</li>
+</ul>
 
+<h3>2.5. Zooming</h3>
+These commands control the overall zooming of the picture or the sub-picture. Normally you can use these variables and commands for removing "white" spaces around a plot.
+<ul>
+	<li><strong><a name="plotfactor"></a>plotfactor</strong> <code>val</code><br>
+	Factor for sizing overall (sub-)plot. Its value should be &gt;1.6 (default value is =-1). If <code>val=-1</code> then plot auto-sizing will be switched on. See also <a href="#zoom">zoom</a>.</li>
+	<li><strong><a name="zoom"></a>zoom</strong> <code>x1 y1 x2 y2</code><br>
+	Zoom in/out the picture by projection of region [x1, x2]&times;[y1, y2] to entire picture. This comand also clear the picture like <a href="#clf">clf</a>. See also <a href="#plotfactor">plotfactor</a>.</li>
+</ul>
+
+<h3><a name="ss26"></a>2.6. Cutting</h3>
+These commands set the condition when the points are excluded (cutted) from the drawing.
+<ul>
+	<li><strong><a name="cut"></a>cut</strong> <code>val</code> <br>
+	Flag which determines how points outside the bounding box are drawn. If it is <code>on</code> then points are excluded from the plot (it is default) otherwise the points are projected to edges of the bounding box. </li>
+	<li><strong>cut</strong> <code>x1 y1 z1 x2 y2 z2</code><br>
+	Lower and upper edge of the box in which no points are drawn. If both edges are the same (the variables are equal) then the cutting box is empty. </li>
+	<li><strong>cut</strong> 'cond'<br>
+	Command set the cutting off condition by formula 'cond'. This condition determine will point be plotted or not. If value of formula is nonzero then point is omitted, otherwise it plotted. Set argument as '' to disable cutting off condition.</li>
+</ul>
+
+<h3>2.7. Other settings</h3>
+<ul>
+	<li><strong><a name="axialdir"></a>axialdir</strong> 'dir' <br>
+	Sets the direction around which curve rotated in <a href="#axial">axial</a> and <a href="#torus">torus</a> commands. Initial value is 'z'. </li>
+	<li><strong><a name="font"></a>font</strong> 'fnt' [<code>val=6</code>]<br>
+	Font style for text and labels (see <a href="#textn">text</a>). Initial style is 'fnt'='rC' &ndash; Roman font with centerin. Parameter <code>val</code> sets the size of font for tick and axis labels. Default font size of axis labels is 1.4 times large than for tick labels. For more detail see Sec. <a href="#s18">Text and font specification</a>. </li>
 	<li><strong><a name="meshnum"></a>meshnum</strong> <code>val</code> <br>
 	Sets approximate number of lines in <a href="#mesh">mesh</a>, <a href="#fall">fall</a> and <a href="#grid2">grid</a>. Initially (=0) it draws all lines.</li>
-
 	<li><strong><a name="palette"></a>palette</strong> 'colors'<br>
 	Set the palette as selected colors. Deafult value is 'Hbgrcmyhlnqeup'. The palette is used mostly in 1D plots for curves which styles are not specified.</li>
-
-	<li><strong><a name="plotfactor"></a>plotfactor</strong> <code>val</code><br>
-	Factor for sizing overall (sub-)plot. Its value should be &gt;1.6 (default value is =-1). If <code>val=-1</code> then plot autsizing will be switched on. See also <a href="#zoom">zoom</a>.</li>
-
 	<li><strong><a name="rotatetext"></a>rotatetext</strong> <code>val</code> <br>
 	The using of text rotation along axis. Initial value is <code>on</code>. </li>
+</ul>
 
-	<li><strong><a name="setsize"></a>setsize</strong> <code>w h</code> <br>
-	Sets size of picture in pixels. This function call <strong>have to be before</strong> any plotting command. In some program the call of this function is forbidden. </li>
+<h3><a name="ss28"></a>2.8. Axis settings</h3>
+These large set of commands control how the axis and ticks will be drawn. Note that there is 3-step transformation of data coordinates are performed. Firstly, coordinates are projected and <a href="#ss26">cutting</a> is applied, after it transformation formulas are applied, and finally the data was normalized in bounding box. For drawing functions see <a href="#s4">axis and colorbar</a>.
+<ul>
+	<li><strong><a name="axis"></a>axis</strong> <code>x1 y1 x2 y2</code><br>
+	<strong>axis</strong> <code>x1 y1 z1 x2 y2 z2</code><br>
+	<strong><a name="ranges"></a>ranges</strong> <code>x1 x2 y1 y2 [z1=0 z2=0]</code><br>
+	Sets the ranges (bounding box) of coordinates changing. Also it sets the range for coloring (analogous to <a href="#caxis">caxis</a> <code>z1 z2</code>). Initial ranges are [-1,&nbsp;1].</li>
 
-	<li><strong><a name="ternary"></a>ternary</strong> <code>val</code> <br>
-	Flag that switch on/off drawing of ternary plot (triangular axis and so on). </li>
+	<li><strong>axis</strong> 'fx' 'fy' ['fz'='' 'fc'='']<br>
+	Sets the transformation formulas for curvilinear coordinates. Each string should contain mathematical expression for real coordinate depending on internal coordinates 'x', 'y', 'z' and 'a' or 'c' for colorbar. For example, the cylindrical coordinates are introduced as <code>axis&nbsp;'x*cos(y)'&nbsp;'x*sin(y)'&nbsp;'z'</code>. For removing of formulas the corresponding parameter should be ''. The using of transformation formulas will slightly slowing the program, i.e. <code>axis&nbsp;''&nbsp;''&nbsp;''</code> is faster than <code>axis&nbsp;'1*x'&nbsp;'1*y'&nbsp;'1*z'</code>. Initially all formulas are absent (Cartesian coordinates are used). For more details about functions and formulas see Sec. <a href="#s19">Formulas</a>.</li>
 
-	<li> <strong><a name="ticklen"></a>ticklen</strong> <code>val [stt=1]</code> <br>
-	The relative length of axis ticks. Default value is 0.1. Parameter <code>stt</code>&gt;0 set relative length of subticks which is in <code>sqrt(1+stt)</code> times smaller.</li>
+	<li><strong>axis</strong> <code>how</code><br>
+	Sets one of the predefined transformation formulas for curvilinear coordinate. Paramater <code>how</code> define the coordinates:<br>
+	<code>0</code> &ndash; Cartesian coordinates (no transformation);<br>
+	<code>1</code> &ndash; Polar coordiantes {x<sub>n</sub>=x*cos(y), y<sub>n</sub>=x*sin(y), z<sub>n</sub>=z};<br>
+	<code>2</code> &ndash; Spherical coordinates {x<sub>n</sub>=x*sin(y)*cos(z), y<sub>n</sub>=x*sin(y)*sin(z), z<sub>n</sub>=x*cos(y)};<br>
+	<code>3</code> &ndash; Parabolic coordinates {x<sub>n</sub>=x*y, y<sub>n</sub>=(x<sup>2</sup>-y<sup>2</sup>)/2, z<sub>n</sub>=z};<br>
+	<code>4</code> &ndash; Paraboloidal coordinates {x<sub>n</sub>=(x<sup>2</sup>-y<sup>2</sup>)*cos(z)/2, y<sub>n</sub>=(x<sup>2</sup>-y<sup>2</sup>)*sin(z)/2, z_n=x*y};<br>
+	<code>5</code> &ndash; Oblate coordinates {x<sub>n</sub>=cosh(x)*cos(y)*cos(z), y<sub>n</sub>=cosh(x)*cos(y)*sin(z), z<sub>n</sub>=sinh(x)*sin(y)};<br>
+	<code>6</code> &ndash; Prolate coordinates {x<sub>n</sub>=sinh(x)*sin(y)*cos(z), y<sub>n</sub>=sinh(x)*sin(y)*sin(z), z<sub>n</sub>=cosh(x)*cos(y)};<br>
+	<code>7</code> &ndash; Elliptic coordinates {x<sub>n</sub>=cosh(x)*cos(y), y<sub>n</sub>=sinh(x)*sin(y), z<sub>n</sub>=z};<br>
+	<code>8</code> &ndash; Toroidal coordinates {x<sub>n</sub>=sinh(x)*cos(z)/(cosh(x)-cos(y)), y<sub>n</sub>=sinh(x)*sin(z)/(cosh(x)-cos(y)), z<sub>n</sub>=sin(y)/(cosh(x)-cos(y))};<br>
+	<code>9</code> &ndash; Bispherical coordinates {x<sub>n</sub>=sin(y)*cos(z)/(cosh(x)-cos(y)), y<sub>n</sub>=sin(y)*sin(z)/(cosh(x)-cos(y)), z<sub>n</sub>=sinh(x)/(cosh(x)-cos(y))};<br>
+	<code>10</code> &ndash; Bipolar coordinates {x<sub>n</sub>=sinh(x)/(cosh(x)-cos(y)), y<sub>n</sub>=sin(y)/(cosh(x)-cos(y)), z<sub>n</sub>=z}.</li>
 
-	<li> <strong><a name="tickstl"></a>tickstl</strong> 'stl' ['sub'='']<br>
-	The line style of axis ticks ('stl') and subticks ('sub'). If 'stl'='' then default style is used (<code>'k'</code> or <code>'w'</code> depending on transparency type). If 'sub'='' then ticks style is used (i.e. 'sub'='stl').</li>
+	<li><strong><a name="caxis"></a>caxis</strong> <code>c1 c2</code> <br>
+	Sets the range for surface coloring. Initial range is [-1,&nbsp;1].</li>
+	<li><strong><a name="origin"></a>origin</strong> <code>x0 y0 [z0=nan]</code> <br>
+	Places the point of intersection of coordinate axes to the point {<code>x0, y0, z0</code>}. If one of values is <code>nan</code> then MathGL library try to select optimal axis position.</li>
+	<li><strong><a name="ternary"></a>ternary</strong> <code>val</code> <br>
+	Flag that switch on/off drawing of ternary plot (triangular axis and so on). </li>
 
-	<li><strong><a name="transparent"></a>transparent</strong> <code>val</code> <br>
-	Flag that temporarily switches transparency on/off for the plot. Initial value is <code>on</code>.</li>
+	<li><strong><a name="adjust"></a>adjust</strong> ['dir'='xyzc']<br>
+	Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) 'dir'.</li>
 
-	<li><strong><a name="transptype"></a>transptype</strong> <code>val</code><br>
-	Type of transparency: 0 &ndash; normal transparency, 1 &ndash; glass-like transparency, 2 &ndash; light-like transparency. Initial value is <code>0</code>.</li>
+	<li><strong><a name="crange"></a>crange</strong> <em>dat </em>[<code>add=off frac=0</code>] <br>
+	<strong><a name="xrange"></a>xrange</strong> <em>dat</em> [<code>add=off frac=0</code>] <br>
+	<strong><a name="yrange"></a>yrange</strong> <em>dat</em> [<code>add=off frac=0</code>] <br>
+	<strong><a name="zrange"></a>zrange</strong> <em>dat</em> [<code>add=off frac=0</code>] <br>
+	Sets the range for x-, y-, z-coordinate and colorbar as minimal and maximal values of data <em>dat</em>. Parameter <code>add=on</code> shows that the new range will be joined to existed one (nut will not replace it). Parameter <code>fact</code> add additional range increase on value (Max-Min)*<code>fact</code>. See also <a href="#axis">axis</a>.</li>
+	<li><strong>crange</strong> <code>v1 v2</code><br>
+	<strong>xrange</strong> <code>v1 v2</code><br>
+	<strong>yrange</strong> <code>v1 v2</code><br>
+	<strong>zrange</strong> <code>v1 v2</code><br>
+	Sets the range for x-, y-, z-coordinate and colorbar as <code>[v1, v2]</code>. See also <a href="#axis">axis</a> and <a href="#caxis">caxis</a>.</li>
 
-	<li><strong><a name="zoom"></a>zoom</strong> <code>x1 y1 x2 y2</code><br>
-	Zoom in/out the picture by projection of region [x1, x2]&times;[y1, y2] to entire picture. This comand also clear the picture like <a href="#clf">clf</a>. See also <a href="#plotfactor">plotfactor</a>.</li>
+	<li><strong><a name="xtick"></a>xtick</strong> <code>dx</code> [<code>sx=0 tx=nan</code>] <br>
+	<strong><a name="ytick"></a>ytick</strong> <code>dx</code> [<code>sx=0 tx=nan</code>] <br>
+	<strong><a name="ztick"></a>ztick</strong> <code>dx</code> [<code>sx=0 tx=nan</code>] <br>
+	<strong><a name="ctick"></a>ctick</strong> <code>dx</code> <br>
+	Step for x-, y-, z-axis ticks and colorbar (if <code>dx</code>&gt;0) or it's number (if <code>dx</code>&lt;0). Zero value <code>dx</code>=0 sets logarithmic ticks. Parameter <code>sx</code> sets the number of subticks. Parameter <code>tx</code> set the starting points for ticks (if not <code>nan</code>).</li>
+	<li><strong>xtick</strong> 'template' <br>
+	<strong>ytick</strong> 'template' <br>
+	<strong>ztick</strong> 'template' <br>
+	<strong>ctick</strong> 'template' <br>
+	Set template (like '%g') for tick labels along x-, y-, z-axis ticks and colorbar. Do not influence on logarithmic ticks. </li>
+	<li><strong>xtick</strong> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...] <br>
+	<strong>ytick</strong> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...] <br>
+	<strong>ztick</strong> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...] <br>
+	Manual positions <code>val1, val2, ...</code> and labels 'lbl1', 'lbl2', ... for ticks along x-, y-, z-axis. Labels may contain TeX symbols also. </li>
 </ul>
 <div style="text-align: right;">[<a href="#s0">contents</a>]</div>
 
@@ -153,11 +225,11 @@ These command define the position of plot on the picture and its properties. The
 	<li><strong><a name="columnplot"></a>columnplot</strong> <code>num ind</code> <br>
 	Puts further plotting in <code>ind</code>-th cell of column with <code>num</code> cells. The position is relative to previous <a href="#subplot">subplot</a> call (or <a href="#inplot">inplot</a> with <code>rel=off</code>).</li>
 
-	<li><strong><a name="inplot"></a>inplot</strong> <code>x1 x2 y1 y2</code> <br>
-	Puts the further plotting in some region of the whole frame surface. This command allows one to create a plot in arbitrary place of the screen. The position is defined by rectangular coordinates [<code>x1,x2</code>]&times;[<code>y1,y2</code>]. The coordinates <code>x1, x2, y1, y2</code> are normalized to interval [0, 1]. This command sets any aspects or rotations off. So, it should be used first for creating subplot. See also <a href="#subplot">subplot</a>. </li>
+	<li><strong><a name="inplot"></a>inplot</strong> <code>x1 x2 y1 y2 [rel=off]</code> <br>
+	Puts the further plotting in some region of the whole frame surface. This command allows one to create a plot in arbitrary place of the screen. The position is defined by rectangular coordinates [<code>x1,x2</code>]&times;[<code>y1,y2</code>]. The coordinates <code>x1, x2, y1, y2</code> are normalized to interval [0, 1]. If parameter <code>rel=on</code> then the relative position to current sub- or inplot is used. This command sets any aspects or rotations off. So, it should be used first for creating subplot. See also <a href="#subplot">subplot</a>. </li>
 
 	<li><strong><a name="perspective"></a>perspective</strong> <code>val</code><br>
-	Set perspective value. Should be in range [0,1]. Initial value is 0 that correspond to ortho projection.</li>
+	Set perspective value. Parameter <code>val</code>~1/z<sub>eff</sub> should be in range [0,1]. Initial value is 0 that correspond to ortho projection.</li>
 
 	<li><strong><a name="rotate"></a>rotate</strong> <code>tetz tetx</code> [<code>tety=0</code>] <br>
 	Rotates a further plotting relative to each axis (x, z, y) consecutively on angles <code>tetz</code>, <code>tetx</code>, <code>tety</code>. </li>
@@ -174,15 +246,6 @@ These command define the position of plot on the picture and its properties. The
 
 Axis functions control and draw the axes. There is the twofold axis representation in MGL. First one consists in normalizing of the data point coordinates in box specified in <a href="#axis">axis</a> command. If <a href="#cut">cut</a> is <code>on</code> then the outer point is omitted otherwise it is projected to bounding box. Also the points are omitted if they are inside the box specified in <a href="#cut">cut</a> command. After it transformation formulas 'fx', 'fy', 'fz' are applied to the data point. Finally, the data point is plotted by one of functions.
 <ul>
-	<li><strong><a name="axis"></a>axis</strong> <code>x1 y1 x2 y2</code><br>
-	<strong>axis</strong> <code>x1 y1 z1 x2 y2 z2</code><br>
-	Sets the ranges (bounding box) of coordinates changing. Also it sets the range for coloring (analogous to <a href="#caxis">caxis</a> <code>z1 z2</code>). Initial ranges are [-1,&nbsp;1].</li>
-
-	<li><strong>axis</strong> 'fx' 'fy' 'fz' <br>
-	Sets the transformation formulas for curvilinear coordinates. Each string should contain mathematical expression for real coordinate depending on internal coordinates x, y, z. For example, the cylindrical coordinates are introduced as <code>axis&nbsp;'x*cos(y)'&nbsp;'x*sin(y)'&nbsp;'z'</code>. For removing of formulas the corresponding parameter should be ''. The using of transformation formulas will slightly slowing the program, i.e. <code>axis&nbsp;''&nbsp;''&nbsp;''</code> is faster than <code>axis&nbsp;'x'&nbsp;'y'&nbsp;'z'</code>. Initially all formulas are absent (Cartesian coordinates are used). For more details about functions and formulas see Sec. <a href="#s19">Formulas</a>.</li>
-
-	<li><strong>axis</strong> <code>how</code><br>
-	Sets one of the predefined transformation formulas for curvilinear coordinate. Paramater <code>how</code> define the coordinates: <code>0</code> -- Cartesian coordinates (no transformation); <code>1</code> -- Polar coordiantes {x<sub>n</sub>=x*cos(y), y<sub>n</sub>=x*sin(y), z<sub>n</sub>=z}; <code>2</code> -- Spherical coordinates {x<sub>n</sub>=x*sin(y)*cos(z), y<sub>n</sub>=x*sin(y)*sin(z), z<sub>n</sub>=x*cos(y)}; <code>3</code> -- Parabolic coordinates {x<sub>n</sub>=x*y, y<sub>n</sub>=(x<sup>2</sup>-y<sup>2</sup>)/2, z<sub>n</sub>=z}; <code>4</code> -- Paraboloidal coordinates {x<sub>n</sub>=(x<sup>2</sup>-y<sup>2</sup>)*cos(z)/2, y<sub>n</sub>=(x<sup>2</sup>-y<sup>2</sup>)*sin(z)/2, z_n=x*y}; <code>5</code> -- Oblate coordinates {x<sub>n</sub>=cosh(x)*cos(y)*cos(z), y<sub>n</sub>=cosh(x)*cos(y)*sin(z), z<sub>n</sub>=sinh(x)*sin(y)}; <code>6</code> -- Prolate coordinates {x<sub>n</sub>=sinh(x)*sin(y)*cos(z), y<sub>n</sub>=sinh(x)*sin(y)*sin(z), z<sub>n</sub>=cosh(x)*cos(y)}; <code>7</code> -- Elliptic coordinates {x<sub>n</sub>=cosh(x)*cos(y), y<sub>n</sub>=sinh(x)*sin(y), z<sub>n</sub>=z}; <code>8</code> -- Toroidal coordinates @math{x<sub>n</sub>=sinh(x)*cos(z)/(cosh(x)-cos(y)), y<sub>n</sub>=sinh(x)*sin(z)/(cosh(x)-cos(y)), z<sub>n</sub>=sin(y)/(cosh(x)-cos(y))}; <code>9</code> -- Bispherical coordinates {x<sub>n</sub>=sin(y)*cos(z)/(cosh(x)-cos(y)), y<sub>n</sub>=sin(y)*sin(z)/(cosh(x)-cos(y)), z<sub>n</sub>=sinh(x)/(cosh(x)-cos(y))}; <code>10</code> -- Bipolar coordinates {x<sub>n</sub>=sinh(x)/(cosh(x)-cos(y)), y<sub>n</sub>=sin(y)/(cosh(x)-cos(y)), z<sub>n</sub>=z}.</li>
 
 	<li><strong>axis</strong> ['dirs'='xyz' <code>adjust=off</code>] <br>
 	Draws axes with ticks (defined by <a href="#xtick">xtick</a>, <a href="#ytick">ytick</a>, <a href="#ztick">ztick</a>) in directions determined by string parameter <em>dir</em>. If the string contains symbol '_' then tick labels are not printed. Font for ticks text is determined by <a href="#font">font</a>. Ticks will be automatically adjusted if <code>adjust=on</code>.</li>
@@ -190,86 +253,37 @@ Axis functions control and draw the axes. There is the twofold axis representati
 	<li><strong><a name="box"></a>box</strong> ['stl'='k'] <br>
 	Draws bounding box outside the plotting volume with line style 'stl'. </li>
 
-	<li><strong><a name="caxis"></a>caxis</strong> <code>c1 c2</code> <br>
-	Sets the range for surface coloring. Initial range is [-1,&nbsp;1].</li>
-
 	<li><strong><a name="colorbar"></a>colorbar</strong> ['sch'='' <code>pos=0</code>] <br>
 	<strong>colorbar</strong> <em>vdat</em> ['sch'='' <code>pos=0</code>] <br>
 	Draws colorbar with color scheme 'sch' (current scheme if 'sch'='') at the edge of plot. If parameter <em>vdat</em> is specified then sharp colors is used (like <code>contd</code> command. Parameter <code>pos</code> specifies the position of colorbar: 0 - at right (default), 1 - at left, 2 - at top, 3 - at bottom. </li>
-
-	<li><strong><a name="crange"></a>crange</strong> <em>dat </em>[<code>add=off frac=0</code>] <br>
-	Sets the range for surface coloring as minimal and maximal values of data <em>dat</em>. Parameter <code>add=on</code> shows that the new range will be joined to existed one (but will not replace it). Parameter <code>fact</code> add additional range increase on value (Max-Min)*<code>fact</code>. See also <a href="#caxis">caxis</a>.</li>
-
-	<li><strong>crange</strong> <code>c1 c2</code><br>
-	Sets the range for surface coloring as <code>[c1, c2]</code>. The same as <a href="#caxis">caxis</a>.</li>
-
-	<li><strong><a name="cut"></a>cut</strong> <code>val</code> <br>
-	Flag which determines how points outside the bounding box are drawn. If it is <code>on</code> then points are excluded from the plot (it is default) otherwise the points are projected to edges of the bounding box. </li>
-
-	<li><strong>cut</strong> <code>x1 y1 z1 x2 y2 z2</code><br>
-	Lower and upper edge of the box in which no points are drawn. If both edges are the same (the variables are equal) then the cutting box is empty. </li>
-
-	<li><strong>cut</strong> 'condition'<br>
-	Set cutting off formula. If 'condition' is nonzero for point coordinates then this point is excluded from the plot. </li>
+	<li><strong>colorbar</strong> 'sch' <code>pos x y w h</code> <br>
+	Draws colorbar with color scheme 'sch' (current scheme if '') at arbitrary position of subplot <code>x y</code> (supposed to be in range [0,1]). Parameter <code>pos</code> specifies the position of colorbar labels: 0 - at left, 1 - at right, 2 - at bottom, 3 - at top. Parameters <code>w h</code> set the relative width and height of the colorbar.</li>
 
 	<li><strong><a name="grid"></a>grid</strong> ['dir'='xyz' 'stl'='B-'] <br>
 	Draws grid lines perpendicular to direction determined by string parameter 'dir'. The step of grid lines is the same as tick step for an <a href="#axis">axis</a>. The style of lines is determined by 'stl'. </li>
 
-	<li><strong><a name="origin"></a>origin</strong> <code>x0 y0 [z0=nan]</code> <br>
-	Places the point of intersection of coordinate axes to the point {<code>x0, y0, z0</code>}. If one of values is <code>nan</code> then MathGL library try to select optimal axis position.</li>
-
-	<li><strong><a name="xlabel"></a>xlabel</strong> 'txt' [<code>pos=1 shift=0</code>]<br>
-	<strong><a name="ylabel"></a>ylabel</strong> 'txt' [<code>pos=1 shift=0</code>]<br>
-	<strong><a name="zlabel"></a>zlabel</strong> 'txt' [<code>pos=1 shift=0</code>]<br>
+	<li><strong><a name="xlabel"></a>xlabel</strong> 'txt' [<code>pos=1 size=-1.4 shift=0</code>]<br>
+	<strong><a name="ylabel"></a>ylabel</strong> 'txt' [<code>pos=1 size=-1.4 shift=0</code>]<br>
+	<strong><a name="zlabel"></a>zlabel</strong> 'txt' [<code>pos=1 size=-1.4 shift=0</code>]<br>
+	<strong><a name="tlabel"></a>tlabel</strong> 'txt' [<code>pos=1 size=-1.4 shift=0</code>]<br>
 	Prints the label 'txt' for x-, y-, z-axis. The position of label is determined by <code>pos</code> parameter. If <code>pos</code>=0 then label is printed at the center of axis. If <code>pos</code>&gt;0 then label is printed at the maximum of axis. If <code>pos</code>&lt;0 then label is printed at the minimum of axis. Font style and size are defined by <a href="#font">font</a> command. Parameter <code>shift</code> specify additional shifting of the label. See also <a href="#textn">text</a>. For more detail see Sec. <a href="#s18">Text and font specification</a>. </li>
-
-	<li><strong><a name="xrange"></a>xrange</strong> <em>dat</em> [<code>add=off frac=0</code>] <br>
-	<strong><a name="yrange"></a>yrange</strong> <em>dat</em> [<code>add=off frac=0</code>] <br>
-	<strong><a name="zrange"></a>zrange</strong> <em>dat</em> [<code>add=off frac=0</code>] <br>
-	Sets the range for x-, y-, z-coordinate as minimal and maximal values of data <em>dat</em>. Parameter <code>add=on</code> shows that the new range will be joined to existed one (nut will not replace it). Parameter <code>fact</code> add additional range increase on value (Max-Min)*<code>fact</code>. See also <a href="#axis">axis</a>.</li>
-
-	<li><strong>xrange</strong> <code>v1 v2</code><br>
-	<strong>yrange</strong> <code>v1 v2</code><br>
-	<strong>zrange</strong> <code>v1 v2</code><br>
-	Sets the range for x-, y-, z-coordinate as <code>[v1, v2]</code>. See also <a href="#axis">axis</a>.</li>
-
-	<li><strong><a name="xtick"></a>xtick</strong> <code>dx</code> [<code>sx=0 tx=nan</code>] <br>
-	<strong><a name="ytick"></a>ytick</strong> <code>dx</code> [<code>sx=0 tx=nan</code>] <br>
-	<strong><a name="ztick"></a>ztick</strong> <code>dx</code> [<code>sx=0 tx=nan</code>] <br>
-	Step for x-, y-, z-axis ticks (if <code>dx</code>&gt;0) or it's number (if <code>dx</code>&lt;0). Zero value <code>dx</code>=0 sets logarithmic ticks. Parameter <code>sx</code> sets the number of subticks. Parameter <code>tx</code> set the starting points for ticks (if not <code>nan</code>).</li>
-
-	<li><strong>xtick</strong> 'template' <br>
-	<strong>ytick</strong> 'template' <br>
-	<strong>ztick</strong> 'template' <br>
-	Set template (like '%g') for tick labels along x-, y-, z-axis ticks. Do not influence on logarithmic ticks. </li>
-
-	<li><strong>xtick</strong> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...] <br>
-	<strong>ytick</strong> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...] <br>
-	<strong>ztick</strong> <code>val1</code> 'lbl1' [<code>val2</code> 'lbl2' ...] <br>
-	Manual positions <code>val1, val2, ...</code> and labels 'lbl1', 'lbl2', ... for ticks along x-, y-, z-axis. Labels may contain TeX symbols also. </li>
-
-	<li><strong><a name="adjust"></a>adjust</strong> 'dir'<br>
-	Set the ticks step, number of sub-ticks and initial ticks position to be the most human readable for the axis along direction(s) 'dir'.</li>
 </ul>
 <div style="text-align: right;">[<a href="#s0">contents</a>]</div>
 
 <h2> <a name="s5"></a>5. Primitive drawing functions</h2>
-
-These functions draw some simple objects like point, line, marker or text string.
+These functions draw some simple objects like line, point, sphere, drop, cone and so on. Also the text printing, plots by formula and legend drawing is included in this section.
 <ul>
-	<li><strong><a name="addlegend"></a>addlegend</strong> 'txt' 'stl' <br>
-	Adds string 'txt' to internal legend accumulator. The style of described line and mark is specified in string 'stl'. The maximal number of entries is 100. If 'stl'='' then the corresponding text is printed without indent.</li>
+	<li><strong><a name="clf"></a>clf</strong> <br>
+	Clears up the picture. Removes all drawing from it. Does not change transformation matrix. </li>
+</ul>
 
+<h3>5.1. Lines, curves and figures</h3>
+These functions draw some simple objects like line, point, sphere, drop, cone and so on.
+<ul>
 	<li><strong><a name="ball"></a>ball</strong> <code>x y</code> ['col'='r']<br>
 	<strong>ball</strong> <code>x y z</code> ['col'='r']<br>
 	Draws a point (ball) at position {<code>x y z</code>} with color 'col'. </li>
 
-	<li><strong><a name="clearlegend"></a>clearlegend</strong> <br>
-	Clears saved legend strings. </li>
-
-	<li><strong><a name="clf"></a>clf</strong> <br>
-	Clears up the picture. Removes all drawing from it. Does not change transformation matrix. </li>
-
 	<li><strong><a name="cone"></a>cone</strong> <code>x1 y1 z1 x2 y2 z2 r1</code> [<code>r2=-1</code> 'stl'='' <code>edge=off</code>]<br>
 	Draws truncated cone from point {<code>x1, y1, z1</code>} with radius <code>r1</code> to point {<code>x2, y2, z2</code>} with radius <code>r2</code>, using line style 'stl'. If radius <code>r2&lt;0</code> then the radius <code>r1</code> is used (<code>r2=r1</code>). Flag <code>edge</code> set to draw or not the edges of the cone.</li>
 
@@ -277,34 +291,14 @@ These functions draw some simple objects like point, line, marker or text string
 	<strong>curve</strong> <code>x1 y1 z1 dx1 dy1 dz1 x2 y2 z2 dx2 dy2 dz2</code> ['stl'=''] <br>
 	Draws Bezier-like curve from point {<code>x1, y1, z1</code>} to {<code>x2, y2, z2</code>} using line style 'stl'. At this tangent is co-directed with {<code>dx1, dy1, dz1</code>}, {<code>dx2, dy2, dz2</code>} and proportional to its amplitude. </li>
 
-	<li><strong><a name="drop"></a>drop</strong> <code>x0 y0 z0 dx dy dz r</code> ['col'='' <code>sh=1 asp=1</code>]<br>
-	<strong>drop</strong> <code>x0 y0 dx dy r</code> ['col'='' <code>sh=1 asp=1</code>]<br>
+	<li><a name="drop"></a><strong>drop</strong> <code>x0 y0 dx dy r</code> ['col'='' <code>sh=1 asp=1</code>]<br>
+	<strong>drop</strong> <code>x0 y0 z0 dx dy dz r</code> ['col'='' <code>sh=1 asp=1</code>]<br>
 	Draws drop with size <code>r</code> starting from point {<code>x0, y0, z0</code>} and directed to {<code>dx, dy, dz</code>}. The drop color is determined by 'col'. Parameter <code>sh</code> (in range [0, 1]) determines the drop oblongness. Parameter <code>asp</code> set relative width of the drop.</li>
 
 	<li><strong><a name="facex"></a>facex</strong> <code>x0 y0 z0 wy wz</code> ['stl'='' <code>d1=0 d2=0</code>]<br>
 	<strong><a name="facey"></a>facey</strong> <code>x0 y0 z0 wx wz</code> ['stl'='' <code>d1=0 d2=0</code>]<br>
 	<strong><a name="facez"></a>facez</strong> <code>x0 y0 z0 wx wy</code> ['stl'='' <code>d1=0 d2=0</code>]<br>
 	Draws the solid rectangle perpendicular to x-, y-, z-axis at position <code>x0, y0, z0</code> with widths <code>wx, wy, wz</code> along corresponding directions. At this colors, specified by 'stl', can be the same for all vertexes or different if all 4 colors are specified for each vertex. Parameters <code>d1,d2</code>&ne;0 set additional shift of the last vertex. See also <a href="#rect">rect</a>.</li>
-	
-	<li><strong><a name="fgets"></a>fgets</strong> <code>x y</code> 'fname' [<code>n=0</code> 'fnt'='' <code>size=-1.4</code>]<br>
-	<strong>fgets</strong> <code>x y z</code> 'fname' [<code>n=0</code> 'fnt'='' <code>size=-1.4</code>]<br>
-	Draws unrotated text of <code>n</code>-th line of the file 'fname' at position {<code>x y z</code>} by font 'fnt' with <code>size</code>. By default font parameters from <a href="#font">font</a> command are used. For more details see Sec. <a href="#s18">Text and font specification</a>.</li>
-	
-	<li><strong><a name="fplot"></a>fplot</strong> 'y(x)' ['pen'='' <code>zval=nan num=100</code>]<br>
-	Draws curve <em>y=y(x)</em> at plane z=<code>zval</code> for <em>x</em> distributed in <a href="#xrange">xrange</a>. You do not need to create the data arrays to plot it. The parameter <code>num</code> set the minimal number of points along coordinate(s) for plots. See also <a href="#plot">plot</a>.</li>
-	<li><strong>fplot</strong> 'x(t)' 'y(t)' 'z(t)' ['pen'='' <code>num=100</code>]<br>
-	Draws parametrical curve {<em>x(t), y(t), z(t)</em>} where <em>t</em> is changed in range [0,1]. You do not need to create the data arrays to plot it. The parameter <code>num</code> set the minimal number of points along coordinate(s) for plots.</li>
-
-	<li><strong><a name="fsurf"></a>fsurf</strong> 'z(x,y)' ['sch'='' <code>num=100</code>]<br>
-	Draws surface <em>z=z(x,y)</em> for <em>x, y</em> distributed in <a href="#xrange">xrange</a>,  <a href="#yrange">yrange</a>. You do not need to create the data arrays to plot it. The parameter <code>num</code> set the minimal number of points along coordinate(s) for plots. See also <a href="#surf">surf</a>.</li>
-	<li><strong><a name="fsurf"></a>fsurf</strong> 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'='' <code>num=100</code>]<br>
-	Draws surface {<em>x(u,v), y(u,v), z(u,v)</em>} where <em>u, v</em> is changed in range [0, 1]. You do not need to create the data arrays to plot it. The parameter <code>num</code> set the minimal number of points along coordinate(s) for plots. See also <a href="#surf">surf</a>.</li>
-
-	<li><strong><a name="legend"></a>legend</strong> [<code>pos=3</code> 'fnt'='rL' <code>size=-1 llen=0.1</code>]<br>
-	Draws legend of accumulated string by font 'fnt' with <code>size</code>. Parameter <code>pos</code> sets the position of the legend: 0 is bottom left corner, 1 is bottom right corner, 2 is top left corner, 3 is top right corner (is default). Parameter <code>llen</code> set the relative width of the line sample and the text indent. </li>
-
-	<li><strong>legend</strong> <code>x y</code> ['fnt'='rL' <code>size=-1 llen=0.1</code>]<br>
-	Draws legend of accumulated string by font 'fnt' with <code>size</code>. Parameters <code>x, y</code> sets the position of the legend. Parameter <code>llen</code> set the relative width of the line sample and the text indent. </li>
 
 	<li><strong><a name="line"></a>line</strong> <code>x1 y1 x2 y2</code> ['stl'='']<br>
 	<strong>line</strong> <code>x1 y1 z1 x2 y2 z2</code> ['stl'='']<br>
@@ -317,24 +311,73 @@ These functions draw some simple objects like point, line, marker or text string
 	<li><strong><a name="sphere"></a>sphere</strong> <code>x0 y0 r</code> ['col'='']<br>
 	<strong>sphere</strong> <code>x0 y0 z0 r</code> ['col'='']<br>
 	Draws sphere with radius <code>r</code> and center at point {<code>x0, y0, z0</code>} using color 'col'. </li>
+</ul>
 
-	<li><strong><a name="textn"></a>text</strong> <code>x y</code> 'txt' ['fnt'='' <code>size=-1.4</code>]<br>
+<h3>5.2. Text printing</h3>
+These commands draw the text. There are commands for drawing text in arbitrary place, in arbitrary direction and along arbitrary curve. It is possible to use arbitrary font-faces and parse many TeX commands. The Unicode text is supported. The <code>size</code> argument control the size of text: if positive it give the value, if negative it give the value relative to defined by <a href="#font">font</a> command. For more details see Sec. <a href="#s18">Text and font specification</a>.
+<ul>
+	<li><strong><a name="fgets"></a>fgets</strong> <code>x y</code> 'fname' [<code>n=0</code> 'fnt'='' <code>size=-1.4</code>]<br>
+	<strong>fgets</strong> <code>x y z</code> 'fname' [<code>n=0</code> 'fnt'='' <code>size=-1.4</code>]<br>
+	Draws unrotated text of <code>n</code>-th line of the file 'fname' at position {<code>x y z</code>} by font 'fnt' with <code>size</code>.</li>
+
+	<li><strong><a name="text"></a>text</strong> <code>x y</code> 'txt' ['fnt'='' <code>size=-1.4</code>]<br>
 	<strong>text</strong> <code>x y z</code> 'txt' ['fnt'='' <code>size=-1.4</code>]<br>
-	Draws unrotated text string 'txt' at position {<code>x y z</code>} by font 'fnt' with <code>size</code>. By default font parameters from <a href="#font">font</a> command are used. For more details see Sec. <a href="#s18">Text and font specification</a>.</li>
+	Draws unrotated text string 'txt' at position {<code>x y z</code>} by font 'fnt' with <code>size</code>.</li>
 
 	<li><strong>text</strong> <code>x y dx dy</code> 'txt' [<code>size=-1.4</code>]<br>
 	<strong>text</strong> <code>x y z dx dy dz</code> 'txt' [<code>size=-1.4</code>]<br>
-	Draws unrotated text string 'txt' at position {<code>x y z</code>} along direction {<ode>dx,dy,dz</code>} by font with <code>size</code>. By default font parameters from <a href="#font">font</a> command are used. For more details see Sec. <a href="#s18">Text and font specification</a>.</li>
+	Draws string 'txt' at position {<code>x y z</code>} along direction {<ode>dx,dy,dz</code>} by font with <code>size</code>.</li>
+
+	<a><strong>text</strong> <em>ydat</em> 'txt' [font='' <code>sise=-1 zval=nan</code>]<br>
+	<strong>text</strong> <em>xdat ydat</em> 'txt' [font='' <code>sise=-1 zval=nan</code>]<br>
+	<strong>text</strong> <em>xdat</em> 'txt' [font='' <code>sise=-1</code>]<br>
+	Prints text along the curve between points {<em>xdat, ydat, zdat</em>}. If string contain 'T' symbol then the text will be drawn above the curve.</li>
+
+	<li><strong><a name="label"></a>label</strong> <code>x y</code> 'txt' ['fnt'='' <code>size=-1.4</code>]<br>
+	Draws text 'txt' at arbitrary position of the picture {<code>x, y</code>} by font 'fnt' with <code>size</code>. Coordiantes <code>x, y</code> are supposed to be in range [0,1].</li>
 
 	<li><strong><a name="title"></a>title</strong> 'txt' ['fnt'='' <code>size=-2</code>]<br>
-	Draws title 'txt' for the overall picture at its top by font 'fnt' with <code>size</code>. By default font parameters from <a href="#font">font</a> command are used. For more details see Sec. <a href="#s18">Text and font specification</a>.</li>
+	Draws title 'txt' for the overall picture at its top by font 'fnt' with <code>size</code>.</li>
+</ul>
+
+<h3>5.2. Text printing</h3>
+These commands draw legend to the graph (useful for <a href="#s6">1D plotting (MGL)</a>). Legend entry is a pair of strings: one for style of the line, another one with description text (with included LaTeX parsing). The array of string are accumulated first to the internal arrays (by command <code>addlegend</code>) and are plotted later. The position of the legend can be selected automatic or manually. Parameters 'fnt' and <code>size</code> specify the font style and size. Parameter <code>llen</code> set the relative width of the line sample and the text indent (default value is 0.1). If line style string for entry is empty then the corresponding text is printed without indent.
+<ul>
+	<li><strong><a name="addlegend"></a>addlegend</strong> 'txt' 'stl' <br>
+	Adds string 'txt' to internal legend accumulator. The style of described line and mark is specified in string 'stl'. The maximal number of entries is 100. If 'stl'='' then the corresponding text is printed without indent.</li>
+
+	<li><strong><a name="clearlegend"></a>clearlegend</strong> <br>
+	Clears saved legend strings. </li>
+
+	<li><strong><a name="legend"></a>legend</strong> [<code>pos=3</code> 'fnt'='rL' <code>size=-1 llen=0.1</code>]<br>
+	Draws legend of accumulated string by font 'fnt' with <code>size</code>. Parameter <code>pos</code> sets the position of the legend: 0 is bottom left corner, 1 is bottom right corner, 2 is top left corner, 3 is top right corner (is default). Parameter <code>llen</code> set the relative width of the line sample and the text indent. </li>
+
+	<li><strong>legend</strong> <code>x y</code> ['fnt'='rL' <code>size=-1 llen=0.1</code>]<br>
+	Draws legend of accumulated string by font 'fnt' with <code>size</code>. Parameters <code>x, y</code> sets the position of the legend. Parameter <code>llen</code> set the relative width of the line sample and the text indent. </li>
+
+	<li><strong><a name="legendbox"></a>legendbox</strong> <code>val</code> <br>
+	Switches on/off the drawing of a box near <a href="#legend">legend</a>. By default, the box is drawn. </li>
+</ul>
 
+<h3>5.3. Plots by formula</h3>
+
+These commands plots curves and surfaces defined by textual formulas. The actual number of points for curves is increased near singularities.
+<ul>
+	<li><strong><a name="fplot"></a>fplot</strong> 'y(x)' ['pen'='' <code>zval=nan num=100</code>]<br>
+	Draws curve <em>y=y(x)</em> at plane z=<code>zval</code> for <em>x</em> distributed in <a href="#xrange">xrange</a>. You do not need to create the data arrays to plot it. The parameter <code>num</code> set the minimal number of points along coordinate(s) for plots. See also <a href="#plot">plot</a>.</li>
+	<li><strong>fplot</strong> 'x(t)' 'y(t)' 'z(t)' ['pen'='' <code>num=100</code>]<br>
+	Draws parametrical curve {<em>x(t), y(t), z(t)</em>} where <em>t</em> is changed in range [0,1]. You do not need to create the data arrays to plot it. The parameter <code>num</code> set the minimal number of points along coordinate(s) for plots.</li>
+
+	<li><strong><a name="fsurf"></a>fsurf</strong> 'z(x,y)' ['sch'='' <code>num=100</code>]<br>
+	Draws surface <em>z=z(x,y)</em> for <em>x, y</em> distributed in <a href="#xrange">xrange</a>,  <a href="#yrange">yrange</a>. You do not need to create the data arrays to plot it. The parameter <code>num</code> set the minimal number of points along coordinate(s) for plots. See also <a href="#surf">surf</a>.</li>
+	<li><strong><a name="fsurf"></a>fsurf</strong> 'x(u,v)' 'y(u,v)' 'z(u,v)' ['sch'='' <code>num=100</code>]<br>
+	Draws surface {<em>x(u,v), y(u,v), z(u,v)</em>} where <em>u, v</em> is changed in range [0, 1]. You do not need to create the data arrays to plot it. The parameter <code>num</code> set the minimal number of points along coordinate(s) for plots. See also <a href="#surf">surf</a>.</li>
 </ul>
 <div style="text-align: right;">[<a href="#s0">contents</a>]</div>
 
 <h2> <a name="s6"></a>6. 1d plotting commands</h2>
 
-<p>These functions perform plotting of 1D data. 1D means that the data depend on the only 1 parameter (index). Most of commands have similar interface. There are version for drawing in 3d space or in plain. For the last one there is a possibility to use single data array.</p>
+<p>These functions perform plotting of 1D data. 1D means that the data depend on the only 1 parameter (index), like parametric curve {x(i),y(i),z(i)}, i=0...n-1. Most of commands have similar interface. There are version for drawing in 3d space or in plain. For the last one there is a possibility to use single data array.</p>
 
 <p>If command allows to use parametric curve definition (depends on 2 or 3 data arrays) then its minor dimensions should be equal. If one of the arrays is 2d array (matrix) then the curves will be drawn for each of rows. At this the other arrays can be one-dimensional. If  array <em>xdat</em> is not specified then its an automatic array is used with values equidistantly distributed along x. Also the <code>zval</code> (the default is at the bottom of the bounding box) is used instead <em>zdat</em> if last is not specified.</p>
 
@@ -347,13 +390,17 @@ These functions draw some simple objects like point, line, marker or text string
 
 	<li><strong><a name="barh"></a>barh</strong> <em>vdat</em> ['stl'='' <code>zval=nan above=off</code>] <br>
 	<strong>barh</strong> <em>ydat vdat</em> ['stl'='' <code>zval=nan above=off</code>]<br>
-	Draws horizontal bars from points {<em>vdat, ydat</em>} to x axis in plane z = <code>zval</code> (the default is at the bottom of the bounding box). Bars are drawn side-by-side (if <code>above = off</code>) or one above another (if <code>above = on</code>). Marks at data points are not drawn. </li>
+	Draws horizontal bars from points {<em>vdat, ydat</em>} to x axis in plane z=<code>zval</code> (the default is at the bottom of the bounding box). Bars are drawn side-by-side (if <code>above = off</code>) or one above another (if <code>above = on</code>). Marks at data points are not drawn. </li>
 
 	<li><strong><a name="bars"></a>bars</strong> <em>ydat</em> ['stl'='' <code>zval=nan above=off</code>] <br>
 	<strong>bars</strong> <em>xdat ydat</em> ['stl'='' <code>zval=nan above=off</code>]<br>
 	<strong>bars</strong> <em>xdat ydat zdat</em> ['stl'='' <code>above=off</code>]<br>
 	Draws vertical bars from points {<em>xdat, ydat, zdat</em>} to axis (to axis plane in 3D). Bars are drawn side-by-side (if <code>above = off</code>) or one above another (if <code>above = on</code>). Marks at data points are not drawn. </li>
 
+	<li><strong><a name="boxplot"></a>boxplot</strong> <em>adat</em> ['stl'='' <code>zval=nan</code>] <br>
+	<strong>boxplot</strong> <em>xdat adat</em> ['stl'='' <code>zval=nan</code>]<br>
+	Draws boxplot (also known as a box-and-whisker diagram) at points {<em>xdat</em>} in plane z=<code>zval</code> (by default is at the bottom of the bounding box). This is five-number summaries of data <em>adat</em> (minimum, lower quartile (Q1), median (Q2), upper quartile (Q3) and maximum) along second (j-th) direction.</li>
+
 	<li><strong><a name="chart"></a>chart</strong> <em>dat</em> ['col'=''] <br>
 	Draws colored stripes (boxes) for data in array <em>dat</em>. The number of stripes is equal to the number of rows in <em>dat</em>. The color of each next stripe is cyclically changed from colors specified in string 'col' or in palette (for 'col'=''). If a char in the sting is space (' ') then corresponding peace will be absent. The stripe width is proportional to value of element in <em>dat</em>. Chart is plotted only for data arrays with non-negative elements. If string 'col' has symbol # then black border lines are drawn. The most nice form the chart has in 3d (after rotation of coordiantes) or in cylindrical coordinates (the so called Pie chart). </li>
 
@@ -374,6 +421,9 @@ These functions draw some simple objects like point, line, marker or text string
 	<strong>plot</strong> <em>xdat ydat zdat</em> ['stl'='']<br>
 	Draws continuous lines between points {<em>xdat, ydat, zdat</em>}. </li>
 
+	<li><strong><a name="radar"></a>radar</strong> <em>adat</em> ['stl'='' <code>r=-1</code>] <br>
+	Draws radar chart which is continuous lines between points located on an radial lines (like plot in Polar coordinates). The plots are drawn for each row if one of the data is the matrix. Parameter <code>r</code> set the additional shift of data (i.e. the data <em>adat</em>+<code>r</code> is used instead of <em>adat</em>). If <code>r&lt;0</code> then <code>r=max(0, -min(adat)</code>. If string 'pen' containt '#' symbol then "grid" (radial lines and circle for <code>r</code>) is drawn.</li>
+
 	<li><strong><a name="region"></a>region</strong> <em>fdat gdat</em> ['stl'='' <code>inside=off</code>] <br>
 	<strong>region</strong> <em>xdat fdat gdat</em> ['stl'='' <code>inside=off</code>] <br>
 	Fills area between curves {<em>xdat, fdat</em>} and {<em>xdat, gdat</em>}. Parameter  <code>inside=off</code> set to fill are with y1&lt;y&lt;y2 else the area with y2&lt;y&lt;y1 will be also filled. </li>
@@ -393,11 +443,6 @@ These functions draw some simple objects like point, line, marker or text string
 	<strong>tens</strong> <em>xdat ydat zdat cdat</em> ['stl'='']<br>
 	Draws continuous lines between points {<em>xdat, ydat, zdat</em>} with color defined by <em>cdat</em>. </li>
 
-	<a><strong><a name="text"></a>text</strong> <em>ydat</em> 'text' [font='' <code>sise=-1 zval=nan</code>]<br>
-	<strong>text</strong> <em>xdat ydat</em> 'text' [font='' <code>sise=-1 zval=nan</code>]<br>
-	<strong>text</strong> <em>xdat</em> 'text' [font='' <code>sise=-1</code>]<br>
-	Prints text along the curve between points {<em>xdat, ydat, zdat</em>}. If string contain 'T' symbol then the text will be drawn above the curve. See also <a href="#textn">text</a>.</li>
-
 	<li><strong><a name="textmark"></a>textmark</strong> <em>ydat</em> 'text' ['stl'='' <code>zval=nan</code>] <br>
 	<strong>textmark</strong> <em>ydat rdat</em> 'text' ['stl'='' <code>zval=nan</code>] <br>
 	<strong>textmark</strong> <em>xdat ydat rdat</em> 'text' ['stl'='' <code>zval=nan</code>] <br>
@@ -426,7 +471,7 @@ These functions draw some simple objects like point, line, marker or text string
 
 <p>If command allows to use parametric surface definition (depends on 3 data arrays <em>xdat, ydat, zdat</em>) then its minor dimensions should be equal. At this arrays <em>xdat, ydat</em> can be one-dimensional. If  arrays <em>xdat, ydat</em> are not specified then its an automatic arrays are used with values equidistantly distributed along x and y. If <em>zdat</em> is 3d array then the surfaces will be drawn for each of slices. </p>
 
-<p>Optional string parameter 'stl' sets the color scheme. Previous color scheme is used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification.</p>
+<p>Optional string parameter 'sch' sets the color scheme. Previous color scheme is used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification.</p>
 <ul>
 	<li><strong><a name="axial"></a>axial</strong> <em>zdat</em> ['sch'='' <code>num=3</code>] <br>
 	<strong>axial</strong> <em>xdat ydat zdat</em> ['sch'='' <code>num=3</code>]<br>
@@ -499,7 +544,7 @@ These functions draw some simple objects like point, line, marker or text string
 <p>These functions perform plotting of 3D data. 3D means that the data depended on 3 independent parameter (indexes). Most of commands have similar interface. There are 2 versions for drawing single data array and for parametrically specified data.</p>
 
 <p>If command allows to use parametric surface definition (depends on 4 data arrays <em>xdat, ydat, zdat, adat</em>) then its minor dimensions should be equal. At this arrays <em>xdat, ydat, zdat</em> can be one-dimensional. If  arrays <em>xdat, ydat, zdat</em> are not specified then its an automatic arrays are used with values equidistantly distributed along x, y and z.</p>
-<p>Optional string parameter 'stl' sets the color scheme. Previous color scheme is used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification.</p>
+<p>Optional string parameter 'sch' sets the color scheme. Previous color scheme is used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification.</p>
 <ul>
 	<li><strong><a name="beam"></a>beam</strong> <em>tr g1 g2 adat</em> <code>r</code> ['sch'='' <code>flag=0 num=3</code>] <br>
 	Draws <code>num</code>-th isosurfaces for 3d array <em>adat</em> at constatnt values of <em>adat</em>. This is special kind of plot for <em>adat</em> specified in accompanied coordinates along curve <em>tr</em> with orts <em>g1, g2</em> and with transverse scale <code>r</code>. Variable <code>flag</code> is bitwise flag: 0x1 - draw in accompanied (not laboratory) coordinates; 0x2 - draw projection to &rho;&times;z plane; 0x4 - draw normalized in each slice field. The x-size of data arrays <em>tr, g1, g2</em> must be nx&ge;3. The y-size of data arrays <em>tr, g1, g2</em> and z-size of the data array <em>adat</em> must be equal. </li>
@@ -564,7 +609,7 @@ These functions draw some simple objects like point, line, marker or text string
 
 <p>If the command allows to use parametric surface definition (depends on 4, 5 or 6 data arrays <em>xdat, ydat, zdat</em>, <em>adat, bdat, cdat</em>) then its minor dimensions should be equal. At this arrays <em>xdat, ydat, zdat</em> can be one-dimensional. The dimensions of other data arrays (<em>adat, bdat, cdat</em> and so on) must be equal. If  arrays <em>xdat, ydat, zdat</em> are not specified then its an automatic arrays are used with values equidistantly distributed along x, y and z.</p>
 
-<p>Optional string parameter 'stl' sets the color scheme. Previous color scheme is used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification. </p>
+<p>Optional string parameter 'sch' sets the color scheme. Previous color scheme is used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification. </p>
 
 <p>Commands for general dual arrays: </p>
 <ul>
@@ -668,7 +713,7 @@ Commands for vector fields:
 
 <h2> <a name="s10"></a>10. Other plotting function</h2>
 
-These plotting commands draw density plot or contour lines in x, y, or z plain. If <em>dat</em> is 3-dimensional data array then interpolation to a given <code>sval</code> is performed. These functions are useful for creating projections of the 3D data array to the bounding box. Optional string parameter 'stl' sets the color scheme. Optional parameter <code>val</code> sets the value of coordiante on the slice. Previous color scheme and axis <a href="#origin">origin</a> are used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification.
+These plotting commands draw density plot or contour lines in x, y, or z plain. If <em>dat</em> is 3-dimensional data array then interpolation to a given <code>sval</code> is performed. These functions are useful for creating projections of the 3D data array to the bounding box. Optional string parameter 'sch' sets the color scheme. Optional parameter <code>val</code> sets the value of coordiante on the slice. Previous color scheme and axis <a href="#origin">origin</a> are used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification.
 <ul>
 	<li><strong><a name="contx"></a>contx</strong> <em>dat</em> ['sch'='' <code>val=nan num=7</code>] <br>
 	<strong><a name="conty"></a>conty</strong> <em>dat</em> ['sch'='' <code>val=nan num=7</code>] <br>
@@ -685,7 +730,7 @@ These plotting commands draw density plot or contour lines in x, y, or z plain.
 	<strong><a name="densz"></a>densz</strong> <em>dat</em> ['sch'='' <code>val=nan</code>] <br>
 	Draws density plot of data array <em>dat</em> at slice x,y,z = <code>val</code>.</li>
 </ul>
-These plotting commands draw rather rare plots like crust or dots which is arbitrary placed in space, or surface of triangles. If several data arrays for coordinates are specified then they should have the same size. These functions are useful for creating plots of unsorted or user-defined data arrays. Optional string parameter 'stl' sets the color scheme. Previous color scheme is used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification.
+These plotting commands draw rather rare plots like crust or dots which is arbitrary placed in space, or surface of triangles. If several data arrays for coordinates are specified then they should have the same size. These functions are useful for creating plots of unsorted or user-defined data arrays. Optional string parameter 'sch' sets the color scheme. Previous color scheme is used by default. See also <a href="#s15">color</a> and <a href="#s17">color schemes</a> specification.
 <ul>
 	<li><strong><a name="crust"></a>crust</strong> <em>xdat ydat zdat</em> ['sch'=''] <br>
 	Draws (and reconstruct) a surface for arbitrary placed points in the space <em>xdat ydat zdat</em>.</li>
@@ -714,6 +759,9 @@ These commands control program flow, like, conditions, cycles, define script arg
 	<li><strong><a name="define"></a>define</strong> $N smth<br>
 	Sets N-th script argument to smth. Note, that smth is used as is (with ' symbols if present).</li>
 
+	<li><strong>define</strong> id smth<br>
+	Create scalar variable <code>id</code> which have the numeric value of <code>smth</code>. Later you can use this variable as usual number.</li>
+
 	<li><strong><a name="if"></a>if</strong> <em>dat</em> 'cond'<br>
 	Starts block which will be executed if <em>dat</em> satisfy to 'cond'.</li>
 	
@@ -739,7 +787,13 @@ These commands control program flow, like, conditions, cycles, define script arg
 	Starts cycle with N-th argument changing for <em>dat</em> values.</li>
 	
 	<li><strong><a name="next"></a>next</strong><br>
-	Finishes <a href="#for">for</a> cycle.</li>
+	Finishes <a href="#for">for</a> cycle and start iteration with next argument value.</li>
+
+	<li><strong><a name="break"></a>break</strong><br>
+	Breaks <a href="#for">for</a> cycle.</li>
+
+	<li><strong><a name="continue"></a>continue</strong><br>
+	Continue <a href="#for">for</a> cycle from starting point with next argument value.</li>
 
 	<li><strong><a name="once"></a>once</strong> <code>val</code><br>
 	The code between <code>once on</code> and <code>once off</code> will be executed only once. Useful for large data manipulation in programs like UDAV.</li>
@@ -750,6 +804,8 @@ These commands control program flow, like, conditions, cycles, define script arg
 	<li><strong><a name="write"></a>write</strong> 'fname' [<code>solid=off</code>]<br>
 	Writes current picture/frame to file 'fname' (file type is determined by extension). Solid (usually white) background will be used if <code>solid=on</code>. If 'fname'='' then the file <code>frameNNNN.jpg</code> is used, where <code>NNNN</code> is current frame id.</li>
 
+	<li><strong><a name="setsize"></a>setsize</strong> <code>w h</code> <br>
+	Sets size of picture in pixels. This function call <strong>have to be before</strong> any plotting command. In some program the call of this function is forbidden. </li>
 </ul>
 
 <div style="text-align: right;"><a href="#s0">contents</a></div>
@@ -814,7 +870,7 @@ These commands create new variable with specified name. Note, that if a variable
 
 This data write resulting data array in some other variable. Note, that if a variable with the same name exists then it will be overwritten.
 <ul>
-	<li><strong><a name="combine"></a>combine</strong> <em>res adat bdat</em> <code>mx</code> [<code>my=1 mz=1</code>] <br>
+	<li><strong><a name="combine"></a>combine</strong> <em>res adat bdat</em> <br>
 	Returns direct multiplication of arrays (like, <em>res</em>[i,j] = <em>adat</em>[i]*<em>bdat</em>[j] and so on).</li>
 	
 	<li><strong><a name="evaluate"></a>evaluate</strong> <em>res dat idat</em> [<code>norm=on</code>]<br>
@@ -827,7 +883,12 @@ This data write resulting data array in some other variable. Note, that if a var
 
 	<li><strong><a name="hist"></a>hist</strong> <em>res dat</em> <code>num v1 v2 [nsub=0]</code> <br>
 	<strong>hist</strong> <em>res dat wdat</em> <code>num v1 v2 [nsub=0]</code> <br>
-	Makes array <em>res</em> of <em>num</em> points as distribution (histogram) of <em>dat</em> data values in range [<code>v1, v2</code>]. Data array <em>wdat</em> contains weights (all weight is 1 if <em>wdat</em> is not specified) and must have the same dimensions as array <em>dat</em>. Parameter <code>nsub</code> define the number of additional interpolated points (for smoothness of histogram).</li>
+	Makes array <em>res</em> of <em>num</em> points as distribution (histogram) of <em>dat</em> data values in range [<code>v1, v2</code>]. Data array <em>wdat</em> contains weights (all weight is 1 if <em>wdat</em> is not specified) and must have the same dimensions as array <em>dat</em>. Parameter <code>nsub</code> define the number of additional interpolated points (for smoothness of histogram). </li>
+
+	<li><strong>hist</strong> <em>res xdat adat</em><br>
+	<strong>hist</strong> <em>res xdat ydat adat</em><br>
+	<strong>hist</strong> <em>res xdat ydat zdat adat</em><br>
+	Creates distribution <em>res</em> of the data values of <em>adat</em> in axis range [Min, Max]. Array <em>adat</em> look like weights of the data points.</li>
 
 	<li><strong><a name="max"></a>max</strong> <em>res dat</em> 'dir' <br>
 	Makes array <em>res</em> as maximal values of <em>dat</em> along direction(s) 'dir'. </li>
@@ -846,7 +907,10 @@ This data write resulting data array in some other variable. Note, that if a var
 
 	<li><strong><a name="sum"></a>sum</strong> <em>res dat</em> 'dir' <br>
 	Makes array <em>res</em> as summation of <em>dat</em> along direction(s) 'dir'.</li>
-	
+
+	<li><strong><a name="trace"></a>trace</strong> <em>res dat</em> 'dir' <br>
+	Gets array of diagonal elements <em>dat</em>[i,i] (for 2D case) or <em>dat</em>[i,i,i] (for 3D case) where i=0...nx-1. Function return copy of itself for 1D case. Data array must have dimensions ny,nz >= nx or ny,nz = 1.</li>
+
 	<li><strong><a name="transform"></a>transform</strong> <em>dat</em> 'type' <em>real imag</em><br>
 	Do integral transformation of complex data <em>real</em>, <em>imag</em> on specified direction. Now only Fourier transformation is supported. The order of transformations is specified in string 'type': first character for x-dimension, second one for y-dimension, third one for z-dimension. The possible character are: 'f' is forward Fourier transformation, 'i' is inverse Fourier transformation, 'n' or ' ' is no transformation.</li>
 
@@ -872,6 +936,7 @@ This data write resulting data array in some other variable. Note, that if a var
 
 <h2> <a name="s13"></a>13. Data handling</h2>
 
+<h3>13.1. Information</h3>
 <ul>
 	<li><strong><a name="info"></a>info</strong> <em>dat</em> [<code>detail=off</code>] <br>
 	Display information (sizes, maximum/minimum, momentums and so on) about the data <em>dat</em>. Show brief information by default (if <code>detail=off</code>). </li>
@@ -882,7 +947,8 @@ This data write resulting data array in some other variable. Note, that if a var
 	<li><strong><a name="set_id"></a>set_id</strong> <em>dat</em> 'ids'<br>
 	Set the symbol id for data columns. The string must contain one symbol 'a'&hellip;'z' per column (without spaces).</li>
 </ul>
-Data filling:
+
+<h3>13.2. Data filling</h3>
 <ul>
 	<li><strong><a name="fill"></a>fill</strong> <em>dat</em> <code>v1 v2</code> ['dir'='x'] <br>
 	Equidistantly fills the data values of <em>dat</em> to range [<code>x1, x2</code>] along direction 'dir'. </li>
@@ -902,7 +968,8 @@ Data filling:
 	<li><strong>put</strong> <em>a v</em> <code>[i=: j=: k=:]</code><br>
 	Function copies value(s) from array <em>v</em> to the range of array <em>a</em>. Negative indexes <code>i, j, k = :</code> set the range in corresponding direction(s). At this minor dimensions of array <em>v</em> should be large than corresponding dimensions of array <em>a</em>. For example, <code>put a v : 0 :</code> sets a[i,0,j]=v.ny>nz ? v[i,j] : v[i], where i=0...(a.nx-1), j=0...(a.nz-1) and condition v.nx>=a.nx is true.
 </ul>
-Rearrange data:
+
+<h3>13.3. Rearrange data</h3>
 <ul>
 	<li><strong><a name="crop"></a>crop</strong> <em>dat</em> <code>n1 n2</code> 'dir' <br>
 	Cuts off (crops) edges of data array <em>dat</em> with indexes <em>n</em>&lt;<code>n1</code> or &gt;<code>n2</code> along direction 'dir'. </li>
@@ -919,7 +986,8 @@ Rearrange data:
 	<li><strong><a name="transpose"></a>transpose</strong> <em>dat</em> ['dir'='yxz'] <br>
 	Transposes (shifts order of) dimensions of the data <em>dat</em>. New order of dimensions is specified in string 'dir'. This may be useful for the reading of one-dimensional data.</li>
 </ul>
-Commands on direction:
+
+<h3>13.4. Commands on direction</h3>
 <ul>
 	<li><strong><a name="cumsum"></a>cumsum</strong> <em>dat</em> 'dir' <br>
 	Cumulative summation of the data in given direction or directions. </li>
@@ -957,7 +1025,8 @@ Commands on direction:
 	<li><strong><a name="swap"></a>swap</strong> <em>dat</em> 'dir' <br>
 	Swaps the left and right parts of the data <em>dat</em> in given direction 'dir' (useful for Fourier spectrum). </li>
 </ul>
-Operators:
+
+<h3>13.5. Operators</h3>
 <ul>
 	<li><strong><a name="addto"></a>addto</strong> <em>dat</em> <code>val</code> <br>
 	Adds number to data. </li>
@@ -992,17 +1061,17 @@ These commands fit data to formula. Fitting goal is to find formula parameters f
 These commands <strong>fit</strong> and <strong>fits</strong> do not draw obtained data themselves. They just fill the data <em>out</em> by formula <em>f</em> with found coefficients. At this, the <em>x, y, z</em> coordinates in the formula are equidistantly distributed in bounding box. Number of points in <em>out</em> is selected as maximal value of <em>out</em> size or 100. Also you may print the last formula with found coefficients by <strong>putsfit</strong> command.
 
 <ul>
-	<li><strong>fit</strong> <em>out a</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-direction for each data row. This is 1D fitting with <em>x</em> equidistantly distributed in <a href="#xrange">xrange</a> and <em>s</em>=1.</li>
+	<li><a name="fit"></a><strong>fit</strong> <em>out a</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-direction for each data row. This is 1D fitting with <em>x</em> equidistantly distributed in <a href="#xrange">xrange</a> and <em>s</em>=1.</li>
 	<li><strong>fit</strong> <em>out x a</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-direction for each data row. This is 1D fitting with <em>s</em>=1.</li>
 	<li><strong>fit</strong> <em>out x y a</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-, y-directions for each data slice. This is 2D fitting with <em>s</em>=1.</li>
 	<li><strong>fit</strong> <em>out x y z a</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-, y-, z-directions. This is 3D fitting with <em>s</em>=1.</li>
 
-	<li><strong>fits</strong> <em>out a s</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-direction for each data row. This is 1D fitting with <em>x</em> equidistantly distributed in <a href="#xrange">xrange</a>.</li>
+	<li><a name="fits"></a><strong>fits</strong> <em>out a s</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-direction for each data row. This is 1D fitting with <em>x</em> equidistantly distributed in <a href="#xrange">xrange</a>.</li>
 	<li><strong>fits</strong> <em>out x a s</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-direction for each data row. This is 1D version of fitting.</li>
 	<li><strong>fits</strong> <em>out x y a s</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-, y-directions for each data slice. This is 2D version of fitting.</li>
 	<li><strong>fits</strong> <em>out x y z a s</em> 'eq' 'var' [<em>ini=0</em>]<br>Fits data along x-, y-, z-directions. This is 3D version of fitting.</li>
 
-	<li><strong>putsfit</strong> <code>x y</code> ['pre'='' 'fnt'='' <code>size=-1</code>]<br>
+	<li><a name="putsfit"></a><strong>putsfit</strong> <code>x y</code> ['pre'='' 'fnt'='' <code>size=-1</code>]<br>
 	<strong>putsfit</strong> <code>x y z</code> ['pre'='' 'fnt'='' <code>size=-1</code>]<br>Prints the last fitted formula with found coefficients at point {<code>x, y, z</code>} by font 'fnt' with <code>size</code>. String 'pre' sets the prefix which will be printed before formula. By default font parameters from <a href="#font">font</a> command are used. For more details see Sec. <a href="#s18">Text and font specification</a>. </li>
 </ul>
 
@@ -1052,34 +1121,34 @@ The color map scheme is used for coloring surfaces and other and is specified by
 
 <table align="center" border="1"><caption><em>Examples of the most popular color schemes</em></caption><tbody align="right">
 	<tr>
-	<td>kw</td>	<td><img src="pics/kw.png" alt="kw.png" width="250pt"></td>
-	<td>wk</td>	<td><img src="pics/wk.png" alt="wk.png" width="250pt"></td>
-	<td>kHCcw</td>	<td><img src="pics/kHCcw.png" alt="kHCcw.png" width="250pt"></td>
+	<td>kw</td>	<td><img src="pics/kw.png" alt="kw.png"></td>
+	<td>wk</td>	<td><img src="pics/wk.png" alt="wk.png"></td>
+	<td>kHCcw</td>	<td><img src="pics/kHCcw.png" alt="kHCcw.png"></td>
 	</tr>
 	<tr>
-	<td>kRryw</td>	<td><img src="pics/kRryw.png" alt="kRryw.png" width="250pt"></td>
-	<td>kGgew</td>	<td><img src="pics/kGgew.png" alt="kGgew.png" width="250pt"></td>
-	<td>kBbcw</td>	<td><img src="pics/kBbcw.png" alt="kBbcw.png" width="250pt"></td>
+	<td>kRryw</td>	<td><img src="pics/kRryw.png" alt="kRryw.png"></td>
+	<td>kGgew</td>	<td><img src="pics/kGgew.png" alt="kGgew.png"></td>
+	<td>kBbcw</td>	<td><img src="pics/kBbcw.png" alt="kBbcw.png"></td>
 	</tr>
 	<tr>
-	<td>BbwrR</td>	<td><img src="pics/BbwrR.png" alt="BbwrR.png" width="250pt"></td>
-	<td>BbwgG</td>	<td><img src="pics/BbwgG.png" alt="BbwgG.png" width="250pt"></td>
-	<td>GgwmM</td>	<td><img src="pics/GgwmM.png" alt="GgwmM.png" width="250pt"></td>
+	<td>BbwrR</td>	<td><img src="pics/BbwrR.png" alt="BbwrR.png"></td>
+	<td>BbwgG</td>	<td><img src="pics/BbwgG.png" alt="BbwgG.png"></td>
+	<td>GgwmM</td>	<td><img src="pics/GgwmM.png" alt="GgwmM.png"></td>
 	</tr>
 	<tr>
-	<td>bcwyr</td>	<td><img src="pics/bcwyr.png" alt="bcwyr.png" width="250pt"></td>
-	<td>QqwcC</td>	<td><img src="pics/QqwcC.png" alt="QqwcC.png" width="250pt"></td>
-	<td>CcwyY</td>	<td><img src="pics/CcwyY.png" alt="CcwyY.png" width="250pt"></td>
+	<td>bcwyr</td>	<td><img src="pics/bcwyr.png" alt="bcwyr.png"></td>
+	<td>QqwcC</td>	<td><img src="pics/QqwcC.png" alt="QqwcC.png"></td>
+	<td>CcwyY</td>	<td><img src="pics/CcwyY.png" alt="CcwyY.png"></td>
 	</tr>
 	<tr>
-	<td>BbcyrR</td>	<td><img src="pics/BbcyrR.png" alt="BbcyrR.png" width="250pt"></td>
-	<td>BbcwyrR</td><td><img src="pics/BbcwyrR.png" alt="BbcwyrR.png" width="250pt"></td>
-	<td>bwr</td>	<td><img src="pics/bwr.png" alt="bwr.png" width="250pt"></td>
+	<td>BbcyrR</td>	<td><img src="pics/BbcyrR.png" alt="BbcyrR.png"></td>
+	<td>BbcwyrR</td><td><img src="pics/BbcwyrR.png" alt="BbcwyrR.png"></td>
+	<td>bwr</td>	<td><img src="pics/bwr.png" alt="bwr.png"></td>
 	</tr>
 	<tr>
-	<td>BbcyrR|</td>	<td><img src="pics/sharp.png" alt="sharp.png" width="250pt"></td>
-	<td>bcyr</td>	<td><img src="pics/bcyr.png" alt="bcyr.png" width="250pt"></td>
-	<td>bgr</td>	<td><img src="pics/bgr.png" alt="bgr.png" width="250pt"></td>
+	<td>BbcyrR|</td>	<td><img src="pics/sharp.png" alt="sharp.png"></td>
+	<td>bcyr</td>	<td><img src="pics/bcyr.png" alt="bcyr.png"></td>
+	<td>bgr</td>	<td><img src="pics/bgr.png" alt="bgr.png"></td>
 	</tr>
 </tbody></table>
 
diff --git a/src/ReadMe b/src/ReadMe
new file mode 100644
index 0000000..87d23f7
--- /dev/null
+++ b/src/ReadMe
@@ -0,0 +1,11 @@
+READ THIS IN ORDER TO COMPILE THE Qt4 TEMPLATE
+----------------------------------------------
+
+Before compiling, check the Qt Options, go to 
+Project->Project Options->C++ Support and open the Qt Options tab.
+
+Check that the Qt installation directory is correct for the Qt version you've chosen.
+
+------------------
+Andreas Pakulat
+July 2006
diff --git a/src/animparam.cpp b/src/animparam.cpp
index e9c0bc6..08cf7ba 100644
--- a/src/animparam.cpp
+++ b/src/animparam.cpp
@@ -41,7 +41,7 @@ AnimParam::AnimParam(QWidget *parent) : QDialog(parent)
 	o->addWidget(lbl);
 	a = new QHBoxLayout();		o->addLayout(a);
 	g = new QVBoxLayout();		a->addLayout(g);
-	rbt = new QRadioButton(tr("strings in lines"),this);
+	rbt = new QRadioButton(tr("strings"),this);
 	connect(rbt, SIGNAL(clicked()),this, SLOT(setRBT()));
 	g->addWidget(rbt);
 	text = new QTextEdit(this);	g->addWidget(text);
@@ -74,7 +74,7 @@ AnimParam::AnimParam(QWidget *parent) : QDialog(parent)
 	delay->setText(s);	dp->setText("1");
 	// export to gif/jpeg
 	a = new QHBoxLayout();		o->addLayout(a);
-	fname = new QLineEdit(this);	a->addWidget(fname);
+//	fname = new QLineEdit(this);	a->addWidget(fname);
 	gif = new QCheckBox(tr("Export to GIF"), this);		a->addWidget(gif);
 	jpg = new QCheckBox(tr("Save JPEG frames"), this);	a->addWidget(jpg);
 }
@@ -84,7 +84,7 @@ AnimParam::~AnimParam()
 //-----------------------------------------------------------------------------
 void AnimParam::fillRes()
 {
-	gifName = fname->text();
+//	gifName = fname->text();
 	gifOn = gif->isChecked();
 	jpgOn = jpg->isChecked();
 	animDelay = delay->text().toInt();
@@ -95,13 +95,11 @@ void AnimParam::fillRes()
 		QString s;
 		float x, x2=p2->text().toDouble(), dx=dp->text().toDouble();
 		for(x=p1->text().toDouble();x<x2;x+=dx)
-		{
-			s.sprintf("%g\n", x);
-			res = res+s;
-		}
+			res = res+QString::number(x,'g',4)+"\n";
 		accept();
 	}
-	else	QMessageBox::warning(this,tr("UDAV - animation"), tr("You should select one of case"));
+	else	QMessageBox::warning(this,tr("UDAV - animation"),
+								 tr("You should select one of case"));
 }
 //-----------------------------------------------------------------------------
 void AnimParam::putTxt()
diff --git a/src/animparam.h b/src/animparam.h
index 03bb2b1..c7e10c7 100644
--- a/src/animparam.h
+++ b/src/animparam.h
@@ -20,7 +20,7 @@
 #ifndef ANIMPARAM_H
 #define ANIMPARAM_H
 //-----------------------------------------------------------------------------
-#include <qdialog.h>
+#include <QDialog>
 //-----------------------------------------------------------------------------
 class QLineEdit;
 class QTextEdit;
@@ -32,7 +32,6 @@ class AnimParam : public QDialog
 Q_OBJECT
 public:
 	bool gifOn, jpgOn;
-	QString gifName;
 	/// string with resulting animation parameters
 	const QString &getResult()	{	return res;	};
 	void setResult(const QString &s);
@@ -47,7 +46,7 @@ private slots:
 	void setRBT();
 private:
 	QString res;
-	QLineEdit *p1, *p2, *dp, *delay, *fname;
+	QLineEdit *p1, *p2, *dp, *delay;//, *fname;
 	QTextEdit *text;
 	QRadioButton *rbt, *rbf;
 	QCheckBox *gif, *jpg;
diff --git a/src/argsdialog.cpp b/src/argsdialog.cpp
deleted file mode 100644
index 0801146..0000000
--- a/src/argsdialog.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by Alexey Balakin                                  *
- *   mathgl.abalakin at gmail.com                                             *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <mgl/mgl_parse.h>
-//-----------------------------------------------------------------------------
-#include "argsdialog.h"
-extern mglParse parser;
-//-----------------------------------------------------------------------------
-ArgsDialog::ArgsDialog(QWidget *parent) : QDialog(parent)
-{
-	setWindowTitle(tr("UDAV - Set script arguments"));
-	QHBoxLayout *h;
-	QVBoxLayout *v;
-	QGridLayout *g;
-	QLabel *l;
-	QPushButton *b;
-	
-	v = new QVBoxLayout(this);
-	g = new QGridLayout();		v->addLayout(g);
-	l = new QLabel(tr("String for $1"), this);	g->addWidget(l, 0, 0);
-	a[1] = new QLineEdit(this);					g->addWidget(a[1], 1, 0);
-	l = new QLabel(tr("String for $2"), this);	g->addWidget(l, 0, 1);
-	a[2] = new QLineEdit(this);					g->addWidget(a[2], 1, 1);
-	l = new QLabel(tr("String for $3"), this);	g->addWidget(l, 2, 0);
-	a[3] = new QLineEdit(this);					g->addWidget(a[3], 3, 0);
-	l = new QLabel(tr("String for $4"), this);	g->addWidget(l, 2, 1);
-	a[4] = new QLineEdit(this);					g->addWidget(a[4], 3, 1);
-	l = new QLabel(tr("String for $5"), this);	g->addWidget(l, 4, 0);
-	a[5] = new QLineEdit(this);					g->addWidget(a[5], 5, 0);
-	l = new QLabel(tr("String for $6"), this);	g->addWidget(l, 4, 1);
-	a[6] = new QLineEdit(this);					g->addWidget(a[6], 5, 1);
-	l = new QLabel(tr("String for $7"), this);	g->addWidget(l, 6, 0);
-	a[7] = new QLineEdit(this);					g->addWidget(a[7], 7, 0);
-	l = new QLabel(tr("String for $8"), this);	g->addWidget(l, 6, 1);
-	a[8] = new QLineEdit(this);					g->addWidget(a[8], 7, 1);
-	l = new QLabel(tr("String for $9"), this);	g->addWidget(l, 8, 0);
-	a[9] = new QLineEdit(this);					g->addWidget(a[9], 9, 0);
-	l = new QLabel(tr("String for $0"), this);	g->addWidget(l, 8, 1);
-	a[0] = new QLineEdit(this);					g->addWidget(a[0], 9, 1);
-	
-	h = new QHBoxLayout();	h->addStretch(1);	v->addLayout(h);
-	b = new QPushButton(tr("Cancel"), this);	h->addWidget(b);
-	connect(b, SIGNAL(clicked()),this, SLOT(reject()));
-	b = new QPushButton(tr("OK"), this);		h->addWidget(b);
-	connect(b, SIGNAL(clicked()),this, SLOT(putArguments()));
-	b->setDefault(true);
-}
-//-----------------------------------------------------------------------------
-ArgsDialog::~ArgsDialog()
-{
-}
-//-----------------------------------------------------------------------------
-void ArgsDialog::putArguments()
-{
-	int len=0, i, j, n;
-	for(i=0;i<10;i++)
-			if(a[i]->text().length()>len)
-				len = a[i]->text().length();
-	wchar_t *str = new wchar_t[len+2];
-	QString s;
-	for(i=0;i<10;i++)
-	{
-		s = a[i]->text();	n = s.length();
-		for(j=0;j<n;j++)	str[j] = (s[j]).unicode();
-		str[j] = 0;
-		parser.AddParam(i, str);
-	}
-	accept();
-}
-//-----------------------------------------------------------------------------
diff --git a/src/argsdialog.h b/src/argsdialog.h
deleted file mode 100644
index 38afd1c..0000000
--- a/src/argsdialog.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by Alexey Balakin                                  *
- *   mathgl.abalakin at gmail.com                                             *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-#ifndef ARGSDIALOG_H
-#define ARGSDIALOG_H
-//-----------------------------------------------------------------------------
-#include <qdialog.h>
-class QLineEdit;
-//-----------------------------------------------------------------------------
-/// Dialog for enetring script arguments $0...$9
-class ArgsDialog : public QDialog
-{
-Q_OBJECT
-public:
-	ArgsDialog(QWidget *parent=0);
-	~ArgsDialog();
-
-private slots:
-	void putArguments();
-private:
-	QLineEdit *a[10];
-};
-//-----------------------------------------------------------------------------
-#endif
-//-----------------------------------------------------------------------------
diff --git a/src/finddialog.cpp b/src/finddialog.cpp
index ef784bc..c87097e 100644
--- a/src/finddialog.cpp
+++ b/src/finddialog.cpp
@@ -17,15 +17,21 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#include <qsettings.h>
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
+#include <QSettings>
+#include <QCheckBox>
+#include <QLabel>
+#include <QLayout>
+#include <QLineEdit>
+#include <QPushButton>
 #include <QCloseEvent>
 #include <QTextEdit>
+#include <QLineEdit>
+#include <QComboBox>
+#include <QTextCursor>
+#include <mgl/mgl_parse.h>
 #include "finddialog.h"
+extern mglParse parser;
+mglData mglFormulaCalc(const wchar_t *string, mglParse *arg);
 //-----------------------------------------------------------------------------
 FindDialog::FindDialog(QWidget *parent) : QDialog(parent)
 {
@@ -81,7 +87,8 @@ void FindDialog::closeEvent(QCloseEvent *event)
 //-----------------------------------------------------------------------------
 #define qtr		HintDialog::tr
 int numHints=-1;
-QString hints[] = {	qtr("You can rotate plot by mouse. Just press 'Rotate' toolbutton, click image and hold a mouse button: left button for rotation, right button for zooming/perspective, middle button for shifting."),
+QString hints[] = {
+	qtr("You can rotate plot by mouse. Just press 'Rotate' toolbutton, click image and hold a mouse button: left button for rotation, right button for zooming/perspective, middle button for shifting."),
 	qtr("You may quickly draw the data from file. Just use: udav 'filename.dat' in command line."),
 	qtr("You can copy the current image to clipboard by pressing Ctrl-Shift-C. Later you can paste it directly into yours document or presentation."),
 	qtr("You can export image into a set of format (EPS, SVG, PNG, JPEG) by pressing right mouse button inside image and selecting 'Export as ...'."),
@@ -90,9 +97,14 @@ QString hints[] = {	qtr("You can rotate plot by mouse. Just press 'Rotate' toolb
 	qtr("New drawing never clears things drawn already. For example, you can make a surface with contour lines by calling commands 'surf' and 'cont' one after another (in any order). "),
 	qtr("You can put several plots in the same image by help of commands 'subplot' or 'inplot'."),
 	qtr("All indexes (of data arrays, subplots and so on) are always start from 0."),
-	qtr("You can edit MGL file in any text editor."),
-	qtr("You can use command 'once on|off' for marking the block which should be executed only once. For example, the block of large data reading/creating/handling. Press F9 (or menu item 'Graphics/Reload') to re-execute this block."),
+	qtr("You can edit MGL file in any text editor. Also you can run it in console by help of commands: mgl2png, mgl2eps, mgl2svg and so on."),
+	qtr("You can use command 'once on|off' for marking the block which should be executed only once. For example, this can be the block of large data reading/creating/handling. Press F9 (or menu item 'Graphics/Reload') to re-execute this block."),
 	qtr("You can use command 'stop' for terminating script parsing. It is useful if you don't want to execute a part of script."),
+	qtr("You can type arbitrary expression as input argument for data or number. In last case, the first value of data array is used."),
+	qtr("There is powerful calculator with a lot of special functions. You can use buttons or keyboard to type the expression. Also you can use existed variables in the expression."),
+	qtr("The calculator can help you to put complex expression in the script. Just type the expression (which may depend on coordinates x,y,z and so on) and put it into the script."),
+	qtr("You can easely insert file or folder names, last fitted formula or numerical value of selection by using menu Edit|Insert."),
+	qtr("The special dialog (Edit|Insert|New Command) help you select the command, fill its arguments and put it into the script."),
 	qtr("")};
 
 //-----------------------------------------------------------------------------
@@ -138,3 +150,206 @@ void HintDialog::closeEvent(QCloseEvent *)
 	settings.endGroup();
 }
 //-----------------------------------------------------------------------------
+//
+//	Calc dialog
+//
+//-----------------------------------------------------------------------------
+CalcDialog::CalcDialog(QWidget *parent) : QWidget(parent)
+{
+	QPushButton *b;
+	QHBoxLayout *m=new QHBoxLayout(this), *oo;
+	QVBoxLayout *o=new QVBoxLayout;	m->addLayout(o);	m->setStretchFactor(o,1);
+
+	text = new QTextEdit(this);	o->addWidget(text);
+	connect(text,SIGNAL(textChanged()),this,SLOT(evaluate()));
+	oo = new QHBoxLayout;		o->addLayout(oo);
+	QLabel *l = new QLabel(tr("Result"),this);	oo->addWidget(l);
+	result=new QLineEdit(this);	oo->addWidget(result);
+	result->setReadOnly(true);
+	b = new QPushButton(tr("To script"), this);	oo->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyPut()));
+	b = new QPushButton(tr("Clear"), this);	oo->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(clear()));
+
+	QGridLayout *g = new QGridLayout;	m->addLayout(g);	m->setStretchFactor(g,0);
+	b = new QPushButton("7", this);	g->addWidget(b, 0, 0);
+	int minw=b->height();	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key7()));
+	b = new QPushButton("8", this);	g->addWidget(b, 0, 1);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key8()));
+	b = new QPushButton("9", this);	g->addWidget(b, 0, 2);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key9()));
+	b = new QPushButton("+", this);	g->addWidget(b, 0, 3);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyAdd()));
+	b = new QPushButton(QString::fromWCharArray(L"π"), this);	g->addWidget(b, 0, 4);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyPi()));		b->setMaximumWidth(minw);
+
+	b = new QPushButton("4", this);	g->addWidget(b, 1, 0);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key4()));
+	b = new QPushButton("5", this);	g->addWidget(b, 1, 1);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key5()));
+	b = new QPushButton("6", this);	g->addWidget(b, 1, 2);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key6()));
+	b = new QPushButton("-", this);	g->addWidget(b, 1, 3);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(keySub()));
+	b = new QPushButton(QString::fromWCharArray(L"x²"), this);	g->addWidget(b, 1, 4);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyX2()));		b->setMaximumWidth(minw);
+
+	b = new QPushButton("1", this);	g->addWidget(b, 2, 0);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key1()));
+	b = new QPushButton("2", this);	g->addWidget(b, 2, 1);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key2()));
+	b = new QPushButton("3", this);	g->addWidget(b, 2, 2);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key3()));
+	b = new QPushButton("*", this);	g->addWidget(b, 2, 3);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyMul()));
+	b = new QPushButton("(", this);	g->addWidget(b, 2, 4);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyBrO()));
+
+	b = new QPushButton("0", this);	g->addWidget(b, 3, 0);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(key0()));
+	b = new QPushButton(".", this);	g->addWidget(b, 3, 1);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyDot()));
+	b = new QPushButton("E", this);	g->addWidget(b, 3, 2);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyE()));
+	b = new QPushButton("/", this);	g->addWidget(b, 3, 3);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyDiv()));
+	b = new QPushButton(")", this);	g->addWidget(b, 3, 4);	b->setMaximumWidth(minw);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyBrC()));
+
+	fillFuncName();
+	o=new QVBoxLayout;	m->addLayout(o);	m->setStretchFactor(o,0);
+	type = new QComboBox(this);		o->addWidget(type);
+	type->addItems(names);	type->setCurrentIndex(0);
+	func = new QComboBox(this);		o->addWidget(func);
+	func->addItems(funcName[0]);	type->setCurrentIndex(0);
+	descr= new QLabel(this);		o->addWidget(descr);	o->setStretchFactor(descr,0);
+	descr->setText(funcInfo[0].at(0));
+	connect(type, SIGNAL(currentIndexChanged(int)), this, SLOT(typeUpdate(int)));
+	connect(func, SIGNAL(currentIndexChanged(int)), this, SLOT(funcUpdate(int)));
+	b = new QPushButton(tr("Put function"), this);	o->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(keyFnc()));
+}
+//-----------------------------------------------------------------------------
+CalcDialog::~CalcDialog()	{}
+void CalcDialog::foc()	{	text->setFocus(Qt::ActiveWindowFocusReason);	}
+//-----------------------------------------------------------------------------
+void CalcDialog::key1()	{	text->textCursor().insertText("1");	foc();	}
+void CalcDialog::key2()	{	text->textCursor().insertText("2");	foc();	}
+void CalcDialog::key3()	{	text->textCursor().insertText("3");	foc();	}
+void CalcDialog::key4()	{	text->textCursor().insertText("4");	foc();	}
+void CalcDialog::key5()	{	text->textCursor().insertText("5");	foc();	}
+void CalcDialog::key6()	{	text->textCursor().insertText("6");	foc();	}
+void CalcDialog::key7()	{	text->textCursor().insertText("7");	foc();	}
+void CalcDialog::key8()	{	text->textCursor().insertText("8");	foc();	}
+void CalcDialog::key9()	{	text->textCursor().insertText("9");	foc();	}
+void CalcDialog::key0()	{	text->textCursor().insertText("0");	foc();	}
+void CalcDialog::keyE()	{	text->textCursor().insertText("E");	foc();	}
+void CalcDialog::keyPi()	{	text->textCursor().insertText("pi");	foc();	}
+void CalcDialog::keyX2()	{	text->textCursor().insertText("^2");	foc();	}
+void CalcDialog::keyAdd()	{	text->textCursor().insertText("+");	foc();	}
+void CalcDialog::keyMul()	{	text->textCursor().insertText("*");	foc();	}
+void CalcDialog::keySub()	{	text->textCursor().insertText("-");	foc();	}
+void CalcDialog::keyDiv()	{	text->textCursor().insertText("/");	foc();	}
+void CalcDialog::keyBrO()	{	text->textCursor().insertText("(");	foc();	}
+void CalcDialog::keyBrC()	{	text->textCursor().insertText(")");	foc();	}
+void CalcDialog::keyDot()	{	text->textCursor().insertText(".");	foc();	}
+void CalcDialog::clear()	{	text->clear();	foc();	}
+//-----------------------------------------------------------------------------
+void CalcDialog::keyFnc()
+{
+	text->textCursor().insertText(func->currentText());
+	text->moveCursor(QTextCursor::PreviousCharacter);	foc();
+}
+//-----------------------------------------------------------------------------
+void CalcDialog::keyPut()	{	emit putNumber(result->text());	}
+//-----------------------------------------------------------------------------
+void CalcDialog::evaluate()
+{
+	QString sel=text->toPlainText();
+	if(sel.isEmpty())	return;
+	wchar_t *txt=new wchar_t[sel.length()+1];
+	sel.toWCharArray(txt);	txt[sel.length()]=0;
+	setlocale(LC_ALL, "C");
+	mglData res=mglFormulaCalc(txt, &parser);
+	setlocale(LC_ALL, "");
+//	result->setText(QString::fromWCharArray(txt));
+	delete []txt;
+	result->setText(QString::number(res.a[0]));
+}
+//-----------------------------------------------------------------------------
+void CalcDialog::fillFuncName()
+{
+	names<<tr("Basic")<<tr("Exp and log")<<tr("Trigonometric")<<tr("Hyperbolic")
+			<<tr("Bessel")<<tr("Elliptic")<<tr("Jacobi")<<tr("Airy and Gamma")
+			<<tr("Exp-integrals")<<tr("Special");
+	// basic
+	funcName[0]<<"abs()"<<"sign()"<<"step()"<<"sqrt()"<<"mod(,)"<<"arg(,)";
+	funcInfo[0]<<"Absolute value"<<"Sign of number"<<"Step function"
+			<<"Square root"<<"x modulo y"<<"Argument of complex number";
+	// exp and logarithms
+	funcName[1]<<"exp()"<<"pow(,)"<<"ln()"<<"lg()"<<"log(,)";
+	funcInfo[1]<<"Exponential function e^x"<<"Power x^y"<<"Logarithm of x"
+			<<"Decimal logarithm of x"<<"Logarithm of x on base a";
+	// trigonometric
+	funcName[2]<<"sin()"<<"cos()"<<"tan()"<<"sinc()"<<"asin()"<<"acos()"<<"atan()";
+	funcInfo[2]<<"Sine function"<<"Cosine function"<<"Tangent function"<<"sin(x)/x"
+			<<"Inverse sine function"<<"Inverse cosine function"<<"Inverse tangent function";
+	// hyperbolic
+	funcName[3]<<"sinh()"<<"cosh()"<<"tanh()"<<"asinh()"<<"acosh()"<<"atanh()";
+	funcInfo[3]<<"Hyperbolic sine function"<<"Hyperbolic cosine function"
+			<<"Hyperbolic tangent function"<<"Inverse hyperbolic sine function"
+			<<"Inverse hyperbolic cosine function"<<"Inverse hyperbolic tangent function";
+	// bessel
+	funcName[4]<<"bessel_j(,)"<<"bessel_y(,)"<<"bessel_i(,)"<<"bessel_k(,)";
+	funcInfo[4]<<"Regular cylindrical Bessel function"<<"Irregular cylindrical Bessel function"
+			<<"Regular modified Bessel function"<<"Irregular modified Bessel function";
+	// elliptic
+	funcName[5]<<"elliptic_e(,)"<<"elliptic_f(,)"<<"elliptic_ec()"<<"elliptic_kc()";
+	funcInfo[5]<<"Elliptic integral E(phi,k)"<<"Elliptic integral F(phi,k)"
+			<<"Complete elliptic integral E(k)"<<"Complete elliptic integral K(k)";
+	// jacobi
+	funcName[6]<<"sn(,)"<<"cn(,)"<<"dn(,)"<<"sc(,)"<<"dc(,)"<<"nc(,)"<<"cs(,)"
+			<<"ds(,)"<<"ns(,)"<<"sd(,)"<<"cd(,)"<<"nd(,)";
+	funcInfo[6]<<"Jacobi function sn(u|m)"<<"Jacobi function cn(u|m)"
+			<<"Jacobi function dn(u|m)"<<"Jacobi function sn(u|m)/cn(u|m)"
+			<<"Jacobi function dn(u|m)/cn(u|m)"<<"Jacobi function 1/cn(u|m)"
+			<<"Jacobi function cn(u|m)/sn(u|m)"<<"Jacobi function dn(u|m)/sn(u|m)"
+			<<"Jacobi function 1/sn(u|m)"<<"Jacobi function sn(u|m)/dn(u|m)"
+			<<"Jacobi function cn(u|m)/dn(u|m)"<<"Jacobi function 1/dn(u|m)";
+	// airy and gamma
+	funcName[7]<<"airy_ai()"<<"airy_bi()"<<"airy_dai()"<<"airy_dbi()"<<"gamma()"<<"psi()"<<"beta(,)";
+	funcInfo[7]<<"Airy function Ai(x)"<<"Airy function Bi(x)"
+			<<"Derivative of Airy function Ai'(x)"<<"Derivative of Airy function Bi'(x)"
+			<<QString::fromWCharArray(L"Gamma function Γ(x)")
+			<<QString::fromWCharArray(L"Digamma function Γ'(x)/Γ(x)")
+			<<QString::fromWCharArray(L"Beta function Γ(x)*Γ(y)/Γ(x+y)");
+	// exp integrals
+	funcName[8]<<"ci()"<<"si()"<<"ei()"<<"e1()"<<"e2()"<<"ei3()";
+	funcInfo[8]<<QString::fromWCharArray(L"Cosine integral ∫dt cos(t)/t")
+			<<QString::fromWCharArray(L"Sine integral ∫dt sin(t)/t")
+			<<QString::fromWCharArray(L"Integral -∫dt exp(-t)/t")
+			<<QString::fromWCharArray(L"Integral Re ∫dt exp(-xt)/t")
+			<<QString::fromWCharArray(L"Integral Re∫dt exp(-xt)/t^2")
+			<<QString::fromWCharArray(L"Integral ∫dt exp(-t^3)");
+	// special
+	funcName[9]<<"erf()"<<"z()"<<"legendre(,)"<<"dilog()"<<"eta()"<<"zeta()"<<"w0()"<<"w1()";
+	funcInfo[9]<<QString::fromWCharArray(L"Error function 2/√π ∫dt exp(-t^2)")<<"Dawson function"
+			<<"Legendre polynomial P_l(x)"<<QString::fromWCharArray(L"Dilogarithm -Re∫ds ln(1-s)/s")
+			<<"Eta function (1-2/2^s)*zeta(s)"<<"Riemann zeta function"
+			<<"Lambert W function W_0(x)"<<"Lambert W function W_{-1}(x)";
+}
+//-----------------------------------------------------------------------------
+void CalcDialog::typeUpdate(int s)
+{
+	if(s<0 && s>9)	return;
+	func->clear();	func->addItems(funcName[s]);	func->setCurrentIndex(0);
+}
+//-----------------------------------------------------------------------------
+void CalcDialog::funcUpdate(int f)
+{
+	int s=type->currentIndex();
+	if(s<0 || s>9 || f<0)	return;	// wrong index
+	descr->setText(funcInfo[s].at(f));
+}
+//-----------------------------------------------------------------------------
diff --git a/src/finddialog.h b/src/finddialog.h
index 8d6903a..0c9f0ca 100644
--- a/src/finddialog.h
+++ b/src/finddialog.h
@@ -20,12 +20,15 @@
 #ifndef FINDDIALOG_H
 #define FINDDIALOG_H
 //-----------------------------------------------------------------------------
-#include <qdialog.h>
+#include <QDialog>
+#include <QStringList>
 class QCheckBox;
 class QLabel;
 class QLineEdit;
 class QTextEdit;
+class QComboBox;
 class QPushButton;
+class QLineEdit;
 //-----------------------------------------------------------------------------
 /// Dialog for finding something in text
 class FindDialog : public QDialog
@@ -71,5 +74,54 @@ private:
 	QCheckBox *start;
 };
 //-----------------------------------------------------------------------------
+/// Dialog for finding something in text
+class CalcDialog : public QWidget
+{
+Q_OBJECT
+public:
+	CalcDialog(QWidget *parent = 0);
+	~CalcDialog();
+public slots:
+	void evaluate();
+signals:
+	void putNumber(const QString &str);
+private slots:
+	void keyPut();
+	void key1();
+	void key2();
+	void key3();
+	void key4();
+	void key5();
+	void key6();
+	void key7();
+	void key8();
+	void key9();
+	void key0();
+	void keyE();
+	void keyDot();
+	void keyMul();
+	void keyDiv();
+	void keyAdd();
+	void keySub();
+	void keyBrO();
+	void keyBrC();
+	void keyFnc();
+	void keyPi();
+	void keyX2();
+	void typeUpdate(int s);
+	void funcUpdate(int s);
+	void foc();
+	void clear();
+
+private:
+	QTextEdit *text;
+	QLineEdit *result;
+	QComboBox *type, *func;
+	QLabel *descr;
+	QStringList names, funcName[10], funcInfo[10];
+
+	void fillFuncName();
+};
+//-----------------------------------------------------------------------------
 #endif
 //-----------------------------------------------------------------------------
diff --git a/src/graphwindow.cpp b/src/graphwindow.cpp
new file mode 100644
index 0000000..c0996b8
--- /dev/null
+++ b/src/graphwindow.cpp
@@ -0,0 +1,552 @@
+/***************************************************************************
+ *   Copyright (C) 2008 by Alexey Balakin                                  *
+ *   mathgl.abalakin at gmail.com                                             *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+#include <QTime>
+#include <QMenu>
+#include <QPrinter>
+#include <QTimer>
+#include <QScrollArea>
+#include <QPainter>
+#include <QPrintDialog>
+#include <QCloseEvent>
+#include <QToolBar>
+#include <QSpinBox>
+#include <QMainWindow>
+#include <QMenuBar>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QTableWidget>
+#include <QPushButton>
+#include <QInputDialog>
+#include <QLineEdit>
+#include <QMessageBox>
+#include <QMdiArea>
+#include <mgl/mgl_parse.h>
+#include "animparam.h"
+#include "graphwindow.h"
+#include "qmglcanvas.h"
+#include "infodialog.h"
+#include "tablewindow.h"
+extern bool mglAutoSave;
+extern mglParse parser;
+int animDelay=500;
+//-----------------------------------------------------------------------------
+//
+//		GraphWindow
+//
+//-----------------------------------------------------------------------------
+GraphWindow::GraphWindow(QWidget *wp) : QMdiSubWindow(wp)
+{
+	gifOn = jpgOn = false;	setWindowTitle("Canvas");
+	animDialog = new AnimParam(this);	animPos = -1;
+	printer = new QPrinter;
+	timer = new QTimer(this);
+	connect(timer, SIGNAL(timeout()), this, SLOT(nextSlide()));
+	connect(animDialog, SIGNAL(putText(const QString &)), this, SLOT(animText(const QString &)));
+
+	sv = new QScrollArea(this);	setWidget(sv);
+	mgl = new QMGLCanvas(this);	sv->setWidget(mgl);
+}
+//-----------------------------------------------------------------------------
+GraphWindow::~GraphWindow()	{	delete printer;	}
+//-----------------------------------------------------------------------------
+void GraphWindow::animText(const QString &txt)	{	animPutText(txt);	}
+//-----------------------------------------------------------------------------
+void GraphWindow::printPlot()
+{
+	QPrintDialog printDlg(printer, this);
+	if (printDlg.exec() == QDialog::Accepted)
+	{
+		statusBarMessage(tr("Printing..."));
+		QPainter p;
+		if(!p.begin(printer))	return;	// paint on printer
+		QRect r = p.viewport();
+		int w = r.width(), h = r.height(), h1;
+		h1 = int(w/mgl->getRatio());
+		if(h1<h)	h = h1;	else	w = int(h*mgl->getRatio());
+		mglGraphZB gr(w, h);
+		if(w*h > 240000)	gr.BaseLineWidth = sqrt(w*h/2.4e5);
+		mgl->execute(&gr);
+
+		uchar *grBuf=0;
+		QPixmap pic;
+		convertFromGraph(pic, &gr, &grBuf);
+		p.drawPixmap(0,0,pic);
+		delete []grBuf;
+		statusBarMessage(tr("Printing completed"));
+	}
+	else
+		statusBarMessage(tr("Printing aborted"));
+}
+//-----------------------------------------------------------------------------
+void GraphWindow::closeEvent(QCloseEvent* ce)	{	ce->ignore();	}
+//-----------------------------------------------------------------------------
+void GraphWindow::pressF5()
+{
+	if(mglAutoSave)	save();
+	showMaximized();	raise();
+	QTime t;	t.start();
+	mgl->execute();
+	statusBarMessage(QString(tr("Drawing time %1 ms")).arg(t.elapsed()*1e-3));
+}
+//-----------------------------------------------------------------------------
+void GraphWindow::pressF9()
+{
+	int l=animParam.length(), i;
+	wchar_t *str = new wchar_t[l+2];
+	animPos = 0;
+	QString cur = animParam.section('\n',animPos,animPos);
+	for(i=0;i<l;i++)	str[i] = (cur[i]).unicode();
+	str[i] = 0;
+	parser.AddParam(0,str);
+	delete []str;
+
+	mgl->reload();
+}
+//-----------------------------------------------------------------------------
+void GraphWindow::animStart(bool st)
+{
+	if(animParam.isEmpty())
+	{
+		if(animDialog->exec())
+		{
+			animParam = animDialog->getResult();
+			gifOn = animDialog->gifOn;
+			jpgOn = animDialog->jpgOn;
+		}
+		else	return;
+	}
+	if(st)
+	{
+		timer->start(animDelay);
+		if(gifOn)	mgl->startGIF(animDelay);
+		showMaximized();	raise();
+	}
+	else
+	{
+		timer->stop();
+		if(gifOn)	mgl->closeGIF();
+	}
+}
+//-----------------------------------------------------------------------------
+void GraphWindow::nextSlide()
+{
+	if(animParam.isEmpty())
+	{
+		if(animDialog->exec())
+		{
+			animParam = animDialog->getResult();
+			gifOn = animDialog->gifOn;
+			jpgOn = animDialog->jpgOn;
+		}
+		else	return;
+	}
+//	showMaximized();	raise();
+	int l=animParam.length(), n=animParam.count('\n') + (animParam[l-1]=='\n' ? 0:1), i;
+	wchar_t *str = new wchar_t[l+2];
+	animPos = (animPos+1)%n;
+	QString cur = animParam.section('\n',animPos,animPos);
+	for(i=0;i<l;i++)	str[i] = (cur[i]).unicode();
+	str[i] = 0;
+	parser.AddParam(0,str);
+	delete []str;
+	if(mgl->graph->GetNumFrame() >= n)
+		mgl->execute();
+	else
+	{
+		mgl->graph->NewFrame();
+		mgl->execute();
+		mgl->graph->EndFrame();
+		if(jpgOn)	mgl->graph->WriteFrame();
+		QString s;	s.sprintf("%d - %d of %d",mgl->graph->GetNumFrame(),animPos,n);
+		statusBarMessage(QString(tr("Frame %1 of %2")).arg(animPos).arg(n));
+	}
+}
+//-----------------------------------------------------------------------------
+void GraphWindow::prevSlide()
+{
+	if(animParam.isEmpty())
+	{
+		if(animDialog->exec())
+		{
+			animParam = animDialog->getResult();
+			gifOn = animDialog->gifOn;
+			jpgOn = animDialog->jpgOn;
+		}
+		else	return;
+	}
+//	showMaximized();	raise();
+	int l=animParam.length(), n=animParam.count('\n') + (animParam[l-1]=='\n' ? 0:1), i;
+	wchar_t *str = new wchar_t[l+2];
+	animPos = (animPos-1+n)%n;
+	QString cur = animParam.section('\n',animPos,animPos);
+	for(i=0;i<l;i++)	str[i] = (cur[i]).unicode();
+	str[i] = 0;
+	parser.AddParam(0,str);
+	delete []str;
+	mgl->execute();
+}
+//-----------------------------------------------------------------------------
+void GraphWindow::animSetup()
+{
+	if(animDialog->exec())
+	{
+		animParam = animDialog->getResult();
+		gifOn = animDialog->gifOn;
+		jpgOn = animDialog->jpgOn;
+		animPos = -1;
+	}
+}
+//-----------------------------------------------------------------------------
+void GraphWindow::adjust()
+{
+	mgl->setSize(sv->width()-5, sv->height()-5);
+	showMaximized();	raise();
+}
+//-----------------------------------------------------------------------------
+void GraphWindow::setMGLFont(const QString &path)	{	mgl->setMGLFont(path);	}
+//-----------------------------------------------------------------------------
+void GraphWindow::animParseText(const QString &txt)
+{
+	int i, n = txt.count('\n')+1;
+	QString s, all;
+	for(i=0;i<n;i++)
+	{
+		s = txt.section('\n',i,i);
+		if(s[0]=='#' && s[1]=='#' && s[2]=='a' && (s[3]==' ' || s[3]=='\t'))
+			all = all + s.mid(4) + "\n";
+	}
+	if(!all.isEmpty())
+	{
+		animDialog->setResult(all);
+		animParam = all;
+	}
+}
+//-----------------------------------------------------------------------------
+#include "xpm/wire.xpm"
+void GraphWindow::makeMenu(QMainWindow *wnd)
+{
+	QAction *a;
+	QMenu *o, *oo;
+	QToolBar *bb;
+
+	menu = new QMenu(this);
+	popup = new QMenu(this);	mgl->setPopup(popup);
+	// graphics menu
+	{
+	bb = new QToolBar(tr("Graphics"),this);
+	wnd->addToolBar(Qt::TopToolBarArea, bb);
+	o = wnd->menuBar()->addMenu(tr("&Graphics"));
+	a = new QAction(QPixmap(":/xpm/alpha.png"), tr("&Alpha"), this);
+	a->setShortcut(Qt::CTRL+Qt::Key_T);	a->setCheckable(true);
+	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setAlpha(bool)));
+	connect(mgl, SIGNAL(alphaChanged(bool)), a, SLOT(setOn(bool)));
+	a->setToolTip(tr("Switch on/off transparency for the graphics (Ctrl+T)."));
+	o->addAction(a);		bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/weather-clear.png"), tr("&Light"), this);
+	a->setShortcut(Qt::CTRL+Qt::Key_L);	a->setCheckable(true);
+	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setLight(bool)));
+	connect(mgl, SIGNAL(lightChanged(bool)), a, SLOT(setOn(bool)));
+	a->setToolTip(tr("Switch on/off lightning for the graphics (Ctrl+L)."));
+	o->addAction(a);		bb->addAction(a);
+	a = new QAction(QPixmap(wire_xpm), tr("&Grid"), this);
+	a->setShortcut(Qt::CTRL+Qt::Key_G);	a->setCheckable(true);
+	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setGrid(bool)));
+	a->setToolTip(tr("Switch on/off grid drawing for absolute coordinates (Ctrl+G)."));
+	o->addAction(a);		bb->addAction(a);
+
+	a = new QAction(QPixmap(":/xpm/object-rotate-right.png"), tr("&Rotate by mouse"), this);
+	a->setCheckable(true);
+	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setRotate(bool)));
+	connect(mgl, SIGNAL(rotateChanged(bool)), a, SLOT(setOn(bool)));
+	a->setToolTip(tr("Switch on/off mouse handling of the graphics\n(rotation, shifting, zooming and perspective)."));
+	bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/zoom-fit-best.png"), tr("&Zoom by mouse"), this);
+	a->setCheckable(true);
+	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setZoom(bool)));
+	connect(mgl, SIGNAL(zoomChanged(bool)), a, SLOT(setOn(bool)));
+	a->setToolTip(tr("Switch on/off mouse zoom of selected region."));
+	bb->addAction(a);
+	o->addSeparator();
+	a = new QAction(QPixmap(":/xpm/zoom-original.png"), tr("Res&tore"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(restore()));
+	a->setToolTip(tr("Restore default graphics rotation, zoom and perspective (Ctrl+Space)."));
+	a->setShortcut(Qt::CTRL+Qt::Key_Space);
+	o->addAction(a);	bb->addAction(a);	popup->addAction(a);
+	bb->addSeparator();
+	a = new QAction(QPixmap(":/xpm/view-refresh.png"), tr("Re&draw"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(pressF5()));
+	a->setToolTip(tr("Execute script and redraw graphics (F5)."));
+	a->setShortcut(Qt::Key_F5);
+	o->addAction(a);	bb->addAction(a);	popup->addAction(a);
+	a = new QAction(tr("&Adjust size"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(adjust()));
+	a->setToolTip(tr("Change canvas size to fill whole region (F6)."));
+	a->setShortcut(Qt::Key_F6);		o->addAction(a);
+	a = new QAction(tr("Re&load"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(pressF9()));
+	a->setToolTip(tr("Restore status for 'once' command and reload data (F9)."));
+	a->setShortcut(Qt::Key_F9);	o->addAction(a);	popup->addAction(a);
+	a = new QAction(QPixmap(":/xpm/process-stop.png"), tr("&Stop"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(stop()));
+	a->setToolTip(tr("Stop script execution (F7)."));
+	a->setShortcut(Qt::Key_F7);	o->addAction(a);		bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("&Copy plot"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(copy()));
+	a->setToolTip(tr("Copy graphics to clipboard (Ctrl+Shift+C)."));
+	a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_C);
+	o->addAction(a);		bb->addAction(a);	popup->addAction(a);
+	a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("&Copy click coor."), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(copyClickCoor()));
+	a->setToolTip(tr("Copy coordinates of last mouse click to clipboard."));
+	o->addAction(a);		bb->addAction(a);	popup->addAction(a);
+	bb->addSeparator();
+	tet = new QSpinBox(this);	tet->setWrapping(true);
+	bb->addWidget(tet);	tet->setRange(-180, 180);	tet->setSingleStep(10);
+	connect(tet, SIGNAL(valueChanged(int)), mgl, SLOT(setTet(int)));
+	connect(mgl, SIGNAL(tetChanged(int)), tet, SLOT(setValue(int)));
+	tet->setToolTip(tr("Set value of \\theta angle."));
+	bb->addSeparator();
+	phi = new QSpinBox(this);	phi->setWrapping(true);
+	bb->addWidget(phi);	phi->setRange(-180, 180);	phi->setSingleStep(10);
+	connect(phi, SIGNAL(valueChanged(int)), mgl, SLOT(setPhi(int)));
+	connect(mgl, SIGNAL(phiChanged(int)), phi, SLOT(setValue(int)));
+	phi->setToolTip(tr("Set value of \\phi angle."));
+//	bb->addSeparator();
+
+	oo = new QMenu(tr("&Export as ..."),this);
+	oo->addAction(tr("PNG"), mgl, SLOT(exportPNG()),Qt::META+Qt::Key_P);
+	oo->addAction(tr("solid PNG"), mgl, SLOT(exportPNGs()),Qt::META+Qt::Key_F);
+	oo->addAction(tr("JPEG"), mgl, SLOT(exportJPG()),Qt::META+Qt::Key_J);
+	oo->addAction(tr("GIF"), mgl, SLOT(exportGIF()),Qt::META+Qt::Key_G);
+	oo->addAction(tr("bitmap EPS"), mgl, SLOT(exportBPS()));
+	oo->addAction(tr("vector EPS"), mgl, SLOT(exportEPS()),Qt::META+Qt::Key_E);
+	oo->addAction(tr("SVG"), mgl, SLOT(exportSVG()),Qt::META+Qt::Key_S);
+	oo->addAction(tr("C++"), mgl, SLOT(exportCPP()));
+	oo->addAction(tr("IDTF"), mgl, SLOT(exportIDTF()));
+	o->addMenu(oo);
+	popup->addMenu(oo);
+
+	}
+	// zooming menu
+	{
+	oo = o->addMenu(tr("Zoom/move"));
+	bb = new QToolBar(tr("Zoom graphics"),this);
+	wnd->addToolBar(Qt::RightToolBarArea, bb);
+	a = new QAction(QPixmap(":/xpm/go-previous.png"), tr("Move &left"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(shiftLeft()));
+	a->setToolTip(tr("Move graphics left by 1/3 of its width."));
+	bb->addAction(a);		oo->addAction(a);
+	a = new QAction(QPixmap(":/xpm/go-up.png"), tr("Move &up"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(shiftUp()));
+	a->setToolTip(tr("Move graphics up by 1/3 of its height."));
+	bb->addAction(a);		oo->addAction(a);
+	a = new QAction(QPixmap(":/xpm/zoom-in.png"), tr("Zoom &in"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(zoomIn()));
+	a->setToolTip(tr("Zoom in graphics."));
+	bb->addAction(a);		oo->addAction(a);
+	a = new QAction(QPixmap(":/xpm/zoom-out.png"), tr("Zoom &out"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(zoomOut()));
+	a->setToolTip(tr("Zoom out graphics."));
+	bb->addAction(a);		oo->addAction(a);
+	a = new QAction(QPixmap(":/xpm/go-down.png"), tr("Move &down"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(shiftDown()));
+	a->setToolTip(tr("Move graphics up down 1/3 of its height."));
+	bb->addAction(a);		oo->addAction(a);
+	a = new QAction(QPixmap(":/xpm/go-next.png"), tr("Move &right"), this);
+	connect(a, SIGNAL(activated()), mgl, SLOT(shiftRight()));
+	a->setToolTip(tr("Move graphics right by 1/3 of its width."));
+	bb->addAction(a);		oo->addAction(a);
+	}
+	// animation menu
+	{
+	oo = wnd->menuBar()->addMenu(tr("&Animation"));
+	bb = new QToolBar(tr("Animation"),this);
+	wnd->addToolBar(Qt::RightToolBarArea, bb);
+	a = new QAction(QPixmap(":/xpm/media-seek-forward.png"), tr("&Next slide"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(nextSlide()));
+	a->setToolTip(tr("Show next slide (Meta+Right)."));
+	a->setShortcut(Qt::META+Qt::Key_Right);	oo->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/media-seek-backward.png"), tr("&Prev slide"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(prevSlide()));
+	a->setToolTip(tr("Show previous slide (Meta+Left)."));
+	a->setShortcut(Qt::META+Qt::Key_Left);	oo->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/film-b.png"), tr("&Slideshow"), this);
+	a->setCheckable(true);
+	connect(a, SIGNAL(toggled(bool)), this, SLOT(animStart(bool)));
+	a->setToolTip(tr("Run slideshow (Ctrl+F5). If no parameter specified\nthen the dialog with slideshow options will appear."));
+	a->setShortcut(Qt::CTRL+Qt::Key_F5);	oo->addAction(a);		bb->addAction(a);
+	oo->addAction(tr("Se&tup show"), this, SLOT(animSetup()), Qt::CTRL+Qt::Key_W);
+	}
+}
+//-----------------------------------------------------------------------------
+//
+//		MemoryWindow
+//
+//-----------------------------------------------------------------------------
+#include "xpm/table.xpm"
+#include "xpm/preview.xpm"
+MemoryWindow::MemoryWindow(QWidget *wp) : QMdiSubWindow(wp)
+{
+	QWidget *p;
+	QHBoxLayout *h;
+	QVBoxLayout *v;
+	QPushButton *b;
+
+	infoDlg = new InfoDialog(this);
+	infoDlg->setModal(true);	infoDlg->allowRefresh=false;
+
+	p = new QWidget(this);
+	v = new QVBoxLayout(p);	h = new QHBoxLayout();	v->addLayout(h);
+	b = new QPushButton(QPixmap(":/xpm/document-new.png"), tr("New"), p);	h->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(newTable()));
+	b = new QPushButton(QPixmap(table_xpm), tr("Edit"), p);	h->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(editData()));
+	b = new QPushButton(QPixmap(":/xpm/edit-delete.png"), tr("Delete"), p);	h->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(delData()));
+	b = new QPushButton(QPixmap(preview_xpm), tr("Info"), p);	h->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(infoData()));
+	b = new QPushButton(QPixmap(":/xpm/view-refresh.png"), tr("Update"), p);	h->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(refresh()));
+	h->addStretch(1);
+	b = new QPushButton(QPixmap(":/xpm/edit-delete.png"), tr("Delete All"), p);	h->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(delAllData()));
+
+	colSort = 0;
+	tab = new QTableWidget(p);	v->addWidget(tab);	tab->setColumnCount(3);
+	QStringList sl;	sl<<tr("Name")<<tr("Sizes")<<tr("Memory");
+	tab->setHorizontalHeaderLabels(sl);
+	connect(tab, SIGNAL(cellClicked(int,int)), this, SLOT(tableClicked(int,int)));
+	connect(tab, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(tableDClicked(int,int)));
+
+	setWidget(p);	setWindowTitle(tr("Memory"));
+}
+//-----------------------------------------------------------------------------
+MemoryWindow::~MemoryWindow()	{}
+//-----------------------------------------------------------------------------
+void MemoryWindow::closeEvent(QCloseEvent* ce)	{	ce->ignore();	}
+//-----------------------------------------------------------------------------
+void MemoryWindow::tableClicked(int, int col)
+{	colSort = col;	tab->sortItems(col);	}
+//-----------------------------------------------------------------------------
+void MemoryWindow::tableDClicked(int row, int)	{	editData(row);	}
+//-----------------------------------------------------------------------------
+TableWindow *MemoryWindow::newWindow(mglVar *v)
+{
+	TableWindow *t = new TableWindow(infoDlg);
+	if(v)	t->setVar(v);
+	mdiArea()->addSubWindow(t);
+	t->setWindowState(Qt::WindowMaximized);
+	return t;
+}
+//-----------------------------------------------------------------------------
+void MemoryWindow::newTable()
+{
+	bool ok;
+	QString name = QInputDialog::getText(this, tr("UDAV - New variable"),
+				tr("Enter name for new variable"), QLineEdit::Normal, "", &ok);
+	if(!ok || name.isEmpty())	return;
+	mglVar *v = parser.AddVar(name.toAscii());
+	TableWindow *t;
+	if(v->o)	t = (TableWindow *)v->o;
+	else		t = newWindow(v);
+	t->showMaximized();	t->activateWindow();
+	refresh();
+}
+//-----------------------------------------------------------------------------
+void MemoryWindow::editData(int n)
+{
+	if(tab->rowCount()<1)	return;
+	if(n<0)	n = tab->currentRow();
+	if(n<0)	n = 0;
+	mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii());
+	if(!v)	return;
+	TableWindow *t;
+	if(v->o)	t = (TableWindow *)v->o;
+	else		t = newWindow(v);
+	t->showMaximized();	t->activateWindow();
+}
+//-----------------------------------------------------------------------------
+void MemoryWindow::delData()
+{
+	if(tab->rowCount()<1)	return;
+	int	n = tab->currentRow();
+	if(n<0)	n = 0;
+	mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii());
+	if(!v)	return;
+	if(v->o)	((TableWindow *)v->o)->close();
+	parser.DeleteVar(v);
+	refresh();
+}
+//-----------------------------------------------------------------------------
+void MemoryWindow::delAllData()
+{
+	if(QMessageBox::information(this, tr("UDAV - delete all data"),
+			tr("Do you want to delete all data?"), QMessageBox::No,
+			QMessageBox::Yes)!=QMessageBox::Yes)	return;
+	while(parser.DataList)	parser.DeleteVar(parser.DataList);
+	refresh();
+}
+//-----------------------------------------------------------------------------
+void MemoryWindow::infoData()
+{
+	if(tab->rowCount()<1)	return;
+	int	n = tab->currentRow();
+	if(n<0)	n = 0;
+	mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii());
+	if(!v)	return;
+	infoDlg->setVar(v);
+	QString s = QString::fromWCharArray(v->s);
+	infoDlg->setWindowTitle(s + tr(" - UDAV preview"));
+	infoDlg->refresh();
+	infoDlg->show();
+}
+//-----------------------------------------------------------------------------
+void MemoryWindow::refresh()
+{
+	mglVar *v = parser.DataList;
+	int n = 0;
+	while(v)	{	v = v->next;	n++;	}
+	tab->setRowCount(n);
+	v = parser.DataList;	n = 0;
+	QString s;
+	QTableWidgetItem *it;
+	Qt::ItemFlags flags=Qt::ItemIsSelectable|Qt::ItemIsEnabled;
+	while(v)
+	{
+		register unsigned i,m=wcslen(v->s);
+		QChar *ss = new QChar[m+1];
+		for(i=0;i<m;i++)	ss[i] = v->s[i];
+		s = QString(ss, m);	delete []ss;
+		it = new QTableWidgetItem(s);
+		tab->setItem(n,0,it);	it->setFlags(flags);
+		s.sprintf("%ld * %ld * %ld", v->d.nx, v->d.ny, v->d.nz);
+		it = new QTableWidgetItem(s);
+		tab->setItem(n,1,it);	it->setFlags(flags);
+		it->setTextAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
+		s.sprintf("%12ld", v->d.nx*v->d.ny*v->d.nz*sizeof(float));
+		it = new QTableWidgetItem(s);
+		tab->setItem(n,2,it);	it->setFlags(flags);
+		it->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
+		if(v->o)	((TableWindow *)v->o)->refresh();
+		v = v->next;	n++;
+	}
+	tab->sortItems(colSort);
+}
+//-----------------------------------------------------------------------------
diff --git a/src/scriptwindow.h b/src/graphwindow.h
similarity index 54%
copy from src/scriptwindow.h
copy to src/graphwindow.h
index 4a42b1a..1f6c065 100644
--- a/src/scriptwindow.h
+++ b/src/graphwindow.h
@@ -1,163 +1,107 @@
-/***************************************************************************
- *   Copyright (C) 2008 by Alexey Balakin                                  *
- *   mathgl.abalakin at gmail.com                                             *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-#ifndef UDAV_H
-#define UDAV_H
-//-----------------------------------------------------------------------------
-#include <qmainwindow.h>
-//-----------------------------------------------------------------------------
-#ifndef UDAV_VERSION
-#define UDAV_VERSION	5.2
-#endif
-
-#ifndef WIN32
-#define USE_HDF5	// Enable HDF "projects"
-#endif
-
-#ifndef MGL_DOC_DIR
-#ifdef WIN32
-#define MGL_DOC_DIR ""
-#else
-#define MGL_DOC_DIR "/usr/local/share/doc/udav/"
-#endif
-#endif
-//-----------------------------------------------------------------------------
-class QTextEdit;
-class QFont;
-class QSplitter;
-class QScrollArea;
-class QMGLCanvas;
-class FindDialog;
-class OptionDialog;
-class StyleDialog;
-class QMenu;
-class QSpinBox;
-class QTimer;
-class QPopupMenu;
-class AnimParam;
-class QTableWidget;
-class SetupDialog;
-class QTabWidget;
-class InfoDialog;
-class HintDialog;
-//-----------------------------------------------------------------------------
-extern int MaxRecentFiles;
-extern int animDelay;
-//-----------------------------------------------------------------------------
-class ScriptWindow: public QMainWindow
-{
-Q_OBJECT
-public:
-	ScriptWindow(QWidget *wp=0);
-	~ScriptWindow();
-	void load(const QString &fileName, bool noNewWnd=false);
-	void writeSettings();
-
-public slots:
-	void refresh();		///< refresh list of variables
-	void setEditorFont(QFont *f=0);
-	void setMGLFont(QString path);
-	void setEditPos(bool bottom);
-	void editPosChanged();
-
-signals:
-	void gotoLine(int n,int i);
-
-protected:
-	void closeEvent ( QCloseEvent* );
-
-private slots:
-	void newDoc();
-	void choose();
-	void save();
-	void saveAs();
-	void printText();
-	void printPlot();
-	void find();
-	void about();
-	void aboutQt();
-	void openRecentFile();
-	bool findText(const QString &str="", bool cs=false, bool fw=true);
-	void replText(const QString &str, const QString &txt, bool cs=false, bool fw=true);
-	void showHelp();
-	void addOptions();
-	void addStyle();
-	void nextSlide();
-	void prevSlide();
-	void animStart(bool st);
-	void animSetup();
-	void addSetup();
-	void animPutText(const QString &);
-
-	void newTable();
-	void editData(int n=-1);
-	void infoData();
-	void delAllData();
-	void delData();
-	void messClicked();
-	void tableClicked(int row, int col);
-	void properties();
-	void setAsterix();
-	void setCursorPosition(int,int);
-	void pressF5();
-
-	void adjust();
-	void warnChanged();
-
+/***************************************************************************
+ *   Copyright (C) 2008 by Alexey Balakin                                  *
+ *   mathgl.abalakin at gmail.com                                             *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+#ifndef GRAPHWINDOW_H
+#define GRAPHWINDOW_H
+//-----------------------------------------------------------------------------
+#include <QMdiSubWindow>
+//-----------------------------------------------------------------------------
+class QMGLCanvas;
+class QScrollArea;
+class QSpinBox;
+class QMenu;
+class QTimer;
+class QPopupMenu;
+class QMainWindow;
+class QTableWidget;
+class InfoDialog;
+class AnimParam;
+class TableWindow;
+class mglVar;
+//-----------------------------------------------------------------------------
+class GraphWindow : public QMdiSubWindow
+{
+Q_OBJECT
+public:
+	QMGLCanvas *mgl;
+	GraphWindow(QWidget *wp=0);
+	~GraphWindow();
+	void setMGLFont(const QString &path);
+	void animParseText(const QString &txt);
+	void makeMenu(QMainWindow *wnd);
+public slots:
+	void closeEvent(QCloseEvent *);
+signals:
+	void save();
+	void animPutText(const QString &);
+	void statusBarMessage(const QString &);
+private slots:
+	void animText(const QString &);
+	void printPlot();
+	void nextSlide();
+	void prevSlide();
+	void animStart(bool st);
+	void animSetup();
+	void adjust();
+	void pressF5();
+	void pressF9();
 private:
-	static int num_wnd;
-	bool gifOn, jpgOn;
-	QString gifName;
-	QMGLCanvas *mgl;
-	QScrollArea* sv;
-	QSplitter *split, *splitG;
-	QPrinter *printer;
-	QTextEdit *edit;
-	QTextEdit *mess;	///< messages and warnings
-	QString filename;
-	FindDialog *findDialog;
-	OptionDialog *optDialog;
-	StyleDialog *stlDialog;
-	QMenu *fileMenu;
-	QSpinBox *tet, *phi;
-	// animation
-	QString animParam;
-	int animPos;
-	QTimer *timer;
-	AnimParam *animDialog;
-	QMenu *popup;
-	QTableWidget *tab;
-	SetupDialog *setupDlg;
-	QTabWidget *info;
-	QAction *ainfo;
-	InfoDialog *infoDlg;	///< Data preview and information
-
-	void updateRecentFileItems();
-	void updateRecent();
-	void setCurrentFile(const QString &fileName);
-	void makeMenu();
-	void readSettings();
-	void animParseText();
-	QTabWidget *setupInfo(QWidget *par);
-	void saveHDF5(const QString &fileName);
-	void loadHDF5(const QString &fileName);
-};
-//-----------------------------------------------------------------------------
-#endif
-//-----------------------------------------------------------------------------
+	bool gifOn, jpgOn;
+	QScrollArea* sv;
+	QSpinBox *tet, *phi;
+	QMenu *menu;
+	// animation
+	QString animParam;
+	int animPos;
+	QTimer *timer;
+	AnimParam *animDialog;
+	QMenu *popup;
+	QPrinter *printer;
+};
+//-----------------------------------------------------------------------------
+class MemoryWindow : public QMdiSubWindow
+{
+Q_OBJECT
+public:
+	MemoryWindow(QWidget *wp=0);
+	~MemoryWindow();
+	void makeMenu(QMainWindow *wnd);
+	TableWindow *newWindow(mglVar *v=0);
+public slots:
+	void refresh();		///< refresh list of variables
+	void closeEvent(QCloseEvent *);
+signals:
+	void save();
+	void animPutText(const QString &);
+	void statusBarMessage(const QString &);
+private slots:
+	void newTable();
+	void editData(int n=-1);
+	void infoData();
+	void delAllData();
+	void delData();
+	void tableClicked(int row, int col);
+	void tableDClicked(int row, int col);
+private:
+	InfoDialog *infoDlg;	///< Data preview and information
+	QTableWidget *tab;
+	int colSort;
+};
+#endif // GRAPHWINDOW_H
+//-----------------------------------------------------------------------------
diff --git a/src/helpwindow.cpp b/src/helpwindow.cpp
index c605dd7..c5c9603 100644
--- a/src/helpwindow.cpp
+++ b/src/helpwindow.cpp
@@ -17,56 +17,73 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#include <qaction.h>
-#include <qtoolbar.h>
-#include <qlineedit.h>
-#include <qtextbrowser.h>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QPushButton>
+#include <QLineEdit>
+#include <QTextBrowser>
+#include <QCloseEvent>
+#include <QToolButton>
 //-----------------------------------------------------------------------------
 #include "helpwindow.h"
 extern QString pathHelp;
 //-----------------------------------------------------------------------------
-HelpWindow::HelpWindow(QWidget *parent) : QMainWindow(parent)
+HelpWindow::HelpWindow(QWidget *parent) : QMdiSubWindow(parent)
 {
-	setWindowTitle(tr("UDAV - Help"));
-	QAction *a;
-	QToolBar *b;
-	QLineEdit *e;
-	hlp = new QTextBrowser(this);
+	QPushButton *b;
+	QToolButton *t;
+	QWidget *p = new QWidget(this);
+	QVBoxLayout *o = new QVBoxLayout(p);
+	QHBoxLayout *a = new QHBoxLayout();	o->addLayout(a);
+	help = new QTextBrowser(this);	o->addWidget(help);
+	setPath(pathHelp);	help->setSource(tr("script_mgl_eng.html"));
 
-	b = new QToolBar(tr("Help Operations"), this);
-	addToolBar(Qt::TopToolBarArea, b);
-	a = new QAction(QPixmap(":/xpm/go-previous.png"), tr("Backward"), this);
-	connect(a, SIGNAL(activated()), hlp, SLOT(backward()));
-	b->addAction(a);
-	e = new QLineEdit(this);	b->addWidget(e);
-	connect(e, SIGNAL(textChanged(const QString &)), this, SLOT(showHelp(const QString &)));
-	a = new QAction(QPixmap(":/xpm/go-next.png"), tr("Forward"), this);
-	connect(a, SIGNAL(activated()), hlp, SLOT(forward()));
-	b->addAction(a);
-
-	hlp->setSource(pathHelp+tr("script_mgl_eng.html"));
-	setCentralWidget(hlp);
-	resize(500, 600);
+	b = new QPushButton(QPixmap(":/xpm/go-previous.png"), tr("Backward"), p);
+	connect(b, SIGNAL(clicked()), help, SLOT(backward()));	a->addWidget(b);
+	entry = new QLineEdit(p);	a->addWidget(entry);
+	connect(entry, SIGNAL(textChanged(const QString &)), this, SLOT(showHelp(const QString &)));
+	connect(entry, SIGNAL(returnPressed()), this, SLOT(showHelp()));
+	b = new QPushButton(QPixmap(":/xpm/go-next.png"), tr("Forward"), p);
+	connect(b, SIGNAL(clicked()), help, SLOT(forward()));	a->addWidget(b);
+	b = new QPushButton(QPixmap(":/xpm/help-faq.png"), tr("&Examples"), this);
+	connect(b, SIGNAL(clicked()), this, SLOT(showExamples()));	a->addWidget(b);
+	t = new QToolButton(p);	t->setIcon(QPixmap(":/xpm/zoom-in.png"));
+	connect(t, SIGNAL(clicked()), this, SLOT(zoomIn()));	a->addWidget(t);
+	t = new QToolButton(p);	t->setIcon(QPixmap(":/xpm/zoom-out.png"));
+	connect(t, SIGNAL(clicked()), this, SLOT(zoomOut()));	a->addWidget(t);
+	setWidget(p);	setWindowTitle(tr("Help"));
 }
 //-----------------------------------------------------------------------------
-HelpWindow::~HelpWindow()
+HelpWindow::~HelpWindow()	{}
+//-----------------------------------------------------------------------------
+void HelpWindow::setPath(const QString &path)
+{	QStringList s;	s<<path;	help->setSearchPaths(s);	}
+//-----------------------------------------------------------------------------
+void HelpWindow::closeEvent(QCloseEvent* ce)	{	ce->ignore();	}
+//-----------------------------------------------------------------------------
+void HelpWindow::showExamples()
 {
+	setWindowTitle("Examples");	showMaximized();	raise();
+	help->setSource(tr("example_mgl_eng.html"));
 }
 //-----------------------------------------------------------------------------
-void HelpWindow::showExamples()
+void HelpWindow::showHelp(const QString &txt)
+{
+	QString cmd=txt;
+	showMaximized();	raise();
+	if(cmd.isEmpty())	cmd = entry->text().trimmed();
+	if(cmd.isEmpty())	help->setSource(tr("script_mgl_eng.html"));
+	else	help->setSource(tr("script_mgl_eng.html")+"#"+cmd);
+	setWindowTitle("Help");
+}
+//-----------------------------------------------------------------------------
+void HelpWindow::zoomIn()
 {
-	hlp->setSource(pathHelp+tr("example_mgl_eng.html"));
-	setWindowTitle("UDAV examples");
-	show();
+	QFont f(help->font());	f.setPointSize(f.pointSize()+1);	help->setFont(f);
 }
 //-----------------------------------------------------------------------------
-void HelpWindow::showHelp(const QString &cmd)
+void HelpWindow::zoomOut()
 {
-	if(cmd.isEmpty())
-		hlp->setSource(pathHelp+tr("script_mgl_eng.html"));
-	else
-		hlp->setSource(pathHelp+tr("script_mgl_eng.html")+"#"+cmd);
-	setWindowTitle("UDAV help");
-	show();	raise();
+	QFont f(help->font());	f.setPointSize(f.pointSize()-1);	help->setFont(f);
 }
 //-----------------------------------------------------------------------------
diff --git a/src/helpwindow.h b/src/helpwindow.h
index beb14b8..f10be56 100644
--- a/src/helpwindow.h
+++ b/src/helpwindow.h
@@ -20,23 +20,30 @@
 #ifndef HELPWINDOW_H
 #define HELPWINDOW_H
 //-----------------------------------------------------------------------------
-#include <qmainwindow.h>
+#include <QMdiSubWindow>
 //-----------------------------------------------------------------------------
 class QTextBrowser;
+class QLineEdit;
 extern QString pathHelp;
+class QCloseEvent;
 //-----------------------------------------------------------------------------
 /// Window for showing MGL help and examples
-class HelpWindow : public QMainWindow
+class HelpWindow : public QMdiSubWindow
 {
 Q_OBJECT
 public:
 	HelpWindow(QWidget *parent = 0);
 	~HelpWindow();
 public slots:
+	void closeEvent(QCloseEvent *);
 	void showExamples();
 	void showHelp(const QString &cmd=QString::null);
+	void setPath(const QString &path);
+	void zoomIn();
+	void zoomOut();
 private:
-	QTextBrowser *hlp;
+	QTextBrowser *help;
+	QLineEdit *entry;
 };
 //-----------------------------------------------------------------------------
 #endif
diff --git a/src/infodialog.cpp b/src/infodialog.cpp
index f55b8f6..e464eca 100644
--- a/src/infodialog.cpp
+++ b/src/infodialog.cpp
@@ -21,7 +21,7 @@
 #include <QComboBox>
 #include <QTextEdit>
 #include <QTabWidget>
-#include <qlayout.h>
+#include <QLayout>
 #include <mgl/mgl_parse.h>
 #include "qmglcanvas.h"
 #include "infodialog.h"
@@ -53,9 +53,7 @@ InfoDialog::InfoDialog(QWidget *parent) : QDialog(parent)
 	tab->addTab(info, tr("Information"));
 }
 //-----------------------------------------------------------------------------
-InfoDialog::~InfoDialog()
-{
-}
+InfoDialog::~InfoDialog()	{}
 //-----------------------------------------------------------------------------
 #include <QMessageBox>
 void InfoDialog::refresh(bool force)
@@ -79,7 +77,5 @@ void InfoDialog::setVar(mglVar *v)
 }
 //-----------------------------------------------------------------------------
 void InfoDialog::showEvent(QShowEvent *)
-{
-	refresh(true);
-}
+{	refresh(true);	}
 //-----------------------------------------------------------------------------
diff --git a/src/infodialog.h b/src/infodialog.h
index b92c4c3..0f0b8ef 100644
--- a/src/infodialog.h
+++ b/src/infodialog.h
@@ -21,6 +21,7 @@
 #define INFODIALOG_H
 //-----------------------------------------------------------------------------
 #include <QDialog>
+#include <QMainWindow>
 //-----------------------------------------------------------------------------
 class QMGLCanvas;
 class mglVar;
diff --git a/src/main.cpp b/src/main.cpp
index fbe2cdb..dace1bd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -17,26 +17,42 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#include <qapplication.h>
+#include <QApplication>
+#include <QTranslator>
+#include <QSettings>
 #include "scriptwindow.h"
-#include "helpwindow.h"
 #include "finddialog.h"
-HelpWindow *hlp=NULL;
+#include <mgl/mgl_parse.h>
+#include <mgl/mgl_eval.h>
+//-----------------------------------------------------------------------------
+extern mglParse parser;
+int mgl_cmd_cmp(const void *a, const void *b);
 HintDialog *hintDialog=NULL;
-extern QString pathHelp;
+QString pathHelp=MGL_DOC_DIR;
 extern bool showHint;
+//-----------------------------------------------------------------------------
 void udavLoadDefCommands();
 //-----------------------------------------------------------------------------
 int main(int argc, char **argv)
 {
 	QApplication a(argc, argv);
+	QTranslator translator;
+
+	QString lang="";
+	QSettings settings("abalakin","UDAV");
+	settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV");
+	settings.beginGroup("/UDAV");
+	pathHelp = settings.value("/helpPath", MGL_DOC_DIR).toString();
+	lang = settings.value("/udavLang", "").toString();
+	settings.endGroup();
+
+	if(!lang.isEmpty())
+	{
+		translator.load("udav_"+lang, pathHelp);
+		a.installTranslator(&translator);
+	}
+
 	udavLoadDefCommands();
-#ifdef WIN32
-	pathHelp = MGL_DOC_DIR;
-#else
-	pathHelp = MGL_DOC_DIR[0] ? MGL_DOC_DIR : "/usr/local/share/doc/udav/";
-#endif
-	hlp = new HelpWindow();
 	hintDialog = new HintDialog();
 	ScriptWindow *mw = new ScriptWindow();
 	if(argc>1)	mw->load(QString(argv[1]), true);
@@ -46,3 +62,55 @@ int main(int argc, char **argv)
 	return a.exec();
 }
 //-----------------------------------------------------------------------------
+//
+//		mgl addon
+//
+//-----------------------------------------------------------------------------
+/*mglCommand udav_base_cmd[] = {
+	{L"fplot",L"Plot curve by formula",L"fplot 'func' ['stl'='' num=100]", mgls_fplot, mglc_fplot},
+	{L"fsurf",L"Plot surface by formula",L"fsurf 'func' ['stl'='' numx=100 numy=100]", mgls_fsurf, mglc_fsurf},
+	{L"fgets",L"Print string from file",L"fgets x y {z} 'fname' [pos=0 'stl'='' size=-1.4]", mgls_fgets, mglc_fgets},
+{L"",0,0,0,0}};*/
+//-----------------------------------------------------------------------------
+void udavAddCommands(const mglCommand *cmd)
+{
+	int i, mp, mc;
+	// determine the number of symbols
+	for(i=0;parser.Cmd[i].name[0];i++){};	mp = i;
+	for(i=0;cmd[i].name[0];i++){};			mc = i;
+	mglCommand *buf = new mglCommand[mp+mc+1];
+	memcpy(buf, parser.Cmd, mp*sizeof(mglCommand));
+	memcpy(buf+mp, cmd, (mc+1)*sizeof(mglCommand));
+	qsort(buf, mp+mc, sizeof(mglCommand), mgl_cmd_cmp);
+	if(parser.Cmd!=mgls_base_cmd)	delete []parser.Cmd;
+	parser.Cmd = buf;
+}
+//-----------------------------------------------------------------------------
+void udavLoadDefCommands()
+{
+//	udavAddCommands(udav_base_cmd);
+}
+//-----------------------------------------------------------------------------
+#ifdef WIN32
+void udavLoadCommands(const char *, const char *)	{}
+#else
+void udavLoadCommands(const char *, const char *)	{}
+/*#include <ltdl.h>
+typedef const mglCommadns *(*udav_cmd) ();
+void udavLoadCommands(const char *lib, const char *func)
+{
+	void *jmodule=0;
+	udav_cmd ff;
+	if(lt_dlinit())	return;
+	errors=lt_dlsetsearchpath(MOD_LIB_DIR);
+	jmodule=lt_dlopenext(lib);
+	if(jmodule)
+	{
+		ff = (udav_cmd) lt_dlsym((lt_dlhandle) jmodule, func);
+		udavAddCommands(ff());
+		lt_dlclose((lt_dlhandle) jmodule);
+	}
+	lt_dlexit();
+}*/
+#endif
+//-----------------------------------------------------------------------------
diff --git a/src/mgl_addon.cpp b/src/mgl_addon.cpp
deleted file mode 100644
index 7ebf464..0000000
--- a/src/mgl_addon.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2008 by Alexey Balakin                                  *
- *   mathgl.abalakin at gmail.com                                             *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
- ***************************************************************************/
-#include <mgl/mgl_parse.h>
-#include <mgl/mgl_eval.h>
-extern mglParse parser;
-int mgl_cmd_cmp(const void *a, const void *b);
-//-----------------------------------------------------------------------------
-/*mglCommand udav_base_cmd[] = {
-	{L"fplot",L"Plot curve by formula",L"fplot 'func' ['stl'='' num=100]", mgls_fplot, mglc_fplot},
-	{L"fsurf",L"Plot surface by formula",L"fsurf 'func' ['stl'='' numx=100 numy=100]", mgls_fsurf, mglc_fsurf},
-	{L"fgets",L"Print string from file",L"fgets x y {z} 'fname' [pos=0 'stl'='' size=-1.4]", mgls_fgets, mglc_fgets},
-{L"",0,0,0,0}};*/
-//-----------------------------------------------------------------------------
-void udavAddCommands(const mglCommand *cmd)
-{
-	int i, mp, mc;
-	// determine the number of symbols
-	for(i=0;parser.Cmd[i].name[0];i++){};	mp = i;
-	for(i=0;cmd[i].name[0];i++){};			mc = i;
-	mglCommand *buf = new mglCommand[mp+mc+1];
-	memcpy(buf, parser.Cmd, mp*sizeof(mglCommand));
-	memcpy(buf+mp, cmd, (mc+1)*sizeof(mglCommand));
-	qsort(buf, mp+mc, sizeof(mglCommand), mgl_cmd_cmp);
-	if(parser.Cmd!=mgls_base_cmd)	delete []parser.Cmd;
-	parser.Cmd = buf;
-}
-//-----------------------------------------------------------------------------
-void udavLoadDefCommands()
-{
-//	udavAddCommands(udav_base_cmd);
-}
-//-----------------------------------------------------------------------------
-#ifdef WIN32
-void udavLoadCommands(const char *, const char *)	{}
-#else
-void udavLoadCommands(const char *, const char *)	{}
-/*#include <ltdl.h>
-typedef const mglCommadns *(*udav_cmd) ();
-void udavLoadCommands(const char *lib, const char *func)
-{
-	void *jmodule=0;
-	udav_cmd ff;
-	if(lt_dlinit())	return;
-	errors=lt_dlsetsearchpath(MOD_LIB_DIR);
-	jmodule=lt_dlopenext(lib);
-	if(jmodule)
-	{
-		ff = (udav_cmd) lt_dlsym((lt_dlhandle) jmodule, func);
-		udavAddCommands(ff());
-		lt_dlclose((lt_dlhandle) jmodule);
-	}
-	lt_dlexit();
-}*/
-#endif
-//-----------------------------------------------------------------------------
diff --git a/src/newcmddialog.cpp b/src/newcmddialog.cpp
new file mode 100644
index 0000000..63e6f11
--- /dev/null
+++ b/src/newcmddialog.cpp
@@ -0,0 +1,292 @@
+/***************************************************************************
+ *   Copyright (C) 2008 by Alexey Balakin                                  *
+ *   mathgl.abalakin at gmail.com                                             *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+#include <QComboBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QTableWidget>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QPushButton>
+#include <QMessageBox>
+#include <QTextBrowser>
+#include <mgl/mgl_parse.h>
+
+#include "newcmddialog.h"
+#include "optiondialog.h"
+#include "styledialog.h"
+extern mglParse parser;
+extern QString pathHelp;
+//-----------------------------------------------------------------------------
+NewCmdDialog::NewCmdDialog(QWidget *p) : QDialog(p)
+{
+	fillList();
+	QPushButton *b;
+	QHBoxLayout *m = new QHBoxLayout(this), *a;
+	QVBoxLayout *o = new QVBoxLayout;	m->addLayout(o);
+	optDialog = new OptionDialog(this);
+	stlDialog = new StyleDialog(this);
+	type = new QComboBox(this);		o->addWidget(type);
+	type->setToolTip(tr("Groups of MGL commands"));
+	name = new QComboBox(this);		o->addWidget(name);
+	name->setToolTip(tr("MGL commands for selected group"));
+	type->addItems(types);	name->addItems(argn[0]);
+	info = new QLabel(this);		o->addWidget(info);
+	info->setToolTip(tr("Short description of selected command"));
+	kind= new QComboBox(this);		o->addWidget(kind);	kind->addItem("");
+	kind->setToolTip(tr("Kind of command argument order. The notation is:\n"
+						" * Capital arguments are data (like, Ydat);\n"
+						" * Argument in '' are strings (like, 'fmt');\n"
+						" * Other arguments are numbers (like, zval);\n"
+						" * Arguments in [] are optional arguments."));
+	args = new QTableWidget(this);	o->addWidget(args);
+	args->setToolTip(tr("Command arguments. Bold ones are required arguments.\n"
+						"Other are optional arguments but its order is required.\n"
+						"You can use '' for default format. See help at right\nfor default values."));
+	QStringList sl;	sl<<tr("Argument")<<tr("Value");
+	args->setHorizontalHeaderLabels(sl);
+
+	a = new QHBoxLayout;	o->addLayout(a);
+	b = new QPushButton(tr("Add style"),this);	a->addWidget(b);
+	b->setToolTip(tr("Here you can select the plot style.\nThe result will be placed in 'fmt' argument."));
+	connect(b, SIGNAL(clicked()),this,SLOT(insertStl()));
+	b = new QPushButton(tr("Add data"),this);	a->addWidget(b);
+	connect(b, SIGNAL(clicked()),this,SLOT(insertData()));
+	b = new QPushButton(tr("Options"),this);	a->addWidget(b);
+	b->setToolTip(tr("Here you can specify command options.\nOptions are used for additional plot tunning."));
+	connect(b, SIGNAL(clicked()),this,SLOT(insertOpt()));
+	QLabel *l=new QLabel(tr("Options"));	o->addWidget(l);
+	opt = new QLineEdit(this);	o->addWidget(opt);
+	a = new QHBoxLayout;	o->addLayout(a);
+	b = new QPushButton(tr("Cancel"),this);	a->addWidget(b);
+	connect(b, SIGNAL(clicked()), this, SLOT(reject()));
+	b = new QPushButton(tr("OK"),this);	a->addWidget(b);
+
+	o = new QVBoxLayout;	m->addLayout(o,1);
+	help = new QTextBrowser(this);	o->addWidget(help);	help->setMinimumWidth(300);
+
+	connect(b, SIGNAL(clicked()), this, SLOT(finish()));
+	connect(type, SIGNAL(currentIndexChanged(int)),this,SLOT(typeChanged(int)));
+	connect(name, SIGNAL(currentIndexChanged(int)),this,SLOT(nameChanged(int)));
+	connect(kind, SIGNAL(currentIndexChanged(int)),this,SLOT(kindChanged(int)));
+	type->setCurrentIndex(0);	typeChanged(0);
+}
+//-----------------------------------------------------------------------------
+void NewCmdDialog::fillList()
+{
+	types<<tr("1D plots")<<tr("2D plots")<<tr("3D plots")<<tr("Dual plots")
+			<<tr("Vector plots")<<tr("Other plots")<<tr("Text and legend")
+			<<tr("Create data and I/O")<<tr("Data handling")<<tr("Data extraction")
+			<<tr("Axis and colorbar")<<tr("General setup")<<tr("Axis setup")
+			<<tr("Scale and rotate")<<tr("Program flow")<<tr("Nonlinear fitting")
+			<<tr("Primitives");
+	cmds[0]<<"plot"<<"area"<<"bars"<<"barh"<<"boxplot"<<"chart"<<"error"<<"mark"
+			<<"region"<<"stem"<<"step"<<"tens"<<"textmark"<<"torus"<<"tube";
+	cmds[1]<<"surf"<<"axial"<<"belt"<<"boxs"<<"cont"<<"contd"<<"contf"<<"dens"
+			<<"fall"<<"grid"<<"mesh"<<"tile";
+	cmds[2]<<"surf3"<<"cloud"<<"beam"<<"cont3"<<"conta"<<"contf3"<<"contfa"
+			<<"dens3"<<"densa"<<"grid3"<<"grida";
+	cmds[3]<<"map"<<"stfa"<<"surfa"<<"surfc"<<"tile"<<"surf3a"<<"surf3c";
+	cmds[4]<<"flow"<<"pipe"<<"traj"<<"vect"<<"vectc"<<"vectl"<<"dew";
+	cmds[5]<<"contx"<<"conty"<<"contz"<<"contfx"<<"contfy"<<"contfz"<<"densx"
+			<<"densy"<<"densz"<<"triplot"<<"crust"<<"dots";
+	cmds[6]<<"text"<<"title"<<"fgets"<<"legend"<<"addlegend"<<"clearlegend"	<<"legendbox";
+	cmds[7]<<"new"<<"var"<<"copy"<<"delete"<<"read"<<"readmat"<<"readall"
+			<<"readhdf"<<"save"<<"savehdf"<<"export"<<"import"<<"info"<<"set_id";
+	cmds[8]<<"fill"<<"modify"<<"put"<<"crop"<<"extend"<<"rearrange"<<"squeeze"
+			<<"transpose"<<"cumsum"<<"diff"<<"diff2"<<"envelop"<<"integrate"
+			<<"mirror"<<"norm"<<"normsl"<<"sew"<<"smooth"<<"swap"<<"addto"
+			<<"subto"<<"divto"<<"multo";
+	cmds[9]<<"combine"<<"evaluate"<<"max"<<"min"<<"hist"<<"jacobian"<<"momentum"
+			<<"resize"<<"sum"<<"trace"<<"transform"<<"transforma"<<"stfad"<<"pde"
+			<<"qo2d"<<"ray";
+	cmds[10]<<"axis"<<"box"<<"colorbar"<<"grid"<<"xlabel"<<"ylabel"<<"zlabel"<<"tlabel";
+	cmds[11]<<"alpha"<<"alphadef"<<"transparent"<<"transptype"<<"ambient"<<"light"
+			<<"fog"<<"arrowsize"<<"barwidth"<<"linewidth"<<"marksize"<<"plotfactor"
+			<<"zoom"<<"cut"<<"axialdir"<<"mesgnum"<<"font"<<"palette"<<"rotatetext";
+	cmds[12]<<"axis"<<"ranges"<<"caxis"<<"crange"<<"xrange"<<"yrange"<<"zrange"
+			<<"origin"<<"ternary"<<"adjust"<<"ctick"<<"xtick"<<"ytick"<<"ztick"
+			<<"ticklen"<<"tickstl";
+	cmds[13]<<"subplot"<<"inplot"<<"rotate"<<"aspect"<<"columnplot"<<"perspective";
+	cmds[14]<<"call"<<"chdir"<<"define"<<"if"<<"elseif"<<"else"<<"endif"<<"for"
+			<<"next"<<"once"<<"stop"<<"write"<<"setsize";
+	cmds[15]<<"fit"<<"fits"<<"putsfit";
+	cmds[16]<<"fplot"<<"fsurf"<<"ball"<<"cone"<<"curve"<<"drop"<<"facex"<<"facey"
+			<<"facez"<<"line"<<"rect"<<"sphere";
+}
+//-----------------------------------------------------------------------------
+void NewCmdDialog::typeChanged(int s)
+{
+	if(s<0 || s>16)	return;
+	name->clear();	name->addItems(cmds[s]);	name->setCurrentIndex(0);
+}
+//-----------------------------------------------------------------------------
+void parse(QStringList &sl, const QString &s)
+{
+	sl.clear();
+	int i, ex=0, i1=0;
+	bool op=false, sp=true;
+	for(i=0;i<s.length();i++)
+	{
+		if(s[i].isLetter() || s[i].isNumber() || s[i]=='\'')
+		{	if(sp)	i1=i;	sp = false;	}
+		else
+		{
+			QString p;
+			if(op)	p="_";	else if(ex)	p="+";
+			if(!sp)	sl<<p+s.mid(i1,i-i1);
+			sp = true;
+			if(s[i]=='{')	ex++;
+			if(s[i]=='}')	ex--;
+			if(s[i]=='[')	op=true;
+		}
+	}
+	if(!sp)	sl<<s.mid(i1);
+}
+//-----------------------------------------------------------------------------
+mglCommand *getCmd(const QString &cmd)
+{
+	wchar_t *c = new wchar_t[cmd.length()+1];
+	cmd.toWCharArray(c);	c[cmd.length()]=0;
+	mglCommand *rts = parser.FindCommand(c);
+	if(!rts)	rts = parser.FindCommand(c,true);
+	delete []c;		return rts;
+}
+//-----------------------------------------------------------------------------
+void NewCmdDialog::nameChanged(int s)
+{
+	QString n=name->itemText(s), par, a;
+	QStringList kinds;
+	int k;
+	if(n.isEmpty())	return;
+	// clear old
+	kind->clear();	for(k=0;k<NUM_CH;k++)	argn[k].clear();
+	// try to find the keyword
+	mglCommand *rts=getCmd(n);
+	if(!rts)	return;
+	info->setText(QString::fromWCharArray(rts->desc));
+	QStringList sl;	sl<<pathHelp;	help->setSearchPaths(sl);
+	help->setSource(tr("script_mgl_eng.html")+"#"+n);
+
+	par = QString::fromWCharArray(rts->form);
+	int i0 = par.indexOf(' ');	// first space if present
+	if(i0<0)	{	kind->addItem(par);	return;	}	// no arguments
+	// parse kind of arguments
+	par = par.mid(i0);
+	for(k=0;k<NUM_CH;k++)
+	{
+		a = par.section('|',k,k);
+		if(a.isEmpty())	break;
+		a=a.trimmed();
+		kinds<<n+" "+a;
+		parse(argn[k],a);
+	}
+	kind->addItems(kinds);	kind->setCurrentIndex(0);
+}
+//-----------------------------------------------------------------------------
+void NewCmdDialog::kindChanged(int s)
+{
+	if(s<0 || s>NUM_CH-1)	return;
+	cmd="";
+	int nn = argn[s].count();
+//return;
+	args->setRowCount(nn);	args->setColumnCount(2);
+	QTableWidgetItem *it;
+	QString a;
+	QFont f;
+	bool optional;
+	for(int i=0;i<nn;i++)
+	{
+		it = new QTableWidgetItem;	args->setItem(i,0,it);
+		it = new QTableWidgetItem;	args->setItem(i,1,it);
+		a = argn[s].at(i);
+		optional = (a[0]=='_' || a[0]=='+');	if(optional)	a=a.mid(1);
+		f.setItalic(a[0].isUpper());	f.setBold(!optional);
+		args->item(i,0)->setText(a);	args->item(i,0)->setFont(f);
+		args->item(i,0)->setFlags(Qt::ItemIsEnabled);
+		args->item(i,1)->setFlags(Qt::ItemIsEditable|Qt::ItemIsEnabled);
+	}
+}
+//-----------------------------------------------------------------------------
+void NewCmdDialog::insertData()	{}	// TODO !!!
+//-----------------------------------------------------------------------------
+void NewCmdDialog::insertOpt()
+{	if(optDialog->exec())	opt->setText(optDialog->getOption());	}
+//-----------------------------------------------------------------------------
+void NewCmdDialog::insertStl()
+{
+	int s=kind->currentIndex();
+	if(s<0 || s>4)
+	{	QMessageBox::warning(this,tr("New command"),
+			tr("Select first the proper kind of arguments"));
+		return;	}
+	if(!argn[s].contains("'fmt'") && !argn[s].contains("_'fmt'"))
+	{	QMessageBox::warning(this,tr("New command"),
+			tr("There is no 'fmt' argument for this command"));
+		return;	}
+	int i;
+	i = argn[s].indexOf("'fmt'");
+	if(i<0)	i = argn[s].indexOf("_'fmt'");
+	if(!stlDialog->exec())	return;
+	args->item(i,1)->setText(stlDialog->getStyle());
+}
+//-----------------------------------------------------------------------------
+void NewCmdDialog::finish()
+{
+	QString txt,cur;
+	int s = kind->currentIndex();
+	if(s<0 || s>4)
+	{	QMessageBox::warning(this,tr("New command"),
+			tr("Select first the proper kind of arguments"));
+		cmd="";	return;	}
+	cmd = name->currentText();
+	int n = argn[s].count(), i;
+	bool op=false;
+	for(i=0;i<n;i++)
+	{
+		cur = argn[s].at(i);
+		txt = args->item(i,1)->text();
+		if(txt.isEmpty())
+		{
+			if(cur[0]!='_' && cur[0]!='+')
+			{	QMessageBox::warning(this,tr("New command"),
+					tr("You should specify required argument ")+cur);
+				cmd="";	return;	}
+			if(argn[s].at(i)[0]=='_')	op = true;
+		}
+		else
+		{
+			if(cur[0]=='\'' && txt[0]!='\'')
+			{	QMessageBox::warning(this,tr("New command"),
+					tr("You should put text inside ' ' for argument ")+cur);
+				cmd="";	return;	}
+			if(cur[1]=='\'' && txt[0]!='\'')
+			{	QMessageBox::warning(this,tr("New command"),
+					tr("You should put text inside ' ' for argument ")+cur.mid(1));
+				cmd="";	return;	}
+			if(cur[0]=='_' && op)
+			{	QMessageBox::warning(this,tr("New command"),
+					tr("You should specify all optional arguments before ")+cur.mid(1));
+				cmd="";	return;	}
+			cmd = cmd + ' ' + txt;
+		}
+	}
+	cmd = cmd + opt->text();	accept();
+}
+//-----------------------------------------------------------------------------
diff --git a/src/styledialog.h b/src/newcmddialog.h
similarity index 71%
copy from src/styledialog.h
copy to src/newcmddialog.h
index a7c2ce3..ec22507 100644
--- a/src/styledialog.h
+++ b/src/newcmddialog.h
@@ -17,45 +17,49 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#ifndef STYLEDIALOG_H
-#define STYLEDIALOG_H
+#ifndef NEWCMDDIALOG_H
+#define NEWCMDDIALOG_H
 //-----------------------------------------------------------------------------
-#include <qdialog.h>
+#include <QDialog>
+#include <QStringList>
+#define NUM_CH	16		// number of argument sets for a command
 class QComboBox;
-class QSlider;
-class QSpinBox;
-class QGroupBox;
-class QTabWidget;
-class QCheckBox;
 class QLabel;
 class QLineEdit;
-class QRadioButton;
+class QTableWidget;
+class QTextBrowser;
+class OptionDialog;
+class StyleDialog;
 //-----------------------------------------------------------------------------
-/// Selecting styles of command (like line style, color scheme, font style, axis style)
-class StyleDialog : public QDialog
+class NewCmdDialog : public QDialog
 {
 Q_OBJECT
 public:
-	QString getStyle()	{	return result;	};
-	StyleDialog(QWidget *parent = 0);
-	~StyleDialog();
+	NewCmdDialog(QWidget *p);
+	const QString &getCommand()	{	return cmd;	};
+
 private slots:
-	void updatePic();
+	void typeChanged(int);
+	void nameChanged(int);
+	void kindChanged(int);
+	void insertData();
+	void insertOpt();
+	void insertStl();
+	void finish();
+
 private:
-	QString result;
-	QComboBox *cc[8], *cline, *cfont;
-	QSlider *nn[8];
-	QComboBox *axial, *ctext, *a1, *a2, *dash, *mark;
-	QCheckBox *swire, *coor, *upd;
-	QCheckBox *ital, *bold, *wire, *uline, *oline;
-	QSpinBox *width;
-	QGroupBox *align;
-	QTabWidget *tab;
-	QLabel *box, *pic;
-	QLineEdit *res;
-	QRadioButton *rbL, *rbC, *rbR;
-	uchar *grBuf;
+	QTextBrowser *help;
+	QComboBox *type, *name, *kind;
+	QLineEdit *opt;
+	QLabel *info;
+	QTableWidget *args;
+	QString cmd;
+	QStringList types, cmds[17], argn[NUM_CH];
+	OptionDialog *optDialog;
+	StyleDialog *stlDialog;
+
+	void fillList();
 };
 //-----------------------------------------------------------------------------
-#endif
+#endif // NEWCMDDIALOG_H
 //-----------------------------------------------------------------------------
diff --git a/src/optiondialog.cpp b/src/optiondialog.cpp
index 0d91989..1261deb 100644
--- a/src/optiondialog.cpp
+++ b/src/optiondialog.cpp
@@ -17,14 +17,17 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#include <qpushbutton.h>
-#include <qmessagebox.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-//-----------------------------------------------------------------------------
+#include <QPushButton>
+#include <QMessageBox>
+#include <QLineEdit>
+#include <QComboBox>
+#include <QLayout>
+#include <QLabel>
+#include <QRadioButton>
+#include <mgl/mgl_parse.h>
 #include "optiondialog.h"
+int numDataOpened=0;
+extern mglParse parser;
 //-----------------------------------------------------------------------------
 OptionDialog::OptionDialog(QWidget *parent) : QDialog(parent)
 {
@@ -71,9 +74,7 @@ OptionDialog::OptionDialog(QWidget *parent) : QDialog(parent)
 	b->setDefault(true);
 }
 //-----------------------------------------------------------------------------
-OptionDialog::~OptionDialog()
-{
-}
+OptionDialog::~OptionDialog()	{}
 //-----------------------------------------------------------------------------
 void OptionDialog::prepareResult()
 {
@@ -116,3 +117,90 @@ void OptionDialog::prepareResult()
 	accept();
 }
 //-----------------------------------------------------------------------------
+DataOpenDialog::DataOpenDialog(QWidget *parent) : QDialog(parent)
+{
+	setWindowTitle(tr("UDAV - Open data file"));
+	QHBoxLayout *a;
+	QLabel *l;
+	QPushButton *b;
+	QVBoxLayout *o=new QVBoxLayout(this);
+
+	a = new QHBoxLayout;	o->addLayout(a);
+	l = new QLabel(tr("Data name"));	a->addWidget(l);
+	char buf[32];	sprintf(buf,"mgl_%d",numDataOpened);
+	name = new QLineEdit(buf,this);		a->addWidget(name);
+
+	rA = new QRadioButton(tr("Auto detect data sizes"), this);
+	rA->setChecked(true);	o->addWidget(rA);
+	rM = new QRadioButton(tr("Set data sizes manually"), this);
+	o->addWidget(rM);	a = new QHBoxLayout;	o->addLayout(a);
+	l = new QLabel(tr("Nx"));	a->addWidget(l);
+	nx = new QLineEdit("1",this);	a->addWidget(nx);
+	l = new QLabel(tr("Ny"));	a->addWidget(l);
+	ny = new QLineEdit("1",this);	a->addWidget(ny);
+	l = new QLabel(tr("Nz"));	a->addWidget(l);
+	nz = new QLineEdit("1",this);	a->addWidget(nz);
+	r2 = new QRadioButton(tr("Matrix with sizes from file"), this);	o->addWidget(r2);
+	r3 = new QRadioButton(tr("3D data with sizes from file"), this);o->addWidget(r3);
+
+	a = new QHBoxLayout;	o->addLayout(a);
+	b = new QPushButton(tr("Cancel"),this);	a->addWidget(b);
+	connect(b,SIGNAL(clicked()),this,SLOT(reject()));
+	b = new QPushButton(tr("OK"), this);	a->addWidget(b);
+	connect(b, SIGNAL(clicked()),this, SLOT(prepareResult()));
+	b->setDefault(true);
+}
+//-----------------------------------------------------------------------------
+DataOpenDialog::~DataOpenDialog(){}
+//-----------------------------------------------------------------------------
+void DataOpenDialog::prepareResult()
+{
+	code = "";	numDataOpened++;	data = name->text();
+	// prepare unique value of name for next time
+	char buf[32];	sprintf(buf,"mgl_%d",numDataOpened);	name->setText(buf);
+	mglVar *v = parser.AddVar(data.toAscii());
+	if(rA->isChecked())	//	auto sizes
+	{
+		setlocale(LC_ALL, "C");	v->d.Read(file.toAscii().constData());	setlocale(LC_ALL, "");
+		if(v->d.nz>1)
+			code=QString("#read %1 '%2'\nrotate 40 60\ncrange %1:box\nsurf3 %1\n").arg(data).arg(file);
+		else if(v->d.ny>1)
+			code=QString("#read %1 '%2'\nrotate 40 60\ncrange %1:zrange %1:box\nsurf %1\n").arg(data).arg(file);
+		else
+			code=QString("#read %1 '%2'\nyrange %1:box\nplot %1\n").arg(data).arg(file);
+	}
+	else if(rM->isChecked())	//	manual sizes
+	{
+		int x=nx->text().toInt(), y=ny->text().toInt(), z=nz->text().toInt();
+		setlocale(LC_ALL, "C");	v->d.Read(file.toAscii().constData(),x,y,z);	setlocale(LC_ALL, "");
+		if(v->d.nz>1)
+			code=QString("#read %1 '%2' %3 %4 %5\nrotate 40 60\ncrange %1:box\nsurf3 %1\n")
+						.arg(data).arg(file).arg(x).arg(y).arg(z);
+		else if(v->d.ny>1)
+			code=QString("#read %1 '%2' %3 %4 %5\nrotate 40 60\ncrange %1:zrange %1:box\nsurf %1\n")
+						.arg(data).arg(file).arg(x).arg(y).arg(z);
+		else
+			code=QString("#read %1 '%2' %3 %4 %5\nyrange %1:box\nplot %1\n")
+						.arg(data).arg(file).arg(x).arg(y).arg(z);
+	}
+	else if(r2->isChecked())	//	matrix
+	{
+		setlocale(LC_ALL, "C");	v->d.ReadMat(file.toAscii().constData());	setlocale(LC_ALL, "");
+		code=QString("#readmat %1 '%2'\nrotate 40 60\ncrange %1:zrange %1:box\nsurf %1\n").arg(data).arg(file);
+	}
+	else if(r3->isChecked())	//	3d-data
+	{
+		setlocale(LC_ALL, "C");	v->d.ReadMat(file.toAscii().constData(),3);	setlocale(LC_ALL, "");
+		code=QString("#readmat %1 '%2' 3\nrotate 40 60\ncrange %1:box\nsurf3 %1\n").arg(data).arg(file);
+	}
+	accept();
+}
+//-----------------------------------------------------------------------------
+void DataOpenDialog::setFile(const QString &fname)
+{
+	file=fname;
+	mglData d(file.toAscii().constData());
+	rA->setText(tr("Auto detect data sizes (%1 x %2 x %3)")
+				.arg(d.nx).arg(d.ny).arg(d.nz));
+}
+//-----------------------------------------------------------------------------
diff --git a/src/optiondialog.h b/src/optiondialog.h
index 75d1ad2..c6cf945 100644
--- a/src/optiondialog.h
+++ b/src/optiondialog.h
@@ -20,9 +20,10 @@
 #ifndef OPTIONDIALOG_H
 #define OPTIONDIALOG_H
 //-----------------------------------------------------------------------------
-#include <qdialog.h>
+#include <QDialog>
 class QLineEdit;
 class QComboBox;
+class QRadioButton;
 //-----------------------------------------------------------------------------
 /// Dialog for selecting command options
 class OptionDialog : public QDialog
@@ -42,5 +43,23 @@ private:
 	QComboBox *cut;
 };
 //-----------------------------------------------------------------------------
+/// Dialog for selecting command options
+class DataOpenDialog : public QDialog
+{
+Q_OBJECT
+public:
+	DataOpenDialog(QWidget *parent=0);
+	~DataOpenDialog();
+	inline const QString getCode()	{	return code;	};
+	inline const QString getName()	{	return data;	};
+	void setFile(const QString &fname);
+private slots:
+	void prepareResult();
+private:
+	QString code, data, file;
+	QLineEdit *nx, *ny, *nz, *name;
+	QRadioButton *rA, *rM, *r2, *r3;
+};
+//-----------------------------------------------------------------------------
 #endif
 //-----------------------------------------------------------------------------
diff --git a/src/propdialog.cpp b/src/propdialog.cpp
index bf6d4cd..70e7fa5 100644
--- a/src/propdialog.cpp
+++ b/src/propdialog.cpp
@@ -17,18 +17,23 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#include <qapplication.h>
-#include <qpushbutton.h>
-#include <qmessagebox.h>
-#include <qcheckbox.h>
-#include <qbuttongroup.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qcolordialog.h>
-#include <qfontdialog.h>
+#include <QApplication>
+#include <QPushButton>
+#include <QMessageBox>
+#include <QCheckBox>
+#include <QButtonGroup>
+#include <QLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QColorDialog>
+#include <QFontDialog>
+#include <QFileDialog>
+#include <QComboBox>
+#include <QSettings>
 //-----------------------------------------------------------------------------
 #include "scriptwindow.h"
+#include "helpwindow.h"
+#include "graphwindow.h"
 #include "propdialog.h"
 //-----------------------------------------------------------------------------
 extern QColor mglColorScheme[9];
@@ -39,7 +44,9 @@ extern bool mglAutoExecute;
 extern bool mglAutoSave;
 extern bool editPosBottom;
 extern bool loadInNewWnd;
+int defWidth, defHeight;
 QString pathFont;
+QString lang[]={"","ru"};
 //-----------------------------------------------------------------------------
 PropDialog::PropDialog(QWidget *parent) : QDialog(parent)
 {
@@ -51,7 +58,7 @@ PropDialog::PropDialog(QWidget *parent) : QDialog(parent)
 
 	v = new QVBoxLayout(this);
 	h = new QHBoxLayout();		v->addLayout(h);
-	lbl = new QLabel(tr("Select font"), this);	h->addWidget(lbl);
+	lbl = new QLabel(tr("Current font"), this);	h->addWidget(lbl);
 	lbl->setFont(QFont(defFontFamily, defFontSize));
 	h->addStretch(1);	defFont = QFont(defFontFamily, defFontSize);
 	b = new QPushButton(tr("Change font"), this);	h->addWidget(b);
@@ -91,9 +98,35 @@ PropDialog::PropDialog(QWidget *parent) : QDialog(parent)
 	g->addWidget(cb[7], 2, 1);
 
 	l = new QLabel(tr("Path for help files"), this);	v->addWidget(l);
-	hlp = new QLineEdit(pathHelp, this);	v->addWidget(hlp);
+	h = new QHBoxLayout();		v->addLayout(h);
+	hlp = new QLineEdit(pathHelp, this);	h->addWidget(hlp,1);
+	b = new QPushButton("...", this);		h->addWidget(b,0);
+	connect(b,SIGNAL(clicked()),this,SLOT(getPathH()));
 	l = new QLabel(tr("Path for user MathGL font files"), this);	v->addWidget(l);
-	fnt = new QLineEdit(pathFont, this);	v->addWidget(fnt);
+	h = new QHBoxLayout();		v->addLayout(h);
+	fnt = new QLineEdit(pathFont, this);	h->addWidget(fnt,1);
+	b = new QPushButton("...", this);		h->addWidget(b,0);
+	connect(b,SIGNAL(clicked()),this,SLOT(getPathF()));
+	h = new QHBoxLayout();		v->addLayout(h);
+	l = new QLabel(tr("Language for UDAV"), this);	h->addWidget(l,0);
+	lng = new QComboBox(this);		h->addWidget(lng,1);
+	lng->addItem(tr("English"));	lng->addItem(tr("Russian"));
+
+	QSettings settings("abalakin","UDAV");
+	settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV");
+	settings.beginGroup("/UDAV");
+	QString prev = settings.value("/udavLang", "").toString();
+	if(prev==lang[1])	lng->setCurrentIndex(1);
+	defWidth = settings.value("/defWidth", 640).toInt();
+	defHeight = settings.value("/defHeight", 480).toInt();
+	settings.endGroup();
+
+	h = new QHBoxLayout();		v->addLayout(h);
+	l = new QLabel(tr("Image size"), this);	h->addWidget(l,0);
+	defW = new QLineEdit(QString::number(defWidth),this);	h->addWidget(defW,1);
+	l = new QLabel("x", this);	h->addWidget(l,0);
+	defH = new QLineEdit(QString::number(defHeight),this);	h->addWidget(defH,1);
+
 	run = new QCheckBox(tr("Automatically execute script after loading"), this);
 	run->setChecked(mglAutoExecute);	v->addWidget(run);
 	edt = new QCheckBox(tr("Place editor at top"), this);
@@ -132,6 +165,21 @@ void PropDialog::setC7()	{	setC(7);	}
 //-----------------------------------------------------------------------------
 void PropDialog::setC8()	{	setC(8);	}
 //-----------------------------------------------------------------------------
+void PropDialog::getPathH()
+{
+	QString str = QFileDialog::getExistingDirectory(this,
+				tr("UDAV - Insert filename"), hlp->text());
+	if(!str.isEmpty())	hlp->setText(str+'/');
+}
+//-----------------------------------------------------------------------------
+void PropDialog::getPathF()
+{
+	QString str = QFileDialog::getOpenFileName(this, tr("UDAV - Insert filename"),
+					fnt->text(), tr("Font files (*.vfm)"));
+//	if(str.contains(".vfm"))	str = str.left(str.length()-4);
+	if(!str.isEmpty())	fnt->setText(str);
+}
+//-----------------------------------------------------------------------------
 void PropDialog::setC(int k)
 {
 	if(k<0 || k>8)	return;
@@ -165,6 +213,9 @@ void PropDialog::applyChanges()
 	mglAutoSave = save->isChecked();
 
 	// apply changes for all windows
+#ifdef WIN32
+	pathFont = pathFont.replace('/','\\');
+#endif
 	bool ok=true;
 	foreach(QWidget *w, QApplication::topLevelWidgets())
 	{
@@ -173,11 +224,35 @@ void PropDialog::applyChanges()
 			ScriptWindow *s = (ScriptWindow *)w;
 			if(ok)	{	s->writeSettings();	ok = false;	}
 			s->setEditorFont();
-			s->setMGLFont(pathFont);
+			s->hlp->setPath(pathHelp);
+			if(s->hlp->isActiveWindow())	s->hlp->showHelp();
+			s->graph->setMGLFont(pathFont);
 			s->setEditPos(editPosBottom);
 			s->update();
 		}
 	}
+
+	if(defWidth!=defW->text().toInt() || defHeight!=defH->text().toInt())
+	{
+		defWidth = defW->text().toInt();
+		defHeight = defH->text().toInt();
+		sizeChanged(defWidth, defHeight);
+	}
+
+	QSettings settings("abalakin","UDAV");
+	settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV");
+	settings.beginGroup("/UDAV");
+	QString prev = settings.value("/udavLang", "").toString();
+	int cur=lng->currentIndex();
+	if(cur>=0 && prev!=lang[cur])
+	{
+		settings.setValue("/udavLang", lang[lng->currentIndex()]);
+		QMessageBox::critical(this,tr("UDAV - Properties"),tr("You have to restart UDAV for applying the cahnges."));
+	}
+	settings.setValue("/defWidth", defWidth);
+	settings.setValue("/defHeight", defHeight);
+	settings.endGroup();
+
 	accept();
 }
 //-----------------------------------------------------------------------------
diff --git a/src/propdialog.h b/src/propdialog.h
index 4478070..8442b0d 100644
--- a/src/propdialog.h
+++ b/src/propdialog.h
@@ -25,6 +25,7 @@ class QLabel;
 class QPushButton;
 class QCheckBox;
 class QLineEdit;
+class QComboBox;
 //-----------------------------------------------------------------------------
 /// Set UDAV general properties
 class PropDialog : public QDialog
@@ -33,6 +34,8 @@ Q_OBJECT
 public:
 	PropDialog(QWidget *parent = 0);
 	~PropDialog();
+signals:
+	void sizeChanged(int w, int h);
 private slots:
 	void applyChanges();
 	void setC0();
@@ -45,15 +48,17 @@ private slots:
 	void setC7();
 	void setC8();
 	void setF();
+	void getPathH();
+	void getPathF();
 private:
 	void setC(int k);
 	QLabel *lbl;
 	QPushButton *cb[9];
 	QCheckBox *run, *edt, *load, *save;
-	QLineEdit *hlp;
-	QLineEdit *fnt;
+	QLineEdit *hlp, *fnt, *defW, *defH;
 	QFont defFont;
 	QColor cc[9];
+	QComboBox *lng;
 };
 //-----------------------------------------------------------------------------
 #endif
diff --git a/src/qmglcanvas.cpp b/src/qmglcanvas.cpp
index eb37982..ee247b2 100644
--- a/src/qmglcanvas.cpp
+++ b/src/qmglcanvas.cpp
@@ -18,16 +18,16 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-#include <qapplication.h>
+#include <QApplication>
 #include <QMouseEvent>
-#include <qmessagebox.h>
-#include <qmenu.h>
-#include <qclipboard.h>
-#include <qtextedit.h>
-#include <qpainter.h>
-#include <qcursor.h>
-#include <qimage.h>
-//#include <QLocale>
+#include <QMessageBox>
+#include <QMenu>
+#include <QClipboard>
+#include <QTextEdit>
+#include <QPainter>
+#include <QCursor>
+#include <QImage>
+#include <QFileInfo>
 #include <stdio.h>
 #include <mgl/mgl_parse.h>
 #include <mgl/mgl_idtf.h>
@@ -43,7 +43,7 @@ QMGLCanvas::QMGLCanvas(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f)
 	popup = 0;		grBuf = 0;
 	phi = tet = per = 0;
 	x1 = y1 = 0;	x2 = y2 = 1;
-	alpha = light = zoom = rotate = false;
+	alpha = light = zoom = rotate = grid = false;
 	resize(graph->GetWidth(), graph->GetHeight());
 	convertFromGraph(pic, graph, &grBuf);
 	thr = new MGLThread();	thr->cnv = this;
@@ -58,6 +58,18 @@ void QMGLCanvas::paintEvent(QPaintEvent *)
 	paint.begin(this);
 	paint.drawPixmap(0,0,pic);
 	if(zoom)	paint.drawRect(x0,y0,xe-x0,ye-y0);
+	else if(grid)
+	{
+		int i, h=pic.height(), w=pic.width();
+		paint.setPen(QColor(192,192,192));
+		for(i=1;i<10;i++)
+		{
+			paint.drawText(0,i*h/10,QString::number(1-i*0.1));
+			paint.drawLine(0,i*h/10,w,i*h/10);
+			paint.drawText(i*w/10,h,QString::number(i*0.1));
+			paint.drawLine(i*w/10,0,i*w/10,h);
+		}
+	}
 	paint.end();
 }
 //-----------------------------------------------------------------------------
@@ -74,12 +86,17 @@ void QMGLCanvas::setPer(int p)
 	{	per = 100*p;	emit perChanged(p);	execute();	}
 }
 //-----------------------------------------------------------------------------
+void QMGLCanvas::imgSize(int w, int h)	{	graph->SetSize(w,h);	execute();	}
+//-----------------------------------------------------------------------------
 void QMGLCanvas::setPhi(int p)
 {	if(phi!=p)	{	phi = p;	emit phiChanged(p);	execute();	}	}
 //-----------------------------------------------------------------------------
 void QMGLCanvas::setTet(int t)
 {	if(tet!=t)	{	tet = t;	emit tetChanged(t);	execute();	}	}
 //-----------------------------------------------------------------------------
+void QMGLCanvas::setGrid(bool a)
+{	if(grid!=a)		{	grid = a;	emit gridChanged(a);	execute();	}	}
+//-----------------------------------------------------------------------------
 void QMGLCanvas::setAlpha(bool a)
 {	if(alpha!=a)	{	alpha = a;	emit alphaChanged(a);	execute();	}	}
 //-----------------------------------------------------------------------------
@@ -102,7 +119,8 @@ void QMGLCanvas::setRotate(bool r)
 	{
 		zoom=false;	rotate=r;
 		emit zoomChanged(false);	emit rotateChanged(r);
-		execute();	}
+		execute();
+	}
 }
 //-----------------------------------------------------------------------------
 void QMGLCanvas::shiftDown()
@@ -141,7 +159,7 @@ void QMGLCanvas::zoomOut()
 	execute();
 }
 //-----------------------------------------------------------------------------
-void QMGLCanvas::execute(mglGraph *gr)
+void QMGLCanvas::execute(mglGraphAB *gr)
 {
 	if(!textMGL && autoResize)	{	run(defText, false, gr);	return;	}
 	else if(!textMGL)	return;
@@ -150,7 +168,7 @@ void QMGLCanvas::execute(mglGraph *gr)
 	if(pic.size()!=size())	setSize(pic.width(), pic.height());
 }
 //-----------------------------------------------------------------------------
-QString QMGLCanvas::run(const QString &text, bool showm, mglGraph *gr)
+QString QMGLCanvas::run(const QString &text, bool showm, mglGraphAB *gr)
 {
 	defText = text;
 	if(gr==0)	gr=graph;
@@ -196,7 +214,7 @@ void MGLThread::run()
 	{
 		cur = text.section('\n',i,i);
 		r = cur.toWCharArray(str);	str[r] = 0;
-		gr->Message[0] = 0;			r = 0;
+		gr->Message[0] = 0;			gr->ObjId = i+1;
 		setlocale(LC_ALL, "C");
 		r = parser.Parse(gr,str,i+1);
 		setlocale(LC_ALL, "");
@@ -210,28 +228,33 @@ void MGLThread::run()
 			if(r==4)	mes += tr(" -- unbalanced ' :\t");
 			mes += cur;
 			warn += mes + "\n";
-//			cnv->showMess(mes);
 		}
 		if(gr->Message && gr->Message[0]!=0)
 		{
-			mes = tr("In line ")+QString::number(i)+tr(" -- warning:\t");
+			mes = tr("In line ")+QString::number(i)+tr(" :\t");
 			mes = mes + cur + "\n" + QString(gr->Message) + "\n";
 			warn += mes + "\n";
-//			cnv->showMess(mes);
 		}
 	}
 	mes = QString(gr->Message);
 	gr->Message=0;	delete []buf;	delete []str;
 }
 //-----------------------------------------------------------------------------
+void QMGLCanvas::mouseDoubleClickEvent(QMouseEvent *ev)
+{
+	int oi = graph->OI[ev->x()+graph->GetWidth()*ev->y()]-1;
+	emit objChanged(oi);
+}
+//-----------------------------------------------------------------------------
 void QMGLCanvas::mousePressEvent(QMouseEvent *ev)
 {
 	if(!zoom && !rotate && ev->button()&Qt::LeftButton)
 	{
 		mglPoint p = graph->CalcXYZ(ev->x(), ev->y());
-		QString str;
-		str.sprintf("x=%g, y=%g, z=%g",p.x,p.y,p.z);
-		emit posChanged(str);
+		clickPos.sprintf("x=%g, y=%g, z=%g  --  Xabs=%g, Yabs=%g",
+					p.x,p.y,p.z,double(ev->x())/graph->GetWidth(),
+					1-double(ev->y())/graph->GetHeight());
+		emit posChanged(clickPos);
 	}
 	xe=x0=ev->x();	ye=y0=ev->y();
 	ev->accept();
@@ -308,6 +331,18 @@ QString setExtension(QString &fname, const char *ext)
 	return oname;
 }
 //-----------------------------------------------------------------------------
+void QMGLCanvas::startGIF(int animDelay, QString fname)
+{	if(fname.isEmpty())	fname = scriptName;
+	if(fname.isEmpty())	QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0);
+	else
+	{
+		graph->StartGIF(setExtension(fname,"gif").toAscii(), animDelay);
+		graph->ResetFrames();
+	}
+}
+//-----------------------------------------------------------------------------
+void QMGLCanvas::closeGIF()		{	graph->CloseGIF();	}
+//-----------------------------------------------------------------------------
 void QMGLCanvas::exportGIF(QString fname)
 {	if(fname.isEmpty())	fname = scriptName;
 	if(fname.isEmpty())	QMessageBox::critical(this, appName, tr("No filename. Please save script first."),QMessageBox::Ok,0,0);
@@ -452,17 +487,22 @@ void convertFromGraph(QPixmap &pic, mglGraphAB *gr, uchar **buf)
 }
 //-----------------------------------------------------------------------------
 void QMGLCanvas::copy()
-{
-	QClipboard *cb = QApplication::clipboard();
-	cb->setPixmap(pic, QClipboard::Clipboard);
-}
+{	QApplication::clipboard()->setPixmap(pic, QClipboard::Clipboard);	}
+//-----------------------------------------------------------------------------
+void QMGLCanvas::copyClickCoor()
+{	QApplication::clipboard()->setText(clickPos);	}
 //-----------------------------------------------------------------------------
 void QMGLCanvas::setMGLFont(QString path)
 {
 	if(path.isEmpty())	graph->GetFont()->Restore();
-	else	graph->GetFont()->Load(path.toAscii());
+	else
+	{
+		QFileInfo fi(path);
+		graph->GetFont()->Load(fi.baseName().toAscii(), fi.path().toAscii());
+	}
+	execute();
 }
 //-----------------------------------------------------------------------------
 void QMGLCanvas::setSize(int w, int h)
-{	graph->SetSize(w,h);	resize(w, h);	execute();	};
+{	graph->SetSize(w,h);	resize(w, h);	execute();	}
 //-----------------------------------------------------------------------------
diff --git a/src/qmglcanvas.h b/src/qmglcanvas.h
index 57dc0b9..b2b5d6c 100644
--- a/src/qmglcanvas.h
+++ b/src/qmglcanvas.h
@@ -31,9 +31,10 @@ class QMGLCanvas;
 class MGLThread : public QThread
 {
 friend class QMGLCanvas;
+Q_OBJECT
 protected:
 	QMGLCanvas *cnv;
-	mglGraph *gr;
+	mglGraphAB *gr;
 	QString mes;	///< gr->Message after execution
 	QString text;	///< text for parsing
 	QString warn;
@@ -58,21 +59,24 @@ public:
 	double getRatio()	{	return double(graph->GetWidth())/graph->GetHeight();	};
 	void setPopup(QMenu *p)	{	popup = p;	};
 	void setSize(int w, int h);
-	QString run(const QString &text, bool showm=true, mglGraph *gr=0);	///< Execute script from string
+	QString run(const QString &text, bool showm=true, mglGraphAB *gr=0);	///< Execute script from string
 //	void showMess(const QString &mes);
 signals:
 	void refreshData();
 public slots:
-	void execute(mglGraph *gr=0);	///< Execute script (and update picture)
+	void execute(mglGraphAB *gr=0);	///< Execute script (and update picture)
 	void copy();			///< copy graphics to clipboard
+	void copyClickCoor();	///< copy click coordinates to clipboard
 	void stop();			///< Stop execution
 	void setPer(int p);		///< Set perspective value
 	void setPhi(int p);		///< Set Phi-angle value
 	void setTet(int t);		///< Set Theta-angle value
+	void setGrid(bool a);	///< Switch on/off grid of absolute coor
 	void setAlpha(bool a);	///< Switch on/off transparency
 	void setLight(bool l);	///< Switch on/off lightning
 	void setZoom(bool z);	///< Switch on/off mouse zooming
 	void setRotate(bool r);	///< Switch on/off mouse rotation
+	void imgSize(int w, int h);	///< Set image size
 	void zoomIn();			///< Zoom in graphics
 	void zoomOut();			///< Zoom out graphics
 	void restore();			///< Restore zoom and rotation to default values
@@ -91,33 +95,40 @@ public slots:
 	void exportCPP(QString fname="");	///< export to CPP file
 	void exportIDTF(QString fname="");	///< export to IDTF file
 	void setMGLFont(QString path);		///< restore/load font for graphics
+	void startGIF(int animDelay=500, QString fname="");
+	void closeGIF();
 signals:
 	void phiChanged(int);
 	void tetChanged(int);
 	void perChanged(int);
+	void zoomChanged(bool);
+	void gridChanged(bool);
 	void alphaChanged(bool);
 	void lightChanged(bool);
-	void zoomChanged(bool);
 	void rotateChanged(bool);
 	void posChanged(QString message);	///< user click to show mouse position
+	void objChanged(int objId);			///< User double-click to select object/line
 protected:
 	void paintEvent(QPaintEvent *);
 	void resizeEvent(QResizeEvent *);
 	void mousePressEvent(QMouseEvent *);
 	void mouseReleaseEvent(QMouseEvent *);
 	void mouseMoveEvent(QMouseEvent *);
+	void mouseDoubleClickEvent(QMouseEvent *);
 
 	MGLThread *thr;		///< Thread for making picture
 	QPixmap pic;		///< Pixmap for drawing (changed by update)
 	double tet, phi;	///< Rotation angles
 	double per;			///< Value of perspective ( must be in [0,1) )
+	bool grid;			///< Grid state
 	bool alpha;			///< Transparency state
 	bool light;			///< Lightning state
 	bool zoom;			///< Mouse zoom state
 	bool rotate;		///< Mouse rotation state
 	float x1,x2,y1,y2;	///< Zoom in region
 	bool showMessage;	///< Flag for showing messages (enabled by each execute())
-	QMenu *popup;	///< Pointer to pop-up menu
+	QMenu *popup;		///< Pointer to pop-up menu
+	QString clickPos;	///< Position of last mouse click
 private:
 	int x0, y0, xe, ye;		///< Temporary variables for mouse
 	uchar *grBuf;
diff --git a/src/qmglsyntax.cpp b/src/qmglsyntax.cpp
index 411a94e..6b0a8e3 100644
--- a/src/qmglsyntax.cpp
+++ b/src/qmglsyntax.cpp
@@ -17,6 +17,9 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
+#include <QPushButton>
+#include <QLabel>
+#include <QLayout>
 #include "qmglsyntax.h"
 #include <mgl/mgl_parse.h>
 mglParse parser;
@@ -24,17 +27,17 @@ int mgl_cmd_cmp(const void *a, const void *b);
 // comment string keyword option suffix number
 QColor mglColorScheme[9] = {QColor(0,127,0), QColor(255,0,0), QColor(0,0,127), QColor(127,0,0), QColor(127,0,0), QColor(0,0,255), QColor(127,0,127), QColor(0,127,127), QColor(0,0,127)};
 //-----------------------------------------------------------------------------
-QMGLSyntax::QMGLSyntax(QTextEdit *textEdit) : QSyntaxHighlighter(textEdit)
-{}
+QMGLSyntax::QMGLSyntax(QTextEdit *textEdit) : QSyntaxHighlighter(textEdit)	{}
 //-----------------------------------------------------------------------------
 void QMGLSyntax::highlightBlock(const QString &text)
 {
-	register int i, j, n, m = text.length();
+	register int i, j, n, m = text.length(),s=0;
 	for(n=0;parser.Cmd[n].name[0];n++){};	// determine the number of symbols in parser
 	bool arg = false, nl = true;
 	QString num("+-.0123456789:");
 	for(i=0;i<m;i++)				// highlight paragraph
 	{
+		if(text[i]=='(')	s++;	if(text[i]==')')	s--;
 		if(text[i]==' ' || text[i]=='\t')	continue;
 		else if(text[i]=='#')	// comment
 		{	setFormat(i,m-i,mglColorScheme[0]);	break;	}
@@ -46,24 +49,17 @@ void QMGLSyntax::highlightBlock(const QString &text)
 		}
 		else if(nl)				// keyword
 		{
-			mglCommand tst, *rts;
 			wchar_t *s = new wchar_t[m+1];
-			for(j=i;j<text.length() && !text[j].isSpace();j++)
+			for(j=i;j<text.length() && !text[j].isSpace() && text[j]!=':';j++)
 				s[j-i] = text[j].toLatin1();
-			s[j-i]=0;		tst.name = s;
-			rts = (mglCommand *)bsearch(&tst, parser.Cmd, n, sizeof(mglCommand), mgl_cmd_cmp);
-			if(rts)
-				setFormat(i,j-i+1,rts->create ? mglColorScheme[6]:mglColorScheme[2]);
+			s[j-i]=0;
+			mglCommand *rts = parser.FindCommand(s);
+			if(rts)	setFormat(i,j-i+1,rts->create ? mglColorScheme[6]:mglColorScheme[2]);
+			if(parser.FindCommand(s,true))	setFormat(i,j-i+1,mglColorScheme[7]);
 			delete []s;
-			const char *o[]={"delete","list","if","else","elseif",
-							"endif","for","next","define","stop",
-							"call","once"};
-			int l[12] = {6, 4, 2, 4, 6, 5, 3, 4, 6, 4, 4, 4};
-			for(j=0;j<12;j++)
-				if(text.indexOf(o[j],i)==i && (text[i+l[j]].isSpace() || i+l[j]==text.length()))
-					setFormat(i,l[j],mglColorScheme[7]);
 		}
 		else if(text[i]==';')	{	arg = true;	nl = false;	continue;	}
+		else if(text[i]==':' && s==0)	{	nl=true;	continue;	}
 		else if(arg)			// option
 		{
 			const char *o[]={"xrange","yrange","zrange","crange","alpha",
@@ -104,3 +100,67 @@ void MessSyntax::highlightBlock(const QString &text)
 		setFormat(0, text.length(), QColor(255,0,0));
 }
 //-----------------------------------------------------------------------------
+//
+//	Args dialog
+//
+//-----------------------------------------------------------------------------
+ArgsDialog::ArgsDialog(QWidget *parent) : QDialog(parent)
+{
+	setWindowTitle(tr("UDAV - Set script arguments"));
+	QHBoxLayout *h;
+	QVBoxLayout *v;
+	QGridLayout *g;
+	QLabel *l;
+	QPushButton *b;
+
+	v = new QVBoxLayout(this);
+	g = new QGridLayout();		v->addLayout(g);
+	l = new QLabel(tr("String for $1"), this);	g->addWidget(l, 0, 0);
+	a[1] = new QLineEdit(this);					g->addWidget(a[1], 1, 0);
+	l = new QLabel(tr("String for $2"), this);	g->addWidget(l, 0, 1);
+	a[2] = new QLineEdit(this);					g->addWidget(a[2], 1, 1);
+	l = new QLabel(tr("String for $3"), this);	g->addWidget(l, 2, 0);
+	a[3] = new QLineEdit(this);					g->addWidget(a[3], 3, 0);
+	l = new QLabel(tr("String for $4"), this);	g->addWidget(l, 2, 1);
+	a[4] = new QLineEdit(this);					g->addWidget(a[4], 3, 1);
+	l = new QLabel(tr("String for $5"), this);	g->addWidget(l, 4, 0);
+	a[5] = new QLineEdit(this);					g->addWidget(a[5], 5, 0);
+	l = new QLabel(tr("String for $6"), this);	g->addWidget(l, 4, 1);
+	a[6] = new QLineEdit(this);					g->addWidget(a[6], 5, 1);
+	l = new QLabel(tr("String for $7"), this);	g->addWidget(l, 6, 0);
+	a[7] = new QLineEdit(this);					g->addWidget(a[7], 7, 0);
+	l = new QLabel(tr("String for $8"), this);	g->addWidget(l, 6, 1);
+	a[8] = new QLineEdit(this);					g->addWidget(a[8], 7, 1);
+	l = new QLabel(tr("String for $9"), this);	g->addWidget(l, 8, 0);
+	a[9] = new QLineEdit(this);					g->addWidget(a[9], 9, 0);
+	l = new QLabel(tr("String for $0"), this);	g->addWidget(l, 8, 1);
+	a[0] = new QLineEdit(this);					g->addWidget(a[0], 9, 1);
+
+	h = new QHBoxLayout();	h->addStretch(1);	v->addLayout(h);
+	b = new QPushButton(tr("Cancel"), this);	h->addWidget(b);
+	connect(b, SIGNAL(clicked()),this, SLOT(reject()));
+	b = new QPushButton(tr("OK"), this);		h->addWidget(b);
+	connect(b, SIGNAL(clicked()),this, SLOT(putArguments()));
+	b->setDefault(true);
+}
+//-----------------------------------------------------------------------------
+ArgsDialog::~ArgsDialog()	{}
+//-----------------------------------------------------------------------------
+void ArgsDialog::putArguments()
+{
+	int len=0, i, j, n;
+	for(i=0;i<10;i++)
+			if(a[i]->text().length()>len)
+				len = a[i]->text().length();
+	wchar_t *str = new wchar_t[len+2];
+	QString s;
+	for(i=0;i<10;i++)
+	{
+		s = a[i]->text();	n = s.length();
+		for(j=0;j<n;j++)	str[j] = (s[j]).unicode();
+		str[j] = 0;
+		parser.AddParam(i, str);
+	}
+	accept();
+}
+//-----------------------------------------------------------------------------
diff --git a/src/qmglsyntax.h b/src/qmglsyntax.h
index 03a0816..0f02124 100644
--- a/src/qmglsyntax.h
+++ b/src/qmglsyntax.h
@@ -20,7 +20,9 @@
 #ifndef QMGLSYNTAX_H
 #define QMGLSYNTAX_H
 //-----------------------------------------------------------------------------
-#include <qsyntaxhighlighter.h>
+#include <QSyntaxHighlighter>
+#include <QDialog>
+#include <QLineEdit>
 //-----------------------------------------------------------------------------
 ///Syntax highlighter for MGL script language.
 class QMGLSyntax : public QSyntaxHighlighter
@@ -38,5 +40,19 @@ public:
 	void highlightBlock(const QString &text);
 };
 //-----------------------------------------------------------------------------
+/// Dialog for enetring script arguments $0...$9
+class ArgsDialog : public QDialog
+{
+Q_OBJECT
+public:
+	ArgsDialog(QWidget *parent=0);
+	~ArgsDialog();
+
+private slots:
+	void putArguments();
+private:
+	QLineEdit *a[10];
+};
+//-----------------------------------------------------------------------------
 #endif
 //-----------------------------------------------------------------------------
diff --git a/src/scriptmenu.cpp b/src/scriptmenu.cpp
index e7ce413..1a18413 100644
--- a/src/scriptmenu.cpp
+++ b/src/scriptmenu.cpp
@@ -18,46 +18,36 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 #include <unistd.h>
-#include <qsplitter.h>
-#include <qtoolbar.h>
-#include <qinputdialog.h>
-#include <qmessagebox.h>
-#include <qapplication.h>
-#include <qspinbox.h>
-#include <qsettings.h>
-#include <qaction.h>
-#include <qfile.h>
-#include <qfiledialog.h>
-#include <qstatusbar.h>
-#include <qmenu.h>
-#include <qmenubar.h>
-#include <qtextedit.h>
-#include <QTableWidget>
-#include <qpushbutton.h>
-#include <qtabwidget.h>
-#include <qlayout.h>
+#include <QSplitter>
+#include <QToolBar>
+#include <QInputDialog>
+#include <QMessageBox>
+#include <QApplication>
+#include <QSettings>
+#include <QAction>
+#include <QFile>
+#include <QFileDialog>
+#include <QStatusBar>
+#include <QMenuBar>
+#include <QTextEdit>
+#include <QPushButton>
+#include <QLayout>
 #include <QTextStream>
+#include <QDockWidget>
+#include <QMdiArea>
 #include <mgl/mgl_parse.h>
 //-----------------------------------------------------------------------------
 #include "scriptwindow.h"
+#include "qmglsyntax.h"
 #include "qmglcanvas.h"
-#include "helpwindow.h"
-#include "argsdialog.h"
-#include "tablewindow.h"
-#include "infodialog.h"
 #include "finddialog.h"
-#ifndef MGL_DOC_DIR
-#ifdef WIN32
-#define MGL_DOC_DIR ""
-#else
-#define MGL_DOC_DIR "/usr/local/share/doc/udav/"
-#endif
-#endif
+#include "graphwindow.h"
+#include "helpwindow.h"
+#include "optiondialog.h"
+#include "newcmddialog.h"
 //-----------------------------------------------------------------------------
 #include "xpm/option.xpm"
 #include "xpm/style.xpm"
-#include "xpm/table.xpm"
-#include "xpm/preview.xpm"
 //-----------------------------------------------------------------------------
 QStringList recentFiles;
 int MaxRecentFiles=5;
@@ -66,26 +56,25 @@ bool editPosBottom = false;
 bool mglAutoSave = false;
 bool showHint=true;
 extern HintDialog *hintDialog;
-extern HelpWindow *hlp;
 extern mglParse parser;
 extern ArgsDialog *args_dlg;
 extern QColor mglColorScheme[9];
 extern QString defFontFamily;
 extern int defFontSize;
-QString pathHelp;
+extern QString pathHelp;
 extern QString pathFont;
 bool loadInNewWnd = false;
+extern int defWidth, defHeight;
 //-----------------------------------------------------------------------------
 void ScriptWindow::about()
 {
-	QString s = tr("UDAV v. 0.")+QString::number(UDAV_VERSION)+tr("\n(c) Alexey Balakin, 2008\nhttp://udav.sf.net/");
+	QString s = tr("UDAV v. 0.")+QString::number(UDAV_VERSION)+
+				tr("\n(c) Alexey Balakin, 2008\nhttp://udav.sf.net/");
 	QMessageBox::about(this, tr("UDAV - about"), s);
 }
 //-----------------------------------------------------------------------------
 void ScriptWindow::aboutQt()
-{
-	QMessageBox::aboutQt(this, tr("About Qt"));
-}
+{	QMessageBox::aboutQt(this, tr("About Qt"));	}
 //-----------------------------------------------------------------------------
 void ScriptWindow::makeMenu()
 {
@@ -93,7 +82,6 @@ void ScriptWindow::makeMenu()
 	QMenu *o, *oo;
 	QToolBar *bb;
 
-	popup = new QMenu(this);
 	// file menu
 	{
 	bb = new QToolBar(tr("File/Edit Operations"),this);
@@ -115,29 +103,15 @@ void ScriptWindow::makeMenu()
 	connect(a, SIGNAL(activated()), this, SLOT(saveAs()));
 	o->addAction(a);
 
-	oo = new QMenu(tr("&Export as ..."),this);
-	oo->addAction(tr("PNG"), mgl, SLOT(exportPNG()),Qt::ALT+Qt::Key_P);
-	oo->addAction(tr("solid PNG"), mgl, SLOT(exportPNGs()),Qt::ALT+Qt::Key_F);
-	oo->addAction(tr("JPEG"), mgl, SLOT(exportJPG()),Qt::ALT+Qt::Key_J);
-	oo->addAction(tr("GIF"), mgl, SLOT(exportGIF()),Qt::ALT+Qt::Key_G);
-	oo->addAction(tr("bitmap EPS"), mgl, SLOT(exportBPS()));
-	oo->addAction(tr("vector EPS"), mgl, SLOT(exportEPS()),Qt::ALT+Qt::Key_E);
-	oo->addAction(tr("SVG"), mgl, SLOT(exportSVG()),Qt::ALT+Qt::Key_S);
-	oo->addAction(tr("C++"), mgl, SLOT(exportCPP()));
-	oo->addAction(tr("IDTF"), mgl, SLOT(exportIDTF()));
-	o->addMenu(oo);
-	popup->addMenu(oo);
-
 	o->addSeparator();
 	o->addAction(tr("&Print script"), this, SLOT(printText()));
 	a = new QAction(QPixmap(":/xpm/document-print.png"), tr("Print &graphics"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(printPlot()));
+	connect(a, SIGNAL(activated()), graph, SLOT(printPlot()));
 	a->setToolTip(tr("Open printer dialog and print graphics\t(Ctrl+P)"));
 	a->setShortcut(Qt::CTRL+Qt::Key_P);	o->addAction(a);
 	o->addSeparator();
 	fileMenu = o->addMenu(tr("Recent files"));
 	o->addSeparator();
-	o->addAction(tr("&Close"), this, SLOT(close()), Qt::CTRL+Qt::Key_W);
 	o->addAction(tr("&Quit"), qApp, SLOT(closeAllWindows()), Qt::CTRL+Qt::Key_Q);
 	bb->addSeparator();
 	}
@@ -151,20 +125,20 @@ void ScriptWindow::makeMenu()
 	a = new QAction(QPixmap(":/xpm/edit-redo.png"), tr("&Redo"), this);
 	connect(a, SIGNAL(activated()), edit, SLOT(redo()));
 	a->setToolTip(tr("Redo editor change (Ctrl+Shift+Z)."));
-	a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_Z);	o->addAction(a);		bb->addAction(a);
+	a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_Z);	o->addAction(a);	bb->addAction(a);
 	bb->addSeparator();	o->addSeparator();
 	o->addAction(tr("Clear all"), edit, SLOT(clear()));
-	a = new QAction(QPixmap(":/xpm/edit-cut.png"), tr("Cu&t"), this);
+	a = new QAction(QPixmap(":/xpm/edit-cut.png"), tr("Cu&t text"), this);
 	connect(a, SIGNAL(activated()), edit, SLOT(cut()));
 	a->setToolTip(tr("Cut selected text to clipboard (Ctrl+X)."));
 	a->setShortcut(Qt::CTRL+Qt::Key_X);	o->addAction(a);		bb->addAction(a);
 	a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("&Copy"), this);
-	connect(a, SIGNAL(activated()), edit, SLOT(copy()));
-	a->setToolTip(tr("Copy selected text to clipboard (Ctrl+C)."));
+	connect(a, SIGNAL(activated()), this, SLOT(copy()));
+	a->setToolTip(tr("Copy selected text or data to clipboard (Ctrl+C)."));
 	a->setShortcut(Qt::CTRL+Qt::Key_C);	o->addAction(a);		bb->addAction(a);
 	a = new QAction(QPixmap(":/xpm/edit-paste.png"), tr("&Paste"), this);
-	connect(a, SIGNAL(activated()), edit, SLOT(paste()));
-	a->setToolTip(tr("Paste text from clipboard (Ctrl+V)."));
+	connect(a, SIGNAL(activated()), this, SLOT(paste()));
+	a->setToolTip(tr("Paste text or data from clipboard (Ctrl+V)."));
 	a->setShortcut(Qt::CTRL+Qt::Key_V);	o->addAction(a);		bb->addAction(a);
 	o->addAction(QPixmap(":/xpm/edit-select-all.png"), tr("Select &all"), edit, SLOT(selectAll()), Qt::CTRL+Qt::Key_A);
 	bb->addSeparator();	o->addSeparator();
@@ -176,152 +150,75 @@ void ScriptWindow::makeMenu()
 	connect(a, SIGNAL(activated()), this, SLOT(findText()));
 	a->setShortcut(Qt::Key_F3);	o->addAction(a);
 	bb->addSeparator();	o->addSeparator();
-	a = new QAction(QPixmap(option_xpm), tr("Add &options"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(addOptions()));
-	a->setToolTip(tr("Show dialog for options and put it into the script.\nOptions are used for additional setup the plot."));
-	o->addAction(a);		bb->addAction(a);
-	a = new QAction(QPixmap(style_xpm), tr("Add &style"), this);
+
+	// insert menu
+	{
+	oo = o->addMenu(tr("Insert"));
+	a = new QAction(QPixmap(":/xpm/format-indent-more.png"), tr("New command"), this);
+	a->setShortcut(Qt::META+Qt::Key_C);	connect(a, SIGNAL(activated()), this, SLOT(newCmd()));
+	a->setToolTip(tr("Show dialog for new command and put it into the script."));
+	oo->addAction(a);		bb->addAction(a);
+	a = new QAction(tr("Fitted formula"), this);	a->setShortcut(Qt::META+Qt::Key_N);
+	connect(a, SIGNAL(activated()), this, SLOT(insFitF()));
+	a->setToolTip(tr("Insert last fitted formula with found coefficients."));
+	oo->addAction(a);
+	a = new QAction(QPixmap(style_xpm), tr("Plot style"), this);
 	connect(a, SIGNAL(activated()), this, SLOT(addStyle()));
 	a->setToolTip(tr("Show dialog for styles and put it into the script.\nStyles define the plot view (color scheme, marks, dashing and so on)."));
-	o->addAction(a);		bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/document-properties.png"), tr("Setup &graphics"), this);
+	oo->addAction(a);//		bb->addAction(a);
+	a = new QAction(QPixmap(option_xpm), tr("Command options"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(addOptions()));
+	a->setToolTip(tr("Show dialog for options and put it into the script.\nOptions are used for additional setup the plot."));
+	oo->addAction(a);//		bb->addAction(a);
+	a = new QAction(tr("Numeric value"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(insNVal()));
+	a->setToolTip(tr("Replace expression by its numerical value."));
+	oo->addAction(a);
+	a = new QAction(QPixmap(":/xpm/x-office-spreadsheet.png"), tr("File path"), this);
+	a->setShortcut(Qt::META+Qt::Key_P);	connect(a, SIGNAL(activated()), this, SLOT(insFile()));
+	a->setToolTip(tr("Select and insert file name."));
+	oo->addAction(a);
+	a = new QAction(QPixmap(":/xpm/folder.png"), tr("Folder path"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(insPath()));
+	a->setToolTip(tr("Select and insert folder name."));
+	oo->addAction(a);
+	a = new QAction(QPixmap(":/xpm/document-properties.png"), tr("Graphics setup"), this);
 	connect(a, SIGNAL(activated()), this, SLOT(addSetup()));
 	a->setToolTip(tr("Show dialog for plot setup and put code into the script.\nThis dialog setup axis, labels, lighting and other general things."));
-	o->addAction(a);		bb->addAction(a);
+	oo->addAction(a);//		bb->addAction(a);
+	}
+
 	o->addSeparator();
 	a = new QAction(QPixmap(":/xpm/preferences-system.png"), tr("Properties"), this);
 	connect(a, SIGNAL(activated()), this, SLOT(properties()));
-	a->setToolTip(tr("Show dialog for UDAV properties."));
-	o->addAction(a);
+	a->setToolTip(tr("Show dialog for UDAV properties."));	o->addAction(a);
+	o->addAction(tr("Set ar&guments"), args_dlg, SLOT(exec()));
+
+	acalc = a = new QAction(QPixmap(":/xpm/accessories-calculator.png"), tr("Calculator"), this);
+	a->setShortcut(Qt::Key_F4);	a->setCheckable(true);	bb->addAction(a);
+	connect(a, SIGNAL(toggled(bool)), calcWnd, SLOT(setVisible(bool)));
+	connect(calcWnd, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool)));
+	a->setToolTip(tr("Show calculator which evaluate and help to type textual formulas.\nTextual formulas may contain data variables too."));
+	o->addAction(a);	a->setChecked(false);	calcWnd->setVisible(false);
+
 	ainfo = a = new QAction(tr("Show info"), this);
 	a->setShortcut(Qt::Key_F2);	a->setCheckable(true);
-	connect(a, SIGNAL(toggled(bool)), info, SLOT(setVisible(bool)));
-	o->addAction(a);	a->setChecked(true);
-	}
-	// graphics menu
-	{
-	bb = new QToolBar(tr("Graphics"),this);
-	addToolBar(Qt::TopToolBarArea, bb);
-	o = menuBar()->addMenu(tr("&Graphics"));
-	a = new QAction(QPixmap(":/xpm/alpha.png"), tr("&Alpha"), this);
-	a->setShortcut(Qt::ALT+Qt::Key_T);	a->setCheckable(true);
-	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setAlpha(bool)));
-	connect(mgl, SIGNAL(alphaChanged(bool)), a, SLOT(setOn(bool)));
-	a->setToolTip(tr("Switch on/off transparency for the graphics (Alt+T)."));
-	o->addAction(a);		bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/weather-clear.png"), tr("&Light"), this);
-	a->setShortcut(Qt::ALT+Qt::Key_L);	a->setCheckable(true);
-	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setLight(bool)));
-	connect(mgl, SIGNAL(lightChanged(bool)), a, SLOT(setOn(bool)));
-	a->setToolTip(tr("Switch on/off lightning for the graphics (Alt+L)."));
-	o->addAction(a);		bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/object-rotate-right.png"), tr("&Rotate by mouse"), this);
-	a->setCheckable(true);
-	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setRotate(bool)));
-	connect(mgl, SIGNAL(rotateChanged(bool)), a, SLOT(setOn(bool)));
-	a->setToolTip(tr("Switch on/off mouse handling of the graphics\n(rotation, shifting, zooming and perspective)."));
-	bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/zoom-fit-best.png"), tr("&Zoom by mouse"), this);
-	a->setCheckable(true);
-	connect(a, SIGNAL(toggled(bool)), mgl, SLOT(setZoom(bool)));
-	connect(mgl, SIGNAL(zoomChanged(bool)), a, SLOT(setOn(bool)));
-	a->setToolTip(tr("Switch on/off mouse zoom of selected region."));
-	bb->addAction(a);
-	o->addSeparator();
-	a = new QAction(QPixmap(":/xpm/zoom-original.png"), tr("Res&tore"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(restore()));
-	a->setToolTip(tr("Restore default graphics rotation, zoom and perspective (Alt+Space)."));
-	a->setShortcut(Qt::ALT+Qt::Key_Space);
-	o->addAction(a);	bb->addAction(a);	popup->addAction(a);
-	bb->addSeparator();
-	a = new QAction(QPixmap(":/xpm/view-refresh.png"), tr("Re&draw"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(pressF5()));
-	a->setToolTip(tr("Execute script and redraw graphics (F5)."));
-	a->setShortcut(Qt::Key_F5);
-	o->addAction(a);	bb->addAction(a);	popup->addAction(a);
-	a = new QAction(tr("&Adjust size"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(adjust()));
-	a->setToolTip(tr("Change canvas size to fill whole region (F6)."));
-	a->setShortcut(Qt::Key_F6);		o->addAction(a);
-	a = new QAction(tr("Re&load"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(reload()));
-	a->setToolTip(tr("Restore status for 'once' command and reload data (F9)."));
-	a->setShortcut(Qt::Key_F9);	o->addAction(a);	popup->addAction(a);
-	a = new QAction(QPixmap(":/xpm/process-stop.png"), tr("&Stop"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(stop()));
-	a->setToolTip(tr("Stop script execution (F7)."));
-	a->setShortcut(Qt::Key_F7);	o->addAction(a);		bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("&Copy plot"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(copy()));
-	a->setToolTip(tr("Copy graphics to clipboard (Ctrl+Shift+C)."));
-	a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_C);
-	o->addAction(a);		bb->addAction(a);	popup->addAction(a);
-	bb->addSeparator();
-	tet = new QSpinBox(this);	tet->setWrapping(true);
-	bb->addWidget(tet);	tet->setRange(-180, 180);	tet->setSingleStep(10);
-	connect(tet, SIGNAL(valueChanged(int)), mgl, SLOT(setTet(int)));
-	connect(mgl, SIGNAL(tetChanged(int)), tet, SLOT(setValue(int)));
-	tet->setToolTip(tr("Set value of \\theta angle."));
-	bb->addSeparator();
-	phi = new QSpinBox(this);	phi->setWrapping(true);
-	bb->addWidget(phi);	phi->setRange(-180, 180);	phi->setSingleStep(10);
-	connect(phi, SIGNAL(valueChanged(int)), mgl, SLOT(setPhi(int)));
-	connect(mgl, SIGNAL(phiChanged(int)), phi, SLOT(setValue(int)));
-	phi->setToolTip(tr("Set value of \\phi angle."));
-	o->addAction(tr("Set ar&guments"), args_dlg, SLOT(exec()));
-//	bb->addSeparator();
-	}
-	// zooming menu
-	{
-	oo = o->addMenu(tr("Zoom/move"));
-	bb = new QToolBar(tr("Zoom graphics"),this);
-	addToolBar(Qt::RightToolBarArea, bb);
-	a = new QAction(QPixmap(":/xpm/go-previous.png"), tr("Move &left"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(shiftLeft()));
-	a->setToolTip(tr("Move graphics left by 1/3 of its width."));
-	bb->addAction(a);		oo->addAction(a);
-	a = new QAction(QPixmap(":/xpm/go-up.png"), tr("Move &up"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(shiftUp()));
-	a->setToolTip(tr("Move graphics up by 1/3 of its height."));
-	bb->addAction(a);		oo->addAction(a);
-	a = new QAction(QPixmap(":/xpm/zoom-in.png"), tr("Zoom &in"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(zoomIn()));
-	a->setToolTip(tr("Zoom in graphics."));
-	bb->addAction(a);		oo->addAction(a);
-	a = new QAction(QPixmap(":/xpm/zoom-out.png"), tr("Zoom &out"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(zoomOut()));
-	a->setToolTip(tr("Zoom out graphics."));
-	bb->addAction(a);		oo->addAction(a);
-	a = new QAction(QPixmap(":/xpm/go-down.png"), tr("Move &down"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(shiftDown()));
-	a->setToolTip(tr("Move graphics up down 1/3 of its height."));
-	bb->addAction(a);		oo->addAction(a);
-	a = new QAction(QPixmap(":/xpm/go-next.png"), tr("Move &right"), this);
-	connect(a, SIGNAL(activated()), mgl, SLOT(shiftRight()));
-	a->setToolTip(tr("Move graphics right by 1/3 of its width."));
-	bb->addAction(a);		oo->addAction(a);
-	}
-	// animation menu
-	{
-	o = menuBar()->addMenu(tr("&Animation"));
-	bb = new QToolBar(tr("Animation"),this);
-	addToolBar(Qt::RightToolBarArea, bb);
-	a = new QAction(QPixmap(":/xpm/media-seek-forward.png"), tr("&Next slide"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(nextSlide()));
-	a->setToolTip(tr("Show next slide (Alt+Right)."));
-	a->setShortcut(Qt::ALT+Qt::Key_Right);	o->addAction(a);		bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/media-seek-backward.png"), tr("&Prev slide"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(prevSlide()));
-	a->setToolTip(tr("Show previous slide (Alt+Left)."));
-	a->setShortcut(Qt::ALT+Qt::Key_Left);	o->addAction(a);		bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/film-b.png"), tr("&Slideshow"), this);
-	a->setCheckable(true);
-	connect(a, SIGNAL(toggled(bool)), this, SLOT(animStart(bool)));
-	a->setToolTip(tr("Run slideshow (Ctrl+F5). If no parameter specified\nthen the dialog with slideshow options will appear."));
-	a->setShortcut(Qt::CTRL+Qt::Key_F5);	o->addAction(a);		bb->addAction(a);
-	o->addAction(tr("Se&tup show"), this, SLOT(animSetup()), Qt::CTRL+Qt::Key_W);
+	connect(a, SIGNAL(toggled(bool)), messWnd, SLOT(setVisible(bool)));
+	connect(messWnd, SIGNAL(visibilityChanged(bool)), a, SLOT(setChecked(bool)));
+	o->addAction(a);	a->setChecked(false);	messWnd->setVisible(false);
 	}
 
+	graph->makeMenu(this);
+	makeDataMenu();
+
+	o = menuBar()->addMenu(tr("&Window"));
+	a = new QAction(tr("Tile"), this);	o->addAction(a);
+	connect(a, SIGNAL(activated()), mdi, SLOT(tileSubWindows()));
+	a = new QAction(tr("Cascade"), this);	o->addAction(a);
+	connect(a, SIGNAL(activated()), mdi, SLOT(cascadeSubWindows()));
+	a = new QAction(tr("Close all"), this);	o->addAction(a);
+	connect(a, SIGNAL(activated()), mdi, SLOT(closeAllSubWindows()));
+
 	menuBar()->addSeparator();
 	bb = new QToolBar(tr("UDAV Help"), this);
 	addToolBar(Qt::RightToolBarArea, bb);
@@ -348,10 +245,9 @@ void ScriptWindow::writeSettings()
 	settings.beginGroup("/UDAV");
 	settings.setValue("/animDelay", animDelay);
 	settings.setValue("/geometry/size", size());
+//	settings.setValue("/geometry/dock", messWnd->size());
 	settings.setValue("/geometry/split_e/w1", split->sizes().at(0));
 	settings.setValue("/geometry/split_e/w2", split->sizes().at(1));
-	settings.setValue("/geometry/split_g/w1", splitG->sizes().at(0));
-	settings.setValue("/geometry/split_g/w2", splitG->sizes().at(1));
 
 	settings.setValue("/recentFiles", recentFiles);
 	settings.setValue("/recentFilesMax", MaxRecentFiles);
@@ -383,21 +279,15 @@ void ScriptWindow::readSettings()
 	QSettings settings("abalakin","UDAV");
 	settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV");
 	settings.beginGroup("/UDAV");
-#ifdef WIN32
 	pathHelp = settings.value("/helpPath", MGL_DOC_DIR).toString();
-#else
-	pathHelp = settings.value("/helpPath", MGL_DOC_DIR[0] ? MGL_DOC_DIR : "/usr/local/share/doc/udav/").toString();
-#endif
 	MaxRecentFiles = settings.value("/recentFilesMax", 5).toInt();
 	animDelay = settings.value("/animDelay", 500).toInt();
 	resize(settings.value("/geometry/size", QSize(880,720)).toSize());
-	QList<int> le, lg;
+//	messWnd->resize(settings.value("/geometry/dock", QSize(880,720)).toSize());
+	QList<int> le;
 	le.append(settings.value("/geometry/split_e/w1", 230).toInt());
 	le.append(settings.value("/geometry/split_e/w2", 604).toInt());
 	split->setSizes(le);
-	lg.append(settings.value("/geometry/split_g/w1", 406).toInt());
-	lg.append(settings.value("/geometry/split_g/w2", 212).toInt());
-	splitG->setSizes(lg);
 
 	pathFont = settings.value("/userFont", "").toString();
 	mglColorScheme[0] = QColor(settings.value("/colComment","#007F00").toString());
@@ -416,7 +306,11 @@ void ScriptWindow::readSettings()
 	loadInNewWnd = settings.value("/loadInNewWnd", false).toBool();
 	defFontFamily = settings.value("/fontFamily", "Georgia").toString();
 	defFontSize = settings.value("/fontSize", 10).toInt();
-	setEditorFont();	setMGLFont(pathFont);	setEditPos(editPosBottom);
+	setEditorFont();	setEditPos(editPosBottom);	graph->setMGLFont(pathFont);
+
+	defWidth = settings.value("/defWidth", 640).toInt();
+	defHeight = settings.value("/defHeight", 480).toInt();
+	graph->mgl->imgSize(defWidth, defHeight);
 
 	recentFiles = settings.value("/recentFiles").toStringList();
 	settings.endGroup();
@@ -426,7 +320,7 @@ void ScriptWindow::readSettings()
 void ScriptWindow::setCurrentFile(const QString &fileName)
 {
 	filename = fileName;
-	mgl->scriptName = filename;
+	graph->mgl->scriptName = filename;
 	edit->document()->setModified(false);
 	if(filename.isEmpty())
 		setWindowTitle(tr("untitled - UDAV"));
@@ -443,40 +337,42 @@ void ScriptWindow::setCurrentFile(const QString &fileName)
 }
 //-----------------------------------------------------------------------------
 void ScriptWindow::openRecentFile()
-{
+{
 	QAction *a = qobject_cast<QAction *>(sender());
 	if(!a)	return;
 	if(edit->document()->isModified())
-		switch(QMessageBox::information(this, tr("UDAV - save current"), tr("Do you want to save the changes to the document?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel))
+		switch(QMessageBox::information(this, tr("UDAV - save current"),
+				tr("Do you want to save the changes to the document?"),
+				QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel))
 		{
 			case QMessageBox::Yes:	save();	break;
 			case QMessageBox::No:	break;
 			default:	return;
-		}
-	QString fn = recentFiles[a->data().toInt()];
-	load(fn);
+		}
+	QString fn = recentFiles[a->data().toInt()];
+	if(!fn.isEmpty())	load(fn);
 }
 //-----------------------------------------------------------------------------
 void ScriptWindow::updateRecentFileItems()
-{
+{
 	foreach(QWidget *w, QApplication::topLevelWidgets())
-	{
-		ScriptWindow *wnd = qobject_cast<ScriptWindow *>(w);
+	{
+		ScriptWindow *wnd = qobject_cast<ScriptWindow *>(w);
 		if(wnd)	wnd->updateRecent();
 //		if(w->inherits("ScriptWindow"))	((ScriptWindow *)w)->updateRecent();
 	}
 }
 //-----------------------------------------------------------------------------
 void ScriptWindow::updateRecent()
-{
+{
 	QAction *a;
-	fileMenu->clear();	qApp->processEvents();
+	fileMenu->clear();	qApp->processEvents();
 	for(int i=0; i<recentFiles.size() && i<MaxRecentFiles; i++)
 	{
-		QString text = "&" + QString::number(i+1) + " " + QFileInfo(recentFiles[i]).fileName();
-		a = fileMenu->addAction(text, this, SLOT(openRecentFile()));
+		QString text="&"+QString::number(i+1)+" "+QFileInfo(recentFiles[i]).fileName();
+		a = fileMenu->addAction(text, this, SLOT(openRecentFile()));
 		a->setData(i);
-	}
+	}
 }
 //-----------------------------------------------------------------------------
 void ScriptWindow::newDoc()
@@ -488,7 +384,9 @@ void ScriptWindow::newDoc()
 void ScriptWindow::choose()
 {
 	if(edit->document()->isModified())
-		switch(QMessageBox::information(this, tr("UDAV - save current"), tr("Do you want to save the changes to the document?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel))
+		switch(QMessageBox::information(this, tr("UDAV - save current"),
+				tr("Do you want to save the changes to the document?"),
+				QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel))
 		{
 			case QMessageBox::Yes:	save();	break;
 			case QMessageBox::No:	break;
@@ -497,9 +395,9 @@ void ScriptWindow::choose()
 	QSettings settings("abalakin","UDAV");
 	settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV");
 	settings.beginGroup("/UDAV");
-	QString fn = QFileDialog::getOpenFileName(this, 
-			tr("UDAV - Open file"), 
-			settings.value("/filePath", MGL_DOC_DIR).toString(), 
+	QString fn = QFileDialog::getOpenFileName(this,
+			tr("UDAV - Open file"),
+			settings.value("/filePath", MGL_DOC_DIR).toString(),
 			tr("MGL scripts (*.mgl)\nHDF5 files (*.hdf *.h5)\nText files (*.txt)\nData files (*.dat)\nAll files (*.*)"));
 	settings.endGroup();
 	if(!fn.isEmpty())	load(fn);
@@ -508,14 +406,13 @@ void ScriptWindow::choose()
 //-----------------------------------------------------------------------------
 void ScriptWindow::load(const QString &fileName, bool noNewWnd)
 {
-	static int num=0;
 	// save current path
 	QFileInfo fi(fileName);
 	QSettings settings("abalakin","UDAV");
 	settings.setPath(QSettings::IniFormat, QSettings::UserScope, "UDAV");
 	settings.beginGroup("/UDAV");
 	settings.setValue("/filePath", fi.absolutePath());
-	settings.endGroup();
+	settings.endGroup();
 	// open new window if it is required
 	if(loadInNewWnd && !noNewWnd)
 	{
@@ -524,24 +421,15 @@ void ScriptWindow::load(const QString &fileName, bool noNewWnd)
 		mw->show();	//ed->activateWindow();
 		return;
 	}
-//QMessageBox::warning(this,"",fileName);
+
 	if(fileName.right(4)==".dat")
 	{
-		char name[16];
-		sprintf(name,"mgl_%d",num);	num++;
-		mglVar *v = parser.AddVar(name);
-		setlocale(LC_ALL, "C");
-		v->d.Read(fileName.toAscii());
-		setlocale(LC_ALL, "");
-		QString s;
-		if(v->d.nz>1)
-			s.sprintf("#read %s '%s'\nrotate 40 60\ncrange %s\nbox\nsurf3 %s\n", name, fileName.toAscii().constData(), name, name);
-		else if(v->d.ny>1)
-			s.sprintf("#read %s '%s'\nrotate 40 60\ncrange %s\nzrange %s\nbox\nsurf %s\n", name, fileName.toAscii().constData(), name, name, name);
-		else
-			s.sprintf("#read %s '%s'\nyrange %s\nbox\nplot %s\n", name, fileName.toAscii().constData(), name, name);
-		edit->setText(s);
-		setCurrentFile(fileName.left(fileName.length()-3)+"mgl");
+		dataOpenDlg->setFile(fileName);
+		if(dataOpenDlg->exec())
+		{
+			edit->setText(dataOpenDlg->getCode());
+			setCurrentFile(fileName.left(fileName.length()-3)+"mgl");
+		}
 	}
 	else if(fileName.right(4)==".hdf" || fileName.right(3)==".h5")
 		loadHDF5(fileName);
@@ -550,7 +438,8 @@ void ScriptWindow::load(const QString &fileName, bool noNewWnd)
 		QFile f(fileName);
 		if(!f.open(QIODevice::ReadOnly))
 		{
-			QMessageBox::warning(this,tr("UDAV - open file"), tr("Couldn't open file"),QMessageBox::Ok,0,0);
+			QMessageBox::warning(this,tr("UDAV - open file"),
+								 tr("Couldn't open file"),QMessageBox::Ok,0,0);
 			return;
 		}
 
@@ -558,11 +447,11 @@ void ScriptWindow::load(const QString &fileName, bool noNewWnd)
 		ts.setAutoDetectUnicode(true);
 //		ts.setCodec(QTextCodec::codecForLocale());
 		edit->setText(ts.readAll());
-		animParseText();
+		graph->animParseText(edit->toPlainText());
 		setCurrentFile(fileName);
 	}
 	statusBar()->showMessage(tr("Loaded document ")+fileName, 2000);
-	if(mglAutoExecute)	mgl->execute();
+	if(mglAutoExecute)	graph->mgl->execute();
 }
 //-----------------------------------------------------------------------------
 void ScriptWindow::save()
@@ -589,109 +478,19 @@ void ScriptWindow::saveAs()
 	QString fn;
 //	while(1)
 	{
-		fn = QFileDialog::getSaveFileName(this, tr("UDAV - save file"), "", tr("MGL scripts (*.mgl)\nHDF5 files (*.hdf *.h5)\nAll files (*.*)"));
+		fn = QFileDialog::getSaveFileName(this, tr("UDAV - save file"), "",
+				tr("MGL scripts (*.mgl)\nHDF5 files (*.hdf *.h5)\nAll files (*.*)"));
 		if(fn.isEmpty())
 		{	statusBar()->showMessage(tr("Saving aborted"), 2000);	return;	}
 		else
 		{
-			if(fn[fn.length()-4]!='.' && fn[fn.length()-3]!='.')
-				fn = fn + ".mgl";
+			int nn=fn.length();
+			if(fn[nn-4]!='.' && fn[nn-3]!='.')	fn = fn + ".mgl";
 			filename = fn;		save();		return;
 		}
 	}
 }
 //-----------------------------------------------------------------------------
-void ScriptWindow::newTable()
-{
-	bool ok;
-	QString name = QInputDialog::getText(this, tr("UDAV - New variable"), tr("Enter name for new variable"), QLineEdit::Normal, "", &ok);
-	if(!ok || name.isEmpty())	return;
-	mglVar *v = parser.AddVar(name.toAscii());
-	TableWindow *t;
-	if(v->o)	t = (TableWindow *)v->o;
-	else
-	{	t = new TableWindow;	t->setVar(v);	}
-	t->show();	t->activateWindow();
-	refresh();
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::editData(int n)
-{
-	if(tab->rowCount()<1)	return;
-	if(n<0)	n = tab->currentRow();
-	if(n<0)	n = 0;
-	mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii());
-	if(!v)	return;
-	TableWindow *t;
-	if(v->o)	t = (TableWindow *)v->o;
-	else
-	{	t = new TableWindow;	t->setVar(v);	}
-	t->show();	t->activateWindow();
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::delData()
-{
-	if(tab->rowCount()<1)	return;
-	int	n = tab->currentRow();
-	if(n<0)	n = 0;
-	mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii());
-	if(!v)	return;
-	if(v->o)	((TableWindow *)v->o)->close();
-	parser.DeleteVar(v);
-	refresh();
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::delAllData()
-{
-	if(QMessageBox::information(this, tr("UDAV - delete all data"), tr("Do you want to delete all data?"), QMessageBox::No, QMessageBox::Yes)!=QMessageBox::Yes)	return;
-	while(parser.DataList)	parser.DeleteVar(parser.DataList);
-	refresh();
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::infoData()
-{
-	if(tab->rowCount()<1)	return;
-	int	n = tab->currentRow();
-	if(n<0)	n = 0;
-	mglVar *v = parser.FindVar(tab->item(n,0)->text().toAscii());
-	if(!v)	return;
-	infoDlg->setVar(v);
-	QString s = QString::fromWCharArray(v->s);
-	infoDlg->setWindowTitle(s + tr(" - UDAV preview"));
-	infoDlg->refresh();
-	infoDlg->show();
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::refresh()
-{
-	mglVar *v = parser.DataList;
-	int n = 0;
-	while(v)	{	v = v->next;	n++;	}
-	tab->setRowCount(n);
-	v = parser.DataList;	n = 0;
-	QString s;
-	QTableWidgetItem *it;
-	Qt::ItemFlags flags;
-	while(v)
-	{
-		register unsigned i,m=wcslen(v->s);
-		QChar *ss = new QChar[m+1];
-		for(i=0;i<m;i++)	ss[i] = v->s[i];
-		s = QString(ss, m);	delete []ss;
-		it = new QTableWidgetItem(s);
-		tab->setItem(n,0,it);	it->setFlags(flags);
-		s.sprintf("%ld * %ld * %ld", v->d.nx, v->d.ny, v->d.nz);
-		it = new QTableWidgetItem(s);
-		tab->setItem(n,1,it);	it->setFlags(flags);
-		it->setTextAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
-		s.sprintf("%12ld", v->d.nx*v->d.ny*v->d.nz*sizeof(float));
-		it = new QTableWidgetItem(s);
-		tab->setItem(n,2,it);	it->setFlags(flags);
-		it->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
-		v = v->next;	n++;
-	}
-}
-//-----------------------------------------------------------------------------
 void ScriptWindow::messClicked()
 {
 	QString m = mess->toPlainText(), q;
@@ -702,64 +501,18 @@ void ScriptWindow::messClicked()
 		if(q.contains("In line "))
 		{
 			QString s = q.mid(8).section(' ',0,0);
-			setCursorPosition(s.toInt(), 0);
+			setCursorPosition(s.toInt());
 		}
 	}
 	edit->setFocus();
 }
 //-----------------------------------------------------------------------------
-void ScriptWindow::tableClicked(int, int col)
-{
-	tab->sortItems(col);
-}
-//-----------------------------------------------------------------------------
-QTabWidget *ScriptWindow::setupInfo(QWidget *par)
-{
-	QWidget *p;
-	QHBoxLayout *h;
-	QVBoxLayout *v;
-	QPushButton *b;
-
-	QTabWidget *t = new QTabWidget(par);
-	// messages and warnings
-	p = new QWidget(par);
-	v = new QVBoxLayout(p);
-	mess = new QTextEdit(p);	v->addWidget(mess);	mess->setReadOnly(true);
-	connect(mess, SIGNAL(cursorPositionChanged()), this, SLOT(messClicked()));
-	t->addTab(p, tr("Messages and warnings"));
-	// data arrays
-	p = new QWidget(par);
-	v = new QVBoxLayout(p);	h = new QHBoxLayout();	v->addLayout(h);
-	b = new QPushButton(QPixmap(":/xpm/document-new.png"), tr("New"), p);	h->addWidget(b);
-	connect(b, SIGNAL(clicked()), this, SLOT(newTable()));
-	b = new QPushButton(QPixmap(table_xpm), tr("Edit"), p);	h->addWidget(b);
-	connect(b, SIGNAL(clicked()), this, SLOT(editData()));
-	b = new QPushButton(QPixmap(":/xpm/edit-delete.png"), tr("Delete"), p);	h->addWidget(b);
-	connect(b, SIGNAL(clicked()), this, SLOT(delData()));
-	b = new QPushButton(QPixmap(preview_xpm), tr("Info"), p);	h->addWidget(b);
-	connect(b, SIGNAL(clicked()), this, SLOT(infoData()));
-	b = new QPushButton(QPixmap(":/xpm/view-refresh.png"), tr("Update"), p);	h->addWidget(b);
-	connect(b, SIGNAL(clicked()), this, SLOT(refresh()));
-	h->addStretch(1);
-	b = new QPushButton(QPixmap(":/xpm/edit-delete.png"), tr("Delete All"), p);	h->addWidget(b);
-	connect(b, SIGNAL(clicked()), this, SLOT(delAllData()));
-	
-	tab = new QTableWidget(p);	v->addWidget(tab);	tab->setColumnCount(3);
-	QStringList sl;	sl.append(tr("Name"));	sl.append(tr("Sizes"));	sl.append(tr("Memory"));
-	tab->setHorizontalHeaderLabels(sl);
-	connect(tab, SIGNAL(cellPressed(int,int)), this, SLOT(tableClicked(int,int)));
-	t->addTab(p, tr("Data arrays"));
-	// set default page - data
-	t->setCurrentIndex(1);
-	return t;
-}
-//-----------------------------------------------------------------------------
 void updateDataItems()
 {
 	foreach (QWidget *w, QApplication::topLevelWidgets())
 	{
 		if(w->inherits("ScriptWindow"))
-			((ScriptWindow *)w)->refresh();
+			((ScriptWindow *)w)->info->refresh();
 	}
 }
 //-----------------------------------------------------------------------------
@@ -781,3 +534,45 @@ void ScriptWindow::setAsterix()
 	}
 }
 //-----------------------------------------------------------------------------
+void ScriptWindow::insFitF()
+{
+	QString str(graph->mgl->graph->GetFit());
+	if(str.isEmpty())	return;
+	edit->textCursor().insertText("'"+str+"'");
+}
+//-----------------------------------------------------------------------------
+void ScriptWindow::insFile()
+{
+	QString str = QFileDialog::getOpenFileName(this, tr("UDAV - Insert filename"));
+	if(str.isEmpty())	return;
+	edit->textCursor().insertText("'"+str+"'");
+}
+//-----------------------------------------------------------------------------
+void ScriptWindow::insPath()
+{
+	QString str = QFileDialog::getExistingDirectory(this, tr("UDAV - Insert filename"));
+	if(str.isEmpty())	return;
+	edit->textCursor().insertText("'"+str+"'");
+}
+//-----------------------------------------------------------------------------
+mglData mglFormulaCalc(const wchar_t *string, mglParse *arg);
+void ScriptWindow::insNVal()
+{
+	QString sel=edit->textCursor().selectedText();
+	if(sel.isEmpty())	return;
+	wchar_t *txt=new wchar_t[sel.length()+1];
+	sel.toWCharArray(txt);	txt[sel.length()]=0;
+	mglData res=mglFormulaCalc(txt, &parser);
+	delete []txt;
+	edit->textCursor().insertText(QString::number(res.a[0]));
+}
+//-----------------------------------------------------------------------------
+void ScriptWindow::newCmd()
+{
+	if(newCmdDlg->exec())
+	{
+		edit->moveCursor(QTextCursor::StartOfLine);
+		edit->textCursor().insertText(newCmdDlg->getCommand()+"\n");
+	}
+}
+//-----------------------------------------------------------------------------
diff --git a/src/scriptwindow.cpp b/src/scriptwindow.cpp
index c5315bc..ebcad9e 100644
--- a/src/scriptwindow.cpp
+++ b/src/scriptwindow.cpp
@@ -17,21 +17,20 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#include <QTime>
-#include <qtextedit.h>
+#include <QTextEdit>
 #include <QPrintDialog>
 #include <QCloseEvent>
-#include <qstatusbar.h>
-#include <qmessagebox.h>
+#include <QStatusBar>
+#include <QMessageBox>
 #include <QPrinter>
-#include <qapplication.h>
-#include <qpainter.h>
-#include <QScrollArea>
-#include <qsplitter.h>
-#include <qtimer.h>
-#include <qaction.h>
-#include <qpixmap.h>
-#include <QTabWidget>
+#include <QApplication>
+#include <QPainter>
+#include <QSplitter>
+#include <QAction>
+#include <QPixmap>
+#include <QMdiArea>
+#include <QMdiSubWindow>
+#include <QDockWidget>
 #include <mgl/mgl_parse.h>
 //-----------------------------------------------------------------------------
 #include "scriptwindow.h"
@@ -41,18 +40,16 @@
 #include "helpwindow.h"
 #include "optiondialog.h"
 #include "styledialog.h"
-#include "animparam.h"
-#include "argsdialog.h"
 #include "propdialog.h"
 #include "setupdialog.h"
 #include "infodialog.h"
-//#include "xpm/udav.xpm"
+#include "graphwindow.h"
+#include "infodialog.h"
+#include "newcmddialog.h"
 //-----------------------------------------------------------------------------
 extern bool mglAutoExecute;
 extern bool mglAutoSave;
-extern HelpWindow *hlp;
 extern mglParse parser;
-int animDelay=500;
 ArgsDialog *args_dlg=0;
 QString defFontFamily;
 int defFontSize;
@@ -61,65 +58,77 @@ int ScriptWindow::num_wnd=0;
 //-----------------------------------------------------------------------------
 ScriptWindow::ScriptWindow(QWidget *wp) : QMainWindow(wp)
 {
-	gifOn = jpgOn = false;
 	setWindowTitle(tr("untitled - UDAV"));
 	setAttribute(Qt::WA_DeleteOnClose);
 	printer = new QPrinter;
 	if(!args_dlg)	args_dlg = new ArgsDialog;
-	infoDlg = new InfoDialog(this);
-	infoDlg->setModal(true);	infoDlg->allowRefresh=false;
 	findDialog = new FindDialog(this);
 	optDialog = new OptionDialog(this);
 	stlDialog = new StyleDialog(this);
-	animDialog = new AnimParam(this);
 	setupDlg = new SetupDialog(this);
+	dataOpenDlg = new DataOpenDialog(this);
+	newCmdDlg = new NewCmdDialog(this);
+
 	connect(findDialog, SIGNAL(findText(const QString &, bool, bool)), this, SLOT(findText(const QString &, bool, bool)));
 	connect(findDialog, SIGNAL(replText(const QString &, const QString &, bool, bool)), this, SLOT(replText(const QString &, const QString &, bool, bool)));
-	connect(animDialog, SIGNAL(putText(const QString &)), this, SLOT(animPutText(const QString &)));
 	connect(setupDlg, SIGNAL(putText(const QString &)), this, SLOT(animPutText(const QString &)));
 
-	animPos = -1;
-	timer = new QTimer(this);
-	connect(timer, SIGNAL(timeout()), this, SLOT(nextSlide()));
-
-	splitG = new QSplitter(this);	splitG->setOrientation(Qt::Vertical);
-	split = new QSplitter(splitG);
-	edit = new QTextEdit(split);
-	edit->setFocus();	edit->setAcceptRichText(false);
+	split = new QSplitter(this);
+	edit = new QTextEdit(split);	edit->setAcceptRichText(false);
 	connect(edit, SIGNAL(cursorPositionChanged()), this, SLOT(editPosChanged()));
 	new QMGLSyntax(edit);
 	defFontFamily = edit->fontFamily();
-	defFontSize = edit->fontPointSize();
+	defFontSize = int(edit->fontPointSize());
 
+	info = new MemoryWindow(this);
+	graph = new GraphWindow(this);	graph->mgl->textMGL = edit;
+	connect(graph, SIGNAL(save()), this, SLOT(save()));
+	connect(graph, SIGNAL(statusBarMessage(const QString &)), this, SLOT(statusBarMessage(const QString &)));
+	connect(graph, SIGNAL(animPutText(const QString &)), this, SLOT(animPutText(const QString &)));
+	connect(graph->mgl, SIGNAL(objChanged(int)), this, SLOT(setCursorPosition(int)));
+	connect(graph->mgl, SIGNAL(posChanged(QString)), statusBar(), SLOT(showMessage(QString)));
+	connect(graph->mgl, SIGNAL(refreshData()), info, SLOT(refresh()));
 
-	sv = new QScrollArea(split);
-	mgl = new QMGLCanvas(split);	mgl->textMGL = edit;
-//	connect(this, SIGNAL(gotoLine(int,int)), this, SLOT(setCursorPosition(int,int)));
-	connect(mgl, SIGNAL(posChanged(QString)), statusBar(), SLOT(showMessage(QString)));
-	connect(mgl, SIGNAL(refreshData()), this, SLOT(refresh()));
-	sv->setWidget(mgl);
+	mdi = new QMdiArea(split);
+	mdi->addSubWindow(graph);	graph->setWindowState(Qt::WindowMaximized);
+	mdi->addSubWindow(info);	info->setWindowState(Qt::WindowMaximized);
+	hlp = new HelpWindow(this);	mdi->addSubWindow(hlp);
+	hlp->setWindowState(Qt::WindowMaximized);
+	mdi->setActiveSubWindow(graph);	mdi->setViewMode(QMdiArea::TabbedView);
+	connect(mdi, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(subActivated(QMdiSubWindow *)));
 
-	info = setupInfo(splitG);	mgl->warnMGL = mess;	new MessSyntax(mess);
+	messWnd = new QDockWidget(tr("Messages and warnings"),this);
+	mess = new QTextEdit(this);	messWnd->setWidget(mess);
+	messWnd->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
+	addDockWidget(Qt::BottomDockWidgetArea, messWnd);
+	messWnd->resize(size().width(), 0);
+	graph->mgl->warnMGL = mess;	new MessSyntax(mess);
 	connect(mess, SIGNAL(textChanged()), this, SLOT(warnChanged()));
 
+	calcWnd = new QDockWidget(tr("Calculator"),this);
+	calc = new CalcDialog();	calcWnd->setWidget(calc);
+	calcWnd->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
+	addDockWidget(Qt::BottomDockWidgetArea, calcWnd);
+	calcWnd->resize(size().width(), 200);
+	connect(calc, SIGNAL(putNumber(QString)),this,SLOT(putText(QString)));
+
 	makeMenu();
-//	setDockMenuEnabled(true);
-	mgl->setPopup(popup);
-	setCentralWidget(splitG);
+	setCentralWidget(split);
 	setWindowIcon(QIcon(":/udav.png"));
 	readSettings();
 	if(!propDlg)	propDlg = new PropDialog;
 	edit->setLineWrapMode(QTextEdit::NoWrap);
+	connect(propDlg, SIGNAL(sizeChanged(int,int)), graph->mgl, SLOT(imgSize(int,int)));
 	connect(edit,SIGNAL(textChanged()), this, SLOT(setAsterix()));
-	info->setCurrentIndex(1);
+	edit->setFocus();	// TODO: not work right now :(
 	statusBar()->showMessage(tr("Ready"), 2000);
 	num_wnd++;
 }
 //-----------------------------------------------------------------------------
-ScriptWindow::~ScriptWindow()
-{
-	delete printer;
-}
+ScriptWindow::~ScriptWindow()	{	delete printer;	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::statusBarMessage(const QString &txt)
+{	statusBar()->showMessage(txt, 2000);	}
 //-----------------------------------------------------------------------------
 void ScriptWindow::printText()
 {
@@ -134,39 +143,14 @@ void ScriptWindow::printText()
 		statusBar()->showMessage(tr("Printing aborted"), 2000);
 }
 //-----------------------------------------------------------------------------
-void ScriptWindow::printPlot()
-{
-	QPrintDialog printDlg(printer, this);
-	if (printDlg.exec() == QDialog::Accepted)
-	{
-		statusBar()->showMessage(tr("Printing..."));
-		QPainter p;
-		if(!p.begin(printer))	return;	// paint on printer
-		QRect r = p.viewport();
-		int w = r.width(), h = r.height(), h1;
-		h1 = int(w/mgl->getRatio());
-		if(h1<h)	h = h1;	else	w = int(h*mgl->getRatio());
-		mglGraphZB gr(w, h);
-		if(w*h > 240000)	gr.BaseLineWidth = sqrt(w*h/2.4e5);
-		mgl->execute(&gr);
-
-		uchar *grBuf=0;
-		QPixmap pic;
-		convertFromGraph(pic, &gr, &grBuf);
-		p.drawPixmap(0,0,pic);
-		delete []grBuf;
-		statusBar()->showMessage(tr("Printing completed"), 2000);
-	}
-	else
-		statusBar()->showMessage(tr("Printing aborted"), 2000);
-}
-//-----------------------------------------------------------------------------
 void ScriptWindow::closeEvent(QCloseEvent* ce)
 {
 	bool ok=true;
 	writeSettings();
 	if(edit->document()->isModified())
-		switch(QMessageBox::information(this, tr("Qt Application Example"), tr("Do you want to save the changes to the document?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel))
+		switch(QMessageBox::information(this, tr("UDAV"),
+				tr("Do you want to save the changes to the document?"),
+				QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel))
 		{
 			case QMessageBox::Yes:	save();	break;
 			case QMessageBox::No:	break;
@@ -181,15 +165,6 @@ void ScriptWindow::closeEvent(QCloseEvent* ce)
 	else	ce->ignore();
 }
 //-----------------------------------------------------------------------------
-void ScriptWindow::pressF5()
-{
-	if(mglAutoSave)	save();
-	QTime t;
-	t.start();
-	mgl->execute();
-	statusBar()->showMessage(QString(tr("Drawing time %1 ms")).arg(t.elapsed()*1e-3));
-}
-//-----------------------------------------------------------------------------
 void ScriptWindow::find()
 {
 	findDialog->show();
@@ -225,7 +200,7 @@ void ScriptWindow::replText(const QString &str, const QString &txt, bool cs, boo
 //-----------------------------------------------------------------------------
 void ScriptWindow::showHelp()
 {
-	QString s = edit->textCursor().block().text(), dlm(" #;\t");
+	QString s = edit->textCursor().block().text(), dlm(" #;:\t");
 	int i, n = s.length();
 	for(i=0;i<n;i++)	if(dlm.contains(s[i]))	break;
 	s.truncate(i);
@@ -237,7 +212,7 @@ int mgl_cmd_cmp(const void *a, const void *b);
 void ScriptWindow::editPosChanged()
 {
 	register int i, n, m;
-	QString text = edit->textCursor().block().text(), dlm(" #;\t");
+	QString text = edit->textCursor().block().text(), dlm(" #;:\t");
 	n = text.length();
 	for(i=0;i<n;i++)	if(dlm.contains(text[i]))	break;
 	text.truncate(i);	m = text.length();
@@ -264,126 +239,13 @@ void ScriptWindow::addOptions()
 	}
 }
 //-----------------------------------------------------------------------------
-void ScriptWindow::animStart(bool st)
-{
-	if(animParam.isEmpty())
-	{
-		if(animDialog->exec())
-		{
-			animParam = animDialog->getResult();
-			gifName = animDialog->gifName;
-			gifOn = animDialog->gifOn;
-			jpgOn = animDialog->jpgOn;
-		}
-		else	return;
-	}
-	if(st)
-	{
-		timer->start(animDelay);
-		if(gifOn)	mgl->graph->StartGIF(gifName.toAscii(), animDelay);
-		mgl->graph->ResetFrames();
-	}
-	else
-	{
-		timer->stop();
-		if(gifOn)	mgl->graph->CloseGIF();
-	}
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::nextSlide()
-{
-	if(animParam.isEmpty())
-	{
-		if(animDialog->exec())
-		{
-			animParam = animDialog->getResult();
-			gifName = animDialog->gifName;
-			gifOn = animDialog->gifOn;
-			jpgOn = animDialog->jpgOn;
-		}
-		else	return;
-	}
-	int l=animParam.length(), n=animParam.count('\n') + (animParam[l-1]=='\n' ? 0:1), i;
-	wchar_t *str = new wchar_t[l+2];
-	animPos = (animPos+1)%n;
-	QString cur = animParam.section('\n',animPos,animPos);
-	for(i=0;i<l;i++)	str[i] = (cur[i]).unicode();
-	str[i] = 0;
-	parser.AddParam(0,str);
-	if(mgl->graph->GetNumFrame() >= n)
-		mgl->execute();
-	else
-	{
-		mgl->graph->NewFrame();
-		mgl->execute();
-		mgl->graph->EndFrame();
-		if(jpgOn)	mgl->graph->WriteFrame();
-		QString s;	s.sprintf("%d - %d of %d",mgl->graph->GetNumFrame(),animPos,n);
-		statusBar()->showMessage(QString(tr("Frame %1 of %2")).arg(animPos).arg(n));
-	}
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::prevSlide()
-{
-	if(animParam.isEmpty())
-	{
-		if(animDialog->exec())
-		{
-			animParam = animDialog->getResult();
-			gifName = animDialog->gifName;
-			gifOn = animDialog->gifOn;
-			jpgOn = animDialog->jpgOn;
-		}
-		else	return;
-	}
-	int l=animParam.length(), n=animParam.count('\n') + (animParam[l-1]=='\n' ? 0:1), i;
-	wchar_t *str = new wchar_t[l+2];
-	animPos = (animPos-1+n)%n;
-	QString cur = animParam.section('\n',animPos,animPos);
-	for(i=0;i<l;i++)	str[i] = (cur[i]).unicode();
-	str[i] = 0;
-	parser.AddParam(0,str);
-	mgl->execute();
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::animSetup()
-{
-	if(animDialog->exec())
-	{
-		animParam = animDialog->getResult();
-		gifName = animDialog->gifName;
-		gifOn = animDialog->gifOn;
-		jpgOn = animDialog->jpgOn;
-	}
-}
-//-----------------------------------------------------------------------------
-void ScriptWindow::addSetup()
-{
-	setupDlg->exec();
-}
+void ScriptWindow::addSetup()	{	setupDlg->exec();	}
 //-----------------------------------------------------------------------------
 void ScriptWindow::animPutText(const QString &s)
-{
-	edit->moveCursor(QTextCursor::Start);
-	edit->insertPlainText(s);
-}
+{	edit->moveCursor(QTextCursor::Start);	edit->insertPlainText(s);	}
 //-----------------------------------------------------------------------------
-void ScriptWindow::animParseText()
-{
-	int i, n = edit->toPlainText().count('\n')+1;
-	QString s, all;
-	for(i=0;i<n;i++)
-	{
-		s = edit->toPlainText().section('\n',i,i);
-		if(s[0]=='#' && s[1]=='#' && s[2]=='a' && (s[3]==' ' || s[3]=='\t'))
-			all = all + s.mid(4) + "\n";
-	}
-	if(!all.isEmpty())
-	{
-		animDialog->setResult(all);
-		animParam = all;
-	}
-}
+void ScriptWindow::putText(const QString &txt)
+{	edit->insertPlainText(txt);	}
 //-----------------------------------------------------------------------------
 void ScriptWindow::addStyle()
 {
@@ -405,29 +267,23 @@ void ScriptWindow::addStyle()
 void ScriptWindow::setEditorFont(QFont *f)
 {	edit->setFont(f ? *f : QFont(defFontFamily, defFontSize));	}
 //-----------------------------------------------------------------------------
-void ScriptWindow::setMGLFont(QString path)	{	mgl->setMGLFont(path);	}
-//-----------------------------------------------------------------------------
 void ScriptWindow::setEditPos(bool bottom)
-{
-	splitG->setOrientation(bottom? Qt::Horizontal : Qt::Vertical);
-	split->setOrientation(bottom ? Qt::Vertical : Qt::Horizontal);
-}
+{	split->setOrientation(bottom ? Qt::Vertical : Qt::Horizontal);	}
 //-----------------------------------------------------------------------------
 void ScriptWindow::properties()	{	propDlg->exec();	}
 //-----------------------------------------------------------------------------
-void ScriptWindow::setCursorPosition(int n,int)
+void ScriptWindow::setCursorPosition(int n)
 {
+	if(n<0)	return;
 	edit->moveCursor(QTextCursor::Start);
 	for(int i=0;i<n;i++)	edit->moveCursor(QTextCursor::NextBlock);
 	edit->setFocus();
 }
 //-----------------------------------------------------------------------------
-void ScriptWindow::adjust()	{	mgl->setSize(sv->width()-5, sv->height()-5);	}
-//-----------------------------------------------------------------------------
 void ScriptWindow::warnChanged()
 {
 	if(mess->toPlainText().isEmpty())	return;
-	info->setCurrentIndex(0);	ainfo->setChecked(true);
+	messWnd->show();	ainfo->setChecked(true);
 }
 //-----------------------------------------------------------------------------
 #ifndef USE_HDF5
@@ -462,11 +318,11 @@ void ScriptWindow::loadHDF5(const QString &fileName)
 			H5Dread(hd, H5T_C_S1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
 			buf[dims[0]]=0;		// to be sure :)
 			edit->setText(buf);
-			animParseText();
+			graph->animParseText(edit->toPlainText());
 			setCurrentFile(fileName);
 			delete []buf;
 			statusBar()->showMessage(tr("Loaded document %1").arg(fileName), 2000);
-			if(mglAutoExecute)	mgl->execute();
+			if(mglAutoExecute)	graph->mgl->execute();
 		}
 		else if(H5Tget_class(ht)==H5T_FLOAT || H5Tget_class(ht)==H5T_INTEGER)
 		{
@@ -499,9 +355,6 @@ void ScriptWindow::saveHDF5(const QString &fileName)
 	const char *fname = fileName.toAscii().constData();
 
 	H5Eset_auto(0,0);
-//	int res=H5Fis_hdf5(fname);
-//	if(res>0)	hf = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT);
-//	else
 	hf = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
 	if(hf<0)
 	{
diff --git a/src/scriptwindow.h b/src/scriptwindow.h
index 4a42b1a..6fe4cc7 100644
--- a/src/scriptwindow.h
+++ b/src/scriptwindow.h
@@ -20,10 +20,10 @@
 #ifndef UDAV_H
 #define UDAV_H
 //-----------------------------------------------------------------------------
-#include <qmainwindow.h>
+#include <QMainWindow>
 //-----------------------------------------------------------------------------
 #ifndef UDAV_VERSION
-#define UDAV_VERSION	5.2
+#define UDAV_VERSION	6.3
 #endif
 
 #ifndef WIN32
@@ -41,21 +41,24 @@
 class QTextEdit;
 class QFont;
 class QSplitter;
-class QScrollArea;
-class QMGLCanvas;
+class QMenu;
+class QMdiArea;
 class FindDialog;
 class OptionDialog;
 class StyleDialog;
-class QMenu;
-class QSpinBox;
-class QTimer;
-class QPopupMenu;
-class AnimParam;
-class QTableWidget;
 class SetupDialog;
-class QTabWidget;
 class InfoDialog;
 class HintDialog;
+class GraphWindow;
+class MemoryWindow;
+class HelpWindow;
+class TableWindow;
+class QDockWidget;
+class QSpinBox;
+class QMdiSubWindow;
+class CalcDialog;
+class DataOpenDialog;
+class NewCmdDialog;
 //-----------------------------------------------------------------------------
 extern int MaxRecentFiles;
 extern int animDelay;
@@ -64,17 +67,20 @@ class ScriptWindow: public QMainWindow
 {
 Q_OBJECT
 public:
+	GraphWindow *graph;
+	MemoryWindow *info;
+	HelpWindow *hlp;
 	ScriptWindow(QWidget *wp=0);
 	~ScriptWindow();
 	void load(const QString &fileName, bool noNewWnd=false);
 	void writeSettings();
 
 public slots:
-	void refresh();		///< refresh list of variables
 	void setEditorFont(QFont *f=0);
-	void setMGLFont(QString path);
 	void setEditPos(bool bottom);
 	void editPosChanged();
+	void animPutText(const QString &);
+	void statusBarMessage(const QString &);
 
 signals:
 	void gotoLine(int n,int i);
@@ -88,7 +94,6 @@ private slots:
 	void save();
 	void saveAs();
 	void printText();
-	void printPlot();
 	void find();
 	void about();
 	void aboutQt();
@@ -98,65 +103,103 @@ private slots:
 	void showHelp();
 	void addOptions();
 	void addStyle();
-	void nextSlide();
-	void prevSlide();
-	void animStart(bool st);
-	void animSetup();
 	void addSetup();
-	void animPutText(const QString &);
+	void insFile();
+	void insPath();
+	void insFitF();
+	void insNVal();
 
-	void newTable();
-	void editData(int n=-1);
-	void infoData();
-	void delAllData();
-	void delData();
 	void messClicked();
-	void tableClicked(int row, int col);
 	void properties();
 	void setAsterix();
-	void setCursorPosition(int,int);
-	void pressF5();
-
-	void adjust();
+	void setCursorPosition(int);
 	void warnChanged();
 
-private:
+	// Table handlers
+	void loadData();
+	void saveData();
+	void imprt();
+	void exprt();
+	void copy();
+	void paste();
+	void plot();
+	void list();
+	// menu fill
+	void byformula();
+	void inrange();
+	void norm();
+	void normsl();
+	// menu resize
+	void create();
+	void reSize();
+	void squize();
+	void crop();
+	void transp();
+	void rearrange();
+	// menu change
+	void smooth();
+	void cumsum();
+	void integr();
+	void diff();
+	void diff2();
+	void swap();
+	void mirror();
+	// menu another ???
+	void sumof();
+	void maxof();
+	void minof();
+	void momentx();
+	void momenty();
+	void momentz();
+	void hist();
+	// menu operations
+	void addto();
+	void subto();
+	void divto();
+	void multo();
+	// menu navigation
+	void first();
+	void last();
+	void next();
+	void prev();
+	void gosl();
+	void setNz(int nz);
+	void subActivated(QMdiSubWindow *wnd);
+	void setSlice(int);
+	void putText(const QString &txt);
+	void newCmd();
+
+private:
 	static int num_wnd;
-	bool gifOn, jpgOn;
-	QString gifName;
-	QMGLCanvas *mgl;
-	QScrollArea* sv;
-	QSplitter *split, *splitG;
+	QSplitter *split;
 	QPrinter *printer;
-	QTextEdit *edit;
+	QTextEdit *edit;	///< script itself
 	QTextEdit *mess;	///< messages and warnings
 	QString filename;
 	FindDialog *findDialog;
 	OptionDialog *optDialog;
 	StyleDialog *stlDialog;
-	QMenu *fileMenu;
-	QSpinBox *tet, *phi;
-	// animation
-	QString animParam;
-	int animPos;
-	QTimer *timer;
-	AnimParam *animDialog;
-	QMenu *popup;
-	QTableWidget *tab;
+	QMenu *fileMenu, *dataMenu;
 	SetupDialog *setupDlg;
-	QTabWidget *info;
-	QAction *ainfo;
-	InfoDialog *infoDlg;	///< Data preview and information
+	QAction *ainfo, *acalc;
+	QMdiArea *mdi;
+	QDockWidget *messWnd, *calcWnd;
+	QToolBar *tbData[4];	///< Data toolbars
+	QSpinBox *sb;			///< Slice changer for TableWindow
+	CalcDialog *calc;	///< Calculator dock window
+	DataOpenDialog *dataOpenDlg;
+	NewCmdDialog *newCmdDlg;
 
 	void updateRecentFileItems();
 	void updateRecent();
 	void setCurrentFile(const QString &fileName);
 	void makeMenu();
+	void makeDataMenu();
 	void readSettings();
-	void animParseText();
-	QTabWidget *setupInfo(QWidget *par);
+	QWidget *setupInfo(QWidget *par);
 	void saveHDF5(const QString &fileName);
 	void loadHDF5(const QString &fileName);
+	TableWindow *activeWindow();
 };
 //-----------------------------------------------------------------------------
 #endif
diff --git a/src/setupdialog.cpp b/src/setupdialog.cpp
index 0fa5412..6fbedbb 100644
--- a/src/setupdialog.cpp
+++ b/src/setupdialog.cpp
@@ -17,17 +17,17 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#include <qpushbutton.h>
-#include <qmessagebox.h>
-#include <qtabwidget.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
-#include <qlineedit.h>
-#include <qspinbox.h>
-#include <qslider.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qfile.h>
+#include <QPushButton>
+#include <QMessageBox>
+#include <QTabWidget>
+#include <QComboBox>
+#include <QCheckBox>
+#include <QLineEdit>
+#include <QSpinBox>
+#include <QSlider>
+#include <QLayout>
+#include <QLabel>
+#include <QFile>
 #include <QTextStream>
 //-----------------------------------------------------------------------------
 #include "setupdialog.h"
@@ -69,45 +69,45 @@ SetupDialog::SetupDialog(QWidget *parent) : QDialog(parent)
 	l = new QLabel(tr("at position"), p);	g->addWidget(l,5,0);
 	QStringList lpos;
 	lpos.append(tr("at minimum"));	lpos += tr("at center");	lpos += tr("at maximum");
-	xpos = new QComboBox(p);	g->addWidget(xpos,4,1);	xpos->addItems(lpos);
-	ypos = new QComboBox(p);	g->addWidget(ypos,4,2);	ypos->addItems(lpos);
-	zpos = new QComboBox(p);	g->addWidget(zpos,4,3);	zpos->addItems(lpos);
-	l = new QLabel(tr("Ticks"), p);	g->addWidget(l,5,0);
-	xtck = new QLineEdit(p);	g->addWidget(xtck,5,1);
-	ytck = new QLineEdit(p);	g->addWidget(ytck,5,2);
-	ztck = new QLineEdit(p);	g->addWidget(ztck,5,3);
-	l = new QLabel(tr("SubTicks"), p);	g->addWidget(l,6,0);
-	xsub = new QLineEdit(p);	g->addWidget(xsub,6,1);
-	ysub = new QLineEdit(p);	g->addWidget(ysub,6,2);
-	zsub = new QLineEdit(p);	g->addWidget(zsub,6,3);
-	l = new QLabel(tr("Start"), p);	g->addWidget(l,7,0);
-	xort = new QLineEdit(p);	g->addWidget(xort,7,1);
-	yort = new QLineEdit(p);	g->addWidget(yort,7,2);
-	zort = new QLineEdit(p);	g->addWidget(zort,7,3);
-	l = new QLabel(tr("Template"), p);	g->addWidget(l,8,0);
-	xtt = new QLineEdit(p);	g->addWidget(xtt,8,1);
-	ytt = new QLineEdit(p);	g->addWidget(ytt,8,2);
-	ztt = new QLineEdit(p);	g->addWidget(ztt,8,3);
-	ctt = new QLineEdit(p);	g->addWidget(ctt,8,4);
-	l = new QLabel(tr("AlphaDef"), p);	g->addWidget(l,9,0);
-	aldef = new QLineEdit(p);	g->addWidget(aldef,10,0);
-	l = new QLabel(tr("Ambient"), p);	g->addWidget(l,9,1);
-	amb = new QLineEdit(p);	g->addWidget(amb,10,1);
-	l = new QLabel(tr("BaseWidth"), p);	g->addWidget(l,9,2);
-	basew = new QLineEdit(p);	g->addWidget(basew,10,2);
-	l = new QLabel(tr("MeshNum"), p);	g->addWidget(l,9,3);
-	mesh = new QLineEdit(p);	g->addWidget(mesh,10,3);
-	l = new QLabel(tr("AxialDir"), p);	g->addWidget(l,9,4);
-	axial = new QComboBox(p);	g->addWidget(axial,10,4);
+	xpos = new QComboBox(p);	g->addWidget(xpos,5,1);	xpos->addItems(lpos);
+	ypos = new QComboBox(p);	g->addWidget(ypos,5,2);	ypos->addItems(lpos);
+	zpos = new QComboBox(p);	g->addWidget(zpos,5,3);	zpos->addItems(lpos);
+	l = new QLabel(tr("Ticks"), p);	g->addWidget(l,6,0);
+	xtck = new QLineEdit(p);	g->addWidget(xtck,6,1);
+	ytck = new QLineEdit(p);	g->addWidget(ytck,6,2);
+	ztck = new QLineEdit(p);	g->addWidget(ztck,6,3);
+	l = new QLabel(tr("SubTicks"), p);	g->addWidget(l,7,0);
+	xsub = new QLineEdit(p);	g->addWidget(xsub,7,1);
+	ysub = new QLineEdit(p);	g->addWidget(ysub,7,2);
+	zsub = new QLineEdit(p);	g->addWidget(zsub,7,3);
+	l = new QLabel(tr("Start"), p);	g->addWidget(l,8,0);
+	xort = new QLineEdit(p);	g->addWidget(xort,8,1);
+	yort = new QLineEdit(p);	g->addWidget(yort,8,2);
+	zort = new QLineEdit(p);	g->addWidget(zort,8,3);
+	l = new QLabel(tr("Template"), p);	g->addWidget(l,9,0);
+	xtt = new QLineEdit(p);	g->addWidget(xtt,9,1);
+	ytt = new QLineEdit(p);	g->addWidget(ytt,9,2);
+	ztt = new QLineEdit(p);	g->addWidget(ztt,9,3);
+	ctt = new QLineEdit(p);	g->addWidget(ctt,9,4);
+	l = new QLabel(tr("AlphaDef"), p);	g->addWidget(l,10,0);
+	aldef = new QLineEdit(p);	g->addWidget(aldef,11,0);
+	l = new QLabel(tr("Ambient"), p);	g->addWidget(l,10,1);
+	amb = new QLineEdit(p);	g->addWidget(amb,11,1);
+	l = new QLabel(tr("BaseWidth"), p);	g->addWidget(l,10,2);
+	basew = new QLineEdit(p);	g->addWidget(basew,11,2);
+	l = new QLabel(tr("MeshNum"), p);	g->addWidget(l,10,3);
+	mesh = new QLineEdit(p);	g->addWidget(mesh,11,3);
+	l = new QLabel(tr("AxialDir"), p);	g->addWidget(l,10,4);
+	axial = new QComboBox(p);	g->addWidget(axial,11,4);
 	axial->addItem("none");	axial->addItem("x");
 	axial->addItem("y");	axial->addItem("z");
-	l = new QLabel(tr("Font"), p);	g->addWidget(l,11,0);
-	font = new QLineEdit(p);	g->addWidget(font,12,0);
-	l = new QLabel(tr("FontSize"), p);	g->addWidget(l,11,1);
-	fsize = new QLineEdit(p);	g->addWidget(fsize,12,1);
-	alpha = new QCheckBox(tr("Alpha on"),p);	g->addWidget(alpha, 12,2);
-	light = new QCheckBox(tr("Light on"),p);	g->addWidget(light, 12,3);
-	rotate = new QCheckBox(tr("No text rotation"),p);	g->addWidget(rotate, 12,4);
+	l = new QLabel(tr("Font"), p);	g->addWidget(l,12,0);
+	font = new QLineEdit(p);	g->addWidget(font,13,0);
+	l = new QLabel(tr("FontSize"), p);	g->addWidget(l,12,1);
+	fsize = new QLineEdit(p);	g->addWidget(fsize,13,1);
+	alpha = new QCheckBox(tr("Alpha on"),p);	g->addWidget(alpha, 13,2);
+	light = new QCheckBox(tr("Light on"),p);	g->addWidget(light, 13,3);
+	rotate = new QCheckBox(tr("No text rotation"),p);	g->addWidget(rotate, 13,4);
 	tab->addTab(p, tr("General settings"));
 
 	p = new QWidget(this);
@@ -123,14 +123,14 @@ SetupDialog::SetupDialog(QWidget *parent) : QDialog(parent)
 	for(int i=0;i<10;i++)
 	{
 		s[0] = char(i+'0');
-		l = new QLabel(s, p);	g->addWidget(l,i,0);
-		slight[i] = new QCheckBox(tr("on"),p);	g->addWidget(slight[i], i, 1);
-		xlight[i] = new QLineEdit(p);	g->addWidget(xlight[i], i, 2);
-		ylight[i] = new QLineEdit(p);	g->addWidget(ylight[i], i, 3);
-		zlight[i] = new QLineEdit(p);	g->addWidget(zlight[i], i, 4);
-		clight[i] = new QComboBox(p);	g->addWidget(clight[i], i, 5);
+		l = new QLabel(s, p);	g->addWidget(l,i+1,0);
+		slight[i] = new QCheckBox(tr("on"),p);	g->addWidget(slight[i], i+1, 1);
+		xlight[i] = new QLineEdit(p);	g->addWidget(xlight[i], i+1, 2);
+		ylight[i] = new QLineEdit(p);	g->addWidget(ylight[i], i+1, 3);
+		zlight[i] = new QLineEdit(p);	g->addWidget(zlight[i], i+1, 4);
+		clight[i] = new QComboBox(p);	g->addWidget(clight[i], i+1, 5);
 		fillColors(clight[i]);
-		blight[i] = new QLineEdit(p);	g->addWidget(blight[i], i, 6);
+		blight[i] = new QLineEdit(p);	g->addWidget(blight[i], i+1, 6);
 	}
 	tab->addTab(p, tr("Light settings"));
 
@@ -186,7 +186,7 @@ bool SetupDialog::convert()
 		if(!slight[i]->isChecked())	continue;
 		if(xlight[i]->text().isEmpty() || ylight[i]->text().isEmpty() || zlight[i]->text().isEmpty())
 		{
-			QMessageBox::information(this, tr("UDAV - Setup"), tr("Light position should be filled. Ignore it."), QMessageBox::Ok);
+			QMessageBox::information(this, tr("UDAV - Setup plot"), tr("Light position should be filled. Ignore it."), QMessageBox::Ok);
 			continue;
 		}
 		x1=xlight[i]->text().toDouble();	y1=ylight[i]->text().toDouble();
diff --git a/src/src.pro b/src/src.pro
index a1be200..0126607 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,63 +1,58 @@
 DEFINES += MGL_DOC_DIR=\\\"$(MGLDOCDIR)\\\"
-
 TEMPLATE = app
 CONFIG += release \
-          warn_on \
-	  thread \
-          qt
+    warn_on \
+    thread \
+    qt
 TARGET = ../bin/udav
-RESOURCES -= application.qrc
-
+RESOURCES += udav.qrc
 SOURCES += optiondialog.cpp \
-finddialog.cpp \
-animparam.cpp \
-argsdialog.cpp \
-styledialog.cpp \
-qmglcanvas.cpp \
-qmglsyntax.cpp \
-main.cpp \
-propdialog.cpp \
-setupdialog.cpp \
-tablewindow.cpp \
-scriptwindow.cpp \
-helpwindow.cpp \
-scriptmenu.cpp \
- infodialog.cpp \
- mgl_addon.cpp
+    finddialog.cpp \
+    animparam.cpp \
+    styledialog.cpp \
+    qmglcanvas.cpp \
+    qmglsyntax.cpp \
+    main.cpp \
+    propdialog.cpp \
+    setupdialog.cpp \
+    tablewindow.cpp \
+    scriptwindow.cpp \
+    helpwindow.cpp \
+    scriptmenu.cpp \
+    infodialog.cpp \
+    graphwindow.cpp \
+    tablewrapper.cpp \
+	newcmddialog.cpp
 HEADERS += finddialog.h \
-optiondialog.h \
-animparam.h \
-argsdialog.h \
-styledialog.h \
-tablewindow.h \
-qmglsyntax.h \
-helpwindow.h \
-qmglcanvas.h \
-propdialog.h \
-scriptwindow.h \
-setupdialog.h \
- infodialog.h
-DISTFILES += ../TODO \
-../ChangeLog.txt \
-../INSTALL
-
+    optiondialog.h \
+    animparam.h \
+    styledialog.h \
+    tablewindow.h \
+    qmglsyntax.h \
+    helpwindow.h \
+    qmglcanvas.h \
+    propdialog.h \
+    scriptwindow.h \
+    setupdialog.h \
+    graphwindow.h \
+    infodialog.h \
+	newcmddialog.h
+DISTFILES += ../TODO ../ChangeLog.txt ../INSTALL
 RC_FILE = udav.rc
-
 target.path = /usr/local/bin/
 INSTALLS += target \
- help \
- pics
-
-RESOURCES += udav.qrc
-
+    help \
+    pics \
+    icon \
+    desc
+TRANSLATIONS = udav_ru.ts
 LIBS += -lmgl -lhdf5
-
-../help/*.html.files += ../help/*.html
-
-help.files += ../help/*.html
+desc.files += ../UDAV.desktop
+icon.files += udav.png
+help.files += ../help/*.html udav_ru.qm
 pics.files += ../help/pics/*.png
-
 help.path = /usr/local/share/doc/udav/
-
 pics.path = /usr/local/share/doc/udav/pics/
-
+icon.path = /usr/local/share/udav/
+desc.path = /usr/local/share/applications/
+OTHER_FILES += ../ChangeLog.txt ../TODO
diff --git a/src/styledialog.cpp b/src/styledialog.cpp
index 1840080..be12720 100644
--- a/src/styledialog.cpp
+++ b/src/styledialog.cpp
@@ -17,18 +17,18 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-#include <qpushbutton.h>
-#include <qmessagebox.h>
-#include <qcombobox.h>
-#include <qcheckbox.h>
+#include <QPushButton>
+#include <QMessageBox>
+#include <QComboBox>
+#include <QCheckBox>
 #include <QRadioButton>
 #include <QGroupBox>
-#include <qtabwidget.h>
-#include <qslider.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qlineedit.h>
+#include <QTabWidget>
+#include <QSlider>
+#include <QSpinBox>
+#include <QLayout>
+#include <QLabel>
+#include <QLineEdit>
 #include <mgl/mgl_zb.h>
 //-----------------------------------------------------------------------------
 #include "xpm/none.xpm"
@@ -168,7 +168,7 @@ StyleDialog::StyleDialog(QWidget *parent) : QDialog(parent)
 	connect(rbL,SIGNAL(toggled(bool)), this, SLOT(updatePic()));
 	connect(rbC,SIGNAL(toggled(bool)), this, SLOT(updatePic()));
 	connect(rbR,SIGNAL(toggled(bool)), this, SLOT(updatePic()));
-	tab->addTab(p, tr("Color scheme"));
+	tab->addTab(p, tr("Font style"));
 	connect(tab,SIGNAL(currentChanged(QWidget *)), this, SLOT(updatePic()));
 
 	// dialog itself
@@ -213,7 +213,7 @@ void fillColors(QComboBox *cb)
 	pic.fill(QColor(0,127,0));		cb->addItem(pic, QObject::tr("G - green"));
 	pic.fill(QColor(127,0,0));		cb->addItem(pic, QObject::tr("R - maroon"));
 	pic.fill(QColor(0,127,127));	cb->addItem(pic, QObject::tr("C - teal"));
-	pic.fill(QColor(127,0,127));	cb->addItem(pic, QObject::tr("M -purple"));
+	pic.fill(QColor(127,0,127));	cb->addItem(pic, QObject::tr("M - purple"));
 	pic.fill(QColor(127,127,0));	cb->addItem(pic, QObject::tr("Y - olive"));
 	pic.fill(QColor(0,127,77));		cb->addItem(pic, QObject::tr("L - seagreen"));
 	pic.fill(QColor(77,127,0));		cb->addItem(pic, QObject::tr("E - darklawn"));
diff --git a/src/tablewindow.cpp b/src/tablewindow.cpp
index 4c7fe25..318771f 100644
--- a/src/tablewindow.cpp
+++ b/src/tablewindow.cpp
@@ -18,19 +18,18 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 #include <QTableWidget>
-#include <qlabel.h>
-#include <qaction.h>
-#include <qlayout.h>
-#include <qmenubar.h>
-#include <qlineedit.h>
-#include <qlineedit.h>
+#include <QLabel>
+#include <QAction>
+#include <QLayout>
+#include <QMenuBar>
+#include <QLineEdit>
 #include <QMenu>
-#include <qclipboard.h>
-#include <qstatusbar.h>
-#include <qfiledialog.h>
-#include <qpushbutton.h>
-#include <qapplication.h>
-#include <qinputdialog.h>
+#include <QClipboard>
+#include <QStatusBar>
+#include <QFileDialog>
+#include <QPushButton>
+#include <QApplication>
+#include <QInputDialog>
 #include <QToolBar>
 #include <QSpinBox>
 #include <mgl/mgl_parse.h>
@@ -42,52 +41,43 @@ extern mglParse parser;
 void updateDataItems();
 void deleteWindow(void *o)	{	if(o)	delete ((TableWindow *)o);	}
 //-----------------------------------------------------------------------------
-TableWindow::TableWindow(QWidget *parent) : QMainWindow(parent)
+TableWindow::TableWindow(InfoDialog *inf, QWidget *parent) : QMdiSubWindow(parent)
 {
 	setAttribute(Qt::WA_DeleteOnClose);
 	kz = nx = ny = nz = 0;	var = 0;
 	ready = false;
-
-	infoDlg = new InfoDialog(this);
+	infoDlg = inf;
 	tab = new QTableWidget(this);
 	connect(tab, SIGNAL(cellChanged(int,int)), this, SLOT(putValue(int, int)));
 
-	makeMenu();
-//	setDockMenuEnabled(true);
 	setWindowIcon(QPixmap(table_xpm));
-	setCentralWidget(tab);
-	QMainWindow::resize(700, 400);
-	statusBar()->showMessage(tr("Ready"), 2000);
+	setWidget(tab);
 }
 //-----------------------------------------------------------------------------
-TableWindow::~TableWindow()
-{
-	if(var)	var->o = 0;
-}
+TableWindow::~TableWindow()	{	if(var)	var->o = 0;	}
 //-----------------------------------------------------------------------------
 void TableWindow::refresh()
 {
 	bool rc = false;
 	if(!var)	return;
 	infoDlg->allowRefresh=false;
-	if(nx!=var->d.nx)
-	{	nx = var->d.nx;	tab->setColumnCount(nx);rc=true;	}
-	if(ny!=var->d.ny)
-	{	ny = var->d.ny;	tab->setRowCount(ny);	rc=true;	}
-	if(kz>=var->d.nz)
-	{	kz = 0;			emit sliceChanged(0);	}
-	if(nz!=var->d.ny)
-	{	nz = var->d.nz;	sb->setRange(0,nz-1);	emit nzChanged(nz);		}
+	if(nx!=var->d.nx)	{	nx = var->d.nx;	tab->setColumnCount(nx);rc=true;	}
+	if(ny!=var->d.ny)	{	ny = var->d.ny;	tab->setRowCount(ny);	rc=true;	}
+	if(kz>=var->d.nz)	{	kz = 0;			emit sliceChanged(0);	}
+	if(nz!=var->d.ny)	{	nz = var->d.nz;	emit nzChanged(nz);		}
 	register long i,j,m=wcslen(var->s);
 	register float f;
 	QString s,d;
 	if(rc)
 	{
-		QTableWidgetItem *it;
+		QStringList sh,sv;
+		for(i=0;i<nx;i++)	sh<<QString::number(i);
+		tab->setHorizontalHeaderLabels(sh);
+		for(i=0;i<ny;i++)	sv<<QString::number(i);
+		tab->setVerticalHeaderLabels(sv);
 		for(i=0;i<nx;i++)	for(j=0;j<ny;j++)
-		{	it = new QTableWidgetItem;	tab->setItem(j,i,it);	}
+			tab->setItem(j,i,new QTableWidgetItem);
 	}
-//	tab->setNumCols(nx);	tab->setNumRows(ny);
 	for(i=0;i<nx;i++)	for(j=0;j<ny;j++)
 	{
 		f = var->d.a[i+nx*(j+ny*kz)];
@@ -101,7 +91,6 @@ void TableWindow::refresh()
 	s = QString(ss, m);	delete []ss;
 	d.sprintf("%d * %d * %d", nx, ny, nz);
 	ready = true;
-	statusBar()->showMessage(tr("Data: ") + s + tr(", sizes: ") + d);
 }
 //-----------------------------------------------------------------------------
 void TableWindow::setVar(mglVar *v)
@@ -149,228 +138,6 @@ void TableWindow::putValue(int r, int c)
 	infoDlg->refresh();
 }
 //-----------------------------------------------------------------------------
-#include "xpm/preview.xpm"
-#include "xpm/plot.xpm"
-#include "xpm/size.xpm"
-#include "xpm/smth.xpm"
-#include "xpm/oper_d.xpm"
-#include "xpm/oper_s.xpm"
-#include "xpm/oper_a.xpm"
-#include "xpm/oper_m.xpm"
-#include "xpm/crop.xpm"
-#include "xpm/tran.xpm"
-#include "xpm/integr.xpm"
-#include "xpm/diff.xpm"
-#include "xpm/diff2.xpm"
-#include "xpm/squize.xpm"
-#include "xpm/sum.xpm"
-#include "xpm/func.xpm"
-#include "xpm/swap.xpm"
-//-----------------------------------------------------------------------------
-void TableWindow::makeMenu()
-{
-	QAction *a;
-	QMenu *o, *oo;
-	QToolBar *bb;
-
-	// file menu
-	{
-	bb = new QToolBar(tr("File Operations"),this);
-	addToolBar(Qt::TopToolBarArea, bb);
-	o = menuBar()->addMenu(tr("&File"));
-	a = new QAction(QPixmap(":/xpm/document-open.png"), tr("&Load data"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(load()));
-	a->setToolTip(tr("Load data from file (Ctrl+O). Data will be deleted only\nat exit but UDAV will not ask to save it."));
-	a->setShortcut(Qt::CTRL+Qt::Key_O);	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/document-import.png"), tr("&Import PNG"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(imprt()));
-	a->setToolTip(tr("Import data from PNG picture with specified color scheme.\nData will be deleted only at exit but UDAV will not ask it saving."));
-	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/document-save.png"), tr("&Save data"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(save()));
-	a->setToolTip(tr("Save data to tab-separeted file (Ctrl+S)."));
-	a->setShortcut(Qt::CTRL+Qt::Key_S);	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/document-export.png"), tr("&Export PNG"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(exprt()));
-	a->setToolTip(tr("Export data from PNG picture. The colors defined by \nspecified color scheme. The same as in 'dens' command."));
-	o->addAction(a);	bb->addAction(a);
-	o->addSeparator();	bb->addSeparator();
-//	a = new QAction(QPixmap(insert_xpm), tr("Insert as &list"), this);
-//	connect(a, SIGNAL(activated()), this, SLOT(list()));
-//	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(plot_xpm), tr("Plot &data"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(plot()));
-	a->setToolTip(tr("Plot data in new script window. You may select the kind\nof plot, its style and so on."));
-	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(preview_xpm), tr("Pre&view"), this);
-	a->setShortcut(Qt::Key_F2);	a->setCheckable(true);
-	connect(a, SIGNAL(toggled(bool)), infoDlg, SLOT(setVisible(bool)));
-	connect(infoDlg, SIGNAL(finished(int)), a, SLOT(toggle()));
-	a->setToolTip(tr("Open/close the preview/information window (F2).\nThis window show simple graphics and information about data."));
-	o->addAction(a);	bb->addAction(a);
-//	o->addSeparator();	bb->addSeparator();
-	a = new QAction(QPixmap(":/xpm/edit-copy.png"), tr("&Copy data"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(copy()));
-	a->setToolTip(tr("Copy selected data to clipboard (Ctrl+C).\nValues are copied as tab-separated text."));
-	a->setShortcut(Qt::CTRL+Qt::Key_C);	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/edit-paste.png"), tr("&Paste data"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(paste()));
-	a->setToolTip(tr("Paste data from clipboard (Ctrl+V).\nIt is supposed that values have tab-separated text format."));
-	a->setShortcut(Qt::CTRL+Qt::Key_V);	o->addAction(a);	bb->addAction(a);
-	}
-	// size menu
-	{
-	bb = new QToolBar(tr("Resize data"),this);
-	addToolBar(Qt::TopToolBarArea, bb);
-	o = menuBar()->addMenu(tr("&Sizes"));
-	a = new QAction(QPixmap(":/xpm/document-new.png"), tr("&Create new"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(create()));
-	a->setToolTip(tr("Recreate the data with new sizes and fill it by zeros (Ctrl+N)."));
-	a->setShortcut(Qt::CTRL+Qt::Key_N);	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(size_xpm), tr("&Resize"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(resize()));
-	a->setToolTip(tr("Resize (interpolate) the data to specified sizes (Ctrl+R)."));
-	a->setShortcut(Qt::CTRL+Qt::Key_R);	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(squize_xpm), tr("&Squeeze"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(squize()));
-	a->setToolTip(tr("Keep only each n-th element of the data array."));
-	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(crop_xpm), tr("Cro&p"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(crop()));
-	a->setToolTip(tr("Crop the data edges. Useful to cut off the zero-filled area."));
-	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(tran_xpm), tr("&Transpose"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(transp()));
-	a->setToolTip(tr("Transpose data dimensions, like x<->y or x<->z and so on."));
-	o->addAction(a);	bb->addAction(a);
-	a = new QAction(tr("Re&arrange"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(rearrange()));
-	a->setToolTip(tr("Rearrange data sizes without changing data values."));
-	o->addAction(a);
-	}
-	// modify menu
-	{
-	bb = new QToolBar(tr("Modify data"),this);
-	addToolBar(Qt::LeftToolBarArea, bb);
-	o = menuBar()->addMenu(tr("&Modify"));
-
-	a = new QAction(QPixmap(func_xpm), tr("By &formula"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(byformula()));
-	a->setToolTip(tr("Change data values according to formula depended on 'x', 'y' and 'z'\nvariables (Ctrl+M). A set of special function is availible also."));
-	a->setShortcut(Qt::CTRL+Qt::Key_M);	o->addAction(a);	bb->addAction(a);
-	a = new QAction(tr("Fill in &range"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(inrange()));
-	a->setToolTip(tr("Fill data equidistantly from one value to another."));
-	o->addAction(a);
-	a = new QAction(tr("&Normalize"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(norm()));
-	a->setToolTip(tr("Normalize data so that its minimal\nand maximal values be in specified range."));
-	o->addAction(a);
-	a = new QAction(tr("Norm. s&lices"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(normsl()));
-	a->setToolTip(tr("Normalize each data slice perpendicular to some direction\nso that its minimal and maximal values be in specified range."));
-	o->addAction(a);
-	a = new QAction(QPixmap(smth_xpm), tr("&Smooth data"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(smooth()));
-	a->setToolTip(tr("Smooth data by one of 4 methods along specified direction(s)."));
-	o->addAction(a);	bb->addAction(a);
-	o->addSeparator();	bb->addSeparator();
-
-	oo = o->addMenu(tr("&Operators"));
-	a = new QAction(QPixmap(sum_xpm), tr("&Cum. sum"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(cumsum()));
-	a->setToolTip(tr("Summate data values along specified direction(s)."));
-	oo->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(integr_xpm), tr("&Integrate"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(integr()));
-	a->setToolTip(tr("Integrate data values along specified direction(s)."));
-	oo->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(diff_xpm), tr("&Differentiate"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(diff()));
-	a->setToolTip(tr("Differentiate data values along specified direction(s)."));
-	oo->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(diff2_xpm), tr("&Laplace"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(diff2()));
-	a->setToolTip(tr("Double differentiate data values along specified direction(s)."));
-	oo->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(swap_xpm), tr("&Swap"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(swap()));
-	a->setToolTip(tr("Swap left and right data part along specified direction(s).\nThis operation is useful for data after Fourier transform."));
-	oo->addAction(a);	bb->addAction(a);
-	a = new QAction(tr("&Mirror"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(mirror()));
-	a->setToolTip(tr("Mirror left and right data part along specified direction(s).\nThis operation do like index change from 'i' to 'n-i'."));
-	oo->addAction(a);
-
-	oo = o->addMenu(tr("&Algebraic"));
-	a = new QAction(QPixmap(oper_a_xpm), tr("&Add"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(addto()));
-	a->setToolTip(tr("Add a number to all data values."));
-	oo->addAction(a);
-	a = new QAction(QPixmap(oper_s_xpm), tr("&Subtract"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(subto()));
-	a->setToolTip(tr("Subtract a number to all data values."));
-	oo->addAction(a);
-	a = new QAction(QPixmap(oper_m_xpm), tr("&Multiply"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(multo()));
-	a->setToolTip(tr("Multiply all data values by a number."));
-	oo->addAction(a);
-	a = new QAction(QPixmap(oper_d_xpm), tr("&Divide"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(divto()));
-	a->setToolTip(tr("Divide all data values by a number."));
-	oo->addAction(a);
-
-	oo = o->addMenu(tr("A&nother data"));
-	a = new QAction(tr("&Sum of"), this);	oo->addAction(a);
-	connect(a, SIGNAL(activated()), this, SLOT(sumof()));
-	a = new QAction(tr("M&in of"), this);	oo->addAction(a);
-	connect(a, SIGNAL(activated()), this, SLOT(minof()));
-	a = new QAction(tr("M&ax of"), this);	oo->addAction(a);
-	connect(a, SIGNAL(activated()), this, SLOT(maxof()));
-	a = new QAction(tr("Momentum along &x"), this);	oo->addAction(a);
-	connect(a, SIGNAL(activated()), this, SLOT(momentx()));
-	a = new QAction(tr("Momentum along &y"), this);	oo->addAction(a);
-	connect(a, SIGNAL(activated()), this, SLOT(momenty()));
-	a = new QAction(tr("Momentum along &z"), this);	oo->addAction(a);
-	connect(a, SIGNAL(activated()), this, SLOT(momentz()));
-	a = new QAction(tr("&Histogram"), this);	oo->addAction(a);
-	connect(a, SIGNAL(activated()), this, SLOT(hist()));
-	}
-	// navigation menu
-	{
-	bb = new QToolBar(tr("Navigate data"),this);
-	addToolBar(Qt::TopToolBarArea, bb);
-	o = menuBar()->addMenu(tr("&Navigate"));
-	a = new QAction(QPixmap(":/xpm/go-first.png"), tr("&First slice"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(first()));
-	a->setToolTip(tr("Go to the first data slice for 3D data."));
-	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/go-previous.png"), tr("&Prev. slice"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(prev()));
-	a->setToolTip(tr("Go to the previous data slice for 3D data."));
-	o->addAction(a);	bb->addAction(a);
-
-	sb = new QSpinBox(this);
-	bb->addWidget(sb);	sb->setRange(0,0);
-	connect(sb, SIGNAL(valueChanged(int)), this, SLOT(setSlice(int)));
-	connect(this, SIGNAL(sliceChanged(int)), sb, SLOT(setValue(int)));
-	sb->setToolTip(tr("Go to the specified data slice for 3D data."));
-
-	a = new QAction(tr("Go to slice"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(gosl()));
-	a->setToolTip(tr("Go to the specified data slice for 3D data."));
-	o->addAction(a);
-	a = new QAction(QPixmap(":/xpm/go-next.png"), tr("Next slice"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(next()));
-	a->setToolTip(tr("Go to the next data slice for 3D data."));
-	o->addAction(a);	bb->addAction(a);
-	a = new QAction(QPixmap(":/xpm/go-last.png"), tr("Last slice"), this);
-	connect(a, SIGNAL(activated()), this, SLOT(last()));
-	a->setToolTip(tr("Go to the last data slice for 3D data."));
-	o->addAction(a);	bb->addAction(a);
-	}
-}
-//-----------------------------------------------------------------------------
 void TableWindow::imprt()
 {
 	QString fn = QFileDialog::getOpenFileName(this, tr("UDAV - Import PNG"), "", tr("Data files (*.dat)\nAll files (*.*)"));
@@ -609,7 +376,7 @@ void TableWindow::swap()
 void TableWindow::mirror()
 {
 	bool ok;
-	QString s = QInputDialog::getText(this, tr("UDAV - Mirror data"), tr("Enter direction(s) for mirroring.\nFor example 'xy' - mirror along x and y directions. Useful for Fourier spectrum."), QLineEdit::Normal, "", &ok);
+	QString s = QInputDialog::getText(this, tr("UDAV - Mirror data"), tr("Enter direction(s) for mirroring.\nFor example 'xy' - mirror along x and y directions."), QLineEdit::Normal, "", &ok);
 	if(ok)	{	var->d.Swap(s.toAscii());	refresh();	}
 }
 //-----------------------------------------------------------------------------
@@ -649,7 +416,8 @@ void TableWindow::minof()
 void TableWindow::momentx()
 {
 	QString name, val;
-	if(namesDialog(tr("UDAV - Momentum along 'x'"), tr("Specify which momentum evaluate.\nFor example, 'z2y' will give moment 'z^2*y'."), name, val))
+	if(namesDialog(tr("UDAV - Momentum along 'x'"),
+		tr("Specify which momentum evaluate.\nThe momentum is res_i = sum_jk how(x_i,y_j,z_k) a_jk/ sum_jk a_jk.\nCoordinates x, y, z are data indexes normalized in range [0,1]."), name, val))
 	{
 		mglVar *v = parser.AddVar(name.toAscii());
 		v->d = var->d.Momentum('x', val.toAscii());
@@ -660,7 +428,8 @@ void TableWindow::momentx()
 void TableWindow::momenty()
 {
 	QString name, val;
-	if(namesDialog(tr("UDAV - Momentum along 'y'"), tr("Specify which momentum evaluate.\nFor example, 'z2x' will give moment 'z^2*x'."), name, val))
+	if(namesDialog(tr("UDAV - Momentum along 'y'"),
+		tr("Specify which momentum evaluate.\nThe momentum is res_j = sum_ik how(x_i,y_j,z_k) a_ik/ sum_ik a_ik.\nCoordinates x, y, z are data indexes normalized in range [0,1]."), name, val))
 	{
 		mglVar *v = parser.AddVar(name.toAscii());
 		v->d = var->d.Momentum('y', val.toAscii());
@@ -671,7 +440,8 @@ void TableWindow::momenty()
 void TableWindow::momentz()
 {
 	QString name, val;
-	if(namesDialog(tr("UDAV - Momentum along 'z'"), tr("Specify which momentum evaluate.\nFor example, 'x2y' will give moment 'x^2*y'."), name, val))
+	if(namesDialog(tr("UDAV - Momentum along 'z'"),
+		tr("Specify which momentum evaluate.\nThe momentum is res_k = sum_ij how(x_i,y_j,z_k) a_ij/ sum_ij a_ij.\nCoordinates x, y, z are data indexes normalized in range [0,1]."), name, val))
 	{
 		mglVar *v = parser.AddVar(name.toAscii());
 		v->d = var->d.Momentum('z', val.toAscii());
@@ -687,8 +457,8 @@ void TableWindow::hist()
 	QPushButton *b;
 	QDialog *d = new QDialog(this);	d->setWindowTitle(tr("UDAV - Make histogram"));
 	QGridLayout *g = new QGridLayout(d);
-	l = new QLabel(tr("From value"), d);	g->addWidget(l,0,0);
-	l = new QLabel(tr("To value"), d);	g->addWidget(l,0,1);
+	l = new QLabel(tr("From"), d);	g->addWidget(l,0,0);
+	l = new QLabel(tr("To"), d);	g->addWidget(l,0,1);
 	v1 = new QLineEdit(d);	g->addWidget(v1,1,0);
 	v2 = new QLineEdit(d);	g->addWidget(v2,1,1);
 	l = new QLabel(tr("Number of points"), d);	g->addWidget(l,2,0);
diff --git a/src/tablewindow.h b/src/tablewindow.h
index 9b1bba6..758dcc8 100644
--- a/src/tablewindow.h
+++ b/src/tablewindow.h
@@ -20,22 +20,26 @@
 #ifndef TABLEWINDOW_H
 #define TABLEWINDOW_H
 //-----------------------------------------------------------------------------
-#include <qmainwindow.h>
+#include <QMdiSubWindow>
 class mglVar;
 class QTableWidget;
 class QSpinBox;
+class QMainWindow;
 class InfoDialog;
 //-----------------------------------------------------------------------------
 /// Window for viewing, handling and editing the data array
-class TableWindow : public QMainWindow
+class TableWindow : public QMdiSubWindow
 {
 Q_OBJECT
+friend class ScriptWindow;
 public:
-	TableWindow(QWidget *parent = 0);
+	InfoDialog *infoDlg;	///< NOTE: Reference to dialog !!!
+	TableWindow(InfoDialog *inf, QWidget *parent = 0);
 	~TableWindow();
 
 	void refresh();	///< Refresh table with new data values
 	void setVar(mglVar *v);
+	inline long GetNz()	{	return nz;	};	///< Get number of slices
 protected:
 	//void contextMenuEvent(QContextMenuEvent *event);
 private slots:
@@ -98,11 +102,9 @@ private:
 	QTableWidget *tab;	///< Table itself
 	int kz;			///< Current z-slice
 	mglVar *var;	///< Variable with data
-	QSpinBox *sb;	///< SpinBox for selecting slice
+//	QSpinBox *sb;	///< SpinBox for selecting slice
 	bool ready;		///< Data is refreshed
-	InfoDialog *infoDlg;	///< Data preview and information
 
-	void makeMenu();
 	bool sizesDialog(const QString &cap, const QString &lab, const QString &desc1, const QString &desc2, const QString &desc3, QString &val1, QString &val2, QString &val3);
 	bool namesDialog(const QString &cap, const QString &lab, QString &name, QString &val);
 };
diff --git a/src/tablewrapper.cpp b/src/tablewrapper.cpp
new file mode 100644
index 0000000..1b8fb98
--- /dev/null
+++ b/src/tablewrapper.cpp
@@ -0,0 +1,393 @@
+/***************************************************************************
+ *   Copyright (C) 2008 by Alexey Balakin                                  *
+ *   mathgl.abalakin at gmail.com                                             *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+#include <QMenuBar>
+#include <QToolBar>
+#include <QMenu>
+#include <QAction>
+#include <QSpinBox>
+#include <QMdiArea>
+#include <QTextEdit>
+
+#include "scriptwindow.h"
+#include "tablewindow.h"
+#include "infodialog.h"
+//-----------------------------------------------------------------------------
+//#include "xpm/preview.xpm"
+#include "xpm/plot.xpm"
+#include "xpm/size.xpm"
+#include "xpm/smth.xpm"
+#include "xpm/oper_d.xpm"
+#include "xpm/oper_s.xpm"
+#include "xpm/oper_a.xpm"
+#include "xpm/oper_m.xpm"
+#include "xpm/crop.xpm"
+#include "xpm/tran.xpm"
+#include "xpm/integr.xpm"
+#include "xpm/diff.xpm"
+#include "xpm/diff2.xpm"
+#include "xpm/squize.xpm"
+#include "xpm/sum.xpm"
+#include "xpm/func.xpm"
+#include "xpm/swap.xpm"
+//-----------------------------------------------------------------------------
+void ScriptWindow::makeDataMenu()
+{
+	QAction *a;
+	QMenu *o, *oo;
+	QToolBar *bb;
+
+	dataMenu = menuBar()->addMenu(tr("&Data"));
+	// file menu
+	{
+	bb = tbData[0] = new QToolBar(tr("File Operations"),this);
+	addToolBar(Qt::TopToolBarArea, bb);	insertToolBarBreak(bb);
+	o = dataMenu->addMenu(tr("&File"));
+	a = new QAction(QPixmap(":/xpm/document-open.png"), tr("&Load data"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(loadData()));
+	a->setToolTip(tr("Load data from file. Data will be deleted only\nat exit but UDAV will not ask to save it."));
+	a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_O);	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/document-import.png"), tr("&Import PNG"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(imprt()));
+	a->setToolTip(tr("Import data from PNG picture with specified color scheme.\nData will be deleted only at exit but UDAV will not ask it saving."));
+	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/document-save.png"), tr("&Save data"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(saveData()));
+	a->setToolTip(tr("Save data to tab-separeted file."));
+	a->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_S);	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/document-export.png"), tr("&Export PNG"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(exprt()));
+	a->setToolTip(tr("Export data to PNG picture. The colors defined by \nspecified color scheme. The same as in 'dens' command."));
+	o->addAction(a);	bb->addAction(a);
+//	o->addSeparator();	bb->addSeparator();
+//	a = new QAction(QPixmap(insert_xpm), tr("Insert as &list"), this);
+//	connect(a, SIGNAL(activated()), this, SLOT(list()));
+//	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(plot_xpm), tr("Plot &data"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(plot()));
+	a->setToolTip(tr("Plot data in new script window. You may select the kind\nof plot, its style and so on."));
+	o->addAction(a);	bb->addAction(a);
+/*	a = new QAction(QPixmap(preview_xpm), tr("Pre&view"), this);	// TODO
+	a->setShortcut(Qt::Key_F2);	a->setCheckable(true);
+	connect(a, SIGNAL(toggled(bool)), infoDlg, SLOT(setVisible(bool)));
+	connect(infoDlg, SIGNAL(finished(int)), a, SLOT(toggle()));
+	a->setToolTip(tr("Open/close the preview/information window (F2).\nThis window show simple graphics and information about data."));
+	o->addAction(a);	bb->addAction(a);*/
+	}
+	// size menu
+	{
+	bb = tbData[1] = new QToolBar(tr("Resize data"),this);
+	addToolBar(Qt::TopToolBarArea, bb);
+	o = dataMenu->addMenu(tr("&Sizes"));
+	a = new QAction(QPixmap(":/xpm/document-new.png"), tr("&Create new"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(create()));
+	a->setToolTip(tr("Recreate the data with new sizes and fill it by zeros (Ctrl+N)."));
+	a->setShortcut(Qt::CTRL+Qt::Key_N);	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(size_xpm), tr("&Resize"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(reSize()));
+	a->setToolTip(tr("Resize (interpolate) the data to specified sizes (Ctrl+R)."));
+	a->setShortcut(Qt::CTRL+Qt::Key_R);	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(squize_xpm), tr("&Squeeze"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(squize()));
+	a->setToolTip(tr("Keep only each n-th element of the data array."));
+	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(crop_xpm), tr("Cro&p"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(crop()));
+	a->setToolTip(tr("Crop the data edges. Useful to cut off the zero-filled area."));
+	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(tran_xpm), tr("&Transpose"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(transp()));
+	a->setToolTip(tr("Transpose data dimensions, like x<->y or x<->z and so on."));
+	o->addAction(a);	bb->addAction(a);
+	a = new QAction(tr("Re&arrange"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(rearrange()));
+	a->setToolTip(tr("Rearrange data sizes without changing data values."));
+	o->addAction(a);
+	}
+	// modify menu
+	{
+	bb = tbData[2] = new QToolBar(tr("Modify data"),this);
+	addToolBar(Qt::TopToolBarArea, bb);
+	o = dataMenu->addMenu(tr("&Modify"));
+
+	a = new QAction(QPixmap(func_xpm), tr("By &formula"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(byformula()));
+	a->setToolTip(tr("Change data values according to formula depended on 'x', 'y' and 'z'\nvariables. A set of special function is availible also."));
+	a->setShortcut(Qt::CTRL+Qt::Key_M);	o->addAction(a);	bb->addAction(a);
+	a = new QAction(tr("Fill in &range"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(inrange()));
+	a->setToolTip(tr("Fill data equidistantly from one value to another."));
+	o->addAction(a);
+	a = new QAction(tr("&Normalize"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(norm()));
+	a->setToolTip(tr("Normalize data so that its minimal\nand maximal values be in specified range."));
+	o->addAction(a);
+	a = new QAction(tr("Norm. s&lices"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(normsl()));
+	a->setToolTip(tr("Normalize each data slice perpendicular to some direction\nso that its minimal and maximal values be in specified range."));
+	o->addAction(a);
+	a = new QAction(QPixmap(smth_xpm), tr("&Smooth data"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(smooth()));
+	a->setToolTip(tr("Smooth data by one of 4 methods along specified direction(s)."));
+	o->addAction(a);	bb->addAction(a);
+	o->addSeparator();	bb->addSeparator();
+
+	oo = dataMenu->addMenu(tr("&Operators"));
+	a = new QAction(QPixmap(sum_xpm), tr("&Cum. sum"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(cumsum()));
+	a->setToolTip(tr("Summate data values along specified direction(s)."));
+	oo->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(integr_xpm), tr("&Integrate"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(integr()));
+	a->setToolTip(tr("Integrate data values along specified direction(s)."));
+	oo->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(diff_xpm), tr("&Differentiate"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(diff()));
+	a->setToolTip(tr("Differentiate data values along specified direction(s)."));
+	oo->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(diff2_xpm), tr("&Laplace"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(diff2()));
+	a->setToolTip(tr("Double differentiate data values along specified direction(s)."));
+	oo->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(swap_xpm), tr("&Swap"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(swap()));
+	a->setToolTip(tr("Swap left and right data part along specified direction(s).\nThis operation is useful for data after Fourier transform."));
+	oo->addAction(a);	bb->addAction(a);
+	a = new QAction(tr("&Mirror"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(mirror()));
+	a->setToolTip(tr("Mirror left and right data part along specified direction(s).\nThis operation do like index change from 'i' to 'n-i'."));
+	oo->addAction(a);
+
+	oo = dataMenu->addMenu(tr("&Algebraic"));
+	a = new QAction(QPixmap(oper_a_xpm), tr("&Add"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(addto()));
+	a->setToolTip(tr("Add a number to all data values."));
+	oo->addAction(a);
+	a = new QAction(QPixmap(oper_s_xpm), tr("&Subtract"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(subto()));
+	a->setToolTip(tr("Subtract a number to all data values."));
+	oo->addAction(a);
+	a = new QAction(QPixmap(oper_m_xpm), tr("&Multiply"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(multo()));
+	a->setToolTip(tr("Multiply all data values by a number."));
+	oo->addAction(a);
+	a = new QAction(QPixmap(oper_d_xpm), tr("&Divide"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(divto()));
+	a->setToolTip(tr("Divide all data values by a number."));
+	oo->addAction(a);
+
+	oo = dataMenu->addMenu(tr("A&nother data"));
+	a = new QAction(tr("&Sum of"), this);	oo->addAction(a);
+	connect(a, SIGNAL(activated()), this, SLOT(sumof()));
+	a = new QAction(tr("M&in of"), this);	oo->addAction(a);
+	connect(a, SIGNAL(activated()), this, SLOT(minof()));
+	a = new QAction(tr("M&ax of"), this);	oo->addAction(a);
+	connect(a, SIGNAL(activated()), this, SLOT(maxof()));
+	a = new QAction(tr("Momentum along &x"), this);	oo->addAction(a);
+	connect(a, SIGNAL(activated()), this, SLOT(momentx()));
+	a = new QAction(tr("Momentum along &y"), this);	oo->addAction(a);
+	connect(a, SIGNAL(activated()), this, SLOT(momenty()));
+	a = new QAction(tr("Momentum along &z"), this);	oo->addAction(a);
+	connect(a, SIGNAL(activated()), this, SLOT(momentz()));
+	a = new QAction(tr("&Histogram"), this);	oo->addAction(a);
+	connect(a, SIGNAL(activated()), this, SLOT(hist()));
+	}
+	// navigation menu
+	{
+	bb = tbData[3] = new QToolBar(tr("Navigate data"),this);
+	addToolBar(Qt::TopToolBarArea, bb);
+	o = dataMenu->addMenu(tr("&Navigate"));
+	a = new QAction(QPixmap(":/xpm/go-first.png"), tr("&First slice"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(first()));
+	a->setToolTip(tr("Go to the first data slice for 3D data."));
+	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/go-previous.png"), tr("&Prev. slice"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(prev()));
+	a->setToolTip(tr("Go to the previous data slice for 3D data."));
+	o->addAction(a);	bb->addAction(a);
+
+	sb = new QSpinBox(this);
+	bb->addWidget(sb);	sb->setRange(0,0);
+	sb->setToolTip(tr("Go to the specified data slice for 3D data."));
+
+	a = new QAction(tr("Go to slice"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(gosl()));
+	a->setToolTip(tr("Go to the specified data slice for 3D data."));
+	o->addAction(a);
+	a = new QAction(QPixmap(":/xpm/go-next.png"), tr("Next slice"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(next()));
+	a->setToolTip(tr("Go to the next data slice for 3D data."));
+	o->addAction(a);	bb->addAction(a);
+	a = new QAction(QPixmap(":/xpm/go-last.png"), tr("Last slice"), this);
+	connect(a, SIGNAL(activated()), this, SLOT(last()));
+	a->setToolTip(tr("Go to the last data slice for 3D data."));
+	o->addAction(a);	bb->addAction(a);
+	}
+	subActivated(0);
+}
+//-----------------------------------------------------------------------------
+void ScriptWindow::loadData()
+{	if(activeWindow())	activeWindow()->load();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::saveData()
+{	if(activeWindow())	activeWindow()->save();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::imprt()
+{	if(activeWindow())	activeWindow()->imprt();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::exprt()
+{	if(activeWindow())	activeWindow()->exprt();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::copy()
+{	if(activeWindow())	activeWindow()->copy();		else	edit->copy();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::paste()
+{	if(activeWindow())	activeWindow()->paste();	else	edit->paste();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::plot()
+{	if(activeWindow())	activeWindow()->plot();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::list()
+{	if(activeWindow())	activeWindow()->list();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::byformula()
+{	if(activeWindow())	activeWindow()->byformula();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::inrange()
+{	if(activeWindow())	activeWindow()->inrange();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::norm()
+{	if(activeWindow())	activeWindow()->norm();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::normsl()
+{	if(activeWindow())	activeWindow()->normsl();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::create()
+{	if(activeWindow())	activeWindow()->create();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::reSize()
+{	if(activeWindow())	activeWindow()->resize();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::squize()
+{	if(activeWindow())	activeWindow()->squize();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::crop()
+{	if(activeWindow())	activeWindow()->crop();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::transp()
+{	if(activeWindow())	activeWindow()->transp();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::rearrange()
+{	if(activeWindow())	activeWindow()->rearrange();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::smooth()
+{	if(activeWindow())	activeWindow()->smooth();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::cumsum()
+{	if(activeWindow())	activeWindow()->cumsum();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::integr()
+{	if(activeWindow())	activeWindow()->integr();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::diff()
+{	if(activeWindow())	activeWindow()->diff();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::diff2()
+{	if(activeWindow())	activeWindow()->diff2();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::swap()
+{	if(activeWindow())	activeWindow()->swap();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::mirror()
+{	if(activeWindow())	activeWindow()->mirror();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::sumof()
+{	if(activeWindow())	activeWindow()->sumof();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::maxof()
+{	if(activeWindow())	activeWindow()->maxof();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::minof()
+{	if(activeWindow())	activeWindow()->minof();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::momentx()
+{	if(activeWindow())	activeWindow()->momentx();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::momenty()
+{	if(activeWindow())	activeWindow()->momenty();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::momentz()
+{	if(activeWindow())	activeWindow()->momentz();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::hist()
+{	if(activeWindow())	activeWindow()->hist();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::addto()
+{	if(activeWindow())	activeWindow()->addto();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::subto()
+{	if(activeWindow())	activeWindow()->subto();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::divto()
+{	if(activeWindow())	activeWindow()->divto();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::multo()
+{	if(activeWindow())	activeWindow()->multo();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::first()
+{	if(activeWindow())	activeWindow()->first();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::last()
+{	if(activeWindow())	activeWindow()->last();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::next()
+{	if(activeWindow())	activeWindow()->next();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::prev()
+{	if(activeWindow())	activeWindow()->prev();	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::gosl()
+{	if(activeWindow())	activeWindow()->gosl();	}
+//-----------------------------------------------------------------------------
+TableWindow *ScriptWindow::activeWindow()
+{	return dynamic_cast<TableWindow *>(mdi->activeSubWindow());	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::setSlice(int k)
+{	if(activeWindow())	activeWindow()->setSlice(k);	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::setNz(int nz)	// TODO !!! connect to TableWindow::nzChanged() then active
+{	sb->setMaximum(nz-1);	}
+//-----------------------------------------------------------------------------
+void ScriptWindow::subActivated(QMdiSubWindow *)
+{
+	TableWindow *p=0;
+	TableWindow *t = activeWindow();
+	dataMenu->setEnabled(t!=0);
+	for(int i=0;i<4;i++)	tbData[i]->setVisible(t!=0);
+	if(p)	{	disconnect(sb, 0, p, 0);	disconnect(this, 0, p, 0);	}
+	if(t)
+	{
+		sb->setMinimum(0);	sb->setMaximum(t->nz-1);	sb->setValue(t->kz);
+		connect(sb, SIGNAL(valueChanged(int)), this, SLOT(setSlice(int)));
+		connect(t, SIGNAL(sliceChanged(int)), sb, SLOT(setValue(int)));
+		connect(t, SIGNAL(nzChanged(int)), this, SLOT(setNz(int)));
+		p=t;
+	}
+}
+//-----------------------------------------------------------------------------
diff --git a/src/udav.qrc b/src/udav.qrc
index 8e11aa7..2baf8e5 100644
--- a/src/udav.qrc
+++ b/src/udav.qrc
@@ -1,41 +1,45 @@
 <RCC>
-	<qresource prefix="/" >
-		<file>udav.png</file>
-		<file>xpm/document-new.png</file>
-		<file>xpm/document-open.png</file>
-		<file>xpm/document-print.png</file>
-		<file>xpm/document-save.png</file>
-		<file>xpm/document-properties.png</file>
-		<file>xpm/document-export.png</file>
-		<file>xpm/document-import.png</file>
-		<file>xpm/alpha.png</file>
-		<file>xpm/preferences-system.png</file>
-		<file>xpm/edit-cut.png</file>
-		<file>xpm/edit-copy.png</file>
-		<file>xpm/edit-delete.png</file>
-		<file>xpm/edit-paste.png</file>
-		<file>xpm/edit-select-all.png</file>
-		<file>xpm/edit-find.png</file>
-		<file>xpm/edit-redo.png</file>
-		<file>xpm/edit-undo.png</file>
-		<file>xpm/process-stop.png</file>
-		<file>xpm/zoom-out.png</file>
-		<file>xpm/zoom-in.png</file>
-		<file>xpm/zoom-original.png</file>
-		<file>xpm/zoom-fit-best.png</file>
-		<file>xpm/view-refresh.png</file>
-		<file>xpm/weather-clear.png</file>
-		<file>xpm/help-contents.png</file>
-		<file>xpm/help-faq.png</file>
-		<file>xpm/go-first.png</file>
-		<file>xpm/go-last.png</file>
-		<file>xpm/go-previous.png</file>
-		<file>xpm/go-next.png</file>
-		<file>xpm/go-down.png</file>
-		<file>xpm/go-up.png</file>
-		<file>xpm/media-seek-backward.png</file>
-		<file>xpm/media-seek-forward.png</file>
-		<file>xpm/film-b.png</file>
-		<file>xpm/object-rotate-right.png</file>
-	</qresource>
+    <qresource prefix="/" >
+        <file>udav.png</file>
+        <file>xpm/document-new.png</file>
+        <file>xpm/document-open.png</file>
+        <file>xpm/document-print.png</file>
+        <file>xpm/document-save.png</file>
+        <file>xpm/document-properties.png</file>
+        <file>xpm/document-export.png</file>
+        <file>xpm/document-import.png</file>
+        <file>xpm/alpha.png</file>
+        <file>xpm/preferences-system.png</file>
+        <file>xpm/edit-cut.png</file>
+        <file>xpm/edit-copy.png</file>
+        <file>xpm/edit-delete.png</file>
+        <file>xpm/edit-paste.png</file>
+        <file>xpm/edit-select-all.png</file>
+        <file>xpm/edit-find.png</file>
+        <file>xpm/edit-redo.png</file>
+        <file>xpm/edit-undo.png</file>
+        <file>xpm/process-stop.png</file>
+        <file>xpm/zoom-out.png</file>
+        <file>xpm/zoom-in.png</file>
+        <file>xpm/zoom-original.png</file>
+        <file>xpm/zoom-fit-best.png</file>
+        <file>xpm/view-refresh.png</file>
+        <file>xpm/weather-clear.png</file>
+        <file>xpm/help-contents.png</file>
+        <file>xpm/help-faq.png</file>
+        <file>xpm/go-first.png</file>
+        <file>xpm/go-last.png</file>
+        <file>xpm/go-previous.png</file>
+        <file>xpm/go-next.png</file>
+        <file>xpm/go-down.png</file>
+        <file>xpm/go-up.png</file>
+        <file>xpm/media-seek-backward.png</file>
+        <file>xpm/media-seek-forward.png</file>
+        <file>xpm/film-b.png</file>
+        <file>xpm/object-rotate-right.png</file>
+        <file>xpm/accessories-calculator.png</file>
+        <file>xpm/format-indent-more.png</file>
+        <file>xpm/x-office-spreadsheet.png</file>
+        <file>xpm/folder.png</file>
+    </qresource>
 </RCC>
diff --git a/src/udav_ru.qm b/src/udav_ru.qm
new file mode 100644
index 0000000..4232323
Binary files /dev/null and b/src/udav_ru.qm differ
diff --git a/src/udav_ru.ts b/src/udav_ru.ts
new file mode 100644
index 0000000..41a0e8b
--- /dev/null
+++ b/src/udav_ru.ts
@@ -0,0 +1,2767 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="ru_RU">
+<context>
+    <name>AnimParam</name>
+    <message>
+        <source>UDAV - Animation setup</source>
+        <translation>UDAV - Параметры анимации</translation>
+    </message>
+    <message>
+        <source>Redraw picture for $0 equal to</source>
+        <translation>Перерисовать для $0 равного</translation>
+    </message>
+    <message>
+        <source>strings</source>
+        <oldsource>strings in lines</oldsource>
+        <translation>строкам</translation>
+    </message>
+    <message>
+        <source>values</source>
+        <translation>числам</translation>
+    </message>
+    <message>
+        <source>from</source>
+        <translation>от</translation>
+    </message>
+    <message>
+        <source>to</source>
+        <translation>до</translation>
+    </message>
+    <message>
+        <source>with step</source>
+        <translation>с шагом</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Put to script</source>
+        <translation>Вставить в код</translation>
+    </message>
+    <message>
+        <source>Delay (in ms)</source>
+        <translation>Задержка (в мсек)</translation>
+    </message>
+    <message>
+        <source>Export to GIF</source>
+        <translation>Экспорт в GIF</translation>
+    </message>
+    <message>
+        <source>Save JPEG frames</source>
+        <translation>Сохранить кадры в JPEG</translation>
+    </message>
+    <message>
+        <source>UDAV - animation</source>
+        <translation>UDAV - анимация</translation>
+    </message>
+    <message>
+        <source>You should select one of case</source>
+        <translation>Вы должны выбрать строки или числа</translation>
+    </message>
+</context>
+<context>
+    <name>ArgsDialog</name>
+    <message>
+        <source>UDAV - Set script arguments</source>
+        <translation>UDAV - Аргументы программы</translation>
+    </message>
+    <message>
+        <source>String for $1</source>
+        <translation>Строка для $1</translation>
+    </message>
+    <message>
+        <source>String for $2</source>
+        <translation>Строка для $2</translation>
+    </message>
+    <message>
+        <source>String for $3</source>
+        <translation>Строка для $3</translation>
+    </message>
+    <message>
+        <source>String for $4</source>
+        <translation>Строка для $4</translation>
+    </message>
+    <message>
+        <source>String for $5</source>
+        <translation>Строка для $5</translation>
+    </message>
+    <message>
+        <source>String for $6</source>
+        <translation>Строка для $6</translation>
+    </message>
+    <message>
+        <source>String for $7</source>
+        <translation>Строка для $7</translation>
+    </message>
+    <message>
+        <source>String for $8</source>
+        <translation>Строка для $8</translation>
+    </message>
+    <message>
+        <source>String for $9</source>
+        <translation>Строка для $9</translation>
+    </message>
+    <message>
+        <source>String for $0</source>
+        <translation>Строка для $0</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+</context>
+<context>
+    <name>CalcDialog</name>
+    <message>
+        <source>Result</source>
+        <translation>Результат</translation>
+    </message>
+    <message>
+        <source>To script</source>
+        <translation>В код</translation>
+    </message>
+    <message>
+        <source>Clear</source>
+        <translation>Очистить</translation>
+    </message>
+    <message>
+        <source>Put function</source>
+        <translation>Вставить функцию</translation>
+    </message>
+    <message>
+        <source>Basic</source>
+        <translation>Базовые</translation>
+    </message>
+    <message>
+        <source>Exp and log</source>
+        <translation>Exp и log</translation>
+    </message>
+    <message>
+        <source>Trigonometric</source>
+        <translation>Тригонометрические</translation>
+    </message>
+    <message>
+        <source>Hyperbolic</source>
+        <translation>Гиперболические</translation>
+    </message>
+    <message>
+        <source>Bessel</source>
+        <translation>Бесселя</translation>
+    </message>
+    <message>
+        <source>Elliptic</source>
+        <translation>Эллиптические</translation>
+    </message>
+    <message>
+        <source>Jacobi</source>
+        <translation>Якоби</translation>
+    </message>
+    <message>
+        <source>Airy and Gamma</source>
+        <translation>Airy и Gamma</translation>
+    </message>
+    <message>
+        <source>Exp-integrals</source>
+        <translation>Exp-интегралы</translation>
+    </message>
+    <message>
+        <source>Special</source>
+        <translation>Специальные</translation>
+    </message>
+</context>
+<context>
+    <name>DataOpenDialog</name>
+    <message>
+        <source>UDAV - Open data file</source>
+        <translation>UDAV - Открыть файл данных</translation>
+    </message>
+    <message>
+        <source>Data name</source>
+        <translation>Имя данных</translation>
+    </message>
+    <message>
+        <source>Auto detect data sizes</source>
+        <translation>Автом. определение размеров</translation>
+    </message>
+    <message>
+        <source>Set data sizes manually</source>
+        <translation>Задать размеры вручную</translation>
+    </message>
+    <message>
+        <source>Nx</source>
+        <translation>Nx</translation>
+    </message>
+    <message>
+        <source>Ny</source>
+        <translation>Ny</translation>
+    </message>
+    <message>
+        <source>Nz</source>
+        <translation>Nz</translation>
+    </message>
+    <message>
+        <source>Matrix with sizes from file</source>
+        <translation>Матрица с размерами из файла</translation>
+    </message>
+    <message>
+        <source>3D data with sizes from file</source>
+        <translation>3D данные с размерами из файла</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>Auto detect data sizes (%1 x %2 x %3)</source>
+        <translation>Определить размер автоматически (%1 x %2 x %3)</translation>
+    </message>
+</context>
+<context>
+    <name>FindDialog</name>
+    <message>
+        <source>UDAV - Find</source>
+        <translation>UDAV - Найти</translation>
+    </message>
+    <message>
+        <source>Find &amp;what:</source>
+        <translation>&amp;Что найти:</translation>
+    </message>
+    <message>
+        <source>Replace &amp;by:</source>
+        <translation>З&amp;аменить на:</translation>
+    </message>
+    <message>
+        <source>Match &amp;case</source>
+        <translation>Учитывать &amp;регистр</translation>
+    </message>
+    <message>
+        <source>Search &amp;backward</source>
+        <translation>Искать на&amp;зад</translation>
+    </message>
+    <message>
+        <source>&amp;Find</source>
+        <translation>&amp;Найти</translation>
+    </message>
+    <message>
+        <source>&amp;Replace</source>
+        <translation>&amp;Заменить</translation>
+    </message>
+    <message>
+        <source>Close</source>
+        <translation>Закрыть</translation>
+    </message>
+</context>
+<context>
+    <name>GraphWindow</name>
+    <message>
+        <source>Printing...</source>
+        <translation>Печатаю...</translation>
+    </message>
+    <message>
+        <source>Printing completed</source>
+        <translation>Печать завершена</translation>
+    </message>
+    <message>
+        <source>Printing aborted</source>
+        <translation>Печать прервана</translation>
+    </message>
+    <message>
+        <source>Drawing time %1 ms</source>
+        <translation>Время рисования %1 мсек</translation>
+    </message>
+    <message>
+        <source>Frame %1 of %2</source>
+        <translation>Кадр %1 из %2</translation>
+    </message>
+    <message>
+        <source>Graphics</source>
+        <translation>График</translation>
+    </message>
+    <message>
+        <source>&amp;Graphics</source>
+        <translation>&amp;График</translation>
+    </message>
+    <message>
+        <source>&amp;Alpha</source>
+        <translation>&amp;Прозрачность</translation>
+    </message>
+    <message>
+        <source>Switch on/off transparency for the graphics (Alt+T).</source>
+        <translation type="obsolete">Включить/выключить прозрачность графика (Alt+T).</translation>
+    </message>
+    <message>
+        <source>&amp;Light</source>
+        <translation>&amp;Освещение</translation>
+    </message>
+    <message>
+        <source>Switch on/off lightning for the graphics (Alt+L).</source>
+        <translation type="obsolete">Включить/выключить освещение графика (Alt+L).</translation>
+    </message>
+    <message>
+        <source>&amp;Grid</source>
+        <translation>&amp;Сетка</translation>
+    </message>
+    <message>
+        <source>Switch on/off grid drawing for absolute coordinates (Alt+G).</source>
+        <translation type="obsolete">Включить/выключить сетку абсолютных координат (Alt+G).</translation>
+    </message>
+    <message>
+        <source>&amp;Rotate by mouse</source>
+        <translation>&amp;Вращать мышкой</translation>
+    </message>
+    <message>
+        <source>Switch on/off mouse handling of the graphics
+(rotation, shifting, zooming and perspective).</source>
+        <translation>Включить/выключить изменение графика мышью
+(вращение, сдвиг, приближение и перспектива).</translation>
+    </message>
+    <message>
+        <source>&amp;Zoom by mouse</source>
+        <translation>&amp;Приближение мышью</translation>
+    </message>
+    <message>
+        <source>Switch on/off mouse zoom of selected region.</source>
+        <translation>Включить/выключить приближение выбранного региона.</translation>
+    </message>
+    <message>
+        <source>Res&amp;tore</source>
+        <translation>В&amp;осстановить</translation>
+    </message>
+    <message>
+        <source>Restore default graphics rotation, zoom and perspective (Alt+Space).</source>
+        <translation type="obsolete">Восстановить вращение, масштаб и перспективу по умолчанию (Alt+Space).</translation>
+    </message>
+    <message>
+        <source>Re&amp;draw</source>
+        <translation>Пе&amp;рерисовать</translation>
+    </message>
+    <message>
+        <source>Execute script and redraw graphics (F5).</source>
+        <translation>Выполнить код и перерисовать график (F5).</translation>
+    </message>
+    <message>
+        <source>&amp;Adjust size</source>
+        <translation>&amp;Подобрать размер</translation>
+    </message>
+    <message>
+        <source>Change canvas size to fill whole region (F6).</source>
+        <translation>Изменить размер рисунка так, чтобы он заполнял всю область (F6).</translation>
+    </message>
+    <message>
+        <source>Re&amp;load</source>
+        <translation>Пере&amp;грузить</translation>
+    </message>
+    <message>
+        <source>Restore status for &apos;once&apos; command and reload data (F9).</source>
+        <translation>Восстановить статус команды &apos;once&apos; и перегрузить данные (F9).</translation>
+    </message>
+    <message>
+        <source>&amp;Stop</source>
+        <translation>&amp;Остановить</translation>
+    </message>
+    <message>
+        <source>Stop script execution (F7).</source>
+        <translation>Остановить выполенение кода (F7).</translation>
+    </message>
+    <message>
+        <source>&amp;Copy plot</source>
+        <translation>&amp;Копировать график</translation>
+    </message>
+    <message>
+        <source>Copy graphics to clipboard (Ctrl+Shift+C).</source>
+        <translation>Копировать график в буфер обмена (Ctrl+Shift+C).</translation>
+    </message>
+    <message>
+        <source>Set value of \theta angle.</source>
+        <translation>Установить значение угла \theta.</translation>
+    </message>
+    <message>
+        <source>Set value of \phi angle.</source>
+        <translation>Установить значение угла \phi.</translation>
+    </message>
+    <message>
+        <source>&amp;Export as ...</source>
+        <translation>&amp;Экспорт в ...</translation>
+    </message>
+    <message>
+        <source>bitmap EPS</source>
+        <translation>растровый EPS</translation>
+    </message>
+    <message>
+        <source>vector EPS</source>
+        <translation>векторный EPS</translation>
+    </message>
+    <message>
+        <source>Zoom/move</source>
+        <translation>Масштаб/сдвиг</translation>
+    </message>
+    <message>
+        <source>Zoom graphics</source>
+        <translation>Приближение графика</translation>
+    </message>
+    <message>
+        <source>Move &amp;left</source>
+        <translation>Сдвиг в&amp;лево</translation>
+    </message>
+    <message>
+        <source>Move graphics left by 1/3 of its width.</source>
+        <translation>Сдвиг графика влево на 1/3 его ширины.</translation>
+    </message>
+    <message>
+        <source>Move &amp;up</source>
+        <translation>Сдвиг &amp;вверх</translation>
+    </message>
+    <message>
+        <source>Move graphics up by 1/3 of its height.</source>
+        <translation>Сдвиг графика вверх на 1/3 его высоты.</translation>
+    </message>
+    <message>
+        <source>Zoom &amp;in</source>
+        <translation>&amp;Приблизить</translation>
+    </message>
+    <message>
+        <source>Zoom in graphics.</source>
+        <translation>Приблизить график.</translation>
+    </message>
+    <message>
+        <source>Zoom &amp;out</source>
+        <translation>&amp;Отдалить</translation>
+    </message>
+    <message>
+        <source>Zoom out graphics.</source>
+        <translation>Отдалить график.</translation>
+    </message>
+    <message>
+        <source>Move &amp;down</source>
+        <translation>Сдвиг в&amp;низ</translation>
+    </message>
+    <message>
+        <source>Move graphics up down 1/3 of its height.</source>
+        <translation>Сдвиг графика вниз на 1/3 его высоты.</translation>
+    </message>
+    <message>
+        <source>Move &amp;right</source>
+        <translation>Сдвиг вп&amp;раво</translation>
+    </message>
+    <message>
+        <source>Move graphics right by 1/3 of its width.</source>
+        <translation>Сдвиг графика вправо на 1/3 его ширины.</translation>
+    </message>
+    <message>
+        <source>&amp;Animation</source>
+        <translation>&amp;Анимация</translation>
+    </message>
+    <message>
+        <source>Animation</source>
+        <translation>Анимация</translation>
+    </message>
+    <message>
+        <source>&amp;Next slide</source>
+        <translation>&amp;Следующий кадр</translation>
+    </message>
+    <message>
+        <source>Show next slide (Alt+Right).</source>
+        <translation type="obsolete">Показать следующий кадр (Alt+Right).</translation>
+    </message>
+    <message>
+        <source>&amp;Prev slide</source>
+        <translation>&amp;Предыдущий кадр</translation>
+    </message>
+    <message>
+        <source>Show previous slide (Alt+Left).</source>
+        <translation type="obsolete">Показать предыдущий кадр (Alt+Left).</translation>
+    </message>
+    <message>
+        <source>&amp;Slideshow</source>
+        <translation>&amp;Запустить</translation>
+    </message>
+    <message>
+        <source>Run slideshow (Ctrl+F5). If no parameter specified
+then the dialog with slideshow options will appear.</source>
+        <translation>Запустить анимацию (Ctrl+F5). Если параметры не были указаны,
+то показывается диалог с параметрами анимации.</translation>
+    </message>
+    <message>
+        <source>Se&amp;tup show</source>
+        <translation>&amp;Настроить анимацию</translation>
+    </message>
+    <message>
+        <source>Switch on/off transparency for the graphics (Ctrl+T).</source>
+        <translation>Включить/выключить прозрачность графика (Ctrl+T).</translation>
+    </message>
+    <message>
+        <source>Switch on/off lightning for the graphics (Ctrl+L).</source>
+        <translation>Включить/выключить освещение графика (Ctrl+L).</translation>
+    </message>
+    <message>
+        <source>Switch on/off grid drawing for absolute coordinates (Ctrl+G).</source>
+        <translation>Включить/выключить рисование сетки абсолютных координат (Ctrl+G).</translation>
+    </message>
+    <message>
+        <source>Restore default graphics rotation, zoom and perspective (Ctrl+Space).</source>
+        <translation>Восстановить вращение, масштаб и перспективу по умолчанию (Ctrl+Space).</translation>
+    </message>
+    <message>
+        <source>&amp;Copy click coor.</source>
+        <translation>&amp;Копировать координаты</translation>
+    </message>
+    <message>
+        <source>Copy coordinates of last mouse click to clipboard.</source>
+        <translation>Копировать в буфер обмена координаты последнего щелчка мыши.</translation>
+    </message>
+    <message>
+        <source>PNG</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>solid PNG</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>JPEG</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>GIF</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>SVG</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>C++</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>IDTF</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>Show next slide (Meta+Right).</source>
+        <translation>Показать следующий кадр (Meta+Right).</translation>
+    </message>
+    <message>
+        <source>Show previous slide (Meta+Left).</source>
+        <translation>Показать предыдущий кадр (Meta+Left).</translation>
+    </message>
+</context>
+<context>
+    <name>HelpWindow</name>
+    <message>
+        <source>Backward</source>
+        <translation>Назад</translation>
+    </message>
+    <message>
+        <source>Forward</source>
+        <translation>Вперед</translation>
+    </message>
+    <message>
+        <source>&amp;Examples</source>
+        <translation>&amp;Примеры</translation>
+    </message>
+    <message>
+        <source>Help</source>
+        <translation>Помощь</translation>
+    </message>
+    <message>
+        <source>script_mgl_eng.html</source>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <source>example_mgl_eng.html</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>HintDialog</name>
+    <message>
+        <source>UDAV - Hint</source>
+        <translation>UDAV - Советы</translation>
+    </message>
+    <message>
+        <source>&amp;Show at startup</source>
+        <translation>Показывать при з&amp;апуске</translation>
+    </message>
+    <message>
+        <source>&amp;Prev</source>
+        <translation>&amp;Предыдущий</translation>
+    </message>
+    <message>
+        <source>&amp;Next</source>
+        <translation>&amp;Следующий</translation>
+    </message>
+    <message>
+        <source>&amp;Close</source>
+        <translation>&amp;Закрыть</translation>
+    </message>
+</context>
+<context>
+    <name>InfoDialog</name>
+    <message>
+        <source>Select kind of plot</source>
+        <translation>Выберите тип графика</translation>
+    </message>
+    <message>
+        <source>Data preview for current slice.</source>
+        <translation>Просмотр для текущего среза.</translation>
+    </message>
+    <message>
+        <source>1D plot</source>
+        <translation>1D график</translation>
+    </message>
+    <message>
+        <source>2D plot</source>
+        <translation>2D график</translation>
+    </message>
+    <message>
+        <source>Kind of plots: lines for 1D, density for 2D.</source>
+        <translation>Тип графика: линии для 1D, график плотности для 2D.</translation>
+    </message>
+    <message>
+        <source>Preview</source>
+        <translation>Просмотр</translation>
+    </message>
+    <message>
+        <source>Short information about the data.</source>
+        <translation>Краткая информация о данных.</translation>
+    </message>
+    <message>
+        <source>Information</source>
+        <translation>Информация</translation>
+    </message>
+</context>
+<context>
+    <name>MGLThread</name>
+    <message>
+        <source>In line </source>
+        <translation>В линии </translation>
+    </message>
+    <message>
+        <source> -- wrong argument(s):	</source>
+        <translation> -- неправильный аргумент(ы):	</translation>
+    </message>
+    <message>
+        <source> -- wrong command:	</source>
+        <translation> -- неправильная команда:	</translation>
+    </message>
+    <message>
+        <source> -- string too long:	</source>
+        <translation> -- строка слишком длинная:	</translation>
+    </message>
+    <message>
+        <source> -- unbalanced &apos; :	</source>
+        <translation> -- не хватает &apos; :	</translation>
+    </message>
+    <message>
+        <source> :	</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>MemoryWindow</name>
+    <message>
+        <source>New</source>
+        <translation>Новый</translation>
+    </message>
+    <message>
+        <source>Edit</source>
+        <translation>Правка</translation>
+    </message>
+    <message>
+        <source>Delete</source>
+        <translation>Удалить</translation>
+    </message>
+    <message>
+        <source>Info</source>
+        <translation>Информация</translation>
+    </message>
+    <message>
+        <source>Update</source>
+        <translation>Обновить</translation>
+    </message>
+    <message>
+        <source>Delete All</source>
+        <translation>Удалить все</translation>
+    </message>
+    <message>
+        <source>Name</source>
+        <translation>Имя</translation>
+    </message>
+    <message>
+        <source>Sizes</source>
+        <translation>Размеры</translation>
+    </message>
+    <message>
+        <source>Memory</source>
+        <translation>Память</translation>
+    </message>
+    <message>
+        <source>UDAV - New variable</source>
+        <translation>UDAV - Новая переменная</translation>
+    </message>
+    <message>
+        <source>Enter name for new variable</source>
+        <translation>Введите имя для новой переменной</translation>
+    </message>
+    <message>
+        <source>UDAV - delete all data</source>
+        <translation>UDAV - Удалить все данные</translation>
+    </message>
+    <message>
+        <source>Do you want to delete all data?</source>
+        <translation>Вы хотите удалить все данные?</translation>
+    </message>
+    <message>
+        <source> - UDAV preview</source>
+        <translation> - UDAV просмотр</translation>
+    </message>
+</context>
+<context>
+    <name>NewCmdDialog</name>
+    <message>
+        <source>Argument</source>
+        <translation>Аргумент</translation>
+    </message>
+    <message>
+        <source>Value</source>
+        <translation>Значение</translation>
+    </message>
+    <message>
+        <source>Add style</source>
+        <translation>Добавить стиль</translation>
+    </message>
+    <message>
+        <source>Add data</source>
+        <translation>Добавить данные</translation>
+    </message>
+    <message>
+        <source>Options</source>
+        <translation>Опции</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>1D plots</source>
+        <translation>1D графики</translation>
+    </message>
+    <message>
+        <source>2D plots</source>
+        <translation>2D графики</translation>
+    </message>
+    <message>
+        <source>3D plots</source>
+        <translation>3D графики</translation>
+    </message>
+    <message>
+        <source>Dual plots</source>
+        <translation>Парные графики</translation>
+    </message>
+    <message>
+        <source>Vector plots</source>
+        <translation>Векторные графики</translation>
+    </message>
+    <message>
+        <source>Other plots</source>
+        <translation>Прочие графики</translation>
+    </message>
+    <message>
+        <source>Text and legend</source>
+        <translation>Текст и легенда</translation>
+    </message>
+    <message>
+        <source>Create data and I/O</source>
+        <translation>Создание данных и I/O</translation>
+    </message>
+    <message>
+        <source>Data handling</source>
+        <translation>Обработка данных</translation>
+    </message>
+    <message>
+        <source>Data extraction</source>
+        <translation>Выделение данных</translation>
+    </message>
+    <message>
+        <source>Axis and colorbar</source>
+        <translation>Оси координат</translation>
+    </message>
+    <message>
+        <source>General setup</source>
+        <translation>Настройка графика</translation>
+    </message>
+    <message>
+        <source>Axis setup</source>
+        <translation>Настройка осей</translation>
+    </message>
+    <message>
+        <source>Scale and rotate</source>
+        <translation>Положение и поворот</translation>
+    </message>
+    <message>
+        <source>Program flow</source>
+        <translation>Условия и циклы</translation>
+    </message>
+    <message>
+        <source>Nonlinear fitting</source>
+        <translation>Подбор функции</translation>
+    </message>
+    <message>
+        <source>Primitives</source>
+        <translation>Примитивы</translation>
+    </message>
+    <message>
+        <source>New command</source>
+        <translation>Новая команда</translation>
+    </message>
+    <message>
+        <source>Select first the proper kind of arguments</source>
+        <translation>Сначала выберите тип аргументов</translation>
+    </message>
+    <message>
+        <source>There is no &apos;fmt&apos; argument for this command</source>
+        <translation>Нет аргумента &apos;fmt&apos; для данной команды</translation>
+    </message>
+    <message>
+        <source>You should specify required argument </source>
+        <translation>Вы должны ввести все обязательные аргументы</translation>
+    </message>
+    <message>
+        <source>You should put text inside &apos; &apos; for argument </source>
+        <translation>Вы должны вводить текст внутри &apos; &apos;</translation>
+    </message>
+    <message>
+        <source>You should specify all optional arguments before </source>
+        <translation>Вы должны ввести все опциональные аргументы перед </translation>
+    </message>
+    <message>
+        <source>Groups of MGL commands</source>
+        <translation>Группы команд MGL</translation>
+    </message>
+    <message>
+        <source>MGL commands for selected group</source>
+        <translation>Команды MGL для выбранной группы</translation>
+    </message>
+    <message>
+        <source>Short description of selected command</source>
+        <translation>Краткое описание выбранной команды</translation>
+    </message>
+    <message>
+        <source>Kind of command argument order. The notation is:
+ * Capital arguments are data (like, Ydat);
+ * Argument in &apos;&apos; are strings (like, &apos;fmt&apos;);
+ * Other arguments are numbers (like, zval);
+ * Arguments in [] are optional arguments.</source>
+        <translation>Тип аргументов команды. Используются обозначения:
+ * Заглавными обозначены данные (например, Ydat);
+ * Аргументы в &apos;&apos; означают строки (например, &apos;fmt&apos;);
+ * Прочие аргументы -- числа (например, zval);
+ * Аргументы в [] опциональны (могут не указываться).</translation>
+    </message>
+    <message>
+        <source>Command arguments. Bold ones are required arguments.
+Other are optional arguments but its order is required.
+You can use &apos;&apos; for default format. See help at right
+for default values.</source>
+        <translation>Аргументы команды. Жирным обозначены обязательные аргументы.
+Все прочие аргументы опциональны, но их порядок должен соблюдаться.
+Можно использовать &apos;&apos; для формата по умолчанию. Справка справа дает
+подробное описание команды и значения аргументов по умолчанию.</translation>
+    </message>
+    <message>
+        <source>Here you can select the plot style.
+The result will be placed in &apos;fmt&apos; argument.</source>
+        <translation>Здесь можно выбрать стиль графика.
+Результат будет помещен в аргумент &apos;fmt&apos;.</translation>
+    </message>
+    <message>
+        <source>Here you can specify command options.
+Options are used for additional plot tunning.</source>
+        <translation>Здесь можно выбрать опции команд.
+Опции используются для дополнительной
+настройки вида графика.</translation>
+    </message>
+    <message>
+        <source>script_mgl_eng.html</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
+<context>
+    <name>OptionDialog</name>
+    <message>
+        <source>UDAV - Add options</source>
+        <translation>UDAV - Добавить опцию</translation>
+    </message>
+    <message>
+        <source>X-range</source>
+        <translation>Диапазон по X</translation>
+    </message>
+    <message>
+        <source>Y-range</source>
+        <translation>Диапазон по Y</translation>
+    </message>
+    <message>
+        <source>Z-range</source>
+        <translation>Диапазон по Z</translation>
+    </message>
+    <message>
+        <source>C-range</source>
+        <translation>Диапазон по C</translation>
+    </message>
+    <message>
+        <source>Alpha</source>
+        <translation>Прозрачность</translation>
+    </message>
+    <message>
+        <source>Ambient</source>
+        <translation>Фоновое освещение</translation>
+    </message>
+    <message>
+        <source>Mesh num</source>
+        <translation>Число линий сетки</translation>
+    </message>
+    <message>
+        <source>Font size</source>
+        <translation>Размер шрифта</translation>
+    </message>
+    <message>
+        <source>Cutting</source>
+        <translation>Обрезание</translation>
+    </message>
+    <message>
+        <source>Legend</source>
+        <translation>Легенда</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>UDAV - command options</source>
+        <translation>UDAV - опции команд</translation>
+    </message>
+    <message>
+        <source>Both fields in xrange must be filled</source>
+        <translation>Оба поля в xrange должны быть заполнены</translation>
+    </message>
+    <message>
+        <source>Both fields in yrange must be filled</source>
+        <translation>Оба поля в yrange должны быть заполнены</translation>
+    </message>
+    <message>
+        <source>Both fields in zrange must be filled</source>
+        <translation>Оба поля в zrange должны быть заполнены</translation>
+    </message>
+    <message>
+        <source>Both fields in crange must be filled</source>
+        <translation>Оба поля в crange должны быть заполнены</translation>
+    </message>
+    <message>
+        <source>on</source>
+        <translation>вкл</translation>
+    </message>
+    <message>
+        <source>off</source>
+        <translation>выкл</translation>
+    </message>
+</context>
+<context>
+    <name>PropDialog</name>
+    <message>
+        <source>UDAV - Properties</source>
+        <translation>UDAV - Настройки</translation>
+    </message>
+    <message>
+        <source>Select font</source>
+        <translation type="obsolete">Выбрать шрифт</translation>
+    </message>
+    <message>
+        <source>Current font</source>
+        <translation>Текущий шрифт</translation>
+    </message>
+    <message>
+        <source>Change font</source>
+        <translation>Изменить шрифт</translation>
+    </message>
+    <message>
+        <source>Setup colors for:</source>
+        <translation>Настроить цвета для:</translation>
+    </message>
+    <message>
+        <source>Comments</source>
+        <translation>Коментарии</translation>
+    </message>
+    <message>
+        <source>Strings</source>
+        <translation>Строки</translation>
+    </message>
+    <message>
+        <source>Keywords</source>
+        <translation>Команды</translation>
+    </message>
+    <message>
+        <source>Options</source>
+        <translation>Опции</translation>
+    </message>
+    <message>
+        <source>Suffixes</source>
+        <translation>Суффиксы</translation>
+    </message>
+    <message>
+        <source>Numbers</source>
+        <translation>Числа</translation>
+    </message>
+    <message>
+        <source>AutoKey</source>
+        <translation>Созд.данных</translation>
+    </message>
+    <message>
+        <source>FlowKey</source>
+        <translation>Упр.команды</translation>
+    </message>
+    <message>
+        <source>Path for help files</source>
+        <translation>Путь к файлам справки</translation>
+    </message>
+    <message>
+        <source>Path for user MathGL font files</source>
+        <translation>Путь к шрифтам MathGL</translation>
+    </message>
+    <message>
+        <source>Language for UDAV</source>
+        <translation>Язык для UDAV</translation>
+    </message>
+    <message>
+        <source>Russian</source>
+        <translation>Русский</translation>
+    </message>
+    <message>
+        <source>Automatically execute script after loading</source>
+        <translation>Автоматически выполнять после загрузки</translation>
+    </message>
+    <message>
+        <source>Place editor at top</source>
+        <translation>Поместить редактор сверху</translation>
+    </message>
+    <message>
+        <source>Load script to new window</source>
+        <translation>Загружать скрипт в новое окно</translation>
+    </message>
+    <message>
+        <source>Automatical save before redrawing (F5)</source>
+        <translation>Автоматически сохранять перед перерисовкой (F5)</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>UDAV - Insert filename</source>
+        <translation>UDAV - Вставить имя файла</translation>
+    </message>
+    <message>
+        <source>You have to restart UDAV for applying the cahnges.</source>
+        <translation>Вы должны перезапустить UDAV для применения изменений.</translation>
+    </message>
+    <message>
+        <source>English</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>Image size</source>
+        <translation>Размер рисунка</translation>
+    </message>
+    <message>
+        <source>Font files (*.vfm)</source>
+        <translation>Файлы шрифтов (*.vfm)</translation>
+    </message>
+</context>
+<context>
+    <name>QMGLCanvas</name>
+    <message>
+        <source>No filename. Please save script first.</source>
+        <translation>Нет имени файла. Сохраните сначала код.</translation>
+    </message>
+    <message>
+        <source>UDAV</source>
+        <translation></translation>
+    </message>
+</context>
+<context>
+    <name>QObject</name>
+    <message>
+        <source>none or default</source>
+        <translation>нет или по-умолчанию</translation>
+    </message>
+    <message>
+        <source>w - white</source>
+        <translation>w - белый</translation>
+    </message>
+    <message>
+        <source>b - blue</source>
+        <translation>b - синий</translation>
+    </message>
+    <message>
+        <source>g - lime</source>
+        <translation>g - ярко-зеленый</translation>
+    </message>
+    <message>
+        <source>r - red</source>
+        <translation>r - красный</translation>
+    </message>
+    <message>
+        <source>c - cyan</source>
+        <translation>c - голубой</translation>
+    </message>
+    <message>
+        <source>m - magenta</source>
+        <translation>m - малиновый</translation>
+    </message>
+    <message>
+        <source>y - yellow</source>
+        <translation>y - желтый</translation>
+    </message>
+    <message>
+        <source>l - springgreen</source>
+        <translation>l - сине-зеленый</translation>
+    </message>
+    <message>
+        <source>e - lawngreen</source>
+        <translation>e - желто-зеленый</translation>
+    </message>
+    <message>
+        <source>n - skyblue</source>
+        <translation>n - небесно-голубой</translation>
+    </message>
+    <message>
+        <source>u - blueviolet</source>
+        <translation>u - сине-фиолетовый</translation>
+    </message>
+    <message>
+        <source>q - orange</source>
+        <translation>q - оранжевый</translation>
+    </message>
+    <message>
+        <source>p - deeppink</source>
+        <translation>p - фиолетовый</translation>
+    </message>
+    <message>
+        <source>h - gray</source>
+        <translation>h - серый</translation>
+    </message>
+    <message>
+        <source>k - black</source>
+        <translation>k - черный</translation>
+    </message>
+    <message>
+        <source>W - lightgray</source>
+        <translation>W - светло-серый</translation>
+    </message>
+    <message>
+        <source>B - navy</source>
+        <translation>B - темно синий</translation>
+    </message>
+    <message>
+        <source>G - green</source>
+        <translation>G - зеленый</translation>
+    </message>
+    <message>
+        <source>R - maroon</source>
+        <translation>R - темно красный</translation>
+    </message>
+    <message>
+        <source>C - teal</source>
+        <translation>C - темно голубой</translation>
+    </message>
+    <message>
+        <source>M - purple</source>
+        <oldsource>M -purple</oldsource>
+        <translation>M - пурпурный</translation>
+    </message>
+    <message>
+        <source>Y - olive</source>
+        <translation>Y - оливковый</translation>
+    </message>
+    <message>
+        <source>L - seagreen</source>
+        <translation>L - темно сине-зеленый</translation>
+    </message>
+    <message>
+        <source>E - darklawn</source>
+        <translation>E - темно желто-зеленый</translation>
+    </message>
+    <message>
+        <source>N - darkskyblue</source>
+        <translation>N - темно небесно-голубой</translation>
+    </message>
+    <message>
+        <source>U - indigo</source>
+        <translation>U - индиго</translation>
+    </message>
+    <message>
+        <source>Q - brown</source>
+        <translation>Q - коричневый</translation>
+    </message>
+    <message>
+        <source>P - darkpink</source>
+        <translation>P - темно фиолетовый</translation>
+    </message>
+    <message>
+        <source>H - darkgray</source>
+        <translation>H - темно серый</translation>
+    </message>
+    <message>
+        <source>none</source>
+        <translation>нет</translation>
+    </message>
+    <message>
+        <source>arrow</source>
+        <translation>стрелка</translation>
+    </message>
+    <message>
+        <source>back arrow</source>
+        <translation>обратная стрелка</translation>
+    </message>
+    <message>
+        <source>stop</source>
+        <translation>стоп</translation>
+    </message>
+    <message>
+        <source>size</source>
+        <translation>размер</translation>
+    </message>
+    <message>
+        <source>triangle</source>
+        <translation>треугольник</translation>
+    </message>
+    <message>
+        <source>square</source>
+        <translation>квадрат</translation>
+    </message>
+    <message>
+        <source>rhomb</source>
+        <translation>ромб</translation>
+    </message>
+    <message>
+        <source>circle</source>
+        <translation>окружность</translation>
+    </message>
+    <message>
+        <source>solid</source>
+        <translation>сплошная</translation>
+    </message>
+    <message>
+        <source>dash</source>
+        <translation>пунктир</translation>
+    </message>
+    <message>
+        <source>dash dot</source>
+        <translation>пунктир-точка</translation>
+    </message>
+    <message>
+        <source>small dash</source>
+        <translation>мелкий пунктир</translation>
+    </message>
+    <message>
+        <source>small dash dot</source>
+        <translation>мелкий пунктир-точка</translation>
+    </message>
+    <message>
+        <source>dots</source>
+        <translation>точки</translation>
+    </message>
+    <message>
+        <source>dot</source>
+        <translation>точка</translation>
+    </message>
+    <message>
+        <source>cross</source>
+        <translation>крест</translation>
+    </message>
+    <message>
+        <source>skew cross</source>
+        <translation>косой крест</translation>
+    </message>
+    <message>
+        <source>asterix</source>
+        <translation>звездочка</translation>
+    </message>
+    <message>
+        <source>triangle down</source>
+        <translation>треугольник вниз</translation>
+    </message>
+    <message>
+        <source>triangle up</source>
+        <translation>треугольник вверх</translation>
+    </message>
+    <message>
+        <source>filled square</source>
+        <translation>закрашенный квадрат</translation>
+    </message>
+    <message>
+        <source>filled rhomb</source>
+        <translation>закрашенный ромб</translation>
+    </message>
+    <message>
+        <source>filled triangle down</source>
+        <translation>закрашенный треугольник вниз</translation>
+    </message>
+    <message>
+        <source>filled triangle up</source>
+        <translation>закрашенный треугольник вверх</translation>
+    </message>
+    <message>
+        <source>filled circle</source>
+        <translation>круг</translation>
+    </message>
+</context>
+<context>
+    <name>ScriptWindow</name>
+    <message>
+        <source>
+(c) Alexey Balakin, 2008
+http://udav.sf.net/</source>
+        <translation>
+(c) Алексей Балакин, 2008
+http://udav.sf.net/</translation>
+    </message>
+    <message>
+        <source>UDAV - about</source>
+        <translation>UDAV - о программе</translation>
+    </message>
+    <message>
+        <source>File/Edit Operations</source>
+        <translation>Файл/Правка</translation>
+    </message>
+    <message>
+        <source>&amp;File</source>
+        <translation>&amp;Файл</translation>
+    </message>
+    <message>
+        <source>&amp;New script</source>
+        <translation>&amp;Новый код</translation>
+    </message>
+    <message>
+        <source>Create new empty script window (Ctrl+N).</source>
+        <translation>Создать новое пустое окно для кода (Ctrl+N).</translation>
+    </message>
+    <message>
+        <source>&amp;Open file</source>
+        <translation>&amp;Открыть файл</translation>
+    </message>
+    <message>
+        <source>Open and execute/show script or data from file (Ctrl+O).
+You may switch off automatic exection in UDAV properties.</source>
+        <translation>Открыть и выполнить/показать код или данные из файла (Ctrl+O).
+Вы можете выключить автоматическое выполнение в настройках UDAV.</translation>
+    </message>
+    <message>
+        <source>&amp;Save script</source>
+        <translation>&amp;Сохранить файл</translation>
+    </message>
+    <message>
+        <source>Save script to a file (Ctrl+S)</source>
+        <translation>Сохранить код в файл (Ctrl+S)</translation>
+    </message>
+    <message>
+        <source>Save &amp;As ...</source>
+        <translation>Сохранить &amp;как ...</translation>
+    </message>
+    <message>
+        <source>&amp;Print script</source>
+        <translation>Печатать &amp;код</translation>
+    </message>
+    <message>
+        <source>Print &amp;graphics</source>
+        <translation>&amp;Печатать график</translation>
+    </message>
+    <message>
+        <source>Open printer dialog and print graphics	(Ctrl+P)</source>
+        <translation>Открыть диалог принтера и напечатать график (Ctrl+P)</translation>
+    </message>
+    <message>
+        <source>Recent files</source>
+        <translation>Последние файлы</translation>
+    </message>
+    <message>
+        <source>&amp;Quit</source>
+        <translation>В&amp;ыход</translation>
+    </message>
+    <message>
+        <source>&amp;Edit</source>
+        <translation>&amp;Правка</translation>
+    </message>
+    <message>
+        <source>&amp;Undo</source>
+        <translation>&amp;Отменить</translation>
+    </message>
+    <message>
+        <source>Undo editor change (Ctrl+Z).</source>
+        <translation>Отменить изменения в редакторе (Ctrl+Z).</translation>
+    </message>
+    <message>
+        <source>&amp;Redo</source>
+        <translation>&amp;Вернуть</translation>
+    </message>
+    <message>
+        <source>Redo editor change (Ctrl+Shift+Z).</source>
+        <translation>Вернуть изменения в редакторе (Ctrl+Shift+Z).</translation>
+    </message>
+    <message>
+        <source>Clear all</source>
+        <translation>Очистить все</translation>
+    </message>
+    <message>
+        <source>Cu&amp;t text</source>
+        <translation>В&amp;ырезать</translation>
+    </message>
+    <message>
+        <source>Cut selected text to clipboard (Ctrl+X).</source>
+        <translation>Вырезать выделенный текст в буфер обмена (Ctrl+X).</translation>
+    </message>
+    <message>
+        <source>&amp;Copy</source>
+        <translation>&amp;Копировать</translation>
+    </message>
+    <message>
+        <source>Copy selected text or data to clipboard (Ctrl+C).</source>
+        <translation>Копировать выделенный текст в буфер обмена (Ctrl+C).</translation>
+    </message>
+    <message>
+        <source>&amp;Paste</source>
+        <translation>&amp;Вставить</translation>
+    </message>
+    <message>
+        <source>Paste text or data from clipboard (Ctrl+V).</source>
+        <translation>Вставить текст или данные из буфера обмена (Ctrl+V).</translation>
+    </message>
+    <message>
+        <source>Select &amp;all</source>
+        <translation>Выделить вс&amp;е</translation>
+    </message>
+    <message>
+        <source>&amp;Find/Replace</source>
+        <translation>&amp;Найти/заменить</translation>
+    </message>
+    <message>
+        <source>Show dialog for text finding (Ctrl+F).</source>
+        <translation>Показать диалог поиска текста (Ctrl+F).</translation>
+    </message>
+    <message>
+        <source>Find next</source>
+        <translation>Найти текст</translation>
+    </message>
+    <message>
+        <source>Insert</source>
+        <translation>Вставить</translation>
+    </message>
+    <message>
+        <source>New command</source>
+        <translation>Новая команда</translation>
+    </message>
+    <message>
+        <source>Show dialog for new command and put it into the script.</source>
+        <translation>Показать диалог вставки новой команды.</translation>
+    </message>
+    <message>
+        <source>Fitted formula</source>
+        <translation>Найденная формула</translation>
+    </message>
+    <message>
+        <source>Insert last fitted formula with found coefficients.</source>
+        <translation>Вставить последнюю найденную формулу в текст.</translation>
+    </message>
+    <message>
+        <source>Plot style</source>
+        <translation>Стиль графика</translation>
+    </message>
+    <message>
+        <source>Show dialog for styles and put it into the script.
+Styles define the plot view (color scheme, marks, dashing and so on).</source>
+        <translation>Показать диалог стиля графика и вставить его в код.
+Стиль определяет вид графика (цвет, маркеры, пунктир и пр).</translation>
+    </message>
+    <message>
+        <source>Command options</source>
+        <translation>Опции команды</translation>
+    </message>
+    <message>
+        <source>Show dialog for options and put it into the script.
+Options are used for additional setup the plot.</source>
+        <translation>Показать диалог выбора опций команды. Опции используются 
+для дополнительной настройки выбранного графика.</translation>
+    </message>
+    <message>
+        <source>Numeric value</source>
+        <translation>Численное значение</translation>
+    </message>
+    <message>
+        <source>Replace expression by its numerical value.</source>
+        <translation>Заменить выделенное выражение его числовым значением.</translation>
+    </message>
+    <message>
+        <source>File path</source>
+        <translation>Путь файла</translation>
+    </message>
+    <message>
+        <source>Select and insert file name.</source>
+        <translation>Выбрать и вставить путь файла.</translation>
+    </message>
+    <message>
+        <source>Folder path</source>
+        <translation>Путь папки</translation>
+    </message>
+    <message>
+        <source>Select and insert folder name.</source>
+        <translation>Выбрать и вставить путь папки.</translation>
+    </message>
+    <message>
+        <source>Graphics setup</source>
+        <translation>Настройка графика</translation>
+    </message>
+    <message>
+        <source>Show dialog for plot setup and put code into the script.
+This dialog setup axis, labels, lighting and other general things.</source>
+        <translation>Показать диалог настройки графика и вставить ее в код.
+Диалог позволяет настроить оси, подписи, освещение и пр.</translation>
+    </message>
+    <message>
+        <source>Properties</source>
+        <translation>Настройки UDAV</translation>
+    </message>
+    <message>
+        <source>Show dialog for UDAV properties.</source>
+        <translation>Показать диалог настроек программы UDAV.</translation>
+    </message>
+    <message>
+        <source>Set ar&amp;guments</source>
+        <translation>&amp;Аргументы кода</translation>
+    </message>
+    <message>
+        <source>Calculator</source>
+        <translation>Калькулятор</translation>
+    </message>
+    <message>
+        <source>Show calculator which evaluate and help to type textual formulas.
+Textual formulas may contain data variables too.</source>
+        <translation>Показывает калькулятор, который вычисляет и помогает набрать текстовые формулы.
+Текстовые формулы могут содержать также и определенные в коде данные.</translation>
+    </message>
+    <message>
+        <source>Show info</source>
+        <translation>Окно сообщений</translation>
+    </message>
+    <message>
+        <source>&amp;Window</source>
+        <translation>&amp;Окна</translation>
+    </message>
+    <message>
+        <source>Tile</source>
+        <translation>Плиткой</translation>
+    </message>
+    <message>
+        <source>Cascade</source>
+        <translation>Каскадом</translation>
+    </message>
+    <message>
+        <source>Close all</source>
+        <translation>Закрыть все</translation>
+    </message>
+    <message>
+        <source>UDAV Help</source>
+        <translation>Справка по UDAV</translation>
+    </message>
+    <message>
+        <source>&amp;Help</source>
+        <translation>&amp;Справка</translation>
+    </message>
+    <message>
+        <source>MGL &amp;help</source>
+        <translation>MGL &amp;справка</translation>
+    </message>
+    <message>
+        <source>Show help on MGL commands (F1).</source>
+        <translation>Показывает справку по текущей команде MGL (F1).</translation>
+    </message>
+    <message>
+        <source>&amp;Examples</source>
+        <translation>&amp;Примеры</translation>
+    </message>
+    <message>
+        <source>Show examples of MGL usage (Shift+F1).</source>
+        <translation>Показывает примеры использования MGL (Shift+F1).</translation>
+    </message>
+    <message>
+        <source>H&amp;ints</source>
+        <translation>С&amp;оветы</translation>
+    </message>
+    <message>
+        <source>Show hints of MGL usage.</source>
+        <translation>Показывает советы по использованию MGL.</translation>
+    </message>
+    <message>
+        <source>&amp;About</source>
+        <translation>О &amp;программе</translation>
+    </message>
+    <message>
+        <source>untitled - UDAV</source>
+        <translation>без имени - UDAV</translation>
+    </message>
+    <message>
+        <source>UDAV - save current</source>
+        <translation>UDAV - сохранить текущий код</translation>
+    </message>
+    <message>
+        <source>Do you want to save the changes to the document?</source>
+        <translation>Вы хотите сохранить изменения в коде?</translation>
+    </message>
+    <message>
+        <source>UDAV - Open file</source>
+        <translation>UDAV - Открыть файл</translation>
+    </message>
+    <message>
+        <source>MGL scripts (*.mgl)
+HDF5 files (*.hdf *.h5)
+Text files (*.txt)
+Data files (*.dat)
+All files (*.*)</source>
+        <translation>MGL код (*.mgl)
+HDF5 файлы (*.hdf *.h5)
+Текст (*.txt)
+Файлы данных (*.dat)
+Все файлы (*.*)</translation>
+    </message>
+    <message>
+        <source>Loading aborted</source>
+        <translation>Загрузка прервана</translation>
+    </message>
+    <message>
+        <source>UDAV - open file</source>
+        <translation>UDAV - открыть файл</translation>
+    </message>
+    <message>
+        <source>Couldn&apos;t open file</source>
+        <translation>Не могу открыть файл</translation>
+    </message>
+    <message>
+        <source>Loaded document </source>
+        <translation>Загружен документ </translation>
+    </message>
+    <message>
+        <source>Could not write to %1</source>
+        <translation>Не могу записать в %1</translation>
+    </message>
+    <message>
+        <source>File %1 saved</source>
+        <translation>Файл %1 сохранен</translation>
+    </message>
+    <message>
+        <source>UDAV - save file</source>
+        <translation>UDAV - сохранить файл</translation>
+    </message>
+    <message>
+        <source>MGL scripts (*.mgl)
+HDF5 files (*.hdf *.h5)
+All files (*.*)</source>
+        <translation>MGL код (*.mgl)
+HDF5 файлы (*.hdf *.h5)
+Все файлы (*.*)</translation>
+    </message>
+    <message>
+        <source>Saving aborted</source>
+        <translation>Сохранение прервано</translation>
+    </message>
+    <message>
+        <source>untitled* - UDAV</source>
+        <translation>без имени* - UDAV</translation>
+    </message>
+    <message>
+        <source>UDAV - Insert filename</source>
+        <translation>UDAV - Вставить имя файла</translation>
+    </message>
+    <message>
+        <source>Messages and warnings</source>
+        <translation>Сообщения и предупреждения</translation>
+    </message>
+    <message>
+        <source>Ready</source>
+        <translation>Готово</translation>
+    </message>
+    <message>
+        <source>Printing...</source>
+        <translation>Печатаю...</translation>
+    </message>
+    <message>
+        <source>Printing completed</source>
+        <translation>Печать завершена</translation>
+    </message>
+    <message>
+        <source>Printing aborted</source>
+        <translation>Печать прервана</translation>
+    </message>
+    <message>
+        <source>UDAV - find text</source>
+        <translation>UDAV - поиск текста</translation>
+    </message>
+    <message>
+        <source>No string occurrence is found</source>
+        <translation>Строка не найдена</translation>
+    </message>
+    <message>
+        <source>Not recognized</source>
+        <translation>Не распознано</translation>
+    </message>
+    <message>
+        <source>Loaded document %1</source>
+        <translation>Загружен документ %1</translation>
+    </message>
+    <message>
+        <source>&amp;Data</source>
+        <translation>&amp;Данные</translation>
+    </message>
+    <message>
+        <source>File Operations</source>
+        <translation>Работа с файлами</translation>
+    </message>
+    <message>
+        <source>&amp;Load data</source>
+        <translation>&amp;Загрузить данные</translation>
+    </message>
+    <message>
+        <source>Load data from file. Data will be deleted only
+at exit but UDAV will not ask to save it.</source>
+        <translation>Загрузить данные из файла. Данные будут удалены при
+выходе, но UDAV не спросит об их сохранении.</translation>
+    </message>
+    <message>
+        <source>&amp;Import PNG</source>
+        <translation>&amp;Импорт PNG</translation>
+    </message>
+    <message>
+        <source>Import data from PNG picture with specified color scheme.
+Data will be deleted only at exit but UDAV will not ask it saving.</source>
+        <translation>Импортировать данные из PNG рисунка с заданной цветовой схемой.
+Данные будут удалены при выходе, но UDAV не спросит об их сохранении.</translation>
+    </message>
+    <message>
+        <source>&amp;Save data</source>
+        <translation>Сохранить &amp;данные</translation>
+    </message>
+    <message>
+        <source>Save data to tab-separeted file.</source>
+        <translation>Сохранить данные в текстовый файл с разделителем табуляцией.</translation>
+    </message>
+    <message>
+        <source>&amp;Export PNG</source>
+        <translation>&amp;Экспорт PNG</translation>
+    </message>
+    <message>
+        <source>Export data to PNG picture. The colors defined by 
+specified color scheme. The same as in &apos;dens&apos; command.</source>
+        <translation>Экспортирует данные в PNG рисунок. Цвета определяются
+указанной цветовой схемой. Рисунок аналогичен команде &apos;dens&apos;.</translation>
+    </message>
+    <message>
+        <source>Plot &amp;data</source>
+        <translation>&amp;Отобразить данные</translation>
+    </message>
+    <message>
+        <source>Plot data in new script window. You may select the kind
+of plot, its style and so on.</source>
+        <translation>Отобразить данные в новом окне. Вы можете
+выбрать тип графика, его стиль и т.д.</translation>
+    </message>
+    <message>
+        <source>Resize data</source>
+        <translation>Размеры данных</translation>
+    </message>
+    <message>
+        <source>&amp;Sizes</source>
+        <translation>&amp;Размеры</translation>
+    </message>
+    <message>
+        <source>&amp;Create new</source>
+        <translation>&amp;Создать новые</translation>
+    </message>
+    <message>
+        <source>Recreate the data with new sizes and fill it by zeros (Ctrl+N).</source>
+        <translation>Создает заново данные нового размера и заполняет их нулями (Ctrl+N).</translation>
+    </message>
+    <message>
+        <source>&amp;Resize</source>
+        <translation>&amp;Изменить размер</translation>
+    </message>
+    <message>
+        <source>Resize (interpolate) the data to specified sizes (Ctrl+R).</source>
+        <translation>Изменяет размер (интерполирует) данных в указанному (Ctrl+R).</translation>
+    </message>
+    <message>
+        <source>&amp;Squeeze</source>
+        <translation>С&amp;жать</translation>
+    </message>
+    <message>
+        <source>Keep only each n-th element of the data array.</source>
+        <translation>Сохраняет каждый n-ый элемент массива данных.</translation>
+    </message>
+    <message>
+        <source>Cro&amp;p</source>
+        <translation>О&amp;брезать</translation>
+    </message>
+    <message>
+        <source>Crop the data edges. Useful to cut off the zero-filled area.</source>
+        <translation>Обрезает края данных. Полезно для удаления заполненных нулями областей.</translation>
+    </message>
+    <message>
+        <source>&amp;Transpose</source>
+        <translation>&amp;Транспонировать</translation>
+    </message>
+    <message>
+        <source>Transpose data dimensions, like x&lt;-&gt;y or x&lt;-&gt;z and so on.</source>
+        <translation>Транспонирует массив данных, типа x&lt;-&gt;y или x&lt;-&gt;z и т.д.</translation>
+    </message>
+    <message>
+        <source>Re&amp;arrange</source>
+        <translation>По&amp;менять размеры</translation>
+    </message>
+    <message>
+        <source>Rearrange data sizes without changing data values.</source>
+        <translation>Меняет размеры данных без изменения самого массива данных.</translation>
+    </message>
+    <message>
+        <source>Modify data</source>
+        <translation>Изменить данные</translation>
+    </message>
+    <message>
+        <source>&amp;Modify</source>
+        <translation>&amp;Изменить</translation>
+    </message>
+    <message>
+        <source>By &amp;formula</source>
+        <translation>По &amp;формуле</translation>
+    </message>
+    <message>
+        <source>Change data values according to formula depended on &apos;x&apos;, &apos;y&apos; and &apos;z&apos;
+variables. A set of special function is availible also.</source>
+        <translation>Изменяет данные по формуле, зависяещей от переменных &apos;x&apos;, &apos;y&apos; и &apos;z&apos;.
+Поддерживаются также многие специальные функции.</translation>
+    </message>
+    <message>
+        <source>Fill in &amp;range</source>
+        <translation>&amp;Распределить</translation>
+    </message>
+    <message>
+        <source>Fill data equidistantly from one value to another.</source>
+        <translation>Распределить равномерно данные от одного значения до другого.</translation>
+    </message>
+    <message>
+        <source>&amp;Normalize</source>
+        <translation>&amp;Нормировать</translation>
+    </message>
+    <message>
+        <source>Normalize data so that its minimal
+and maximal values be in specified range.</source>
+        <translation>Нормирует данные так, что их максимальное и
+минимальное значения равны заданным.</translation>
+    </message>
+    <message>
+        <source>Norm. s&amp;lices</source>
+        <translation>Норм. по &amp;срезам</translation>
+    </message>
+    <message>
+        <source>Normalize each data slice perpendicular to some direction
+so that its minimal and maximal values be in specified range.</source>
+        <translation>Нормирует данные по срезам перпендикулярно 
+заданному направлению так, что их максимальное
+и минимальное значения равны заданным.</translation>
+    </message>
+    <message>
+        <source>&amp;Smooth data</source>
+        <translation>С&amp;гладить</translation>
+    </message>
+    <message>
+        <source>Smooth data by one of 4 methods along specified direction(s).</source>
+        <translation>Сглаживает данные одним из 4-х методов вдоль заданного направления(ий).</translation>
+    </message>
+    <message>
+        <source>&amp;Operators</source>
+        <translation>&amp;Опраторы</translation>
+    </message>
+    <message>
+        <source>&amp;Cum. sum</source>
+        <translation>&amp;Суммировать</translation>
+    </message>
+    <message>
+        <source>Summate data values along specified direction(s).</source>
+        <translation>Суммирует данные вдоль указанного направления(ий).</translation>
+    </message>
+    <message>
+        <source>&amp;Integrate</source>
+        <translation>&amp;Интегрировать</translation>
+    </message>
+    <message>
+        <source>Integrate data values along specified direction(s).</source>
+        <translation>Интегрирует данные по заданному направлению(ям).</translation>
+    </message>
+    <message>
+        <source>&amp;Differentiate</source>
+        <translation>&amp;Дифференцировать</translation>
+    </message>
+    <message>
+        <source>Differentiate data values along specified direction(s).</source>
+        <translation>Дифференцирует данные по заданному направлению(ям).</translation>
+    </message>
+    <message>
+        <source>&amp;Laplace</source>
+        <translation>&amp;Лаплас</translation>
+    </message>
+    <message>
+        <source>Double differentiate data values along specified direction(s).</source>
+        <translation>Дважды дифференцирует данные по заданному направлению(ям).</translation>
+    </message>
+    <message>
+        <source>&amp;Swap</source>
+        <translation>&amp;Поменять местами</translation>
+    </message>
+    <message>
+        <source>Swap left and right data part along specified direction(s).
+This operation is useful for data after Fourier transform.</source>
+        <translation>Меняет местами левую и правую часть данных вдоль указанного направления(ий).
+Операция полезна для данных после Фурье преобразования.</translation>
+    </message>
+    <message>
+        <source>&amp;Mirror</source>
+        <translation>&amp;Отразить</translation>
+    </message>
+    <message>
+        <source>Mirror left and right data part along specified direction(s).
+This operation do like index change from &apos;i&apos; to &apos;n-i&apos;.</source>
+        <translation>Отражает данные относительно указанного направления(ий).
+Действует как замена индекса &apos;i&apos; на &apos;n-i&apos;.</translation>
+    </message>
+    <message>
+        <source>&amp;Algebraic</source>
+        <translation>&amp;Алгебраические</translation>
+    </message>
+    <message>
+        <source>&amp;Add</source>
+        <translation>&amp;Добавить</translation>
+    </message>
+    <message>
+        <source>Add a number to all data values.</source>
+        <translation>Добавляет число к элементам массива данных.</translation>
+    </message>
+    <message>
+        <source>&amp;Subtract</source>
+        <translation>&amp;Вычесть</translation>
+    </message>
+    <message>
+        <source>Subtract a number to all data values.</source>
+        <translation>Вычитает из элементов массива данных число.</translation>
+    </message>
+    <message>
+        <source>&amp;Multiply</source>
+        <translation>&amp;Умножить</translation>
+    </message>
+    <message>
+        <source>Multiply all data values by a number.</source>
+        <translation>Умножает элементы массива данных на число.</translation>
+    </message>
+    <message>
+        <source>&amp;Divide</source>
+        <translation>&amp;Разделить</translation>
+    </message>
+    <message>
+        <source>Divide all data values by a number.</source>
+        <translation>Делит элементы массива данных на число.</translation>
+    </message>
+    <message>
+        <source>A&amp;nother data</source>
+        <translation>&amp;Новые данные</translation>
+    </message>
+    <message>
+        <source>&amp;Sum of</source>
+        <translation>&amp;Сумма по</translation>
+    </message>
+    <message>
+        <source>M&amp;in of</source>
+        <translation>М&amp;инимум по</translation>
+    </message>
+    <message>
+        <source>M&amp;ax of</source>
+        <translation>М&amp;аксимум по</translation>
+    </message>
+    <message>
+        <source>Momentum along &amp;x</source>
+        <translation>Момент вдоль &amp;x</translation>
+    </message>
+    <message>
+        <source>Momentum along &amp;y</source>
+        <translation>Момент вдоль &amp;y</translation>
+    </message>
+    <message>
+        <source>Momentum along &amp;z</source>
+        <translation>Момент вдоль &amp;z</translation>
+    </message>
+    <message>
+        <source>&amp;Histogram</source>
+        <translation>&amp;Гистограмма</translation>
+    </message>
+    <message>
+        <source>Navigate data</source>
+        <translation>Переход к срезам</translation>
+    </message>
+    <message>
+        <source>&amp;Navigate</source>
+        <translation>Пере&amp;ход</translation>
+    </message>
+    <message>
+        <source>&amp;First slice</source>
+        <translation>&amp;Первый срез</translation>
+    </message>
+    <message>
+        <source>Go to the first data slice for 3D data.</source>
+        <translation>Перейти к первому срезу 3D данных.</translation>
+    </message>
+    <message>
+        <source>&amp;Prev. slice</source>
+        <translation>&amp;Предыдущий срез</translation>
+    </message>
+    <message>
+        <source>Go to the previous data slice for 3D data.</source>
+        <translation>Перейти к предыдущему срезу 3D данных.</translation>
+    </message>
+    <message>
+        <source>Go to the specified data slice for 3D data.</source>
+        <translation>Перейти к указанному срезу 3D данных.</translation>
+    </message>
+    <message>
+        <source>Go to slice</source>
+        <translation>Перейти к срезу</translation>
+    </message>
+    <message>
+        <source>Next slice</source>
+        <translation>Следующий срез</translation>
+    </message>
+    <message>
+        <source>Go to the next data slice for 3D data.</source>
+        <translation>Перейти к следующему срезу 3D данных.</translation>
+    </message>
+    <message>
+        <source>Last slice</source>
+        <translation>Последний срез</translation>
+    </message>
+    <message>
+        <source>Go to the last data slice for 3D data.</source>
+        <translation>Перейти к последнему срезу 3D данных.</translation>
+    </message>
+    <message>
+        <source>UDAV v. 0.</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>About Qt</source>
+        <translation>О библиотеке Qt</translation>
+    </message>
+    <message>
+        <source>About &amp;Qt</source>
+        <translation>О библиотеке &amp;Qt</translation>
+    </message>
+    <message>
+        <source> - UDAV</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>* - UDAV</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>UDAV</source>
+        <translation></translation>
+    </message>
+</context>
+<context>
+    <name>SetupDialog</name>
+    <message>
+        <source>UDAV - Setup plot</source>
+        <translation>UDAV - Настройка графика</translation>
+    </message>
+    <message>
+        <source>X axis</source>
+        <translation>Ось X</translation>
+    </message>
+    <message>
+        <source>Y axis</source>
+        <translation>Ось Y</translation>
+    </message>
+    <message>
+        <source>Z axis</source>
+        <translation>Ось Z</translation>
+    </message>
+    <message>
+        <source>C axis</source>
+        <translation>Ось C</translation>
+    </message>
+    <message>
+        <source>Minimal</source>
+        <translation>Минимум</translation>
+    </message>
+    <message>
+        <source>Maximal</source>
+        <translation>Максимум</translation>
+    </message>
+    <message>
+        <source>Origin</source>
+        <translation>Начало осей</translation>
+    </message>
+    <message>
+        <source>Label</source>
+        <translation>Подпись</translation>
+    </message>
+    <message>
+        <source>at position</source>
+        <translation>в позиции</translation>
+    </message>
+    <message>
+        <source>at minimum</source>
+        <translation>минимума</translation>
+    </message>
+    <message>
+        <source>at center</source>
+        <translation>по центру</translation>
+    </message>
+    <message>
+        <source>at maximum</source>
+        <translation>максимума</translation>
+    </message>
+    <message>
+        <source>Ticks</source>
+        <translation>Метки</translation>
+    </message>
+    <message>
+        <source>SubTicks</source>
+        <translation>Под-метки</translation>
+    </message>
+    <message>
+        <source>Start</source>
+        <translation>Начало меток</translation>
+    </message>
+    <message>
+        <source>Template</source>
+        <translation>Шаблон</translation>
+    </message>
+    <message>
+        <source>AlphaDef</source>
+        <translation>Базовая прозрачность</translation>
+    </message>
+    <message>
+        <source>Ambient</source>
+        <translation>Фоновый свет</translation>
+    </message>
+    <message>
+        <source>BaseWidth</source>
+        <translation>Базовая ширина</translation>
+    </message>
+    <message>
+        <source>MeshNum</source>
+        <translation>Число линий сетки</translation>
+    </message>
+    <message>
+        <source>AxialDir</source>
+        <translation>Ось вращения</translation>
+    </message>
+    <message>
+        <source>Font</source>
+        <translation>Стиль текста</translation>
+    </message>
+    <message>
+        <source>FontSize</source>
+        <translation>Размер текста</translation>
+    </message>
+    <message>
+        <source>Alpha on</source>
+        <translation>Прозрачность</translation>
+    </message>
+    <message>
+        <source>Light on</source>
+        <translation>Освещение</translation>
+    </message>
+    <message>
+        <source>No text rotation</source>
+        <translation>Запрет вращения текста</translation>
+    </message>
+    <message>
+        <source>General settings</source>
+        <translation>Общие настройки</translation>
+    </message>
+    <message>
+        <source>State</source>
+        <translation>Состояние</translation>
+    </message>
+    <message>
+        <source>Color</source>
+        <translation>Цвет</translation>
+    </message>
+    <message>
+        <source>Brightness</source>
+        <translation>Яркость</translation>
+    </message>
+    <message>
+        <source>Light settings</source>
+        <translation>Настройки освещения</translation>
+    </message>
+    <message>
+        <source>Template name</source>
+        <translation>Имя шаблона</translation>
+    </message>
+    <message>
+        <source>Save</source>
+        <translation>Сохранить</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>To script</source>
+        <translation>В код</translation>
+    </message>
+    <message>
+        <source>UDAV - Save template</source>
+        <translation>UDAV - Сохранить шаблон</translation>
+    </message>
+    <message>
+        <source>Could not write to file</source>
+        <translation>Не могу записать в файл</translation>
+    </message>
+    <message>
+        <source>Template saved</source>
+        <translation>Шаблон сохранен</translation>
+    </message>
+    <message>
+        <source>Light position should be filled. Ignore it.</source>
+        <translation>Положение источника должно быть заполнено. Игнорирую.</translation>
+    </message>
+    <message>
+        <source>ID</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>X pos</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>Y pos</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>Z pos</source>
+        <translation></translation>
+    </message>
+    <message>
+        <source>on</source>
+        <translation>вкл</translation>
+    </message>
+</context>
+<context>
+    <name>StyleDialog</name>
+    <message>
+        <source>UDAV - Insert style/scheme</source>
+        <translation>UDAV - Вставить стиль/схему</translation>
+    </message>
+    <message>
+        <source>Arrow at start</source>
+        <translation>Стрелка в начале</translation>
+    </message>
+    <message>
+        <source>Dashing</source>
+        <translation>Пунктир</translation>
+    </message>
+    <message>
+        <source>Arrow at end</source>
+        <translation>Стрелка в конце</translation>
+    </message>
+    <message>
+        <source>Color</source>
+        <translation>Цвет</translation>
+    </message>
+    <message>
+        <source>Marks</source>
+        <translation>Маркер</translation>
+    </message>
+    <message>
+        <source>Line width</source>
+        <translation>Толщина</translation>
+    </message>
+    <message>
+        <source>Line style</source>
+        <translation>Стиль линии</translation>
+    </message>
+    <message>
+        <source>Color order</source>
+        <translation>Порядок цветов</translation>
+    </message>
+    <message>
+        <source>Saturation</source>
+        <translation>Насыщенность</translation>
+    </message>
+    <message>
+        <source>Colors along coordinates</source>
+        <translation>Цвет вдоль координат</translation>
+    </message>
+    <message>
+        <source>Wire or mesh plot</source>
+        <translation>Сетчатый график</translation>
+    </message>
+    <message>
+        <source>Axial direction</source>
+        <translation>Ось вращения</translation>
+    </message>
+    <message>
+        <source>Text on contours</source>
+        <translation>Текст на контурах</translation>
+    </message>
+    <message>
+        <source>none</source>
+        <translation>нет</translation>
+    </message>
+    <message>
+        <source>under</source>
+        <translation>под</translation>
+    </message>
+    <message>
+        <source>above</source>
+        <translation>над</translation>
+    </message>
+    <message>
+        <source>Color scheme</source>
+        <translation>Цветовая схема</translation>
+    </message>
+    <message>
+        <source>Bold style</source>
+        <translation>Жирный</translation>
+    </message>
+    <message>
+        <source>Italic style</source>
+        <translation>Курсив</translation>
+    </message>
+    <message>
+        <source>Wire style</source>
+        <translation>Контур</translation>
+    </message>
+    <message>
+        <source>Underline</source>
+        <translation>Подчеркнутый</translation>
+    </message>
+    <message>
+        <source>Overline</source>
+        <translation>Надчеркнутый</translation>
+    </message>
+    <message>
+        <source>Text color</source>
+        <translation>Цвет текста</translation>
+    </message>
+    <message>
+        <source>Text align</source>
+        <translation>Выравнивание</translation>
+    </message>
+    <message>
+        <source>left</source>
+        <translation>влево</translation>
+    </message>
+    <message>
+        <source>at center</source>
+        <translation>по центру</translation>
+    </message>
+    <message>
+        <source>right</source>
+        <translation>вправо</translation>
+    </message>
+    <message>
+        <source>Font style</source>
+        <translation>Стиль текста</translation>
+    </message>
+    <message>
+        <source>Resulting string</source>
+        <translation>Результат</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+</context>
+<context>
+    <name>TableWindow</name>
+    <message>
+        <source> - UDAV variable</source>
+        <translation> - UDAV переменная</translation>
+    </message>
+    <message>
+        <source> - UDAV preview</source>
+        <translation> - UDAV просмотр</translation>
+    </message>
+    <message>
+        <source>UDAV - Import PNG</source>
+        <translation>UDAV - Импорт PNG</translation>
+    </message>
+    <message>
+        <source>Data files (*.dat)
+All files (*.*)</source>
+        <translation>Файлы данных (*.dat)
+Все файлы (*.*)</translation>
+    </message>
+    <message>
+        <source>UDAV - Export to PNG</source>
+        <translation>UDAV - Экспорт в PNG</translation>
+    </message>
+    <message>
+        <source>Enter color scheme for picture.
+Note that data will be normalized in range [0,1].</source>
+        <translation>Введите цветовую схему рисунка.
+Данные будут нормированы в [0,1].</translation>
+    </message>
+    <message>
+        <source>PNG files (*.png)
+All files (*.*)</source>
+        <translation>PNG файлы (*.png)
+Все файлы (*.*)</translation>
+    </message>
+    <message>
+        <source>Enter color scheme for picture</source>
+        <translation>Введите цветовую схему рисунка</translation>
+    </message>
+    <message>
+        <source>UDAV - Save data</source>
+        <translation>UDAV - Сохранить данные</translation>
+    </message>
+    <message>
+        <source>UDAV - Load data</source>
+        <translation>UDAV - Загрузить данные</translation>
+    </message>
+    <message>
+        <source>UDAV - Fill data</source>
+        <translation>UDAV - Заполнить данные</translation>
+    </message>
+    <message>
+        <source>Enter formula for data filling.
+Note that variables x,y,z supposed to be in range [0,1].</source>
+        <translation>Введите формулу для данных.
+Переменные x,y,z меняются в интервале [0,1].</translation>
+    </message>
+    <message>
+        <source>Enter range for data and direction of filling</source>
+        <translation>Введите диапазон и направление заполнения</translation>
+    </message>
+    <message>
+        <source>From</source>
+        <translation>От</translation>
+    </message>
+    <message>
+        <source>To</source>
+        <translation>До</translation>
+    </message>
+    <message>
+        <source>Direction</source>
+        <translation>Направление</translation>
+    </message>
+    <message>
+        <source>UDAV - Normalize data</source>
+        <translation>UDAV - Нормировать данные</translation>
+    </message>
+    <message>
+        <source>Enter range for final data</source>
+        <translation>Введите диапазон результата</translation>
+    </message>
+    <message>
+        <source>Symmetrical?</source>
+        <translation>Симметрично?</translation>
+    </message>
+    <message>
+        <source>UDAV - Normalize by slice</source>
+        <translation>UDAV - Нормировать по срезам</translation>
+    </message>
+    <message>
+        <source>UDAV - Clear data</source>
+        <translation>UDAV - Очистить данные</translation>
+    </message>
+    <message>
+        <source>Enter new data sizes</source>
+        <translation>Введите новые размеры</translation>
+    </message>
+    <message>
+        <source>X-size</source>
+        <translation>Размер по X</translation>
+    </message>
+    <message>
+        <source>Y-size</source>
+        <translation>Размер по Y</translation>
+    </message>
+    <message>
+        <source>Z-size</source>
+        <translation>Размер по Z</translation>
+    </message>
+    <message>
+        <source>UDAV - Resize data</source>
+        <translation>UDAV - Изменить размер данных</translation>
+    </message>
+    <message>
+        <source>UDAV - Squeeze data</source>
+        <translation>UDAV - Сжать данные</translation>
+    </message>
+    <message>
+        <source>Enter step of saved points. For example, &apos;1&apos; save all, &apos;2&apos; save each 2nd point, &apos;3&apos; save each 3d and so on.</source>
+        <translation>Введите шаг сохраняемых точек. Например, &apos;1&apos; сохранить все, &apos;2&apos; каждую вторую точку, &apos;3&apos; каждую третью и т.д.</translation>
+    </message>
+    <message>
+        <source>X-direction</source>
+        <translation>X направление</translation>
+    </message>
+    <message>
+        <source>Y-direction</source>
+        <translation>Y направление</translation>
+    </message>
+    <message>
+        <source>Z-direction</source>
+        <translation>Z направление</translation>
+    </message>
+    <message>
+        <source>UDAV - Crop data</source>
+        <translation>UDAV - Обрезать данные</translation>
+    </message>
+    <message>
+        <source>Enter range of saved date.</source>
+        <translation>Введите интервал сохраняемых данных.</translation>
+    </message>
+    <message>
+        <source>UDAV - Rearrange data</source>
+        <translatorcomment>Не знаю хорошего русского термина</translatorcomment>
+        <translation>UDAV - Поменять размеры данных</translation>
+    </message>
+    <message>
+        <source>UDAV - Transpose data</source>
+        <translation>UDAV - Транспонировать данные</translation>
+    </message>
+    <message>
+        <source>Enter new order of dimensions.
+For example, &apos;yx&apos; or &apos;yxz&apos; for transpose x-y, &apos;zyx&apos; for transposing x-z and so on.</source>
+        <translation>Введите новый порядок размерностей.
+Например, &apos;yx&apos; или &apos;yxz&apos; для транспонирования x-y, &apos;zyx&apos; для транспонирования x-z и т.д.</translation>
+    </message>
+    <message>
+        <source>UDAV - Smooth data</source>
+        <translation>UDAV - Сгладить данные</translation>
+    </message>
+    <message>
+        <source>Enter direction(s) for smoothing.
+Optionally you may enter the kind of smoothing by 3 or by 5 points. For example &apos;xy3&apos; - smooth only in x and y directions and use 3-points scheme.</source>
+        <translation>Введите направление(я) сглаживания.
+Можно также ввести тип сглаживания по 3 или по 5 точкам. Например &apos;xy3&apos; - сгладит только в x и y направлениях по 3-точечной схеме.</translation>
+    </message>
+    <message>
+        <source>UDAV - Summarize data</source>
+        <translation>UDAV - Суммировать данные</translation>
+    </message>
+    <message>
+        <source>Enter direction(s) for cumulative summation.
+For example &apos;xy&apos; - summate along x and y directions.</source>
+        <translation>Введите направление(я) для суммирования.
+Например &apos;xy&apos; - суммировать вдоль x и y направлений.</translation>
+    </message>
+    <message>
+        <source>UDAV - Integrate data</source>
+        <translation>UDAV - Интегрировать данные</translation>
+    </message>
+    <message>
+        <source>Enter direction(s) for integration.
+For example &apos;xy&apos; - integrate along x and y directions.</source>
+        <translation>Введите направление(я) для инткгрирования.
+Например &apos;xy&apos; - интегрировать вдоль x и y направлений.</translation>
+    </message>
+    <message>
+        <source>UDAV - Differentiate data</source>
+        <translation>UDAV - Дифференцировать данные</translation>
+    </message>
+    <message>
+        <source>Enter direction(s) for differentiation.
+For example &apos;xy&apos; - differentiate along x and y directions.</source>
+        <translation>Введите направление(я) для дифференцирования.
+Например &apos;xy&apos; - дифференцировать вдоль x и y направлений.</translation>
+    </message>
+    <message>
+        <source>UDAV - Laplace transform</source>
+        <translation>UDAV - Преобразование Лапласа</translation>
+    </message>
+    <message>
+        <source>Enter direction(s) for laplace transform.
+For example &apos;xy&apos; - do transform along x and y directions.</source>
+        <translation>Введите направление(я) для преобразования Лапласа.
+Например &apos;xy&apos; - преобразовать вдоль x и y направлений.</translation>
+    </message>
+    <message>
+        <source>UDAV - Swap data</source>
+        <translation>UDAV - Поменять местами</translation>
+    </message>
+    <message>
+        <source>Enter direction(s) for swapping (exchange left and right parts).
+For example &apos;xy&apos; - swap along x and y directions. Useful for Fourier spectrum.</source>
+        <translation>Введите направление(я) для обмена левой и правой частями данных.
+Например &apos;xy&apos; - меняет вдоль x и y направлений. Полезно для Фурье спектров.</translation>
+    </message>
+    <message>
+        <source>UDAV - Mirror data</source>
+        <translation>UDAV - Отразить данные</translation>
+    </message>
+    <message>
+        <source>Enter direction(s) for mirroring.
+For example &apos;xy&apos; - mirror along x and y directions.</source>
+        <translation>Введите направление(я) для отражения.
+Например &apos;xy&apos; - отразить по x и y направлениям.</translation>
+    </message>
+    <message>
+        <source>UDAV - Sum along ...</source>
+        <translation>UDAV - Сумма по ...</translation>
+    </message>
+    <message>
+        <source>Specify direction(s) of summation</source>
+        <translation>Введите направление(я) суммирования</translation>
+    </message>
+    <message>
+        <source>UDAV - Max along ...</source>
+        <translation>UDAV - Максимум по ...</translation>
+    </message>
+    <message>
+        <source>Specify direction(s) of maximal values</source>
+        <translation>Введите направление(я) поиска максимумов</translation>
+    </message>
+    <message>
+        <source>UDAV - Min along ...</source>
+        <translation>UDAV - Минимум по ...</translation>
+    </message>
+    <message>
+        <source>Specify direction(s) of minimal values</source>
+        <translation>Введите направление(я) поиска минимумов</translation>
+    </message>
+    <message>
+        <source>UDAV - Momentum along &apos;x&apos;</source>
+        <translation>UDAV - Момент по &apos;x&apos;</translation>
+    </message>
+    <message>
+        <source>Specify which momentum evaluate.
+The momentum is res_i = sum_jk how(x_i,y_j,z_k) a_jk/ sum_jk a_jk.
+Coordinates x, y, z are data indexes normalized in range [0,1].</source>
+        <translation>Укажите какой момент вычислять.
+Момент равен res_i = Σ_jk how(x_i,y_j,z_k) a_jk/ Σ_jk a_jk.
+Координаты x, y, z находятся в диапазоне [0,1].</translation>
+    </message>
+    <message>
+        <source>Specify which momentum evaluate.
+The momentum is res_j = sum_ik how(x_i,y_j,z_k) a_ik/ sum_ik a_ik.
+Coordinates x, y, z are data indexes normalized in range [0,1].</source>
+        <translation>Укажите какой момент вычислять.
+Момент равен res_j = Σ_ik how(x_i,y_j,z_k) a_ik/ Σ_ik a_ik.
+Координаты x, y, z находятся в диапазоне [0,1].</translation>
+    </message>
+    <message>
+        <source>Specify which momentum evaluate.
+The momentum is res_k = sum_ij how(x_i,y_j,z_k) a_ij/ sum_ij a_ij.
+Coordinates x, y, z are data indexes normalized in range [0,1].</source>
+        <translation>Укажите какой момент вычислять.
+Момент равен res_k = Σ_ij how(x_i,y_j,z_k) a_ij/ Σ_ij a_ij.
+Координаты x, y, z находятся в диапазоне [0,1].</translation>
+    </message>
+    <message>
+        <source>UDAV - Momentum along &apos;y&apos;</source>
+        <translation>UDAV - Момент по &apos;y&apos;</translation>
+    </message>
+    <message>
+        <source>UDAV - Momentum along &apos;z&apos;</source>
+        <translation>UDAV - Момент по &apos;z&apos;</translation>
+    </message>
+    <message>
+        <source>UDAV - Make histogram</source>
+        <translation>UDAV - Найти гистограмму</translation>
+    </message>
+    <message>
+        <source>Number of points</source>
+        <translation>Число точек</translation>
+    </message>
+    <message>
+        <source>Put in variable</source>
+        <translation>Поместить в переменную</translation>
+    </message>
+    <message>
+        <source>Cancel</source>
+        <translation>Отмена</translation>
+    </message>
+    <message>
+        <source>OK</source>
+        <translation>OK</translation>
+    </message>
+    <message>
+        <source>UDAV - Change data</source>
+        <translation>UDAV - Изменить данные</translation>
+    </message>
+    <message>
+        <source>Enter number for adding to data elements:</source>
+        <translation>Введите число для добавления к элементам массива:</translation>
+    </message>
+    <message>
+        <source>Enter number for subtraction from data elements:</source>
+        <translation>Введите число для вычитания из элементов массива:</translation>
+    </message>
+    <message>
+        <source>Enter number for division of data elements:</source>
+        <translation>Введите число для деления элементов массива:</translation>
+    </message>
+    <message>
+        <source>Enter number for multiplication of data elements:</source>
+        <translation>Введите число для умножения элементов массива:</translation>
+    </message>
+    <message>
+        <source>UDAV - Go to slice</source>
+        <translation>UDAV - Перейти к срезу</translation>
+    </message>
+    <message>
+        <source>Enter slice id:</source>
+        <translation>Введите номер среза:</translation>
+    </message>
+    <message>
+        <source>NOTE: All fields must be filled!</source>
+        <translation>Все поля должны быть заполнены!</translation>
+    </message>
+    <message>
+        <source>Enter the name for new variable</source>
+        <translation>Введите имя новой переменной</translation>
+    </message>
+</context>
+</TS>
diff --git a/src/xpm/accessories-calculator.png b/src/xpm/accessories-calculator.png
new file mode 100644
index 0000000..9248971
Binary files /dev/null and b/src/xpm/accessories-calculator.png differ
diff --git a/src/xpm/folder.png b/src/xpm/folder.png
new file mode 100644
index 0000000..65bd0bb
Binary files /dev/null and b/src/xpm/folder.png differ
diff --git a/src/xpm/format-indent-more.png b/src/xpm/format-indent-more.png
new file mode 100644
index 0000000..00309ea
Binary files /dev/null and b/src/xpm/format-indent-more.png differ
diff --git a/src/xpm/x-office-spreadsheet.png b/src/xpm/x-office-spreadsheet.png
new file mode 100644
index 0000000..a6b1268
Binary files /dev/null and b/src/xpm/x-office-spreadsheet.png differ
diff --git a/templates/udav.mgl b/templates/udav.mgl
index 7b7c82d..2d7ff9f 100644
--- a/templates/udav.mgl
+++ b/templates/udav.mgl
@@ -1,4 +1,4 @@
-setsize 64 64
+setsize 530 530
 
 new xx 30 30
 new yy 30 30
@@ -18,8 +18,6 @@ modify r '0.2*exp(-2*x*x)'
 # for <=32
 zoom 0.35 0.33 0.7 0.68
 
-#rect -1 -1 -1 1 1 -1 'W'
-
 alpha on
 modify xx '0.05+0.6*x*cos(2*pi*y)'
 modify yy '0.6*x*sin(2*pi*y)'
@@ -44,9 +42,3 @@ modify xx '0.2*sin(pi*x)*cos(2*pi*y)+1'
 modify yy '0.2*sin(pi*x)*sin(2*pi*y)'
 modify zz '-1-0.2*cos(pi*x)'
 surf xx yy zz 'b'
-
-#new a 40 40
-#modify a '1*rnd-1'
-#smooth a 2
-#alpha on
-#surf a 'blc'

-- 
Packaging for udav



More information about the debian-science-commits mailing list