]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlBase.C
Merging BRANCH_MVC back into HEAD.
[lyx.git] / src / frontends / controllers / ControlBase.C
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2000 The LyX Team.
8  *
9  * ======================================================
10  *
11  * \file ControlBase.C
12  * \author Angus Leeming <a.leeming@ic.ac.uk>
13  */
14
15 #ifdef __GNUG__
16 #pragma implementation
17 #endif
18
19 #include <config.h>
20
21 #include "buffer.h"
22 #include "ButtonController.h"
23 #include "ControlBase.h"
24 #include "LyXView.h"
25 #include "support/LAssert.h"
26
27 void ControlBase::ApplyButton()
28 {
29         apply();
30         bc().apply();
31 }
32
33
34 void ControlBase::OKButton()
35 {
36         apply();
37         hide();
38         bc().ok();
39 }
40
41
42 void ControlBase::CancelButton()
43 {
44         hide();
45         bc().cancel();
46 }
47
48
49 void ControlBase::RestoreButton()
50 {
51         update();
52         bc().undoAll();
53 }
54
55
56 bool ControlBase::isReadonly() const
57 {
58         return lv_.buffer()->isReadonly();
59 }