Kaydet (Commit) 17675467 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

data bar settings menu

Change-Id: I7cf3604392b04c2fdd5070caebf9f9dc1ce178c8
üst 1e26c563
...@@ -439,9 +439,24 @@ ...@@ -439,9 +439,24 @@
<value xml:lang="en-US">Select Row</value> <value xml:lang="en-US">Select Row</value>
</prop> </prop>
</node> </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"> <node oor:name=".uno:ConditionalFormatDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string"> <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> </prop>
</node> </node>
<node oor:name=".uno:Deselect" oor:op="replace"> <node oor:name=".uno:Deselect" oor:op="replace">
......
...@@ -80,6 +80,7 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\ ...@@ -80,6 +80,7 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/src/sortdlg.src \ sc/source/ui/src/sortdlg.src \
sc/source/ui/src/attrdlg.src \ sc/source/ui/src/attrdlg.src \
sc/source/ui/src/filter.src \ sc/source/ui/src/filter.src \
sc/source/ui/src/colorformat.src \
sc/source/ui/cctrl/checklistmenu.src \ sc/source/ui/cctrl/checklistmenu.src \
sc/source/ui/navipi/navipi.src \ sc/source/ui/navipi/navipi.src \
sc/source/ui/docshell/tpstat.src \ sc/source/ui/docshell/tpstat.src \
......
...@@ -63,6 +63,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\ ...@@ -63,6 +63,7 @@ $(eval $(call gb_Library_add_exception_objects,scui,\
sc/source/ui/attrdlg/scuiexp \ sc/source/ui/attrdlg/scuiexp \
sc/source/ui/attrdlg/tabpages \ sc/source/ui/attrdlg/tabpages \
sc/source/ui/cctrl/editfield \ sc/source/ui/cctrl/editfield \
sc/source/ui/condformat/colorformat \
sc/source/ui/dbgui/dapidata \ sc/source/ui/dbgui/dapidata \
sc/source/ui/dbgui/dapitype \ sc/source/ui/dbgui/dapitype \
sc/source/ui/dbgui/dpgroupdlg \ sc/source/ui/dbgui/dpgroupdlg \
......
...@@ -374,16 +374,18 @@ ...@@ -374,16 +374,18 @@
#define FID_COL_SHOW (FORMAT_MENU_START + 8) #define FID_COL_SHOW (FORMAT_MENU_START + 8)
#define FID_TABLE_HIDE (FORMAT_MENU_START + 9) #define FID_TABLE_HIDE (FORMAT_MENU_START + 9)
#define FID_TABLE_SHOW (FORMAT_MENU_START + 10) #define FID_TABLE_SHOW (FORMAT_MENU_START + 10)
#define FID_CONDITIONAL_FORMAT (FORMAT_MENU_START + 11) #define SID_COLORSCALE (FORMAT_MENU_START + 11)
#define SID_SCSTYLES (FORMAT_MENU_START + 12) #define SID_DATABAR (FORMAT_MENU_START + 12)
#define FID_MERGE_ON (FORMAT_MENU_START + 13) #define FID_CONDITIONAL_FORMAT (FORMAT_MENU_START + 13)
#define FID_MERGE_OFF (FORMAT_MENU_START + 14) #define SID_SCSTYLES (FORMAT_MENU_START + 14)
#define SID_FORMATPAGE (FORMAT_MENU_START + 15) #define FID_MERGE_ON (FORMAT_MENU_START + 15)
#define SID_TEXT_STANDARD (FORMAT_MENU_START + 16) #define FID_MERGE_OFF (FORMAT_MENU_START + 16)
#define SID_DRAWTEXT_ATTR_DLG (FORMAT_MENU_START + 17) #define SID_FORMATPAGE (FORMAT_MENU_START + 17)
#define FID_TABLE_VISIBLE (FORMAT_MENU_START + 18) #define SID_TEXT_STANDARD (FORMAT_MENU_START + 18)
#define FID_COL_OPT_DIRECT (FORMAT_MENU_START + 19) #define SID_DRAWTEXT_ATTR_DLG (FORMAT_MENU_START + 19)
#define FORMAT_MENU_END (FORMAT_MENU_START + 20) #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 EXTRA_MENU_START (FORMAT_MENU_END)
#define FID_VOICE_CONTROL (EXTRA_MENU_START + 1) #define FID_VOICE_CONTROL (EXTRA_MENU_START + 1)
...@@ -420,8 +422,8 @@ ...@@ -420,8 +422,8 @@
#define SID_AUTO_FILTER (DATA_MENU_START + 5) #define SID_AUTO_FILTER (DATA_MENU_START + 5)
#define SID_UNFILTER (DATA_MENU_START + 6) #define SID_UNFILTER (DATA_MENU_START + 6)
#define SID_QUERY (DATA_MENU_START + 7) #define SID_QUERY (DATA_MENU_START + 7)
#define SID_SUBTOTALS (DATA_MENU_START + 8) #define SID_SUBTOTALS (DATA_MENU_START + 13)
#define SID_AUTO_OUTLINE (DATA_MENU_START + 13) #define SID_AUTO_OUTLINE (DATA_MENU_START + 14)
#define SID_IMPORT_DATA (DATA_MENU_START + 15) #define SID_IMPORT_DATA (DATA_MENU_START + 15)
#define SID_REIMPORT_DATA (DATA_MENU_START + 16) #define SID_REIMPORT_DATA (DATA_MENU_START + 16)
#define SID_PIVOT_TABLE (DATA_MENU_START + 17) #define SID_PIVOT_TABLE (DATA_MENU_START + 17)
...@@ -1231,7 +1233,10 @@ ...@@ -1231,7 +1233,10 @@
#define RID_SCDLG_FORMULA_CALCOPTIONS (SC_DIALOGS_START + 155) #define RID_SCDLG_FORMULA_CALCOPTIONS (SC_DIALOGS_START + 155)
#define RID_SCPAGE_SORTKEY_FIELDS (SC_DIALOGS_START + 156) #define RID_SCPAGE_SORTKEY_FIELDS (SC_DIALOGS_START + 156)
#define RID_SCDLG_SORTKEY (SC_DIALOGS_START + 157) #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 #ifndef STD_MASKCOLOR
#define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; } #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }
......
...@@ -85,6 +85,10 @@ public: ...@@ -85,6 +85,10 @@ public:
virtual sal_Bool IsRow() = 0; virtual sal_Bool IsRow() = 0;
}; };
class AbstractScDataBarSettingsDlg : public VclAbstractDialog
{
};
class AbstractScDataPilotDatabaseDlg :public VclAbstractDialog //add for ScDataPilotDatabaseDlg class AbstractScDataPilotDatabaseDlg :public VclAbstractDialog //add for ScDataPilotDatabaseDlg
{ {
public: public:
...@@ -347,6 +351,9 @@ public: ...@@ -347,6 +351,9 @@ public:
int nId, int nId,
sal_Bool bColDefault = sal_True ) = 0; sal_Bool bColDefault = sal_True ) = 0;
virtual VclAbstractDialog * CreateScSortWarningDlg ( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ) = 0; //add for ScSortWarningDlg 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 AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ) = 0; //add for ScDataPilotDatabaseDlg
virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) = 0; //add for ScDataPilotSourceTypeDlg virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) = 0; //add for ScDataPilotSourceTypeDlg
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#define CMD_SID_DETECTIVE_DEL_PRED ".uno:ClearArrowPrecedents" #define CMD_SID_DETECTIVE_DEL_PRED ".uno:ClearArrowPrecedents"
#define CMD_SID_DETECTIVE_DEL_ALL ".uno:ClearArrows" #define CMD_SID_DETECTIVE_DEL_ALL ".uno:ClearArrows"
#define CMD_SID_DELETE_CONTENTS ".uno:ClearContents" #define CMD_SID_DELETE_CONTENTS ".uno:ClearContents"
#define CMD_SID_COLORSCALE ".uno:ColorScaleDialog"
#define CMD_SID_RANGE_COL ".uno:Column" #define CMD_SID_RANGE_COL ".uno:Column"
#define CMD_FID_COL_WIDTH ".uno:ColumnWidth" #define CMD_FID_COL_WIDTH ".uno:ColumnWidth"
#define CMD_FID_CHG_COMMENT ".uno:CommentChange" #define CMD_FID_CHG_COMMENT ".uno:CommentChange"
...@@ -77,6 +78,7 @@ ...@@ -77,6 +78,7 @@
#define CMD_SID_CREATE_SW_DRAWVIEW ".uno:CreateSWDrawView" #define CMD_SID_CREATE_SW_DRAWVIEW ".uno:CreateSWDrawView"
#define CMD_SID_RANGE_REGION ".uno:CurrentRegion" #define CMD_SID_RANGE_REGION ".uno:CurrentRegion"
#define CMD_SID_REFRESH_DBAREA ".uno:DataAreaRefresh" #define CMD_SID_REFRESH_DBAREA ".uno:DataAreaRefresh"
#define CMD_SID_DATABAR ".uno:DataBarDialog"
#define CMD_SID_OPENDLG_CONSOLIDATE ".uno:DataConsolidate" #define CMD_SID_OPENDLG_CONSOLIDATE ".uno:DataConsolidate"
#define CMD_SID_OPENDLG_PIVOTTABLE ".uno:DataDataPilotRun" #define CMD_SID_OPENDLG_PIVOTTABLE ".uno:DataDataPilotRun"
#define CMD_SID_AUTO_FILTER ".uno:DataFilterAutoFilter" #define CMD_SID_AUTO_FILTER ".uno:DataFilterAutoFilter"
......
...@@ -188,6 +188,8 @@ interface CellSelection ...@@ -188,6 +188,8 @@ interface CellSelection
SID_CANCEL [ ExecMethod = Execute; ] SID_CANCEL [ ExecMethod = Execute; ]
SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_OPENDLG_CONDFRMT [ ExecMethod = Execute; StateMethod = GetBlockState; ] SID_OPENDLG_CONDFRMT [ ExecMethod = Execute; StateMethod = GetBlockState; ]
SID_COLORSCALE [ ExecMethod = ExecuteEdit; ]
SID_DATABAR [ ExecMethod = ExecuteEdit; ]
FID_CONDITIONAL_FORMAT [ ExecMethod = ExecuteEdit; ] FID_CONDITIONAL_FORMAT [ ExecMethod = ExecuteEdit; ]
FID_NOTE_VISIBLE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] FID_NOTE_VISIBLE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
SID_DELETE_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_DELETE_NOTE [ ExecMethod = ExecuteEdit; StateMethod = GetState; ]
......
...@@ -1093,6 +1093,56 @@ SfxVoidItem ConditionalFormat FID_CONDITIONAL_FORMAT ...@@ -1093,6 +1093,56 @@ SfxVoidItem ConditionalFormat FID_CONDITIONAL_FORMAT
GroupId = GID_INTERN; GroupId = GID_INTERN;
] ]
//--------------------------------------------------------------------------
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 SfxVoidItem ConditionalFormatDialog SID_OPENDLG_CONDFRMT
() ()
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
#include "datafdlg.hxx" #include "datafdlg.hxx"
#include "tpcompatibility.hxx" #include "tpcompatibility.hxx"
#include "tpdefaults.hxx" #include "tpdefaults.hxx"
#include "colorformat.hxx"
// ause // ause
#include "editutil.hxx" #include "editutil.hxx"
...@@ -87,6 +88,7 @@ IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); ...@@ -87,6 +88,7 @@ IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScColRowLabelDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScColRowLabelDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDataBarSettingsDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl);
...@@ -766,6 +768,22 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window ...@@ -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 , AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg (Window* pParent ,
......
...@@ -66,6 +66,7 @@ class ScImportOptionsDlg; ...@@ -66,6 +66,7 @@ class ScImportOptionsDlg;
class SfxTabDialog; class SfxTabDialog;
class ScSortWarningDlg; class ScSortWarningDlg;
class ScTextImportOptionsDlg; class ScTextImportOptionsDlg;
class ScDataBarSettingsDlg;
#define DECL_ABSTDLG_BASE(Class,DialogClass) \ #define DECL_ABSTDLG_BASE(Class,DialogClass) \
DialogClass* pDlg; \ DialogClass* pDlg; \
...@@ -137,6 +138,11 @@ class AbstractScColRowLabelDlg_Impl : public AbstractScColRowLabelDlg //add for ...@@ -137,6 +138,11 @@ class AbstractScColRowLabelDlg_Impl : public AbstractScColRowLabelDlg //add for
virtual sal_Bool IsRow(); virtual sal_Bool IsRow();
}; };
class AbstractScDataBarSettingsDlg_Impl : public AbstractScDataBarSettingsDlg
{
DECL_ABSTDLG_BASE(AbstractScDataBarSettingsDlg_Impl, ScDataBarSettingsDlg)
};
class AbstractScDataPilotDatabaseDlg_Impl :public AbstractScDataPilotDatabaseDlg //add for ScDataPilotDatabaseDlg class AbstractScDataPilotDatabaseDlg_Impl :public AbstractScDataPilotDatabaseDlg //add for ScDataPilotDatabaseDlg
{ {
DECL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl, ScDataPilotDatabaseDlg) DECL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl, ScDataPilotDatabaseDlg)
...@@ -415,6 +421,8 @@ public: ...@@ -415,6 +421,8 @@ public:
virtual VclAbstractDialog * CreateScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ); 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 AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ); //add for ScDataPilotDatabaseDlg
virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) ; //add for ScDataPilotSourceTypeDlg virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) ; //add for ScDataPilotSourceTypeDlg
......
/* -*- 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: */
/* -*- 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: */
/* -*- 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: */
...@@ -56,6 +56,7 @@ DECL_WRAPPER(ScDbNameDlgWrapper) ...@@ -56,6 +56,7 @@ DECL_WRAPPER(ScDbNameDlgWrapper)
DECL_WRAPPER(ScConsolidateDlgWrapper) DECL_WRAPPER(ScConsolidateDlgWrapper)
DECL_WRAPPER(ScPrintAreasDlgWrapper) DECL_WRAPPER(ScPrintAreasDlgWrapper)
DECL_WRAPPER(ScCondFormatDlgWrapper) DECL_WRAPPER(ScCondFormatDlgWrapper)
DECL_WRAPPER(ScDataBarSettingDlgWrapper)
DECL_WRAPPER(ScColRowNameRangesDlgWrapper) DECL_WRAPPER(ScColRowNameRangesDlgWrapper)
DECL_WRAPPER(ScFormulaDlgWrapper) DECL_WRAPPER(ScFormulaDlgWrapper)
DECL_WRAPPER(ScHighlightChgDlgWrapper) DECL_WRAPPER(ScHighlightChgDlgWrapper)
......
/* -*- 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: */
...@@ -2069,6 +2069,33 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ...@@ -2069,6 +2069,33 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
} }
break; 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: case SID_EXTERNAL_SOURCE:
{ {
String aFile; String aFile;
......
...@@ -259,7 +259,13 @@ ...@@ -259,7 +259,13 @@
</menu:menu> </menu:menu>
<menu:menuitem menu:id=".uno:DesignerDialog"/> <menu:menuitem menu:id=".uno:DesignerDialog"/>
<menu:menuitem menu:id=".uno:AutoFormat"/> <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:menuseparator/>
<menu:menu menu:id=".uno:AnchorMenu"> <menu:menu menu:id=".uno:AnchorMenu">
<menu:menupopup> <menu:menupopup>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment