From 8362bf63dea22bbf6736609b0f49c152f975eb63 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 20 Jan 2010 01:29:50 +0000 Subject: Added old abandoned KDE3 version of koffice git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- lib/kofficeui/KoPageLayoutColumns.cpp | 70 +++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 lib/kofficeui/KoPageLayoutColumns.cpp (limited to 'lib/kofficeui/KoPageLayoutColumns.cpp') diff --git a/lib/kofficeui/KoPageLayoutColumns.cpp b/lib/kofficeui/KoPageLayoutColumns.cpp new file mode 100644 index 000000000..db5e3e25e --- /dev/null +++ b/lib/kofficeui/KoPageLayoutColumns.cpp @@ -0,0 +1,70 @@ +/* This file is part of the KDE project + * Copyright (C) 1998, 1999 Reginald Stadlbauer + * Copyright (C) 2005 Thomas Zander + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; version 2. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include + +#include +#include + +KoPageLayoutColumns::KoPageLayoutColumns(QWidget *parent, const KoColumns& columns, KoUnit::Unit unit, const KoPageLayout& layout) + : KoPageLayoutColumnsBase(parent) { + m_columns = columns; + QHBoxLayout *lay = new QHBoxLayout(previewPane); + m_preview = new KoPagePreview( previewPane, "Preview", layout ); + lay->addWidget(m_preview); + lay = new QHBoxLayout(columnSpacingPane); + m_spacing = new KoUnitDoubleSpinBox( columnSpacingPane ); + m_spacing->setValue( m_columns.ptColumnSpacing ); + m_spacing->setUnit( unit ); + double dStep = KoUnit::fromUserValue( 0.2, unit ); + m_spacing->setMinMaxStep( 0, layout.ptWidth/2, dStep ); + lay->addWidget(m_spacing); + labelSpacing->setBuddy( m_spacing ); + nColumns->setValue( m_columns.columns ); + m_preview->setPageColumns( m_columns ); + + connect( nColumns, SIGNAL( valueChanged( int ) ), this, SLOT( nColChanged( int ) ) ); + connect( m_spacing, SIGNAL( valueChangedPt(double) ), this, SLOT( nSpaceChanged( double ) ) ); +} + +void KoPageLayoutColumns::setEnableColumns(bool on) { + nColumns->setEnabled(on); + m_spacing->setEnabled(on); + nColChanged(on ? nColumns->value(): 1 ); +} + +void KoPageLayoutColumns::nColChanged( int columns ) { + m_columns.columns = columns; + m_preview->setPageColumns( m_columns ); + emit propertyChange(m_columns); +} + +void KoPageLayoutColumns::nSpaceChanged( double spacing ) { + m_columns.ptColumnSpacing = spacing; + emit propertyChange(m_columns); +} + +void KoPageLayoutColumns::setLayout(KoPageLayout &layout) { + m_preview->setPageLayout( layout ); +} + +#include -- cgit v1.2.3