]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QMath.C
some math dialog non-improvements
[lyx.git] / src / frontends / qt2 / QMath.C
1 /**
2  * \file QMath.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon <moz@compsoc.man.ac.uk>
7  */
8
9 #include <config.h>
10
11 #ifdef __GNUG__
12 #pragma implementation
13 #endif
14
15 #include "debug.h"
16  
17 #include "commandtags.h"
18 #include "funcrequest.h"
19 #include "LyXView.h"
20 #include "BufferView.h"
21  
22 #include "QMathDialog.h"
23 #include "QMath.h"
24
25 #include "iconpalette.h"
26
27 // FIXME temporary HACK ! 
28 void createMathPanel()
29 {
30         static QMath * dialog = 0; 
31         if (!dialog) {
32                 dialog = new QMath();
33                 dialog->build_dialog();
34         }
35         dialog->do_show();
36 }
37  
38  
39 QMath::QMath()
40 {
41 }
42
43
44 void QMath::do_show()
45 {
46         dialog_->show();
47 }
48  
49  
50 void QMath::build_dialog()
51 {
52         dialog_ = new QMathDialog(this);
53 }
54
55  
56 // needless to say, this can't last for long
57 extern BufferView * current_view;
58
59 void QMath::subscript()
60 {
61         current_view->owner()->dispatch(FuncRequest(LFUN_SUBSCRIPT));
62 }
63
64
65 void QMath::superscript()
66 {
67         current_view->owner()->dispatch(FuncRequest(LFUN_SUPERSCRIPT));
68 }
69
70
71 void QMath::insert_symbol(string const & name)
72 {
73         current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name));
74 }