2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#ifndef _COLUMN_HXX
|
|
|
|
#define _COLUMN_HXX
|
|
|
|
|
|
|
|
|
|
|
|
#include <vcl/fixed.hxx>
|
|
|
|
#include <vcl/field.hxx>
|
|
|
|
#include <vcl/image.hxx>
|
|
|
|
#include <vcl/group.hxx>
|
|
|
|
#include <vcl/lstbox.hxx>
|
|
|
|
#include <vcl/button.hxx>
|
|
|
|
#include <vcl/timer.hxx>
|
2010-04-19 18:27:03 +02:00
|
|
|
#include <vcl/button.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <svtools/ctrlbox.hxx>
|
|
|
|
#include <svtools/valueset.hxx>
|
|
|
|
#include <sfx2/basedlgs.hxx>
|
|
|
|
#include <sfx2/tabdlg.hxx>
|
|
|
|
#include <fmtclbl.hxx>
|
|
|
|
#include <colex.hxx>
|
|
|
|
#include <prcntfld.hxx>
|
|
|
|
|
2003-12-01 16:33:49 +00:00
|
|
|
const int nMaxCols = 99;
|
2000-09-18 16:15:01 +00:00
|
|
|
class SwColMgr;
|
|
|
|
class SwWrtShell;
|
|
|
|
class SwColumnPage;
|
|
|
|
|
|
|
|
class SwColumnDlg : public SfxModalDialog
|
|
|
|
{
|
2012-12-20 12:30:33 +00:00
|
|
|
ListBox* m_pApplyToLB;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
SwWrtShell& rWrtShell;
|
|
|
|
SwColumnPage* pTabPage;
|
|
|
|
SfxItemSet* pPageSet;
|
|
|
|
SfxItemSet* pSectionSet;
|
|
|
|
SfxItemSet* pSelectionSet;
|
|
|
|
SfxItemSet* pFrameSet;
|
|
|
|
|
|
|
|
long nOldSelection;
|
|
|
|
long nSelectionWidth;
|
|
|
|
long nPageWidth;
|
|
|
|
|
2013-01-26 20:14:11 +09:00
|
|
|
bool bPageChanged : 1;
|
|
|
|
bool bSectionChanged : 1;
|
|
|
|
bool bSelSectionChanged : 1;
|
|
|
|
bool bFrameChanged : 1;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
DECL_LINK(ObjectHdl, ListBox*);
|
2012-03-01 18:00:32 +01:00
|
|
|
DECL_LINK(OkHdl, void *);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
SwColumnDlg(Window* pParent, SwWrtShell& rSh);
|
|
|
|
virtual ~SwColumnDlg();
|
|
|
|
|
|
|
|
SwWrtShell& GetWrtShell() { return rWrtShell; }
|
|
|
|
};
|
|
|
|
|
|
|
|
class ColumnValueSet : public ValueSet
|
|
|
|
{
|
2012-12-20 12:30:33 +00:00
|
|
|
public:
|
|
|
|
ColumnValueSet(Window* pParent, const ResId& rResId)
|
|
|
|
: ValueSet(pParent, rResId)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
ColumnValueSet(Window* pParent)
|
|
|
|
: ValueSet(pParent, WB_TABSTOP | WB_ITEMBORDER | WB_DOUBLEBORDER)
|
|
|
|
{
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
virtual void UserDraw( const UserDrawEvent& rUDEvt );
|
2002-04-02 14:19:20 +00:00
|
|
|
virtual void DataChanged( const DataChangedEvent& rDCEvt );
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
2001-05-29 12:46:19 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
/*--------------------------------------------------------------------
|
2011-04-21 16:51:03 +02:00
|
|
|
Description: column dialog now as TabPage
|
2000-09-18 16:15:01 +00:00
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
class SwColumnPage : public SfxTabPage
|
|
|
|
{
|
2012-12-20 12:30:33 +00:00
|
|
|
NumericField* m_pCLNrEdt;
|
|
|
|
ColumnValueSet* m_pDefaultVS;
|
|
|
|
CheckBox* m_pBalanceColsCB;
|
|
|
|
|
|
|
|
PushButton* m_pBtnBack;
|
|
|
|
FixedText* m_pLbl1;
|
|
|
|
PercentFieldWrap aEd1;
|
|
|
|
FixedText* m_pLbl2;
|
|
|
|
PercentFieldWrap aEd2;
|
|
|
|
FixedText* m_pLbl3;
|
|
|
|
PercentFieldWrap aEd3;
|
|
|
|
PushButton* m_pBtnNext;
|
|
|
|
PercentFieldWrap aDistEd1;
|
|
|
|
PercentFieldWrap aDistEd2;
|
|
|
|
CheckBox* m_pAutoWidthBox;
|
|
|
|
|
|
|
|
FixedText* m_pLineTypeLbl;
|
|
|
|
LineListBox* m_pLineTypeDLB;
|
|
|
|
FixedText* m_pLineWidthLbl;
|
|
|
|
MetricField* m_pLineWidthEdit;
|
|
|
|
FixedText* m_pLineColorLbl;
|
|
|
|
ColorListBox* m_pLineColorDLB;
|
|
|
|
FixedText* m_pLineHeightLbl;
|
|
|
|
MetricField* m_pLineHeightEdit;
|
|
|
|
FixedText* m_pLinePosLbl;
|
|
|
|
ListBox* m_pLinePosDLB;
|
|
|
|
|
|
|
|
FixedText* m_pTextDirectionFT;
|
|
|
|
ListBox* m_pTextDirectionLB;
|
2002-06-19 13:04:16 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
// Example
|
2012-12-20 12:30:33 +00:00
|
|
|
SwColExample* m_pPgeExampleWN;
|
|
|
|
SwColumnOnlyExample* m_pFrmExampleWN;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
SwColMgr* pColMgr;
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nFirstVis;
|
|
|
|
sal_uInt16 nCols;
|
2000-09-18 16:15:01 +00:00
|
|
|
long nColWidth[nMaxCols];
|
|
|
|
long nColDist[nMaxCols];
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nMinWidth;
|
2012-12-20 12:30:33 +00:00
|
|
|
PercentFieldWrap* pModifiedField;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bFormat;
|
|
|
|
sal_Bool bFrm;
|
|
|
|
sal_Bool bHtmlMode;
|
2013-01-26 20:14:11 +09:00
|
|
|
bool bLockUpdate;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
// Handler
|
|
|
|
DECL_LINK( ColModify, NumericField * );
|
2012-12-20 12:30:33 +00:00
|
|
|
DECL_LINK( GapModify, PercentFieldWrap * );
|
|
|
|
DECL_LINK( EdModify, PercentFieldWrap * );
|
2000-09-18 16:15:01 +00:00
|
|
|
DECL_LINK( AutoWidthHdl, CheckBox * );
|
|
|
|
DECL_LINK( SetDefaultsHdl, ValueSet * );
|
|
|
|
|
2012-03-01 18:00:32 +01:00
|
|
|
DECL_LINK(Up, void *);
|
|
|
|
DECL_LINK(Down, void *);
|
2000-09-18 16:15:01 +00:00
|
|
|
DECL_LINK( UpdateColMgr, void* );
|
2012-03-06 00:57:07 +00:00
|
|
|
void Apply(Button *);
|
|
|
|
void Timeout();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
void Update();
|
|
|
|
void UpdateCols();
|
|
|
|
void Init();
|
|
|
|
void ResetColWidth();
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetLabels( sal_uInt16 nVis );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2008-05-06 14:22:48 +00:00
|
|
|
using SfxTabPage::ActivatePage;
|
|
|
|
using SfxTabPage::DeactivatePage;
|
2007-10-22 14:20:57 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
virtual void ActivatePage(const SfxItemSet& rSet);
|
|
|
|
virtual int DeactivatePage(SfxItemSet *pSet);
|
|
|
|
|
|
|
|
SwColumnPage(Window *pParent, const SfxItemSet &rSet);
|
|
|
|
|
|
|
|
public:
|
2007-09-27 10:55:38 +00:00
|
|
|
virtual ~SwColumnPage();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
|
2011-01-17 15:06:54 +01:00
|
|
|
static sal_uInt16* GetRanges();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
virtual sal_Bool FillItemSet(SfxItemSet &rSet);
|
2000-09-18 16:15:01 +00:00
|
|
|
virtual void Reset(const SfxItemSet &rSet);
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetFrmMode(sal_Bool bMod);
|
2000-09-18 16:15:01 +00:00
|
|
|
void SetPageWidth(long nPageWidth);
|
|
|
|
|
2012-12-20 12:30:33 +00:00
|
|
|
void SetFormatUsed(sal_Bool bFmt)
|
|
|
|
{
|
|
|
|
bFormat = bFmt;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ShowBalance(sal_Bool bShow)
|
|
|
|
{
|
|
|
|
m_pBalanceColsCB->Show(bShow);
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SetInSection(sal_Bool bSet);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-12-20 12:30:33 +00:00
|
|
|
void ActivateColumnControl()
|
|
|
|
{
|
|
|
|
m_pCLNrEdt->GrabFocus();
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|