diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-01 05:41:51 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-06-11 08:01:22 +0200 |
commit | f76aa6633452b1bc82d6742986b86f7045c3a7a0 (patch) | |
tree | 2d590799fe20328bc6d8a6eaf97d65d10d043542 /sc | |
parent | 17675467b695967bcb02356be617448949ee60a5 (diff) |
first part for new conditional format dialog
Change-Id: I97d025e468d6c90cdb780c3654706df20300429a
Diffstat (limited to 'sc')
27 files changed, 562 insertions, 1846 deletions
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk index a3a4c7e74f79..1c0eb4d98f1b 100644 --- a/sc/AllLangResTarget_sc.mk +++ b/sc/AllLangResTarget_sc.mk @@ -74,13 +74,13 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\ sc/source/ui/src/miscdlgs.src \ sc/source/ui/src/tabopdlg.src \ sc/source/ui/src/scstring.src \ - sc/source/ui/src/condfrmt.src \ sc/source/ui/src/dbnamdlg.src \ sc/source/ui/src/opredlin.src \ sc/source/ui/src/sortdlg.src \ sc/source/ui/src/attrdlg.src \ sc/source/ui/src/filter.src \ sc/source/ui/src/colorformat.src \ + sc/source/ui/src/condformatdlg.src \ sc/source/ui/cctrl/checklistmenu.src \ sc/source/ui/navipi/navipi.src \ sc/source/ui/docshell/tpstat.src \ diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 72d9da3c945b..274c50470b7d 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -312,7 +312,6 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/app/transobj \ sc/source/ui/app/typemap \ sc/source/ui/app/uiitems \ - sc/source/ui/attrdlg/condfrmt \ sc/source/ui/attrdlg/scabstdlg \ sc/source/ui/cctrl/cbuttonw \ sc/source/ui/cctrl/checklistmenu \ diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 29ef732e662a..0cb2780a6f25 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -64,6 +64,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\ sc/source/ui/attrdlg/tabpages \ sc/source/ui/cctrl/editfield \ sc/source/ui/condformat/colorformat \ + sc/source/ui/condformat/condformatdlg \ sc/source/ui/dbgui/dapidata \ sc/source/ui/dbgui/dapitype \ sc/source/ui/dbgui/dpgroupdlg \ diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 5ab3de4b091c..2d2c3f975666 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -376,7 +376,6 @@ #define FID_TABLE_SHOW (FORMAT_MENU_START + 10) #define SID_COLORSCALE (FORMAT_MENU_START + 11) #define SID_DATABAR (FORMAT_MENU_START + 12) -#define FID_CONDITIONAL_FORMAT (FORMAT_MENU_START + 13) #define SID_SCSTYLES (FORMAT_MENU_START + 14) #define FID_MERGE_ON (FORMAT_MENU_START + 15) #define FID_MERGE_OFF (FORMAT_MENU_START + 16) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 0904646e816d..f91be6650197 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -85,6 +85,10 @@ public: virtual sal_Bool IsRow() = 0; }; +class AbstractScCondFormatDlg : public VclAbstractDialog +{ +}; + class AbstractScDataBarSettingsDlg : public VclAbstractDialog { }; @@ -352,6 +356,9 @@ public: sal_Bool bColDefault = sal_True ) = 0; virtual VclAbstractDialog * CreateScSortWarningDlg ( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ) = 0; //add for ScSortWarningDlg + virtual AbstractScCondFormatDlg* CreateScCondFormatDlg (Window* pParent, ScDocument* pDoc, ScConditionalFormat* pFormat, + const ScRangeList& rList, int nId ) = 0; //add for ScCondFormatDlg + virtual AbstractScDataBarSettingsDlg* CreateScDataBarSetttingsDlg (Window* pParent ,int nId ) = 0; //add for ScDataBarSettingsDlg virtual AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ) = 0; //add for ScDataPilotDatabaseDlg diff --git a/sc/inc/sccommands.h b/sc/inc/sccommands.h index 450f57f6ae5c..4ffa9909e78b 100644 --- a/sc/inc/sccommands.h +++ b/sc/inc/sccommands.h @@ -71,7 +71,6 @@ #define CMD_SID_RANGE_COL ".uno:Column" #define CMD_FID_COL_WIDTH ".uno:ColumnWidth" #define CMD_FID_CHG_COMMENT ".uno:CommentChange" -#define CMD_FID_CONDITIONAL_FORMAT ".uno:ConditionalFormat" #define CMD_SID_OPENDLG_CONDFRMT ".uno:ConditionalFormatDialog" #define CMD_SID_CONSOLIDATE ".uno:ConsolidateExec" #define CMD_FID_USE_NAME ".uno:CreateNames" diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index d70a94454d06..99f3541e55b8 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -187,10 +187,9 @@ interface CellSelection FID_USE_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_CANCEL [ ExecMethod = Execute; ] SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] - SID_OPENDLG_CONDFRMT [ ExecMethod = Execute; StateMethod = GetBlockState; ] + SID_OPENDLG_CONDFRMT [ ExecMethod = ExecuteEdit; ] SID_COLORSCALE [ ExecMethod = ExecuteEdit; ] SID_DATABAR [ ExecMethod = ExecuteEdit; ] - FID_CONDITIONAL_FORMAT [ ExecMethod = ExecuteEdit; ] FID_NOTE_VISIBLE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_DELETE_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_DEC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 2850a5369527..36f355f1555f 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -1069,32 +1069,7 @@ SfxVoidItem CommentChange FID_CHG_COMMENT ] //-------------------------------------------------------------------------- -SfxVoidItem ConditionalFormat FID_CONDITIONAL_FORMAT -() -[ - /* flags: */ - AutoUpdate = FALSE, - Cachable = Cachable, - FastCall = FALSE, - HasCoreId = FALSE, - HasDialog = FALSE, - ReadOnlyDoc = TRUE, - Toggle = FALSE, - Container = FALSE, - RecordAbsolute = FALSE, - RecordPerSet; - Synchron; - - /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, - GroupId = GID_INTERN; -] - -//-------------------------------------------------------------------------- -SfxVoidItem ColorScaleDialog SID_COLORSCALE +SfxVoidItem ConditionalFormatDialog SID_OPENDLG_CONDFRMT () [ /* flags: */ @@ -1119,7 +1094,7 @@ SfxVoidItem ColorScaleDialog SID_COLORSCALE ] //-------------------------------------------------------------------------- -SfxVoidItem DataBarDialog SID_DATABAR +SfxVoidItem ColorScaleDialog SID_COLORSCALE () [ /* flags: */ @@ -1144,7 +1119,7 @@ SfxVoidItem DataBarDialog SID_DATABAR ] //-------------------------------------------------------------------------- -SfxVoidItem ConditionalFormatDialog SID_OPENDLG_CONDFRMT +SfxVoidItem DataBarDialog SID_DATABAR () [ /* flags: */ diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 4c63a4f0c217..fc3d82026b2f 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -267,7 +267,6 @@ void ScDLL::Init() ScDbNameDlgWrapper ::RegisterChildWindow(false, pMod); ScConsolidateDlgWrapper ::RegisterChildWindow(false, pMod); ScPrintAreasDlgWrapper ::RegisterChildWindow(false, pMod); - ScCondFormatDlgWrapper ::RegisterChildWindow(false, pMod); ScColRowNameRangesDlgWrapper::RegisterChildWindow(false, pMod); ScFormulaDlgWrapper ::RegisterChildWindow(false, pMod); diff --git a/sc/source/ui/attrdlg/condfrmt.cxx b/sc/source/ui/attrdlg/condfrmt.cxx deleted file mode 100644 index ca41c8f195ff..000000000000 --- a/sc/source/ui/attrdlg/condfrmt.cxx +++ /dev/null @@ -1,1039 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include <sfx2/dispatch.hxx> -#include <svl/stritem.hxx> - -#include "tabvwsh.hxx" -#include "reffact.hxx" -#include "conditio.hxx" -#include "stlpool.hxx" -#include "uiitems.hxx" -#include "document.hxx" -#include "scresid.hxx" - -#include "condfrmt.hrc" -#include "globstr.hrc" - -#define _CONDFRMT_CXX -#include "condfrmt.hxx" -#undef _CONDFRMT_CXX - -#include "rangelst.hxx" - -//============================================================================ -// class ScConditionalFormat - -//---------------------------------------------------------------------------- -// Konstruktor - -ScConditionalFormatDlg::ScConditionalFormatDlg( - SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, - ScDocument* pCurDoc, - const ScConditionalFormat* pCurrentFormat ) - : ScAnyRefDlg ( pB, pCW, pParent, RID_SCDLG_CONDFORMAT ), - - aCbxCond1 ( this, ScResId( CBX_COND1 ) ), - aLbCond11 ( this, ScResId( LB_COND1_1 ) ), - aLbCond12 ( this, ScResId( LB_COND1_2 ) ), - aEdtCond11 ( this, this, ScResId( EDT_COND1_1 ) ), - aRbCond11 ( this, ScResId( RB_COND1_1 ), &aEdtCond11,this ), - aFtCond1And ( this, ScResId( FT_COND1_AND ) ), - aEdtCond12 ( this, this, ScResId( EDT_COND1_2 ) ), - aRbCond12 ( this, ScResId( RB_COND1_2 ), &aEdtCond12,this ), - aFtCond1Template ( this, ScResId( FT_COND1_TEMPLATE ) ), - aLbCond1Template ( this, ScResId( LB_COND1_TEMPLATE ) ), - aBtnNew1 ( this, ScResId( BTN_COND1_NEW ) ), - aPreviewWin1 ( this, ScResId( WIN_CHAR_PREVIEW_COND1 ) ), - aFlSep1 ( this, ScResId( FL_SEP1 ) ), - - aCbxCond2 ( this, ScResId( CBX_COND2 ) ), - aLbCond21 ( this, ScResId( LB_COND2_1 ) ), - aLbCond22 ( this, ScResId( LB_COND2_2 ) ), - aEdtCond21 ( this, this, ScResId( EDT_COND2_1 ) ), - aRbCond21 ( this, ScResId( RB_COND2_1 ), &aEdtCond21,this ), - aFtCond2And ( this, ScResId( FT_COND2_AND ) ), - aEdtCond22 ( this, this, ScResId( EDT_COND2_2 ) ), - aRbCond22 ( this, ScResId( RB_COND2_2 ), &aEdtCond22,this ), - aFtCond2Template ( this, ScResId( FT_COND2_TEMPLATE ) ), - aLbCond2Template ( this, ScResId( LB_COND2_TEMPLATE ) ), - aBtnNew2 ( this, ScResId( BTN_COND2_NEW ) ), - aPreviewWin2 ( this, ScResId( WIN_CHAR_PREVIEW_COND2 ) ), - aFlSep2 ( this, ScResId( FL_SEP2 ) ), - - aCbxCond3 ( this, ScResId( CBX_COND3 ) ), - aLbCond31 ( this, ScResId( LB_COND3_1 ) ), - aLbCond32 ( this, ScResId( LB_COND3_2 ) ), - aEdtCond31 ( this, this, ScResId( EDT_COND3_1 ) ), - aRbCond31 ( this, ScResId( RB_COND3_1 ), &aEdtCond31,this ), - aFtCond3And ( this, ScResId( FT_COND3_AND ) ), - aEdtCond32 ( this, this, ScResId( EDT_COND3_2 ) ), - aRbCond32 ( this, ScResId( RB_COND3_2 ), &aEdtCond32,this ), - aFtCond3Template ( this, ScResId( FT_COND3_TEMPLATE ) ), - aLbCond3Template ( this, ScResId( LB_COND3_TEMPLATE ) ), - aBtnNew3 ( this, ScResId( BTN_COND3_NEW ) ), - aPreviewWin3 ( this, ScResId( WIN_CHAR_PREVIEW_COND3 ) ), - - aScrollBar ( this, ScResId( LB_SCROLL ) ), - aBtnOk ( this, ScResId( BTN_OK ) ), - aBtnCancel ( this, ScResId( BTN_CANCEL ) ), - aBtnHelp ( this, ScResId( BTN_HELP ) ), - aBtnAdd ( this, ScResId( BTN_ADD ) ), - - pEdActive ( NULL ), - bDlgLostFocus ( false ), - - pDoc ( pCurDoc ), - ppEntries ( NULL ), - nEntryCount ( 0 ), - nCurrentOffset ( 0 ) -{ - Point aPos; - String aName; - SfxStyleSheetBase* pStyle; - - // load entries from current format - if ( pCurrentFormat && ( pCurrentFormat->Count() > 2 ) ) - nEntryCount = pCurrentFormat->Count() + 1; - else - nEntryCount = 3; - ppEntries = new ScCondFormatEntry*[nEntryCount]; - - const ScCondFormatEntry* pEntry; - for (SCSIZE i=0; i<nEntryCount; i++) - { - if ( pCurrentFormat && ( i < pCurrentFormat->Count() ) ) - { - pEntry = pCurrentFormat->GetEntry( i ); - ppEntries[i] = new ScCondFormatEntry( *pEntry ); - } - else - ppEntries[i] = NULL; - } - - FreeResource(); - - aScrollBar.SetEndScrollHdl( LINK( this, ScConditionalFormatDlg, ScrollHdl ) ); - aScrollBar.SetScrollHdl( LINK( this, ScConditionalFormatDlg, ScrollHdl ) ); - aScrollBar.SetRange( Range( 0, nEntryCount - 3 ) ); - aScrollBar.SetLineSize( 1 ); - - // Handler setzen - aCbxCond1.SetClickHdl ( LINK( this, ScConditionalFormatDlg, ClickCond1Hdl ) ); - aLbCond11.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond11Hdl ) ); - aLbCond12.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond12Hdl ) ); - aLbCond1Template.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond1TemplateHdl ) ); - - aCbxCond2.SetClickHdl ( LINK( this, ScConditionalFormatDlg, ClickCond2Hdl ) ); - aLbCond21.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond21Hdl ) ); - aLbCond22.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond22Hdl ) ); - aLbCond2Template.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond2TemplateHdl ) ); - - aCbxCond3.SetClickHdl ( LINK( this, ScConditionalFormatDlg, ClickCond3Hdl ) ); - aLbCond31.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond31Hdl ) ); - aLbCond32.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond32Hdl ) ); - aLbCond3Template.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond3TemplateHdl ) ); - - aBtnOk.SetClickHdl ( LINK( this, ScConditionalFormatDlg, BtnHdl ) ); -//? aBtnCancel.SetClickHdl( LINK( this, ScConditionalFormatDlg, BtnHdl ) ); - aBtnAdd.SetClickHdl( LINK( this, ScConditionalFormatDlg, BtnHdl ) ); - - Link aLink = LINK( this, ScConditionalFormatDlg, NewBtnHdl ); - aBtnNew1.SetClickHdl( aLink ); - aBtnNew2.SetClickHdl( aLink ); - aBtnNew3.SetClickHdl( aLink ); - - aLink = LINK( this, ScConditionalFormatDlg, GetFocusHdl ); - aEdtCond11.SetGetFocusHdl( aLink ); - aEdtCond12.SetGetFocusHdl( aLink ); - aEdtCond21.SetGetFocusHdl( aLink ); - aEdtCond22.SetGetFocusHdl( aLink ); - aEdtCond31.SetGetFocusHdl( aLink ); - aEdtCond32.SetGetFocusHdl( aLink ); - aRbCond11.SetGetFocusHdl( aLink ); - aRbCond12.SetGetFocusHdl( aLink ); - aRbCond21.SetGetFocusHdl( aLink ); - aRbCond22.SetGetFocusHdl( aLink ); - aRbCond31.SetGetFocusHdl( aLink ); - aRbCond32.SetGetFocusHdl( aLink ); - - aLink = LINK( this, ScConditionalFormatDlg, LoseFocusHdl ); - aEdtCond11.SetLoseFocusHdl( aLink ); - aEdtCond12.SetLoseFocusHdl( aLink ); - aEdtCond21.SetLoseFocusHdl( aLink ); - aEdtCond22.SetLoseFocusHdl( aLink ); - aEdtCond31.SetLoseFocusHdl( aLink ); - aEdtCond32.SetLoseFocusHdl( aLink ); - aRbCond11.SetLoseFocusHdl( aLink ); - aRbCond12.SetLoseFocusHdl( aLink ); - aRbCond21.SetLoseFocusHdl( aLink ); - aRbCond22.SetLoseFocusHdl( aLink ); - aRbCond31.SetLoseFocusHdl( aLink ); - aRbCond32.SetLoseFocusHdl( aLink ); - - // Condition 1 - aCond1Pos1 = aLbCond12.GetPosPixel(); // Position Edit ohne Listbox - aCond1Pos2 = aEdtCond11.GetPosPixel(); // Position Edit mit Listbox - aRBtn1Pos1 = aRbCond11.GetPosPixel(); - aRBtn1Pos2 = aRbCond12.GetPosPixel(); - aPos = aEdtCond12.GetPosPixel(); - aPos.X() += aEdtCond12.GetSizePixel().Width(); // rechter Rand - aCond1Size3 = aEdtCond11.GetSizePixel(); - aCond1Size2 = Size( aPos.X() - aCond1Pos2.X(), aCond1Size3.Height() ); - aCond1Size1 = Size( aPos.X() - aCond1Pos1.X(), aCond1Size3.Height() ); - aCbxCond1InitialText = aCbxCond1.GetText(); - - aCbxCond1.Check(); - aLbCond11.SelectEntryPos( 0 ); - aLbCond12.SelectEntryPos( 0 ); - aPreviewWin1.SetDrawBaseLine( false ); - aPreviewWin1.UseResourceText( true ); - - // Condition 2 - aCond2Pos1 = aLbCond22.GetPosPixel(); // Position Edit ohne Listbox - aCond2Pos2 = aEdtCond21.GetPosPixel(); // Position Edit mit Listbox - aRBtn2Pos1 = aRbCond21.GetPosPixel(); - aRBtn2Pos2 = aRbCond22.GetPosPixel(); - aPos = aEdtCond22.GetPosPixel(); - aPos.X() += aEdtCond22.GetSizePixel().Width(); // rechter Rand - aCond2Size3 = aEdtCond21.GetSizePixel(); - aCond2Size2 = Size( aPos.X() - aCond2Pos2.X(), aCond2Size3.Height() ); - aCond2Size1 = Size( aPos.X() - aCond2Pos1.X(), aCond2Size3.Height() ); - aCbxCond2InitialText = aCbxCond2.GetText(); - - aCbxCond2.Check( false ); - aLbCond21.SelectEntryPos( 0 ); - aLbCond22.SelectEntryPos( 0 ); - aPreviewWin2.SetDrawBaseLine( false ); - aPreviewWin2.UseResourceText( true ); - - // Condition 3 - aCond3Pos1 = aLbCond32.GetPosPixel(); // Position Edit ohne Listbox - aCond3Pos2 = aEdtCond31.GetPosPixel(); // Position Edit mit Listbox - aRBtn3Pos1 = aRbCond31.GetPosPixel(); - aRBtn3Pos2 = aRbCond32.GetPosPixel(); - aPos = aEdtCond32.GetPosPixel(); - aPos.X() += aEdtCond32.GetSizePixel().Width(); // rechter Rand - aCond3Size3 = aEdtCond31.GetSizePixel(); - aCond3Size2 = Size( aPos.X() - aCond3Pos2.X(), aCond3Size3.Height() ); - aCond3Size1 = Size( aPos.X() - aCond3Pos1.X(), aCond3Size3.Height() ); - aCbxCond3InitialText = aCbxCond3.GetText(); - - aCbxCond3.Check( false ); - aLbCond31.SelectEntryPos( 0 ); - aLbCond32.SelectEntryPos( 0 ); - aPreviewWin3.SetDrawBaseLine( false ); - aPreviewWin3.UseResourceText( true ); - - // Vorlagen aus pDoc holen - SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); - for ( pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) - { - aName = pStyle->GetName(); - aLbCond1Template.InsertEntry( aName ); - aLbCond2Template.InsertEntry( aName ); - aLbCond3Template.InsertEntry( aName ); - } - - Refresh( nCurrentOffset ); - - ClickCond1Hdl( NULL ); - ClickCond2Hdl( NULL ); - ClickCond3Hdl( NULL ); - - ChangeCond12Hdl( NULL ); - ChangeCond22Hdl( NULL ); - ChangeCond32Hdl( NULL ); - - aEdtCond11.GrabFocus(); - pEdActive = &aEdtCond11; - //@BugID 54702 Enablen/Disablen nur noch in Basisklasse - //SFX_APPWINDOW->Enable(); // Ref-Feld hat Focus -// SFX_APPWINDOW->Disable(); - - aLbCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 ); - aLbCond12.SetAccessibleRelationLabeledBy( &aCbxCond1 ); - aEdtCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 ); - aRbCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 ); - - aLbCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 ); - aLbCond22.SetAccessibleRelationLabeledBy( &aCbxCond2 ); - aEdtCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 ); - aRbCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 ); - - aLbCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 ); - aLbCond32.SetAccessibleRelationLabeledBy( &aCbxCond3 ); - aEdtCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 ); - aRbCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 ); - aLbCond11.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) ); - aLbCond12.SetAccessibleName( ScResId(LABEL_CONDITIONS) ); - aEdtCond11.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) ); - - aLbCond21.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) ); - aLbCond22.SetAccessibleName( ScResId(LABEL_CONDITIONS) ); - aEdtCond21.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) ); - - aLbCond31.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) ); - aLbCond32.SetAccessibleName( ScResId(LABEL_CONDITIONS) ); - aEdtCond31.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) ); -} - -//---------------------------------------------------------------------------- -// Destruktor - -ScConditionalFormatDlg::~ScConditionalFormatDlg() -{ - for (SCSIZE i=0; i<nEntryCount; i++) - delete ppEntries[i]; - delete[] ppEntries; -} - -//---------------------------------------------------------------------------- -void ScConditionalFormatDlg::AddEntry() -{ - ScCondFormatEntry** ppNew = new ScCondFormatEntry*[nEntryCount+1]; - for (sal_uInt16 i=0; i<nEntryCount; i++) - ppNew[i] = ppEntries[i]; - ppNew[nEntryCount] = NULL; - ++nEntryCount; - delete[] ppEntries; - ppEntries = ppNew; - aScrollBar.SetRange( Range( 0, nEntryCount - 3 ) ); -} - -// ----------------------------------------------------------------------- -namespace -{ - // ----------------------------------------------------------------------- - void CondChecked( sal_Bool bChecked, CheckBox &aCbxCond, ListBox &aLbCond1, ListBox &aLbCond2, - formula::RefEdit &aEdtCond1, formula::RefButton &aRbCond1, FixedText &aFtCondAnd, - formula::RefEdit &aEdtCond2, formula::RefButton &aRbCond2, - FixedText &aFtCondTemplate, ListBox &aLbCondTemplate, PushButton &aBtnNew, SvxFontPrevWindow &aPreviewWin ) - { - aCbxCond.Check( bChecked ); - aLbCond1.Enable( bChecked ); - aLbCond2.Enable( bChecked ); - aEdtCond1.Enable( bChecked ); - aRbCond1.Enable( bChecked ); - aFtCondAnd.Enable( bChecked ); - aEdtCond2.Enable( bChecked ); - aRbCond2.Enable( bChecked ); - aFtCondTemplate.Enable( bChecked ); - aLbCondTemplate.Enable( bChecked ); - aBtnNew.Enable( bChecked ); - aPreviewWin.Enable( bChecked ); - } - - // ----------------------------------------------------------------------- - String OffsetAsText( sal_uInt16 nVal ) - { - String aValNum = ScGlobal::GetEmptyString(); - if ( nVal >= 10) - aValNum = String::CreateFromInt32( nVal / 10 ); - aValNum += String::CreateFromAscii("~"); - aValNum += String::CreateFromInt32( nVal % 10 ); - return aValNum; - } - - // ----------------------------------------------------------------------- - void RefreshEntry( sal_uInt16 nOffset, ScCondFormatEntry** ppEntries, ScAddress aCurPos, String aCbxCondInitialText, - CheckBox &aCbxCond, ListBox &aLbCond1, ListBox &aLbCond2, - formula::RefEdit &aEdtCond1, formula::RefButton &aRbCond1, FixedText &aFtCondAnd, - formula::RefEdit &aEdtCond2, formula::RefButton &aRbCond2, - FixedText &aFtCondTemplate, ListBox &aLbCondTemplate, PushButton &aBtnNew, SvxFontPrevWindow &aPreviewWin ) - { - String aEmptyString = ScGlobal::GetEmptyString(); - String aStyleNameStandard = ScGlobal::GetRscString(STR_STYLENAME_STANDARD); - - String aVal = aCbxCondInitialText; - String aOffsetAsText = OffsetAsText( nOffset + 1 ); - if ( STRING_NOTFOUND != aVal.Search( String::CreateFromAscii( "~1" ) ) ) - aVal.SearchAndReplace( String::CreateFromAscii( "~1" ), aOffsetAsText ); - else if ( STRING_NOTFOUND != aVal.Search( String::CreateFromAscii( "~2" ) ) ) - aVal.SearchAndReplace( String::CreateFromAscii( "~2" ), aOffsetAsText ); - else if ( STRING_NOTFOUND != aVal.Search( String::CreateFromAscii( "~3" ) ) ) - aVal.SearchAndReplace( String::CreateFromAscii( "~3" ), aOffsetAsText ); - aCbxCond.SetText(aVal); - - const ScCondFormatEntry* pEntry; - if ( ppEntries[ nOffset + 0 ] ) - { - CondChecked( true, aCbxCond, aLbCond1, aLbCond2, aEdtCond1, aRbCond1, aFtCondAnd, aEdtCond2, aRbCond2, - aFtCondTemplate, aLbCondTemplate, aBtnNew, aPreviewWin ); - pEntry= ppEntries[ nOffset + 0 ]; - aEdtCond1.SetText( pEntry->GetExpression( aCurPos, 0 ) ); - aLbCondTemplate.SelectEntry( pEntry->GetStyle() ); - - ScConditionMode eMode = pEntry->GetOperation(); - if ( eMode == SC_COND_DIRECT ) // via Formel - aLbCond1.SelectEntryPos( 1 ); - else if ( eMode == SC_COND_NONE ) // ??? - ; - else // via Werte - { - aLbCond1.SelectEntryPos( 0 ); - aLbCond2.SelectEntryPos( sal::static_int_cast<sal_uInt16>( eMode ) ); - if ( ( eMode == SC_COND_BETWEEN ) || ( eMode == SC_COND_NOTBETWEEN ) ) - aEdtCond2.SetText( pEntry->GetExpression( aCurPos, 1 ) ); - } - } - else - { - CondChecked( false, aCbxCond, aLbCond1, aLbCond2, aEdtCond1, aRbCond1, aFtCondAnd, aEdtCond2, aRbCond2, - aFtCondTemplate, aLbCondTemplate, aBtnNew, aPreviewWin ); - aLbCond1.SelectEntryPos( 0 ); - aLbCond2.SelectEntryPos( 0 ); - aLbCondTemplate.SelectEntry( aStyleNameStandard ); - aEdtCond1.SetText( aEmptyString ); - aEdtCond2.SetText( aEmptyString ); - } - } - -//---------------------------------------------------------------------------- - - void UpdateValue( sal_uInt16 nOffset, ScDocument* pDoc, ScCondFormatEntry** ppEntries, ScAddress aCurPos, - CheckBox &aCbxCond, ListBox &aLbCond1, ListBox &aLbCond2, - formula::RefEdit &aEdtCond1, formula::RefEdit &aEdtCond2, ListBox &aLbCondTemplate ) - { - ScConditionMode eOper; - String sExpr1; - String sExpr2; - String sStyle; - - delete ppEntries[ nOffset ]; - if ( aCbxCond.IsChecked() ) - { - if ( aLbCond1.GetSelectEntryPos() == 1 ) // via Formel - eOper = SC_COND_DIRECT; - else - eOper = (ScConditionMode)aLbCond2.GetSelectEntryPos(); - sExpr1 = aEdtCond1.GetText(); - sExpr2 = aEdtCond2.GetText(); - sStyle = aLbCondTemplate.GetSelectEntry(); - ppEntries[ nOffset ] = new ScCondFormatEntry( eOper, sExpr1, sExpr2, pDoc, aCurPos, sStyle ); - } - else - ppEntries[ nOffset ] = NULL; - } -} - -// ----------------------------------------------------------------------- - -void ScConditionalFormatDlg::Refresh( sal_uInt16 nOffset ) -{ - ScAddress aCurPos; - ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - if (pViewShell) - { - ScViewData* pData = pViewShell->GetViewData(); - aCurPos = ScAddress( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() ); - } - - RefreshEntry( nOffset + 0, ppEntries, aCurPos, aCbxCond1InitialText, - aCbxCond1, aLbCond11, aLbCond12, aEdtCond11, aRbCond11, aFtCond1And, aEdtCond12, aRbCond12, - aFtCond1Template, aLbCond1Template, aBtnNew1, aPreviewWin1 ); - ChangeCond11Hdl( NULL ); - ChangeCond1TemplateHdl( NULL ); - - RefreshEntry( nOffset + 1, ppEntries, aCurPos, aCbxCond2InitialText, - aCbxCond2, aLbCond21, aLbCond22, aEdtCond21, aRbCond21, aFtCond2And, aEdtCond22, aRbCond22, - aFtCond2Template, aLbCond2Template, aBtnNew2, aPreviewWin2 ); - ChangeCond21Hdl( NULL ); - ChangeCond2TemplateHdl( NULL ); - - RefreshEntry( nOffset + 2, ppEntries, aCurPos, aCbxCond3InitialText, - aCbxCond3, aLbCond31, aLbCond32, aEdtCond31, aRbCond31, aFtCond3And, aEdtCond32, aRbCond32, - aFtCond3Template, aLbCond3Template, aBtnNew3, aPreviewWin3 ); - ChangeCond31Hdl( NULL ); - ChangeCond3TemplateHdl( NULL ); - - if ( nOffset == 0 ) - CondChecked( true, aCbxCond1, aLbCond11, aLbCond12, aEdtCond11, aRbCond11, aFtCond1And, aEdtCond12, aRbCond12, - aFtCond1Template, aLbCond1Template, aBtnNew1, aPreviewWin1 ); -} - -//---------------------------------------------------------------------------- - -void ScConditionalFormatDlg::UpdateValueList( sal_uInt16 nOffset ) -{ - ScAddress aCurPos; - - ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - if (pViewShell) - { - ScViewData* pData = pViewShell->GetViewData(); - aCurPos = ScAddress( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() ); - } - - UpdateValue( nOffset + 0, pDoc, ppEntries, aCurPos, - aCbxCond1, aLbCond11, aLbCond12, aEdtCond11, aEdtCond12, aLbCond1Template ); - - UpdateValue( nOffset + 1, pDoc, ppEntries, aCurPos, - aCbxCond2, aLbCond21, aLbCond22, aEdtCond21, aEdtCond22, aLbCond2Template ); - - UpdateValue( nOffset + 2, pDoc, ppEntries, aCurPos, - aCbxCond3, aLbCond31, aLbCond32, aEdtCond31, aEdtCond32, aLbCond3Template ); -} - -//---------------------------------------------------------------------------- - -void ScConditionalFormatDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) -{ - if ( pEdActive ) - { - if ( rRef.aStart != rRef.aEnd ) - RefInputStart(pEdActive); - - String aStr; - rRef.Format( aStr, SCR_ABS_3D, pDocP, pDocP->GetAddressConvention () ); - String aVal( pEdActive->GetText() ); - Selection aSel( pEdActive->GetSelection() ); - aSel.Justify(); - aVal.Erase( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() ); - aVal.Insert( aStr, (xub_StrLen)aSel.Min() ); - Selection aNewSel( aSel.Min(), aSel.Min()+aStr.Len() ); - pEdActive->SetRefString( aVal ); - pEdActive->SetSelection( aNewSel ); -// pEdActive->SetModifyFlag(); - } -} - -//---------------------------------------------------------------------------- - -void ScConditionalFormatDlg::AddRefEntry() -{ - if ( pEdActive ) - { - String aVal = pEdActive->GetText(); - aVal += ';'; - pEdActive->SetText(aVal); - - xub_StrLen nLen = aVal.Len(); - pEdActive->SetSelection( Selection( nLen, nLen ) ); -// pEdActive->SetModifyFlag(); - } -} - -//---------------------------------------------------------------------------- - -sal_Bool ScConditionalFormatDlg::IsRefInputMode() const -{ - return (pEdActive != NULL); -} - -//---------------------------------------------------------------------------- - -void ScConditionalFormatDlg::SetActive() -{ - if ( bDlgLostFocus ) - { - bDlgLostFocus = false; - if( pEdActive ) - pEdActive->GrabFocus(); - } - else - GrabFocus(); - - RefInputDone(); -} - -//---------------------------------------------------------------------------- -// Holt die ausgewaehlte bedingte Formatierung ab - -void ScConditionalFormatDlg::GetConditionalFormat( ScConditionalFormat& rCndFmt ) -{ - ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - if (pViewShell) - { - ScViewData* pData = pViewShell->GetViewData(); - ScRangeListRef rRanges; - pData->GetMultiArea( rRanges ); - rCndFmt.AddRangeInfo( rRanges ); - } - - UpdateValueList( nCurrentOffset ); - for (SCSIZE i=0; i<nEntryCount; i++) - if ( ppEntries[i] ) - rCndFmt.AddEntry( *ppEntries[i] ); -} - -//---------------------------------------------------------------------------- -// Zerstoert den Dialog - -sal_Bool ScConditionalFormatDlg::Close() -{ - return DoClose( ScCondFormatDlgWrapper::GetChildWindowId() ); -} - -//---------------------------------------------------------------------------- -// Handler: - -//---------------------------------------------------------------------------- -IMPL_LINK_NOARG(ScConditionalFormatDlg, ScrollHdl) -{ - SliderMoved(); - return 0; -} - -void ScConditionalFormatDlg::SliderMoved() -{ - sal_uInt16 nOffset = GetSliderPos(); - if ( nOffset != nCurrentOffset ) - { - UpdateValueList( nCurrentOffset ); - Refresh( nOffset ); - } - nCurrentOffset = nOffset; -} -sal_uInt16 ScConditionalFormatDlg::GetSliderPos() -{ - return (sal_uInt16) aScrollBar.GetThumbPos(); -} - -//---------------------------------------------------------------------------- -// Enabled/Disabled Condition1-Controls - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ClickCond1Hdl) -{ - sal_Bool bChecked = aCbxCond1.IsChecked(); - CondChecked( bChecked, aCbxCond1, aLbCond11, aLbCond12, aEdtCond11, aRbCond11, aFtCond1And, aEdtCond12, aRbCond12, - aFtCond1Template, aLbCond1Template, aBtnNew1, aPreviewWin1 ); - return( 0L ); -} - -//---------------------------------------------------------------------------- -// Zellwert/Formel - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond11Hdl) -{ - sal_uInt16 nPos = aLbCond11.GetSelectEntryPos(); - - if( nPos == 0 ) // Zellwert - { - aLbCond12.Show(); - aEdtCond11.SetPosPixel( aCond1Pos2 ); - } - else // Formel - { - aLbCond12.Hide(); - aFtCond1And.Hide(); - aEdtCond12.Hide(); - aRbCond12.Hide(); - aRbCond11.SetPosPixel( aRBtn1Pos2 ); - aEdtCond11.SetPosSizePixel( aCond1Pos1, aCond1Size1 ); - aEdtCond11.Show(); - aRbCond11.Show(); - } - - ChangeCond12Hdl( NULL ); - - return( 0L ); -} - -//---------------------------------------------------------------------------- -// zwischen, gleich, groesser, ... - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond12Hdl) -{ - if( aLbCond12.IsVisible() ) - { - sal_uInt16 nPos = aLbCond12.GetSelectEntryPos(); - - aEdtCond11.Show(); - aRbCond11.Show(); - if( nPos > 7 ) - { - aEdtCond11.Hide(); - aRbCond11.Hide(); - aFtCond1And.Hide(); - aEdtCond12.Hide(); - aRbCond12.Hide(); - } - else if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen - { - aEdtCond11.SetSizePixel( aCond1Size3 ); - aRbCond11.SetPosPixel( aRBtn1Pos1 ); - aFtCond1And.Show(); - aEdtCond12.Show(); - aRbCond12.Show(); - } - else // gleich, n. gleich ... - { - aEdtCond12.Hide(); - aRbCond12.Hide(); - aFtCond1And.Hide(); - aRbCond11.SetPosPixel( aRBtn1Pos2 ); - aEdtCond11.SetSizePixel( aCond1Size2 ); - } - } - - return( 0L ); -} - -//---------------------------------------------------------------------------- - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond1TemplateHdl) -{ - String aStyleName = aLbCond1Template.GetSelectEntry(); - SfxStyleSheetBase* pStyleSheet = pDoc->GetStyleSheetPool()->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); - if ( pStyleSheet ) - { - const SfxItemSet& rSet = pStyleSheet->GetItemSet(); - aPreviewWin1.Init( rSet ); - aPreviewWin1.Show(); - } - else - aPreviewWin1.Hide(); - return( 0L ); -} - -//---------------------------------------------------------------------------- -// Enabled/Disabled Condition2-Controls - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ClickCond2Hdl) -{ - sal_Bool bChecked = aCbxCond2.IsChecked(); - CondChecked( bChecked, aCbxCond2, aLbCond21, aLbCond22, aEdtCond21, aRbCond21, aFtCond2And, aEdtCond22, aRbCond22, - aFtCond2Template, aLbCond2Template, aBtnNew2, aPreviewWin2 ); - return( 0L ); -} - -//---------------------------------------------------------------------------- -// Zellwert/Formel - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond21Hdl) -{ - sal_uInt16 nPos = aLbCond21.GetSelectEntryPos(); - - if( nPos == 0 ) // Zellwert - { - aLbCond22.Show(); - aEdtCond21.SetPosPixel( aCond2Pos2 ); - } - else // Formel - { - aLbCond22.Hide(); - aFtCond2And.Hide(); - aEdtCond22.Hide(); - aRbCond22.Hide(); - aRbCond21.SetPosPixel( aRBtn2Pos2 ); - aEdtCond21.SetPosSizePixel( aCond2Pos1, aCond2Size1 ); - aEdtCond21.Show(); - aRbCond21.Show(); - } - - ChangeCond22Hdl( NULL ); - - return( 0L ); -} - -//---------------------------------------------------------------------------- -// zwischen, gleich, groesser, ... - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond22Hdl) -{ - if( aLbCond22.IsVisible() ) - { - sal_uInt16 nPos = aLbCond22.GetSelectEntryPos(); - - aEdtCond21.Show(); - aRbCond21.Show(); - if( nPos > 7 ) - { - aEdtCond21.Hide(); - aRbCond21.Hide(); - aFtCond2And.Hide(); - aEdtCond22.Hide(); - aRbCond22.Hide(); - } - else if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen - { - aEdtCond21.SetSizePixel( aCond2Size3 ); - aRbCond21.SetPosPixel( aRBtn2Pos1 ); - aFtCond2And.Show(); - aEdtCond22.Show(); - aRbCond22.Show(); - } - else // gleich, n. gleich ... - { - aEdtCond22.Hide(); - aRbCond22.Hide(); - aFtCond2And.Hide(); - aRbCond21.SetPosPixel( aRBtn2Pos2 ); - aEdtCond21.SetSizePixel( aCond2Size2 ); - } - } - - return( 0L ); -} - -//---------------------------------------------------------------------------- - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond2TemplateHdl) -{ - String aStyleName = aLbCond2Template.GetSelectEntry(); - SfxStyleSheetBase* pStyleSheet = pDoc->GetStyleSheetPool()->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); - if ( pStyleSheet ) - { - const SfxItemSet& rSet = pStyleSheet->GetItemSet(); - aPreviewWin2.Init( rSet ); - aPreviewWin2.Show(); - } - else - aPreviewWin2.Hide(); - return( 0L ); -} - -//---------------------------------------------------------------------------- -// Enabled/Disabled Condition3-Controls - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ClickCond3Hdl) -{ - sal_Bool bChecked = aCbxCond3.IsChecked(); - CondChecked( bChecked, aCbxCond3, aLbCond31, aLbCond32, aEdtCond31, aRbCond31, aFtCond3And, aEdtCond32, aRbCond32, - aFtCond3Template, aLbCond3Template, aBtnNew3, aPreviewWin3 ); - if ( bChecked && ( ( nCurrentOffset + 3 ) == nEntryCount ) ) - AddEntry(); - return( 0L ); -} - -//---------------------------------------------------------------------------- -// Zellwert/Formel - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond31Hdl) -{ - sal_uInt16 nPos = aLbCond31.GetSelectEntryPos(); - - if( nPos == 0 ) // Zellwert - { - aLbCond32.Show(); - aEdtCond31.SetPosPixel( aCond3Pos2 ); - } - else // Formel - { - aLbCond32.Hide(); - aFtCond3And.Hide(); - aEdtCond32.Hide(); - aRbCond32.Hide(); - aRbCond31.SetPosPixel( aRBtn3Pos2 ); - aEdtCond31.SetPosSizePixel( aCond3Pos1, aCond3Size1 ); - aEdtCond31.Show(); - aRbCond31.Show(); - } - - ChangeCond32Hdl( NULL ); - - return( 0L ); -} - -//---------------------------------------------------------------------------- -// zwischen, gleich, groesser, ... - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond32Hdl) -{ - if( aLbCond32.IsVisible() ) - { - sal_uInt16 nPos = aLbCond32.GetSelectEntryPos(); - - aEdtCond31.Show(); - aRbCond31.Show(); - if( nPos > 7 ) - { - aEdtCond31.Hide(); - aRbCond31.Hide(); - aFtCond3And.Hide(); - aEdtCond32.Hide(); - aRbCond32.Hide(); - } - else if( nPos == 6 || nPos == 7 ) // zwischen, n. zwischen - { - aEdtCond31.SetSizePixel( aCond3Size3 ); - aRbCond31.SetPosPixel( aRBtn3Pos1 ); - aFtCond3And.Show(); - aEdtCond32.Show(); - aRbCond32.Show(); - } - else // gleich, n. gleich ... - { - aEdtCond32.Hide(); - aRbCond32.Hide(); - aFtCond3And.Hide(); - aRbCond31.SetPosPixel( aRBtn3Pos2 ); - aEdtCond31.SetSizePixel( aCond3Size2 ); - } - } - - return( 0L ); -} - -//---------------------------------------------------------------------------- - -IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond3TemplateHdl) -{ - String aStyleName = aLbCond3Template.GetSelectEntry(); - SfxStyleSheetBase* pStyleSheet = pDoc->GetStyleSheetPool()->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); - if ( pStyleSheet ) - { - const SfxItemSet& rSet = pStyleSheet->GetItemSet(); - aPreviewWin3.Init( rSet ); - aPreviewWin3.Show(); - } - else - aPreviewWin3.Hide(); - return( 0L ); -} - -//---------------------------------------------------------------------------- - -IMPL_LINK( ScConditionalFormatDlg, GetFocusHdl, Control*, pCtrl ) -{ - if( (pCtrl == (Control*)&aEdtCond11) || (pCtrl == (Control*)&aRbCond11) ) - pEdActive = &aEdtCond11; - else if( (pCtrl == (Control*)&aEdtCond12) || (pCtrl == (Control*)&aRbCond12) ) - pEdActive = &aEdtCond12; - else if( (pCtrl == (Control*)&aEdtCond21) || (pCtrl == (Control*)&aRbCond21) ) - pEdActive = &aEdtCond21; - else if( (pCtrl == (Control*)&aEdtCond22) || (pCtrl == (Control*)&aRbCond22) ) - pEdActive = &aEdtCond22; - else if( (pCtrl == (Control*)&aEdtCond31) || (pCtrl == (Control*)&aRbCond31) ) - pEdActive = &aEdtCond31; - else if( (pCtrl == (Control*)&aEdtCond32) || (pCtrl == (Control*)&aRbCond32) ) - pEdActive = &aEdtCond32; - else - pEdActive = NULL; - - if( pEdActive ) - pEdActive->SetSelection( Selection( 0, SELECTION_MAX ) ); - - return 0; -} - -//---------------------------------------------------------------------------- - -IMPL_LINK_NOARG(ScConditionalFormatDlg, LoseFocusHdl) -{ - bDlgLostFocus = !IsActive(); - return 0; -} - -//---------------------------------------------------------------------------- -// [OK], [Cancel] - -IMPL_LINK( ScConditionalFormatDlg, BtnHdl, PushButton*, pBtn ) -{ - if ( pBtn == &aBtnOk ) - { - ScConditionalFormat aCondFrmt( 0, pDoc ); - GetConditionalFormat( aCondFrmt ); - ScCondFrmtItem aOutItem( FID_CONDITIONAL_FORMAT, aCondFrmt ); - - SetDispatcherLock( false ); - SwitchToDocument(); - GetBindings().GetDispatcher()->Execute( FID_CONDITIONAL_FORMAT, - SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD, - &aOutItem, 0L, 0L ); - Close(); - } - - else if ( pBtn == &aBtnAdd ) - { - AddEntry(); - aScrollBar.SetThumbPos( nEntryCount - 3 ); - SliderMoved(); - aEdtCond31.GrabFocus(); - pEdActive = &aEdtCond31; - } - - else if ( pBtn == &aBtnCancel ) - Close(); - - return( 0L ); -} - -//---------------------------------------------------------------------------- - -IMPL_LINK( ScConditionalFormatDlg, NewBtnHdl, PushButton*, pBtn ) -{ - SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA ); - SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); - - // unlock the dispatcher so SID_STYLE_NEW can be executed - // (SetDispatcherLock would affect all Calc documents) - SfxDispatcher* pDisp = GetBindings().GetDispatcher(); - sal_Bool bLocked = pDisp->IsLocked(); - if (bLocked) - pDisp->Lock(false); - - // Execute the "new style" slot, complete with undo and all necessary updates. - // The return value (SfxUInt16Item) is ignored, look for new styles instead. - pDisp->Execute( SID_STYLE_NEW, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL, - &aFamilyItem, - &aRefItem, - 0L ); - - if (bLocked) - pDisp->Lock(sal_True); - - // Find the new style and add it into the style list boxes - String aNewStyle; - SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); - for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) - { - String aName = pStyle->GetName(); - if ( aLbCond1Template.GetEntryPos(aName) == LISTBOX_ENTRY_NOTFOUND ) // all lists contain the same entries - { - aLbCond1Template.InsertEntry( aName ); - aLbCond2Template.InsertEntry( aName ); - aLbCond3Template.InsertEntry( aName ); - // if there are several new styles (from API or a different view), - // assume the last one is the result of the dialog - aNewStyle = aName; - } - } - - // select the new style in the list box for which the button was pressed - if ( aNewStyle.Len() ) - { - ListBox* pListBox = &aLbCond1Template; - if ( pBtn == &aBtnNew2 ) - pListBox = &aLbCond2Template; - else if ( pBtn == &aBtnNew3 ) - pListBox = &aLbCond3Template; - - pListBox->SelectEntry( aNewStyle ); - - ChangeCond1TemplateHdl( NULL ); - ChangeCond2TemplateHdl( NULL ); - ChangeCond3TemplateHdl( NULL ); - } - - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 1b78cfba122c..649e4d347142 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -80,6 +80,7 @@ #include "tpcompatibility.hxx" #include "tpdefaults.hxx" #include "colorformat.hxx" +#include "condformatdlg.hxx" // ause #include "editutil.hxx" @@ -88,6 +89,7 @@ IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScColRowLabelDlg_Impl); +IMPL_ABSTDLG_BASE(AbstractScCondFormatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataBarSettingsDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); @@ -768,6 +770,24 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window } +AbstractScCondFormatDlg* ScAbstractDialogFactory_Impl::CreateScCondFormatDlg(Window* pParent, ScDocument* pDoc, ScConditionalFormat* pFormat, + const ScRangeList& rRange, int nId) +{ + ScCondFormatDlg* pDlg = NULL; + switch( nId ) + { + case RID_SCDLG_CONDFORMAT: + pDlg = new ScCondFormatDlg( pParent, pDoc, pFormat, rRange ); + break; + default: + break; + } + if(pDlg) + return new AbstractScCondFormatDlg_Impl( pDlg ); + + return NULL; +} + AbstractScDataBarSettingsDlg* ScAbstractDialogFactory_Impl::CreateScDataBarSetttingsDlg(Window* pParent, int nId) { ScDataBarSettingsDlg* pDlg = NULL; diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 2fb0a12c6f3d..04aa60537cb3 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -67,6 +67,7 @@ class SfxTabDialog; class ScSortWarningDlg; class ScTextImportOptionsDlg; class ScDataBarSettingsDlg; +class ScCondFormatDlg; #define DECL_ABSTDLG_BASE(Class,DialogClass) \ DialogClass* pDlg; \ @@ -138,6 +139,11 @@ class AbstractScColRowLabelDlg_Impl : public AbstractScColRowLabelDlg //add for virtual sal_Bool IsRow(); }; +class AbstractScCondFormatDlg_Impl : public AbstractScCondFormatDlg +{ + DECL_ABSTDLG_BASE(AbstractScCondFormatDlg_Impl, ScCondFormatDlg) +}; + class AbstractScDataBarSettingsDlg_Impl : public AbstractScDataBarSettingsDlg { DECL_ABSTDLG_BASE(AbstractScDataBarSettingsDlg_Impl, ScDataBarSettingsDlg) @@ -421,6 +427,9 @@ public: virtual VclAbstractDialog * CreateScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ); + virtual AbstractScCondFormatDlg* CreateScCondFormatDlg(Window* pParent, ScDocument* pDoc, ScConditionalFormat* pFormat, + const ScRangeList& rRange, int nId ); //add for ScDataBarSettingsDlg + virtual AbstractScDataBarSettingsDlg* CreateScDataBarSetttingsDlg (Window* pParent ,int nId ); //add for ScDataBarSettingsDlg virtual AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ); //add for ScDataPilotDatabaseDlg diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx new file mode 100644 index 000000000000..eedb99a7b071 --- /dev/null +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -0,0 +1,188 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "condformatdlg.hxx" +#include "condformatdlg.hrc" + +#include "anyrefdg.hxx" +#include "document.hxx" +#include "conditio.hxx" + +#include <iostream> + +ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent): + Control(pParent, ScResId( CTRL_ENTRY ) ), + mbActive(false), + maLbType( this, ScResId( LB_TYPE ) ), + maFtCondNr( this, ScResId( FT_COND_NR ) ), + maFtCondition( this, ScResId( FT_CONDITION ) ), + maLbCondType( this, ScResId( LB_CELLIS_TYPE ) ), + maEdVal1( this, ScResId( ED_VAL1 ) ), + maEdVal2( this, ScResId( ED_VAL2 ) ), + maFtStyle( this, ScResId( FT_STYLE ) ), + maLbStyle( this, ScResId( LB_STYLE ) ) +{ + Size aSize = GetSizePixel(); + aSize.Height() = 40; + SetSizePixel(aSize); + SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); + SwitchToType(COLLAPSED); + FreeResource(); + + maLbType.SelectEntryPos(1); + maLbCondType.SelectEntryPos(0); + maEdVal2.Hide(); +} + +long ScCondFrmtEntry::GetHeight() const +{ + if(mbActive) + return 100; + else + return 10; +} + +namespace { + +rtl::OUString getTextForType(ScCondFormatEntryType eType) +{ + switch(eType) + { + case CONDITION: + return rtl::OUString("Cell value"); + case COLORSCALE: + return rtl::OUString("Color scale"); + case DATABAR: + return rtl::OUString("Data Bar"); + default: + break; + } + + return rtl::OUString(); +} + +} + +void ScCondFrmtEntry::SwitchToType( ScCondFormatEntryType eType ) +{ + switch(eType) + { + case COLLAPSED: + maLbType.Hide(); + maFtCondition.SetText(getTextForType(meType)); + maFtCondition.Show(); + maEdVal2.Hide(); + maEdVal1.Hide(); + break; + default: + maLbType.Show(); + maFtCondition.SetText(rtl::OUString("")); + maFtCondition.Hide(); + maEdVal1.Show(); + maEdVal2.Show(); + break; + } +} + +void ScCondFrmtEntry::Select() +{ + mbActive = !mbActive; + + if(mbActive) + { + Size aSize = GetSizePixel(); + aSize.Height() += 120; + SetSizePixel(aSize); + SetControlBackground(Color(COL_RED)); + SwitchToType(meType); + } + else + { + Size aSize = GetSizePixel(); + aSize.Height() = 60; + SetSizePixel(aSize); + SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); + SwitchToType(COLLAPSED); + } +} + +ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId): + Control(pParent, rResId), + mbHasScrollBar(false), + mpScrollBar(NULL), + mnTopIndex(0) +{ + maEntries.push_back( new ScCondFrmtEntry(this) ); + maEntries.push_back( new ScCondFrmtEntry(this) ); + maEntries.push_back( new ScCondFrmtEntry(this) ); + maEntries[1].Select(); + + RecalcAll(); + FreeResource(); +} + +void ScCondFormatList::RecalcAll() +{ + Point aPoint(0,0); + for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + { + itr->SetPosPixel(aPoint); + aPoint.Y() += itr->GetSizePixel().Height(); + } +} + +ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, ScConditionalFormat* pFormat, const ScRangeList& rRange): + ModalDialog(pParent, ScResId( RID_SCDLG_CONDFORMAT )), + maBtnAdd( this, ScResId( BTN_ADD ) ), + maBtnRemove( this, ScResId( BTN_REMOVE ) ), + maBtnOk( this, ScResId( BTN_OK ) ), + maBtnCancel( this, ScResId( BTN_CANCEL ) ), + maCondFormList( this, ScResId( CTRL_LIST ) ), + mpDoc(pDoc), + mpFormat(pFormat) +{ + + rtl::OUStringBuffer aTitle( GetText() ); + aTitle.append(rtl::OUString(" ")); + rtl::OUString aRangeString; + rRange.Format(aRangeString, 0, pDoc); + aTitle.append(aRangeString); + SetText(aTitle.makeStringAndClear()); + maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) ); +} + +IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl ) +{ + maEntries.push_back( new ScCondFrmtEntry(this) ); + RecalcAll(); + return 0; +} + + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlg.hrc b/sc/source/ui/inc/condformatdlg.hrc new file mode 100644 index 000000000000..89eb53cd86b2 --- /dev/null +++ b/sc/source/ui/inc/condformatdlg.hrc @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "sc.hrc" + +#define BTN_OK 1 +#define BTN_CANCEL 2 + +#define BTN_ADD 10 +#define BTN_REMOVE 11 + +#define CTRL_LIST 12 +#define CTRL_ENTRY 13 + +#define LB_TYPE 14 +#define FT_COND_NR 15 +#define FT_CONDITION 16 +#define LB_CELLIS_TYPE 17 +#define ED_VAL1 18 +#define ED_VAL2 19 +#define LB_STYLE 20 +#define FT_STYLE 21 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx new file mode 100644 index 000000000000..b88fe2419741 --- /dev/null +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -0,0 +1,118 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/lstbox.hxx> +#include <vcl/scrbar.hxx> +#include <vcl/fixed.hxx> +#include <vcl/edit.hxx> + +#include "rangelst.hxx" + +#include <boost/ptr_container/ptr_vector.hpp> + +class ScDocument; +class ScConditionalFormat; + +enum ScCondFormatEntryType +{ + CONDITION, + COLORSCALE, + DATABAR, + COLLAPSED +}; + +class ScCondFrmtEntry : public Control +{ +private: + bool mbActive; + ScCondFormatEntryType meType; + + //general ui elements + ListBox maLbType; + FixedText maFtCondNr; + FixedText maFtCondition; + + //cond format ui elements + ListBox maLbCondType; + Edit maEdVal1; + Edit maEdVal2; + FixedText maFtStyle; + ListBox maLbStyle; + //color scale ui elements + + //data bar ui elements + // + // + void SwitchToType(ScCondFormatEntryType eType); + +public: + ScCondFrmtEntry( Window* pParent ); + + long GetHeight() const; + void Select(); +}; + +class ScCondFormatList : public Control +{ +private: + typedef boost::ptr_vector<ScCondFrmtEntry> EntryContainer; + EntryContainer maEntries; + + bool mbHasScrollBar; + ScrollBar* mpScrollBar; + long mnTopIndex; + + void RecalcAll(); +public: + ScCondFormatList( Window* pParent, const ResId& rResId ); + + DECL_LINK( AddBtnHdl, void* ); + +}; + +class ScCondFormatDlg : public ModalDialog +{ +private: + PushButton maBtnAdd; + PushButton maBtnRemove; + OKButton maBtnOk; + CancelButton maBtnCancel; + + ScCondFormatList maCondFormList; + + ScDocument* mpDoc; + ScConditionalFormat* mpFormat; + +public: + ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, ScConditionalFormat* pFormat, const ScRangeList& rRange); + +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condfrmt.hrc b/sc/source/ui/inc/condfrmt.hrc deleted file mode 100644 index 86cf8f13c72a..000000000000 --- a/sc/source/ui/inc/condfrmt.hrc +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "sc.hrc" // ->RID_SCDLG_SOLVER - -#define CBX_COND1 1 -#define LB_COND1_1 2 -#define LB_COND1_2 3 -#define EDT_COND1_1 4 -#define RB_COND1_1 5 -#define FT_COND1_AND 6 -#define EDT_COND1_2 7 -#define RB_COND1_2 8 -#define FT_COND1_TEMPLATE 9 -#define LB_COND1_TEMPLATE 10 - -#define CBX_COND2 11 -#define LB_COND2_1 12 -#define LB_COND2_2 13 -#define EDT_COND2_1 14 -#define RB_COND2_1 15 -#define FT_COND2_AND 16 -#define EDT_COND2_2 17 -#define RB_COND2_2 18 -#define FT_COND2_TEMPLATE 19 -#define LB_COND2_TEMPLATE 20 - -#define CBX_COND3 21 -#define LB_COND3_1 22 -#define LB_COND3_2 23 -#define EDT_COND3_1 24 -#define RB_COND3_1 25 -#define FT_COND3_AND 26 -#define EDT_COND3_2 27 -#define RB_COND3_2 28 -#define FT_COND3_TEMPLATE 29 -#define LB_COND3_TEMPLATE 30 - -#define FL_SEP1 41 -#define FL_SEP2 42 - -#define LB_SCROLL 43 - -#define WIN_CHAR_PREVIEW_COND1 44 -#define WIN_CHAR_PREVIEW_COND2 45 -#define WIN_CHAR_PREVIEW_COND3 46 -#define BTN_ADD 47 - -//IAccessibility2 Implementation 2009----- -#define LABEL_FORMARTTING_CONDITIONS 5043 -#define LABEL_CONDITIONS 5044 -#define LABEL_CONDITION_VALUE 5045 -//-----IAccessibility2 Implementation 2009 - -#define BTN_OK 31 -#define BTN_CANCEL 32 -#define BTN_HELP 33 - -#define BTN_COND1_NEW 34 -#define BTN_COND2_NEW 35 -#define BTN_COND3_NEW 36 diff --git a/sc/source/ui/inc/condfrmt.hxx b/sc/source/ui/inc/condfrmt.hxx deleted file mode 100644 index 1bfaf7906312..000000000000 --- a/sc/source/ui/inc/condfrmt.hxx +++ /dev/null @@ -1,179 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#ifndef SC_CONDFRMT_HXX_ -#define SC_CONDFRMT_HXX_ - -#include "anyrefdg.hxx" -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> -#include <svx/fntctrl.hxx> - - -class ScDocument; -class ScConditionalFormat; - - -//============================================================================ -// class ScConditionalFormat -// -// Dialog zum Festlegen von bedingten Formaten - -class ScConditionalFormatDlg : public ScAnyRefDlg -{ -public: - ScConditionalFormatDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, - ScDocument* pCurDoc, - const ScConditionalFormat* pCurrentFormat ); - ~ScConditionalFormatDlg(); - - virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ); - virtual void AddRefEntry(); - virtual sal_Bool IsRefInputMode() const; - virtual void SetActive(); - void SliderMoved(); - sal_uInt16 GetSliderPos(); - virtual sal_Bool Close(); - -private: - CheckBox aCbxCond1; - ListBox aLbCond11; - ListBox aLbCond12; - formula::RefEdit aEdtCond11; - formula::RefButton aRbCond11; - FixedText aFtCond1And; - formula::RefEdit aEdtCond12; - formula::RefButton aRbCond12; - FixedText aFtCond1Template; - ListBox aLbCond1Template; - PushButton aBtnNew1; - SvxFontPrevWindow aPreviewWin1; - FixedLine aFlSep1; - - CheckBox aCbxCond2; - ListBox aLbCond21; - ListBox aLbCond22; - formula::RefEdit aEdtCond21; - formula::RefButton aRbCond21; - FixedText aFtCond2And; - formula::RefEdit aEdtCond22; - formula::RefButton aRbCond22; - FixedText aFtCond2Template; - ListBox aLbCond2Template; - PushButton aBtnNew2; - SvxFontPrevWindow aPreviewWin2; - FixedLine aFlSep2; - - CheckBox aCbxCond3; - ListBox aLbCond31; - ListBox aLbCond32; - formula::RefEdit aEdtCond31; - formula::RefButton aRbCond31; - FixedText aFtCond3And; - formula::RefEdit aEdtCond32; - formula::RefButton aRbCond32; - FixedText aFtCond3Template; - ListBox aLbCond3Template; - PushButton aBtnNew3; - SvxFontPrevWindow aPreviewWin3; - - ScrollBar aScrollBar; - OKButton aBtnOk; - CancelButton aBtnCancel; - HelpButton aBtnHelp; - PushButton aBtnAdd; - - Point aCond1Pos1; - Point aCond1Pos2; - Point aRBtn1Pos1; - Point aRBtn1Pos2; - Size aCond1Size1; - Size aCond1Size2; - Size aCond1Size3; - - Point aCond2Pos1; - Point aCond2Pos2; - Point aRBtn2Pos1; - Point aRBtn2Pos2; - Size aCond2Size1; - Size aCond2Size2; - Size aCond2Size3; - - Point aCond3Pos1; - Point aCond3Pos2; - Point aRBtn3Pos1; - Point aRBtn3Pos2; - Size aCond3Size1; - Size aCond3Size2; - Size aCond3Size3; - - formula::RefEdit* pEdActive; - sal_Bool bDlgLostFocus; - ScDocument* pDoc; - ScCondFormatEntry** ppEntries; - sal_uInt16 nEntryCount; - sal_uInt16 nCurrentOffset; - String aCbxCond1InitialText; - String aCbxCond2InitialText; - String aCbxCond3InitialText; - -#ifdef _CONDFRMT_CXX - void AddEntry(); - void GetConditionalFormat( ScConditionalFormat& rCndFmt ); - void Refresh( sal_uInt16 nOffset ); - void UpdateValueList ( sal_uInt16 nOffset ); - - DECL_LINK( ClickCond1Hdl, void * ); - DECL_LINK( ChangeCond11Hdl, void * ); - DECL_LINK( ChangeCond12Hdl, void * ); - DECL_LINK( ChangeCond1TemplateHdl, void * ); - - DECL_LINK( ClickCond2Hdl, void * ); - DECL_LINK( ChangeCond21Hdl, void * ); - DECL_LINK( ChangeCond22Hdl, void * ); - DECL_LINK( ChangeCond2TemplateHdl, void * ); - - DECL_LINK( ClickCond3Hdl, void * ); - DECL_LINK( ChangeCond31Hdl, void * ); - DECL_LINK( ChangeCond32Hdl, void * ); - DECL_LINK( ChangeCond3TemplateHdl, void * ); - - DECL_LINK( GetFocusHdl, Control* ); - DECL_LINK( LoseFocusHdl, void* ); - DECL_LINK( BtnHdl, PushButton* ); - DECL_LINK( NewBtnHdl, PushButton* ); - DECL_LINK( ScrollHdl, void* ); - -#endif // _CONDFRMT_CXX -}; - -#endif // SC_CONDFRMT_HXX_ - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index 9e1a919b298e..07a751c8b3e7 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -55,8 +55,6 @@ DECL_WRAPPER(ScSpecialFilterDlgWrapper) DECL_WRAPPER(ScDbNameDlgWrapper) DECL_WRAPPER(ScConsolidateDlgWrapper) DECL_WRAPPER(ScPrintAreasDlgWrapper) -DECL_WRAPPER(ScCondFormatDlgWrapper) -DECL_WRAPPER(ScDataBarSettingDlgWrapper) DECL_WRAPPER(ScColRowNameRangesDlgWrapper) DECL_WRAPPER(ScFormulaDlgWrapper) DECL_WRAPPER(ScHighlightChgDlgWrapper) diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src new file mode 100644 index 000000000000..83c7d3ac42be --- /dev/null +++ b/sc/source/ui/src/condformatdlg.src @@ -0,0 +1,153 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer) + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "condformatdlg.hrc" + +ModalDialog RID_SCDLG_CONDFORMAT +{ + OutputSize = TRUE; + Hide = TRUE; + Size = MAP_APPFONT ( 200, 200 ); + Text [ en-US ] = "Conditional Formatting for"; + Moveable = TRUE; + Closeable = TRUE; + OkButton BTN_OK + { + Pos = MAP_APPFONT ( 160, 180 ); + Size = MAP_APPFONT ( 30, 14 ); + TabStop = TRUE; + }; + CancelButton BTN_CANCEL + { + Pos = MAP_APPFONT ( 120, 180 ); + Size = MAP_APPFONT ( 30, 14 ); + TabStop = TRUE; + }; + PushButton BTN_ADD + { + Pos = MAP_APPFONT( 5, 155 ); + Size = MAP_APPFONT( 40, 14 ); + Text [ en-US ] = "Add"; + TabStop = TRUE; + }; + PushButton BTN_REMOVE + { + Pos = MAP_APPFONT( 50, 155 ); + Size = MAP_APPFONT( 40, 14 ); + Text [ en-US ] = "Remove"; + TabStop = TRUE; + }; + Control CTRL_LIST + { + Pos = MAP_APPFONT( 5, 20 ); + Size = MAP_APPFONT( 190, 120 ); + + Control CTRL_ENTRY + { + Pos = MAP_APPFONT( 0, 0 ); + Size = MAP_APPFONT( 190, 40 ); + Border = TRUE; + + FixedText FT_COND_NR + { + Pos = MAP_APPFONT( 2, 2 ); + Size = MAP_APPFONT( 30, 10 ); + Text [ en-US ] = "Condition"; + }; + + FixedText FT_CONDITION + { + Pos = MAP_APPFONT( 40, 2 ); + Size = MAP_APPFONT( 30, 10 ); + }; + + ListBox LB_TYPE + { + Pos = MAP_APPFONT( 5, 15 ); + Size = MAP_APPFONT( 40, 14 ); + Border = TRUE; + DropDown = TRUE; + StringList [ en-US ] = + { + "All Cells"; + "Cell value is"; + "Formula is"; + }; + }; + ListBox LB_CELLIS_TYPE + { + Pos = MAP_APPFONT( 50, 15 ); + Size = MAP_APPFONT( 30, 14 ); + Border = TRUE; + DropDown = TRUE; + StringList [ en-US ] = + { + "equal to"; + "less than"; + "greater than"; + "less than or equal to"; + "greater than or equal to"; + "not equal to"; + "between"; + "not between"; + }; + }; + FixedText FT_STYLE + { + Pos = MAP_APPFONT( 10, 32 ); + Size = MAP_APPFONT( 35, 14 ); + Text [ en-US ] = "Apply Style"; + }; + Edit ED_VAL1 + { + Pos = MAP_APPFONT( 90, 15 ); + Size = MAP_APPFONT( 70, 14 ); + Border = TRUE; + }; + Edit ED_VAL2 + { + Pos = MAP_APPFONT( 130, 15 ); + Size = MAP_APPFONT( 30, 14 ); + Border = TRUE; + }; + ListBox LB_STYLE + { + Pos = MAP_APPFONT( 50, 32 ); + Size = MAP_APPFONT( 30, 14 ); + Border = TRUE; + DropDown = TRUE; + StringList [ en-US ] = + { + "New Style..."; + }; + }; + }; + }; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/src/condfrmt.src b/sc/source/ui/src/condfrmt.src deleted file mode 100644 index d4178d67c022..000000000000 --- a/sc/source/ui/src/condfrmt.src +++ /dev/null @@ -1,442 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "condfrmt.hrc" - -ModelessDialog RID_SCDLG_CONDFORMAT -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 326 , 161 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - HelpId = HID_SCDLG_CONDFORMAT ; - Hide = TRUE ; - CheckBox CBX_COND1 - { - HelpID = "sc:CheckBox:RID_SCDLG_CONDFORMAT:CBX_COND1"; - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 248 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Condition ~1" ; - }; - ListBox LB_COND1_1 - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND1_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 19 ) ; - Size = MAP_APPFONT ( 48 , 40 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Cell value is" ; Default ; > ; - < "Formula is" ; Default ; > ; - }; - }; - ListBox LB_COND1_2 - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND1_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 58 , 19 ) ; - Size = MAP_APPFONT ( 62 , 88 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "equal to" ; Default ; > ; - < "less than" ; Default ; > ; - < "greater than" ; Default ; > ; - < "less than or equal to" ; Default ; > ; - < "greater than or equal to" ; Default ; > ; - < "not equal to" ; Default ; > ; - < "between" ; Default ; > ; - < "not between" ; Default ; > ; - < "duplicated values" ; Default ; > ; - < "non duplicated values" ; Default ; > ; - }; - }; - Edit EDT_COND1_1 - { - HelpID = "sc:Edit:RID_SCDLG_CONDFORMAT:EDT_COND1_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 124 , 19 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - }; - ImageButton RB_COND1_1 - { - HelpID = "sc:ImageButton:RID_SCDLG_CONDFORMAT:RB_COND1_1"; - Pos = MAP_APPFONT ( 167 , 18 ) ; - Size = MAP_APPFONT ( 13 , 15 ) ; - TabStop = FALSE ; - QuickHelpText [ en-US ] = "Shrink" ; - }; - FixedText FT_COND1_AND - { - Pos = MAP_APPFONT ( 181 , 21 ) ; - Size = MAP_APPFONT ( 16 , 8 ) ; - Center = TRUE ; - Text [ en-US ] = "and" ; - }; - Edit EDT_COND1_2 - { - HelpID = "sc:Edit:RID_SCDLG_CONDFORMAT:EDT_COND1_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 199 , 19 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - }; - ImageButton RB_COND1_2 - { - HelpID = "sc:ImageButton:RID_SCDLG_CONDFORMAT:RB_COND1_2"; - Pos = MAP_APPFONT ( 242 , 18 ) ; - Size = MAP_APPFONT ( 13 , 15 ) ; - TabStop = FALSE ; - QuickHelpText [ en-US ] = "Shrink" ; - }; - FixedText FT_COND1_TEMPLATE - { - Pos = MAP_APPFONT ( 6 , 37 ) ; - Size = MAP_APPFONT ( 46 , 8 ) ; - Right = TRUE ; - Text [ en-US ] = "~Cell Style" ; - }; - ListBox LB_COND1_TEMPLATE - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND1_TEMPLATE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 58 , 35 ) ; - Size = MAP_APPFONT ( 62 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - Window WIN_CHAR_PREVIEW_COND1 - { - Border = FALSE ; - Pos = MAP_APPFONT ( 124 , 34 ) ; - Size = MAP_APPFONT ( 41 , 14 ) ; - Text [ en-US ] = "Example"; - }; - PushButton BTN_COND1_NEW - { - HelpID = "sc:PushButton:RID_SCDLG_CONDFORMAT:BTN_COND1_NEW"; - Pos = MAP_APPFONT ( 169 , 34 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~New Style..." ; - }; - FixedLine FL_SEP1 - { - Pos = MAP_APPFONT ( 6 , 51 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - }; - CheckBox CBX_COND2 - { - HelpID = "sc:CheckBox:RID_SCDLG_CONDFORMAT:CBX_COND2"; - Pos = MAP_APPFONT ( 6 , 60 ) ; - Size = MAP_APPFONT ( 248 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Condition ~2" ; - }; - ListBox LB_COND2_1 - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND2_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 73 ) ; - Size = MAP_APPFONT ( 48 , 40 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Cell value is" ; Default ; > ; - < "Formula is" ; Default ; > ; - }; - }; - ListBox LB_COND2_2 - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND2_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 58 , 73 ) ; - Size = MAP_APPFONT ( 62 , 88 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "equal to" ; Default ; > ; - < "less than" ; Default ; > ; - < "greater than" ; Default ; > ; - < "less than or equal to" ; Default ; > ; - < "greater than or equal to" ; Default ; > ; - < "not equal to" ; Default ; > ; - < "between" ; Default ; > ; - < "not between" ; Default ; > ; - < "duplicated values" ; Default ; > ; - < "non duplicated values" ; Default ; > ; - }; - }; - Edit EDT_COND2_1 - { - HelpID = "sc:Edit:RID_SCDLG_CONDFORMAT:EDT_COND2_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 124 , 73 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - }; - ImageButton RB_COND2_1 - { - HelpID = "sc:ImageButton:RID_SCDLG_CONDFORMAT:RB_COND2_1"; - Pos = MAP_APPFONT ( 167 , 72 ) ; - Size = MAP_APPFONT ( 13 , 15 ) ; - TabStop = FALSE ; - QuickHelpText [ en-US ] = "Shrink" ; - }; - FixedText FT_COND2_AND - { - Pos = MAP_APPFONT ( 181 , 75 ) ; - Size = MAP_APPFONT ( 16 , 8 ) ; - Center = TRUE ; - Text [ en-US ] = "and" ; - }; - Edit EDT_COND2_2 - { - HelpID = "sc:Edit:RID_SCDLG_CONDFORMAT:EDT_COND2_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 199 , 73 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - }; - ImageButton RB_COND2_2 - { - HelpID = "sc:ImageButton:RID_SCDLG_CONDFORMAT:RB_COND2_2"; - Pos = MAP_APPFONT ( 242 , 72 ) ; - Size = MAP_APPFONT ( 13 , 15 ) ; - TabStop = FALSE ; - QuickHelpText [ en-US ] = "Shrink" ; - }; - FixedText FT_COND2_TEMPLATE - { - Pos = MAP_APPFONT ( 6 , 91 ) ; - Size = MAP_APPFONT ( 46 , 8 ) ; - Right = TRUE ; - Text [ en-US ] = "C~ell Style" ; - }; - ListBox LB_COND2_TEMPLATE - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND2_TEMPLATE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 58 , 89 ) ; - Size = MAP_APPFONT ( 62 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - Window WIN_CHAR_PREVIEW_COND2 - { - Border = FALSE ; - Pos = MAP_APPFONT ( 124 , 88 ) ; - Size = MAP_APPFONT ( 41 , 14 ) ; - Text [ en-US ] = "Example"; - }; - PushButton BTN_COND2_NEW - { - HelpID = "sc:PushButton:RID_SCDLG_CONDFORMAT:BTN_COND2_NEW"; - Pos = MAP_APPFONT ( 169 , 88 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Ne~w Style..." ; - }; - FixedLine FL_SEP2 - { - Pos = MAP_APPFONT ( 6 , 105 ) ; - Size = MAP_APPFONT ( 248 , 8 ) ; - }; - CheckBox CBX_COND3 - { - HelpID = "sc:CheckBox:RID_SCDLG_CONDFORMAT:CBX_COND3"; - Pos = MAP_APPFONT ( 6 , 114 ) ; - Size = MAP_APPFONT ( 248 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "Condition ~3" ; - }; - ListBox LB_COND3_1 - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND3_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 127 ) ; - Size = MAP_APPFONT ( 48 , 40 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Cell value is" ; Default ; > ; - < "Formula is" ; Default ; > ; - }; - }; - ListBox LB_COND3_2 - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND3_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 58 , 127 ) ; - Size = MAP_APPFONT ( 62 , 88 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "equal to" ; Default ; > ; - < "less than" ; Default ; > ; - < "greater than" ; Default ; > ; - < "less than or equal to" ; Default ; > ; - < "greater than or equal to" ; Default ; > ; - < "not equal to" ; Default ; > ; - < "between" ; Default ; > ; - < "not between" ; Default ; > ; - < "duplicated values" ; Default ; > ; - < "non duplicated values" ; Default ; > ; - }; - }; - Edit EDT_COND3_1 - { - HelpID = "sc:Edit:RID_SCDLG_CONDFORMAT:EDT_COND3_1"; - Border = TRUE ; - Pos = MAP_APPFONT ( 124 , 127 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - }; - ImageButton RB_COND3_1 - { - HelpID = "sc:ImageButton:RID_SCDLG_CONDFORMAT:RB_COND3_1"; - Pos = MAP_APPFONT ( 167 , 126 ) ; - Size = MAP_APPFONT ( 13 , 15 ) ; - TabStop = FALSE ; - QuickHelpText [ en-US ] = "Shrink" ; - }; - FixedText FT_COND3_AND - { - Pos = MAP_APPFONT ( 181 , 129 ) ; - Size = MAP_APPFONT ( 16 , 8 ) ; - Center = TRUE ; - Text [ en-US ] = "and" ; - }; - Edit EDT_COND3_2 - { - HelpID = "sc:Edit:RID_SCDLG_CONDFORMAT:EDT_COND3_2"; - Border = TRUE ; - Pos = MAP_APPFONT ( 199 , 127 ) ; - Size = MAP_APPFONT ( 41 , 12 ) ; - TabStop = TRUE ; - }; - ImageButton RB_COND3_2 - { - HelpID = "sc:ImageButton:RID_SCDLG_CONDFORMAT:RB_COND3_2"; - Pos = MAP_APPFONT ( 242 , 126 ) ; - Size = MAP_APPFONT ( 13 , 15 ) ; - TabStop = FALSE ; - QuickHelpText [ en-US ] = "Shrink" ; - }; - FixedText FT_COND3_TEMPLATE - { - Pos = MAP_APPFONT ( 6 , 145 ) ; - Size = MAP_APPFONT ( 46 , 8 ) ; - Right = TRUE ; - Text [ en-US ] = "Ce~ll Style" ; - }; - ListBox LB_COND3_TEMPLATE - { - HelpID = "sc:ListBox:RID_SCDLG_CONDFORMAT:LB_COND3_TEMPLATE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 58 , 143 ) ; - Size = MAP_APPFONT ( 62 , 80 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - Window WIN_CHAR_PREVIEW_COND3 - { - Border = FALSE ; - Pos = MAP_APPFONT ( 124 , 142 ) ; - Size = MAP_APPFONT ( 41 , 14 ) ; - Text [ en-US ] = "Example"; - }; - PushButton BTN_COND3_NEW - { - HelpID = "sc:PushButton:RID_SCDLG_CONDFORMAT:BTN_COND3_NEW"; - Pos = MAP_APPFONT ( 169 , 142 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "New ~Style..." ; - }; - ScrollBar LB_SCROLL - { - Pos = MAP_APPFONT ( 260, 6 ) ; - Size = MAP_APPFONT ( 8 , 150 ) ; - TabStop = TRUE ; - VScroll = TRUE ; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 270 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 270 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 270 , 40 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - PushButton BTN_ADD - { - Pos = MAP_APPFONT ( 270 , 74 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Add" ; - }; - Text [ en-US ] = "Conditional Formatting" ; -}; - -String LABEL_FORMARTTING_CONDITIONS -{ - Text [ en-US ] = "Formatting Conditions" ; -}; -String LABEL_CONDITIONS -{ - Text [ en-US ] = "Conditions" ; -}; -String LABEL_CONDITION_VALUE -{ - Text [ en-US ] = "Condition Value" ; -}; - diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 62150edd97d8..a9a9e1d5e0a2 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -222,20 +222,6 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) || ((nCol2 - nCol1) < 2) || ((nRow2 - nRow1) < 2); break; - case SID_OPENDLG_CONDFRMT : - { - if ( !bEditable && bOnlyNotBecauseOfMatrix ) - { - bNeedEdit = false; - } - if ( pDocShell && pDocShell->IsDocShared() ) - { - bDisable = sal_True; - } - } - break; - - case FID_CONDITIONAL_FORMAT : case SID_CELL_FORMAT_RESET : case FID_CELL_FORMAT : case SID_ENABLE_HYPHENATION : diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 32a8bc87cf68..f6f15a325fac 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -26,7 +26,7 @@ * ************************************************************************/ - +#include <iostream> //------------------------------------------------------------------ @@ -2049,23 +2049,19 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; - case FID_CONDITIONAL_FORMAT: - if( pReqArgs ) + case SID_OPENDLG_CONDFRMT: { - const SfxPoolItem* pItem; - if( pReqArgs->HasItem( FID_CONDITIONAL_FORMAT, &pItem ) ) - { - // when RefInput has switched to other tabs as data table, switch back - if ( GetViewData()->GetTabNo() != GetViewData()->GetRefTabNo() ) - { - pTabViewShell->SetTabNo( GetViewData()->GetRefTabNo() ); - pTabViewShell->PaintExtras(); - } + ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - const ScCondFrmtItem* pCndFmtItem = (const ScCondFrmtItem*) pItem; - pTabViewShell->SetConditionalFormat( pCndFmtItem->GetData() ); - rReq.Done(); - } + ScRangeList aRangeList; + GetViewData()->GetMarkData().FillRangeListWithMarks(&aRangeList, false); + ScDocument* pDoc = GetViewData()->GetDocument(); + + AbstractScCondFormatDlg* pDlg = pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, RID_SCDLG_CONDFORMAT ); + OSL_ENSURE(pDlg, "Dialog create fail!"); + pDlg->Execute(); + delete pDlg; } break; diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 24c97b21fb0b..9c5a417aaab5 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -886,16 +886,6 @@ void ScCellShell::Execute( SfxRequest& rReq ) } break; - case SID_OPENDLG_CONDFRMT: - { - sal_uInt16 nId = ScCondFormatDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); - - pScMod->SetRefDialog( nId, pWnd ? false : sal_True ); - } - break; - // ---------------------------------------------------------------- case FID_INPUTLINE_STATUS: diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 5c6d23f59aed..d7247deddaef 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -53,7 +53,6 @@ SFX_IMPL_MODELESSDIALOG(ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER ) SFX_IMPL_MODELESSDIALOG(ScDbNameDlgWrapper, SID_DEFINE_DBNAME ) SFX_IMPL_MODELESSDIALOG(ScConsolidateDlgWrapper, SID_OPENDLG_CONSOLIDATE ) SFX_IMPL_MODELESSDIALOG(ScPrintAreasDlgWrapper, SID_OPENDLG_EDIT_PRINTAREA ) -SFX_IMPL_MODELESSDIALOG(ScCondFormatDlgWrapper, SID_OPENDLG_CONDFRMT ) SFX_IMPL_MODELESSDIALOG(ScColRowNameRangesDlgWrapper, SID_DEFINE_COLROWNAMERANGES ) SFX_IMPL_MODELESSDIALOG(ScFormulaDlgWrapper, SID_OPENDLG_FUNCTION ) SFX_IMPL_MODELESSDIALOG(ScAcceptChgDlgWrapper, FID_CHG_ACCEPT ) @@ -182,12 +181,6 @@ IMPL_CHILD_CTOR( ScConsolidateDlgWrapper, SID_OPENDLG_CONSOLIDATE ) IMPL_CHILD_CTOR( ScPrintAreasDlgWrapper, SID_OPENDLG_EDIT_PRINTAREA ) //------------------------------------------------------------------------- -// ScCondFormatDlgWrapper -//------------------------------------------------------------------------- - -IMPL_CHILD_CTOR( ScCondFormatDlgWrapper, SID_OPENDLG_CONDFRMT ) - -//------------------------------------------------------------------------- // ScFormulaDlgWrapper //------------------------------------------------------------------------- diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index e8b7be8c2993..0453de4d386b 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -430,7 +430,6 @@ void ScTabView::SelectionChanged() rBindings.Invalidate( SID_INSERT_POSTIT ); rBindings.Invalidate( SID_CHARMAP ); rBindings.Invalidate( SID_OPENDLG_FUNCTION ); - rBindings.Invalidate( SID_OPENDLG_CONDFRMT ); rBindings.Invalidate( FID_VALIDATION ); rBindings.Invalidate( SID_EXTERNAL_SOURCE ); rBindings.Invalidate( SID_TEXT_TO_COLUMNS ); diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index f2f37277687b..6c976cb6e6ec 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -72,7 +72,6 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL)) SFX_CHILDWINDOW_REGISTRATION(ScDbNameDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScConsolidateDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScPrintAreasDlgWrapper::GetChildWindowId()); - SFX_CHILDWINDOW_REGISTRATION(ScCondFormatDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScColRowNameRangesDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScFormulaDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(SvxIMapDlgChildWindow::GetChildWindowId()); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index cef7f45bcb81..a92fca945f8b 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -52,7 +52,6 @@ #include "dbnamdlg.hxx" #include "pvlaydlg.hxx" #include "areasdlg.hxx" -#include "condfrmt.hxx" #include "rangeutl.hxx" #include "crnrdlg.hxx" #include "formula.hxx" @@ -346,20 +345,6 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( } break; - case SID_OPENDLG_CONDFRMT: - { - ScViewData* pViewData = GetViewData(); - - const ScConditionalFormat* pForm = pDoc->GetCondFormat( - pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo() ); - - // aktuelle Tabelle merken (wg. RefInput im Dialog) - pViewData->SetRefTabNo( pViewData->GetTabNo() ); - - pResult = new ScConditionalFormatDlg( pB, pCW, pParent, pDoc, pForm ); - } - break; - case SID_OPENDLG_FUNCTION: { // Dialog schaut selber, was in der Zelle steht |