diff options
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 17 | ||||
-rw-r--r-- | sc/AllLangResTarget_sc.mk | 1 | ||||
-rw-r--r-- | sc/Library_scui.mk | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 31 | ||||
-rw-r--r-- | sc/inc/scabstdlg.hxx | 7 | ||||
-rw-r--r-- | sc/inc/sccommands.h | 2 | ||||
-rw-r--r-- | sc/sdi/cellsh.sdi | 2 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 50 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 8 | ||||
-rw-r--r-- | sc/source/ui/condformat/colorformat.cxx | 143 | ||||
-rw-r--r-- | sc/source/ui/inc/colorformat.hrc | 53 | ||||
-rw-r--r-- | sc/source/ui/inc/colorformat.hxx | 73 | ||||
-rw-r--r-- | sc/source/ui/inc/reffact.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/src/colorformat.src | 174 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 27 | ||||
-rw-r--r-- | sc/uiconfig/scalc/menubar/menubar.xml | 8 |
17 files changed, 601 insertions, 15 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 9acaa25e0395..80f6c868e5a7 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -439,9 +439,24 @@ <value xml:lang="en-US">Select Row</value> </prop> </node> + <node oor:name=".uno:ConditionalFormatMenu" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">C~onditional Formatting</value> + </prop> + </node> + <node oor:name=".uno:DataBarDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Data Bar...</value> + </prop> + </node> + <node oor:name=".uno:ColorScaleDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Color Scale...</value> + </prop> + </node> <node oor:name=".uno:ConditionalFormatDialog" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">C~onditional Formatting...</value> + <value xml:lang="en-US">Conditional Formatting...</value> </prop> </node> <node oor:name=".uno:Deselect" oor:op="replace"> diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk index ba833475e278..a3a4c7e74f79 100644 --- a/sc/AllLangResTarget_sc.mk +++ b/sc/AllLangResTarget_sc.mk @@ -80,6 +80,7 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\ 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/cctrl/checklistmenu.src \ sc/source/ui/navipi/navipi.src \ sc/source/ui/docshell/tpstat.src \ diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 19adbb21145f..29ef732e662a 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -63,6 +63,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\ sc/source/ui/attrdlg/scuiexp \ sc/source/ui/attrdlg/tabpages \ sc/source/ui/cctrl/editfield \ + sc/source/ui/condformat/colorformat \ 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 1059d9c7ba5c..5ab3de4b091c 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -374,16 +374,18 @@ #define FID_COL_SHOW (FORMAT_MENU_START + 8) #define FID_TABLE_HIDE (FORMAT_MENU_START + 9) #define FID_TABLE_SHOW (FORMAT_MENU_START + 10) -#define FID_CONDITIONAL_FORMAT (FORMAT_MENU_START + 11) -#define SID_SCSTYLES (FORMAT_MENU_START + 12) -#define FID_MERGE_ON (FORMAT_MENU_START + 13) -#define FID_MERGE_OFF (FORMAT_MENU_START + 14) -#define SID_FORMATPAGE (FORMAT_MENU_START + 15) -#define SID_TEXT_STANDARD (FORMAT_MENU_START + 16) -#define SID_DRAWTEXT_ATTR_DLG (FORMAT_MENU_START + 17) -#define FID_TABLE_VISIBLE (FORMAT_MENU_START + 18) -#define FID_COL_OPT_DIRECT (FORMAT_MENU_START + 19) -#define FORMAT_MENU_END (FORMAT_MENU_START + 20) +#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) +#define SID_FORMATPAGE (FORMAT_MENU_START + 17) +#define SID_TEXT_STANDARD (FORMAT_MENU_START + 18) +#define SID_DRAWTEXT_ATTR_DLG (FORMAT_MENU_START + 19) +#define FID_TABLE_VISIBLE (FORMAT_MENU_START + 20) +#define FID_COL_OPT_DIRECT (FORMAT_MENU_START + 21) +#define FORMAT_MENU_END (FORMAT_MENU_START + 22) #define EXTRA_MENU_START (FORMAT_MENU_END) #define FID_VOICE_CONTROL (EXTRA_MENU_START + 1) @@ -420,8 +422,8 @@ #define SID_AUTO_FILTER (DATA_MENU_START + 5) #define SID_UNFILTER (DATA_MENU_START + 6) #define SID_QUERY (DATA_MENU_START + 7) -#define SID_SUBTOTALS (DATA_MENU_START + 8) -#define SID_AUTO_OUTLINE (DATA_MENU_START + 13) +#define SID_SUBTOTALS (DATA_MENU_START + 13) +#define SID_AUTO_OUTLINE (DATA_MENU_START + 14) #define SID_IMPORT_DATA (DATA_MENU_START + 15) #define SID_REIMPORT_DATA (DATA_MENU_START + 16) #define SID_PIVOT_TABLE (DATA_MENU_START + 17) @@ -1231,7 +1233,10 @@ #define RID_SCDLG_FORMULA_CALCOPTIONS (SC_DIALOGS_START + 155) #define RID_SCPAGE_SORTKEY_FIELDS (SC_DIALOGS_START + 156) #define RID_SCDLG_SORTKEY (SC_DIALOGS_START + 157) -#define SC_DIALOGS_END (SC_DIALOGS_START + 158) +#define RID_SCDLG_COLORSCALE (SC_DIALOGS_START + 158) +#define RID_SCDLG_DATABAR (SC_DIALOGS_START + 159) + +#define SC_DIALOGS_END (SC_DIALOGS_START + 160) #ifndef STD_MASKCOLOR #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 6e5d0010510e..0904646e816d 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -85,6 +85,10 @@ public: virtual sal_Bool IsRow() = 0; }; +class AbstractScDataBarSettingsDlg : public VclAbstractDialog +{ +}; + class AbstractScDataPilotDatabaseDlg :public VclAbstractDialog //add for ScDataPilotDatabaseDlg { public: @@ -347,6 +351,9 @@ public: int nId, sal_Bool bColDefault = sal_True ) = 0; virtual VclAbstractDialog * CreateScSortWarningDlg ( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ) = 0; //add for ScSortWarningDlg + + virtual AbstractScDataBarSettingsDlg* CreateScDataBarSetttingsDlg (Window* pParent ,int nId ) = 0; //add for ScDataBarSettingsDlg + virtual AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ) = 0; //add for ScDataPilotDatabaseDlg virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) = 0; //add for ScDataPilotSourceTypeDlg diff --git a/sc/inc/sccommands.h b/sc/inc/sccommands.h index 3bac2d856bc3..450f57f6ae5c 100644 --- a/sc/inc/sccommands.h +++ b/sc/inc/sccommands.h @@ -67,6 +67,7 @@ #define CMD_SID_DETECTIVE_DEL_PRED ".uno:ClearArrowPrecedents" #define CMD_SID_DETECTIVE_DEL_ALL ".uno:ClearArrows" #define CMD_SID_DELETE_CONTENTS ".uno:ClearContents" +#define CMD_SID_COLORSCALE ".uno:ColorScaleDialog" #define CMD_SID_RANGE_COL ".uno:Column" #define CMD_FID_COL_WIDTH ".uno:ColumnWidth" #define CMD_FID_CHG_COMMENT ".uno:CommentChange" @@ -77,6 +78,7 @@ #define CMD_SID_CREATE_SW_DRAWVIEW ".uno:CreateSWDrawView" #define CMD_SID_RANGE_REGION ".uno:CurrentRegion" #define CMD_SID_REFRESH_DBAREA ".uno:DataAreaRefresh" +#define CMD_SID_DATABAR ".uno:DataBarDialog" #define CMD_SID_OPENDLG_CONSOLIDATE ".uno:DataConsolidate" #define CMD_SID_OPENDLG_PIVOTTABLE ".uno:DataDataPilotRun" #define CMD_SID_AUTO_FILTER ".uno:DataFilterAutoFilter" diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index ebcf86e11e67..d70a94454d06 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -188,6 +188,8 @@ interface CellSelection SID_CANCEL [ ExecMethod = Execute; ] SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_OPENDLG_CONDFRMT [ ExecMethod = Execute; StateMethod = GetBlockState; ] + 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; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index b924b8e4deed..2850a5369527 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -1094,6 +1094,56 @@ SfxVoidItem ConditionalFormat FID_CONDITIONAL_FORMAT ] //-------------------------------------------------------------------------- +SfxVoidItem ColorScaleDialog SID_COLORSCALE +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + +//-------------------------------------------------------------------------- +SfxVoidItem DataBarDialog SID_DATABAR +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + +//-------------------------------------------------------------------------- SfxVoidItem ConditionalFormatDialog SID_OPENDLG_CONDFRMT () [ diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index bfba9f06337a..1b78cfba122c 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -79,6 +79,7 @@ #include "datafdlg.hxx" #include "tpcompatibility.hxx" #include "tpdefaults.hxx" +#include "colorformat.hxx" // ause #include "editutil.hxx" @@ -87,6 +88,7 @@ IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScColRowLabelDlg_Impl); +IMPL_ABSTDLG_BASE(AbstractScDataBarSettingsDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); @@ -766,6 +768,22 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window } +AbstractScDataBarSettingsDlg* ScAbstractDialogFactory_Impl::CreateScDataBarSetttingsDlg(Window* pParent, int nId) +{ + ScDataBarSettingsDlg* pDlg = NULL; + switch( nId ) + { + case RID_SCDLG_DATABAR: + pDlg = new ScDataBarSettingsDlg( pParent ); + break; + default: + break; + } + if(pDlg) + return new AbstractScDataBarSettingsDlg_Impl( pDlg ); + + return NULL; +} AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg (Window* pParent , diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index bb749aaffb92..2fb0a12c6f3d 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -66,6 +66,7 @@ class ScImportOptionsDlg; class SfxTabDialog; class ScSortWarningDlg; class ScTextImportOptionsDlg; +class ScDataBarSettingsDlg; #define DECL_ABSTDLG_BASE(Class,DialogClass) \ DialogClass* pDlg; \ @@ -137,6 +138,11 @@ class AbstractScColRowLabelDlg_Impl : public AbstractScColRowLabelDlg //add for virtual sal_Bool IsRow(); }; +class AbstractScDataBarSettingsDlg_Impl : public AbstractScDataBarSettingsDlg +{ + DECL_ABSTDLG_BASE(AbstractScDataBarSettingsDlg_Impl, ScDataBarSettingsDlg) +}; + class AbstractScDataPilotDatabaseDlg_Impl :public AbstractScDataPilotDatabaseDlg //add for ScDataPilotDatabaseDlg { DECL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl, ScDataPilotDatabaseDlg) @@ -415,6 +421,8 @@ public: virtual VclAbstractDialog * CreateScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ); + virtual AbstractScDataBarSettingsDlg* CreateScDataBarSetttingsDlg (Window* pParent ,int nId ); //add for ScDataBarSettingsDlg + virtual AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ); //add for ScDataPilotDatabaseDlg virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) ; //add for ScDataPilotSourceTypeDlg diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx new file mode 100644 index 000000000000..f0cba520d8f8 --- /dev/null +++ b/sc/source/ui/condformat/colorformat.cxx @@ -0,0 +1,143 @@ +/* -*- 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 "colorformat.hxx" + +#include "colorformat.hrc" + +#include <svx/xtable.hxx> +#include <svx/drawitem.hxx> + +ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow): + ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ), + maBtnOk( this, ScResId( BTN_OK ) ), + maBtnCancel( this, ScResId( BTN_CANCEL ) ), + maFlBarColors( this, ScResId( FL_BAR_COLORS ) ), + maFlAxes( this, ScResId( FL_AXIS ) ), + maFlValues( this, ScResId( FL_VALUES ) ), + maFtMin( this, ScResId( FT_MINIMUM ) ), + maFtMax( this, ScResId( FT_MAXIMUM ) ), + maFtPositive( this, ScResId( FT_POSITIVE ) ), + maFtNegative( this, ScResId( FT_NEGATIVE ) ), + maFtPosition( this, ScResId( FT_POSITION ) ), + maFtAxisColor( this, ScResId( FT_COLOR_AXIS ) ), + maLbPos( this, ScResId( LB_POS ) ), + maLbNeg( this, ScResId( LB_NEG ) ), + maLbAxisCol( this, ScResId( LB_COL_AXIS ) ), + maLbTypeMin( this, ScResId( LB_TYPE ) ), + maLbTypeMax( this, ScResId( LB_TYPE ) ), + maLbAxisPos( this, ScResId( LB_AXIS_POSITION ) ), + maEdMin( this, ScResId( ED_MIN ) ), + maEdMax( this, ScResId( ED_MAX ) ) +{ + SfxObjectShell* pDocSh = SfxObjectShell::Current(); + const SfxPoolItem* pItem = NULL; + XColorListRef pColorTable; + + DBG_ASSERT( pDocSh, "DocShell not found!" ); + + if ( pDocSh ) + { + pItem = pDocSh->GetItem( SID_COLOR_TABLE ); + if ( pItem != NULL ) + pColorTable = ( (SvxColorListItem*)pItem )->GetColorList(); + } + + DBG_ASSERT( pColorTable.is(), "ColorTable not found!" ); + + if ( pColorTable.is() ) + { + // filling the line color box + maLbPos.SetUpdateMode( false ); + maLbNeg.SetUpdateMode( false ); + maLbAxisCol.SetUpdateMode( false ); + + for ( long i = 0; i < pColorTable->Count(); ++i ) + { + XColorEntry* pEntry = pColorTable->GetColor(i); + maLbPos.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + maLbNeg.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + maLbAxisCol.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + + if(pEntry->GetColor() == Color(COL_LIGHTRED)) + maLbNeg.SelectEntryPos(i); + if(pEntry->GetColor() == Color(COL_BLACK)) + maLbAxisCol.SelectEntryPos(i); + if(pEntry->GetColor() == Color(COL_LIGHTBLUE)) + maLbPos.SelectEntryPos(i); + } + maLbPos.SetUpdateMode( sal_True ); + maLbNeg.SetUpdateMode( sal_True ); + maLbAxisCol.SetUpdateMode( sal_True ); + } + FreeResource(); + + maLbTypeMin.SelectEntryPos(0); + maLbTypeMax.SelectEntryPos(1); + maLbAxisPos.SelectEntryPos(0); + maBtnOk.SetClickHdl( LINK( this, ScDataBarSettingsDlg, OkBtnHdl ) ); + + Point aPoint = maLbTypeMax.GetPosPixel(); + aPoint.Y() += 50; + maLbTypeMax.SetPosPixel(aPoint); +} + +IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl ) +{ + //check that min < max + bool bWarn = false; + if(maLbTypeMin.GetSelectEntryPos() == 1) + bWarn = true; + if(maLbTypeMax.GetSelectEntryPos() == 0) + bWarn = true; + + if(!bWarn && maLbTypeMin.GetSelectEntryPos() == maLbTypeMax.GetSelectEntryPos()) + { + if(maLbTypeMax.GetSelectEntryPos() != 5) + { + rtl::OUString aMinString = maEdMin.GetText(); + rtl::OUString aMaxString = maEdMax.GetText(); + double nMinValue = rtl::math::stringToDouble(aMinString, '.', ','); + double nMaxValue = rtl::math::stringToDouble(aMaxString, '.', ','); + if(rtl::math::approxEqual(nMinValue, nMaxValue) || nMinValue > nMaxValue) + bWarn = true; + } + } + + if(bWarn) + { + //show warning message and don't close + } + else + { + Close(); + } + return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/colorformat.hrc b/sc/source/ui/inc/colorformat.hrc new file mode 100644 index 000000000000..fc27609cc678 --- /dev/null +++ b/sc/source/ui/inc/colorformat.hrc @@ -0,0 +1,53 @@ +/* -*- 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) 2011 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 FL_BAR_COLORS 10 +#define FL_AXIS 11 +#define FL_VALUES 12 +#define FT_MINIMUM 13 +#define FT_MAXIMUM 14 +#define FT_POSITIVE 15 +#define FT_NEGATIVE 16 +#define FT_POSITION 17 +#define FT_COLOR_AXIS 18 +#define LB_POS 19 +#define LB_NEG 20 +#define LB_COL_AXIS 21 + +#define LB_TYPE 22 +#define LB_AXIS_POSITION 23 + +#define ED_MIN 24 +#define ED_MAX 25 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx new file mode 100644 index 000000000000..2c43548c52c4 --- /dev/null +++ b/sc/source/ui/inc/colorformat.hxx @@ -0,0 +1,73 @@ +/* -*- 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/fixed.hxx> +#include <svtools/ctrlbox.hxx> +#include "anyrefdg.hxx" + +class ScColorScaleSettingsDlg : public ModalDialog +{ + +}; + +class ScDataBarSettingsDlg : public ModalDialog +{ +private: + OKButton maBtnOk; + CancelButton maBtnCancel; + FixedLine maFlBarColors; + FixedLine maFlAxes; + FixedLine maFlValues; + + FixedText maFtMin; + FixedText maFtMax; + FixedText maFtPositive; + FixedText maFtNegative; + FixedText maFtPosition; + FixedText maFtAxisColor; + + ColorListBox maLbPos; + ColorListBox maLbNeg; + ColorListBox maLbAxisCol; + + ListBox maLbTypeMin; + ListBox maLbTypeMax; + ListBox maLbAxisPos; + + Edit maEdMin; + Edit maEdMax; + + DECL_LINK(OkBtnHdl, void*); + +public: + ScDataBarSettingsDlg(Window* pParent); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index 63e55ef769c2..9e1a919b298e 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -56,6 +56,7 @@ 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/colorformat.src b/sc/source/ui/src/colorformat.src new file mode 100644 index 000000000000..18cd823a7df0 --- /dev/null +++ b/sc/source/ui/src/colorformat.src @@ -0,0 +1,174 @@ +/* -*- 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) 2011 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 "colorformat.hrc" + +ModalDialog RID_SCDLG_DATABAR +{ + OutputSize = TRUE; + Hide = TRUE; + Size = MAP_APPFONT ( 200, 200 ); + Text [ en-US ] = "Data Bar"; + 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; + }; + FixedLine FL_VALUES + { + Pos = MAP_APPFONT( 5, 5 ); + Size = MAP_APPFONT( 190, 10 ); + Text [ en-US ] = "Bar Colors"; + }; + FixedLine FL_BAR_COLORS + { + Pos = MAP_APPFONT( 5, 60 ); + Size = MAP_APPFONT( 190, 10 ); + Text [ en-US ] = "Bar Colors"; + }; + FixedLine FL_AXIS + { + Pos = MAP_APPFONT( 5, 120 ); + Size = MAP_APPFONT( 190, 10 ); + Text [ en-US ] = "Axis"; + }; + FixedText FT_MINIMUM + { + Pos = MAP_APPFONT( 10, 20 ); + Size = MAP_APPFONT( 50, 14 ); + Text [ en-US ] = "Minimum:"; + }; + FixedText FT_MAXIMUM + { + Pos = MAP_APPFONT( 10, 40 ); + Size = MAP_APPFONT( 50, 14 ); + Text [ en-US ] = "Maximum:"; + }; + FixedText FT_POSITIVE + { + Pos = MAP_APPFONT( 10, 75 ); + Size = MAP_APPFONT( 50, 14 ); + Text [ en-US ] = "Positive:"; + }; + FixedText FT_NEGATIVE + { + Pos = MAP_APPFONT( 10, 95 ); + Size = MAP_APPFONT( 50, 14 ); + Text [ en-US ] = "Negative:"; + }; + FixedText FT_POSITION + { + Pos = MAP_APPFONT( 10, 135 ); + Size = MAP_APPFONT( 70, 14 ); + Text [ en-US ] = "Position of vertical axis"; + }; + FixedText FT_COLOR_AXIS + { + Pos = MAP_APPFONT( 10, 155 ); + Size = MAP_APPFONT( 70, 14 ); + Text [ en-US ] = "Color of vertical axis"; + }; + ListBox LB_POS + { + Pos = MAP_APPFONT( 80, 75 ); + Size = MAP_APPFONT( 60, 50 ); + Border = TRUE; + DropDown = TRUE; + DDExtraWidth = TRUE; + }; + ListBox LB_NEG + { + Pos = MAP_APPFONT( 80, 95 ); + Size = MAP_APPFONT( 60, 50 ); + Border = TRUE; + DropDown = TRUE; + DDExtraWidth = TRUE; + }; + ListBox LB_COL_AXIS + { + Pos = MAP_APPFONT( 100, 155 ); + Size = MAP_APPFONT( 60, 50 ); + Border = TRUE; + DropDown = TRUE; + DDExtraWidth = TRUE; + }; + ListBox LB_TYPE + { + Pos = MAP_APPFONT( 80, 20 ); + Size = MAP_APPFONT( 50, 50 ); + Border = TRUE; + DropDown = TRUE; + StringList [ en-US ] = + { + "Minimum"; + "Maximum"; + "Percent"; + "Percentile"; + "Value"; + "Formula"; + }; + }; + ListBox LB_AXIS_POSITION + { + Pos = MAP_APPFONT( 100, 135 ); + Size = MAP_APPFONT( 50, 50 ); + Border = TRUE; + DropDown = TRUE; + StringList [ en-US ] = + { + "Automatic"; + "Middle"; + "None"; + }; + }; + Edit ED_MIN + { + Pos = MAP_APPFONT( 140, 21 ); + Size = MAP_APPFONT( 40, 12 ); + TabStop = TRUE; + Border = TRUE; + }; + Edit ED_MAX + { + Pos = MAP_APPFONT( 140, 41 ); + Size = MAP_APPFONT( 40, 12 ); + TabStop = TRUE; + Border = TRUE; + }; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 1588e4080c84..32a8bc87cf68 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2069,6 +2069,33 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; + case SID_COLORSCALE: + { + ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); + + AbstractScDataBarSettingsDlg* pDlg = pFact->CreateScDataBarSetttingsDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_DATABAR ); + OSL_ENSURE(pDlg, "Dialog create fail!"); + pDlg->Execute(); + delete pDlg; + } + break; + + case SID_DATABAR: + { + ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); + OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); + + AbstractScDataBarSettingsDlg* pDlg = pFact->CreateScDataBarSetttingsDlg( pTabViewShell->GetDialogParent(), RID_SCDLG_DATABAR ); + OSL_ENSURE(pDlg, "Dialog create fail!"); + if(pDlg->Execute() == RET_OK) + { + //add here code that handles the data bar inserting + } + delete pDlg; + } + break; + case SID_EXTERNAL_SOURCE: { String aFile; diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index ce3e3f234785..ec7c6886dd1a 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -259,7 +259,13 @@ </menu:menu> <menu:menuitem menu:id=".uno:DesignerDialog"/> <menu:menuitem menu:id=".uno:AutoFormat"/> - <menu:menuitem menu:id=".uno:ConditionalFormatDialog"/> + <menu:menu menu:id=".uno:ConditionalFormatMenu"> + <menu:menupopup> + <menu:menuitem menu:id="uno:DataBarDialog"/> + <menu:menuitem menu:id="uno:ColorScaleDialog"/> + <menu:menuitem menu:id="uno:ConditionalFormatDialog"/> + </menu:menupopup> + </menu:menu> <menu:menuseparator/> <menu:menu menu:id=".uno:AnchorMenu"> <menu:menupopup> |