1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
10 * \author Jürgen Vigna, jug@sad.it
11 * \author Angus Leeming, a.leeming@ic.ac.uk
17 #pragma implementation
21 #include "ButtonControllerBase.h"
22 #include "ControlMinipage.h"
26 #include "BufferView.h"
27 #include "helper_funcs.h"
33 ControlMinipage::ControlMinipage(LyXView & lv, Dialogs & d)
34 : ControlInset<InsetMinipage, MinipageParams>(lv, d)
36 d_.showMinipage.connect(slot(this, &ControlMinipage::showInset));
38 // We could have an extra method updateInset that calls
39 // view().update() rather than view().show(), but I don't see why
40 // it is really needed.
41 d_.updateMinipage.connect(slot(this, &ControlMinipage::showInset));
45 void ControlMinipage::applyParamsToInset()
47 inset()->pageWidth(params().pageWidth);
48 inset()->pos(params().pos);
50 lv_.view()->updateInset(inset(), true);
54 void ControlMinipage::applyParamsNoInset()
59 MinipageParams const ControlMinipage::getParams(InsetMinipage const & inset)
61 return MinipageParams(inset);
65 MinipageParams::MinipageParams()
66 : pos(InsetMinipage::top)
69 MinipageParams::MinipageParams(InsetMinipage const & inset)
70 : pageWidth(inset.pageWidth()), pos(inset.pos())
74 bool operator==(MinipageParams const & p1, MinipageParams const & p2)
76 return (p1.pageWidth == p2.pageWidth && p1.pos == p2.pos);
80 bool operator!=(MinipageParams const & p1, MinipageParams const & p2)