1
//--------------------------------------------------------------------------------------
2
// LenMus Phonascus: The teacher of music
3
// Copyright (c) 2002-2007 Cecilio Salmeron
5
// This program is free software; you can redistribute it and/or modify it under the
6
// terms of the GNU General Public License as published by the Free Software Foundation;
7
// either version 2 of the License, or (at your option) any later version.
9
// This program is distributed in the hope that it will be useful, but WITHOUT ANY
10
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
// PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License along with this
14
// program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
15
// Fifth Floor, Boston, MA 02110-1301, USA.
17
// For any comment, suggestion or feature request, please contact the manager of
18
// the project at cecilios@users.sourceforge.net
20
//-------------------------------------------------------------------------------------
26
#ifndef _PAGE_H //to avoid nested includes
29
#include "../score/defs.h"
37
void SetTopMargin(lmLUnits nMicrons) { m_nTopMargin = nMicrons; }
38
void SetBottomMargin(lmLUnits nMicrons) { m_nBottomMargin = nMicrons; }
39
void SetLeftMargin(lmLUnits nMicrons) { m_nLeftMargin = nMicrons; }
40
void SetRightMargin(lmLUnits nMicrons) { m_nRightMargin = nMicrons; }
41
void SetBindingMargin(lmLUnits nMicrons) { m_nBindingMargin = nMicrons; }
42
void SetPageSize(lmLUnits width, lmLUnits height);
46
lmLUnits TopMargin() { return m_nTopMargin; }
47
lmLUnits BottomMargin() { return m_nBottomMargin; }
48
lmLUnits LeftMargin() {
49
return (m_nPageNum % 2) ? m_nLeftMargin + m_nBindingMargin : m_nLeftMargin ;
51
lmLUnits RightMargin() {
52
return (m_nPageNum % 2) ? m_nRightMargin : m_nRightMargin + m_nBindingMargin ;
54
wxSize& PageSize() { return m_pageSize; }
55
lmLUnits GetUsableHeight() { return m_pageSize.GetHeight() - m_nTopMargin - m_nBottomMargin; }
60
// Mesaures: all in logical units
61
lmLUnits m_nLeftMargin;
62
lmLUnits m_nRightMargin;
63
lmLUnits m_nTopMargin;
64
lmLUnits m_nBottomMargin;
65
lmLUnits m_nBindingMargin;
67
wxSize m_pageSize; // paper size
68
int m_nPageNum; // absolute num of page