summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-05 10:06:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-05 11:36:35 +0000
commite401b9c8243af61d4b2889d38e8390e8971099f2 (patch)
tree62131a8864309262e4b8bb461a940183a35522f4 /sc
parent258e6f93e81539d90b23f45224dd225a6e20ab0d (diff)
convert scenario dialog to .ui
Change-Id: I66f7fe04155ad4c6e42e6aa96bb2db71ba4f682f
Diffstat (limited to 'sc')
-rw-r--r--sc/AllLangResTarget_sc.mk1
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/inc/sc.hrc1
-rw-r--r--sc/inc/scabstdlg.hxx1
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx20
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx1
-rw-r--r--sc/source/ui/dbgui/scendlg.cxx151
-rw-r--r--sc/source/ui/dbgui/scendlg.hrc52
-rw-r--r--sc/source/ui/dbgui/scendlg.src165
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
-rw-r--r--sc/source/ui/inc/scendlg.hxx27
-rw-r--r--sc/source/ui/view/cellsh3.cxx2
-rw-r--r--sc/uiconfig/scalc/ui/scenariodialog.ui382
13 files changed, 455 insertions, 351 deletions
diff --git a/sc/AllLangResTarget_sc.mk b/sc/AllLangResTarget_sc.mk
index b312bba81783..e56cafc90730 100644
--- a/sc/AllLangResTarget_sc.mk
+++ b/sc/AllLangResTarget_sc.mk
@@ -53,7 +53,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/dbgui/dpgroupdlg.src \
sc/source/ui/dbgui/pvfundlg.src \
sc/source/ui/dbgui/dapitype.src \
- sc/source/ui/dbgui/scendlg.src \
sc/source/ui/dbgui/validate.src \
sc/source/ui/drawfunc/drformsh.src \
sc/source/ui/drawfunc/objdraw.src \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index e0cd10795f41..0e9c1fd82c0b 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -133,6 +133,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/rowheightdialog \
sc/uiconfig/scalc/ui/samplingdialog \
sc/uiconfig/scalc/ui/standardfilterdialog \
+ sc/uiconfig/scalc/ui/scenariodialog \
sc/uiconfig/scalc/ui/scgeneralpage \
sc/uiconfig/scalc/ui/searchresults \
sc/uiconfig/scalc/ui/selectdatasource \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 3bdad835c746..a733aec73160 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1014,7 +1014,6 @@
#define RID_SCDLG_PIVOTFILTER (SC_DIALOGS_START + 33)
#define RID_SCDLG_PIVOT_LAYOUT (SC_DIALOGS_START + 34)
#define RID_SCDLG_CONSOLIDATE (SC_DIALOGS_START + 35)
-#define RID_SCDLG_NEWSCENARIO (SC_DIALOGS_START + 39)
#define RID_SCDLG_INSERT_TABLE (SC_DIALOGS_START + 42)
#define RID_SCPAGE_AREAS (SC_DIALOGS_START + 44)
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 0861d60fb145..39fd50cc7b84 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -442,7 +442,6 @@ public:
sal_uInt16 nOrient ) = 0;
virtual AbstractScNewScenarioDlg * CreateScNewScenarioDlg ( Window* pParent, const OUString& rName,
- int nId,
sal_Bool bEdit = false, sal_Bool bSheetProtected = false ) = 0;
virtual AbstractScShowTabDlg * CreateScShowTabDlg(Window* pParent) = 0;
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index f9e146c2bacc..381e8681de67 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -901,23 +901,11 @@ AbstractScDPShowDetailDlg * ScAbstractDialogFactory_Impl::CreateScDPShowDetailDl
return 0;
}
-AbstractScNewScenarioDlg * ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg ( Window* pParent, const OUString& rName,
- int nId,
- sal_Bool bEdit , sal_Bool bSheetProtected )
+AbstractScNewScenarioDlg * ScAbstractDialogFactory_Impl::CreateScNewScenarioDlg(Window* pParent, const OUString& rName,
+ sal_Bool bEdit, sal_Bool bSheetProtected)
{
- ScNewScenarioDlg * pDlg=NULL;
- switch ( nId )
- {
- case RID_SCDLG_NEWSCENARIO :
- pDlg = new ScNewScenarioDlg( pParent, rName, bEdit,bSheetProtected );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractScNewScenarioDlg_Impl( pDlg );
- return 0;
+ ScNewScenarioDlg *pDlg = new ScNewScenarioDlg(pParent, rName, bEdit, bSheetProtected);
+ return new AbstractScNewScenarioDlg_Impl( pDlg );
}
AbstractScShowTabDlg * ScAbstractDialogFactory_Impl::CreateScShowTabDlg(Window* pParent)
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index c414cbe2274e..141fd5e04d20 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -511,7 +511,6 @@ public:
sal_uInt16 nOrient );
virtual AbstractScNewScenarioDlg * CreateScNewScenarioDlg ( Window* pParent, const OUString& rName,
- int nId,
sal_Bool bEdit = false, sal_Bool bSheetProtected = false );
virtual AbstractScShowTabDlg * CreateScShowTabDlg(Window* pParent);
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index 4499e72ba11d..2d55288aba07 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -37,35 +37,31 @@
#include "viewdata.hxx"
#include "document.hxx"
#include "scresid.hxx"
-#include "scendlg.hrc"
#include "scendlg.hxx"
//========================================================================
ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const OUString& rName, sal_Bool bEdit, sal_Bool bSheetProtected)
- : ModalDialog ( pParent, ScResId( RID_SCDLG_NEWSCENARIO ) ),
- aFlName ( this, ScResId( FL_NAME )),
- aEdName ( this, ScResId( ED_NAME ) ),
- aFlComment ( this, ScResId( FL_COMMENT ) ),
- aEdComment ( this, ScResId( ED_COMMENT ) ),
- aFlOptions ( this, ScResId( FL_OPTIONS ) ),
- aCbShowFrame ( this, ScResId( CB_SHOWFRAME ) ),
- aLbColor ( this, ScResId( LB_COLOR ) ),
- //aCbPrintFrame ( this, ScResId( CB_PRINTFRAME ) ),
- aCbTwoWay ( this, ScResId( CB_TWOWAY ) ),
- //aCbAttrib ( this, ScResId( CB_ATTRIB ) ),
- //aCbValue ( this, ScResId( CB_VALUE ) ),
- aCbCopyAll ( this, ScResId( CB_COPYALL ) ),
- aCbProtect ( this, ScResId( CB_PROTECT ) ),
- aBtnOk ( this, ScResId( BTN_OK ) ),
- aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
- aBtnHelp ( this, ScResId( BTN_HELP ) ),
- aDefScenarioName( rName ),
- bIsEdit ( bEdit )
+ : ModalDialog(pParent, "ScenarioDialog",
+ "modules/scalc/ui/scenariodialog.ui")
+ , aDefScenarioName(rName)
+ , bIsEdit(bEdit)
{
+ get(m_pEdName, "name");
+ get(m_pEdComment, "comment");
+ Size aSize(m_pEdComment->LogicToPixel(Size(183, 46), MAP_APPFONT));
+ m_pEdComment->set_width_request(aSize.Width());
+ m_pEdComment->set_height_request(aSize.Height());
+ get(m_pCbShowFrame, "showframe");
+ get(m_pLbColor, "bordercolor");
+ get(m_pCbTwoWay, "copyback");
+ get(m_pCbCopyAll, "copysheet");
+ get(m_pCbProtect, "preventchanges");
+ get(m_pBtnOk, "ok");
+
if (bIsEdit)
- SetText(OUString(ScResId(STR_EDIT)));
+ SetText(get<FixedText>("alttitle")->GetText());
SfxObjectShell* pDocSh = SfxObjectShell::Current();
if ( pDocSh )
@@ -76,65 +72,45 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const OUString& rName, sal_
XColorListRef pColorList = ((SvxColorListItem*)pItem)->GetColorList();
if (pColorList.is())
{
- aLbColor.SetUpdateMode( false );
+ m_pLbColor->SetUpdateMode( false );
long nCount = pColorList->Count();
for ( long n=0; n<nCount; n++ )
{
XColorEntry* pEntry = pColorList->GetColor(n);
- aLbColor.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
+ m_pLbColor->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
- aLbColor.SetUpdateMode( sal_True );
+ m_pLbColor->SetUpdateMode( sal_True );
}
}
}
SvtUserOptions aUserOpt;
- OUString aComment(OUString(ScResId(STR_CREATEDBY)) + " " + aUserOpt.GetFirstName() + " " +aUserOpt.GetLastName()
- + ", " + OUString(ScResId(STR_ON)) + " " + ScGlobal::GetpLocaleData()->getDate(Date(Date::SYSTEM))
- + ", " + ScGlobal::GetpLocaleData()->getTime(Time(Time::SYSTEM)));
-
- aEdComment.SetText(aComment);
- aEdName.SetText(rName);
- aBtnOk.SetClickHdl( LINK( this, ScNewScenarioDlg, OkHdl ) );
- aCbShowFrame.SetClickHdl( LINK( this, ScNewScenarioDlg, EnableHdl ) );
+ OUString sCreatedBy(get<FixedText>("createdft")->GetText());
+ OUString sOn(get<FixedText>("onft")->GetText());
- aLbColor.SetAccessibleName(OUString(ScResId( STR_COLOR ) ));
+ OUString aComment(sCreatedBy + " " + aUserOpt.GetFirstName() + " " +aUserOpt.GetLastName()
+ + ", " + sOn + " " + ScGlobal::GetpLocaleData()->getDate(Date(Date::SYSTEM))
+ + ", " + ScGlobal::GetpLocaleData()->getTime(Time(Time::SYSTEM)));
- FreeResource();
+ m_pEdComment->SetText(aComment);
+ m_pEdName->SetText(rName);
+ m_pBtnOk->SetClickHdl( LINK( this, ScNewScenarioDlg, OkHdl ) );
+ m_pCbShowFrame->SetClickHdl( LINK( this, ScNewScenarioDlg, EnableHdl ) );
- aLbColor.SelectEntry( Color( COL_LIGHTGRAY ) );
- aCbShowFrame.Check(sal_True);
- //aCbPrintFrame.Check(sal_True);
- aCbTwoWay.Check(sal_True);
- //aCbAttrib.Check(sal_False);
- //aCbValue.Check(sal_False);
- aCbCopyAll.Check(false);
- aCbProtect.Check(sal_True);
+ m_pLbColor->SelectEntry( Color( COL_LIGHTGRAY ) );
+ m_pCbShowFrame->Check(sal_True);
+ m_pCbTwoWay->Check(sal_True);
+ m_pCbCopyAll->Check(false);
+ m_pCbProtect->Check(sal_True);
if (bIsEdit)
- aCbCopyAll.Enable(false);
+ m_pCbCopyAll->Enable(false);
// If the Sheet is protected then we disable the Scenario Protect input
// and default it to true above. Note we are in 'Add' mode here as: if
// Sheet && scenario protection are true, then we cannot edit this dialog.
if (bSheetProtected)
- aCbProtect.Enable(false);
-
- //! die drei funktionieren noch nicht...
- /*
- aCbPrintFrame.Enable(sal_False);
- aCbAttrib.Enable(sal_False);
- aCbValue.Enable(sal_False);
- */
-
- aEdComment.SetAccessibleRelationMemberOf(&aFlComment);
- aLbColor.SetAccessibleRelationLabeledBy(&aCbShowFrame);
-}
-
-//------------------------------------------------------------------------
-
-ScNewScenarioDlg::~ScNewScenarioDlg()
-{
+ m_pCbProtect->Enable(false);
}
//------------------------------------------------------------------------
@@ -142,31 +118,21 @@ ScNewScenarioDlg::~ScNewScenarioDlg()
void ScNewScenarioDlg::GetScenarioData( OUString& rName, OUString& rComment,
Color& rColor, sal_uInt16& rFlags ) const
{
- rComment = aEdComment.GetText();
- rName = aEdName.GetText();
+ rComment = m_pEdComment->GetText();
+ rName = m_pEdName->GetText();
if (rName.isEmpty())
rName = aDefScenarioName;
- rColor = aLbColor.GetSelectEntryColor();
+ rColor = m_pLbColor->GetSelectEntryColor();
sal_uInt16 nBits = 0;
- if (aCbShowFrame.IsChecked())
+ if (m_pCbShowFrame->IsChecked())
nBits |= SC_SCENARIO_SHOWFRAME;
- /*
- if (aCbPrintFrame.IsChecked())
- nBits |= SC_SCENARIO_PRINTFRAME;
- */
- if (aCbTwoWay.IsChecked())
+ if (m_pCbTwoWay->IsChecked())
nBits |= SC_SCENARIO_TWOWAY;
- /*
- if (aCbAttrib.IsChecked())
- nBits |= SC_SCENARIO_ATTRIB;
- if (aCbValue.IsChecked())
- nBits |= SC_SCENARIO_VALUE;
- */
- if (aCbCopyAll.IsChecked())
+ if (m_pCbCopyAll->IsChecked())
nBits |= SC_SCENARIO_COPYALL;
- if (aCbProtect.IsChecked())
+ if (m_pCbProtect->IsChecked())
nBits |= SC_SCENARIO_PROTECT;
rFlags = nBits;
}
@@ -174,38 +140,35 @@ void ScNewScenarioDlg::GetScenarioData( OUString& rName, OUString& rComment,
void ScNewScenarioDlg::SetScenarioData( const OUString& rName, const OUString& rComment,
const Color& rColor, sal_uInt16 nFlags )
{
- aEdComment.SetText(rComment);
- aEdName.SetText(rName);
- aLbColor.SelectEntry(rColor);
-
- aCbShowFrame.Check ( (nFlags & SC_SCENARIO_SHOWFRAME) != 0 );
- EnableHdl( &aCbShowFrame );
- //aCbPrintFrame.Check( (nFlags & SC_SCENARIO_PRINTFRAME) != 0 );
- aCbTwoWay.Check ( (nFlags & SC_SCENARIO_TWOWAY) != 0 );
- //aCbAttrib.Check ( (nFlags & SC_SCENARIO_ATTRIB) != 0 );
- //aCbValue.Check ( (nFlags & SC_SCENARIO_VALUE) != 0 );
+ m_pEdComment->SetText(rComment);
+ m_pEdName->SetText(rName);
+ m_pLbColor->SelectEntry(rColor);
+
+ m_pCbShowFrame->Check ( (nFlags & SC_SCENARIO_SHOWFRAME) != 0 );
+ EnableHdl(m_pCbShowFrame);
+ m_pCbTwoWay->Check ( (nFlags & SC_SCENARIO_TWOWAY) != 0 );
// CopyAll nicht
- aCbProtect.Check ( (nFlags & SC_SCENARIO_PROTECT) != 0 );
+ m_pCbProtect->Check ( (nFlags & SC_SCENARIO_PROTECT) != 0 );
}
//------------------------------------------------------------------------
IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl)
{
- OUString aName = comphelper::string::strip(aEdName.GetText(), ' ');
+ OUString aName = comphelper::string::strip(m_pEdName->GetText(), ' ');
ScDocument* pDoc = ((ScTabViewShell*)SfxViewShell::Current())->GetViewData()->GetDocument();
- aEdName.SetText( aName );
+ m_pEdName->SetText( aName );
if ( !pDoc->ValidTabName( aName ) )
{
InfoBox( this, ScGlobal::GetRscString( STR_INVALIDTABNAME ) ).Execute();
- aEdName.GrabFocus();
+ m_pEdName->GrabFocus();
}
else if ( !bIsEdit && !pDoc->ValidNewTabName( aName ) )
{
InfoBox( this, ScGlobal::GetRscString( STR_NEWTABNAMENOTUNIQUE ) ).Execute();
- aEdName.GrabFocus();
+ m_pEdName->GrabFocus();
}
else
EndDialog( RET_OK );
@@ -218,8 +181,8 @@ IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl)
IMPL_LINK( ScNewScenarioDlg, EnableHdl, CheckBox *, pBox )
{
- if( pBox == &aCbShowFrame )
- aLbColor.Enable( aCbShowFrame.IsChecked() );
+ if (pBox == m_pCbShowFrame)
+ m_pLbColor->Enable( m_pCbShowFrame->IsChecked() );
return 0;
}
diff --git a/sc/source/ui/dbgui/scendlg.hrc b/sc/source/ui/dbgui/scendlg.hrc
deleted file mode 100644
index 2df24dfaf67e..000000000000
--- a/sc/source/ui/dbgui/scendlg.hrc
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include "sc.hrc"
-
-#define BTN_OK 1
-#define BTN_CANCEL 2
-#define BTN_HELP 3
-
-#define FL_NAME 10
-#define ED_NAME 11
-#define FL_COMMENT 12
-#define ED_COMMENT 13
-
-#define FL_OPTIONS 20
-#define CB_SHOWFRAME 21
-#define LB_COLOR 22
-#define CB_PRINTFRAME 23
-#define CB_TWOWAY 24
-#define CB_ATTRIB 25
-#define CB_VALUE 26
-#define CB_COPYALL 27
-#define CB_PROTECT 28
-
-#ifdef STR_ON
-#undef STR_ON
-#endif
-#ifdef STR_EDIT
-#undef STR_EDIT
-#endif
-
-#define STR_CREATEDBY 31
-#define STR_ON 32
-#define STR_EDIT 33
-#define STR_COLOR 34
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/scendlg.src b/sc/source/ui/dbgui/scendlg.src
deleted file mode 100644
index a80ff019553e..000000000000
--- a/sc/source/ui/dbgui/scendlg.src
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include "scendlg.hrc"
-ModalDialog RID_SCDLG_NEWSCENARIO
-{
- HelpID = "sc:ModalDialog:RID_SCDLG_NEWSCENARIO";
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 260 , 165 ) ;
- Text [ en-US ] = "Create Scenario" ;
- Moveable = TRUE ;
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 204 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 204 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 204 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- MultiLineEdit ED_COMMENT
- {
- HelpID = "sc:MultiLineEdit:RID_SCDLG_NEWSCENARIO:ED_COMMENT";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 183 , 46 ) ;
- TabStop = TRUE ;
- MaxTextLength = 512 ;
- VScroll = TRUE ;
- IgnoreTab = TRUE ;
- };
- Edit ED_NAME
- {
- HelpID = "sc:Edit:RID_SCDLG_NEWSCENARIO:ED_NAME";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 183 , 12 ) ;
- TabStop = TRUE ;
- };
- CheckBox CB_SHOWFRAME
- {
- HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_SHOWFRAME";
- Pos = MAP_APPFONT ( 12 , 107 ) ;
- Size = MAP_APPFONT ( 109 , 10 ) ;
- Text [ en-US ] = "~Display border";
- };
- ListBox LB_COLOR
- {
- HelpID = "sc:ListBox:RID_SCDLG_NEWSCENARIO:LB_COLOR";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 125 , 105 ) ;
- Size = MAP_APPFONT ( 70 , 86 ) ;
- DropDown = TRUE ;
- DDExtraWidth = TRUE ;
- };
- CheckBox CB_PRINTFRAME
- {
- HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_PRINTFRAME";
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 121 , 243 ) ;
- Size = MAP_APPFONT ( 83 , 10 ) ;
- Text [ en-US ] = "Print border" ;
- };
- CheckBox CB_TWOWAY
- {
- HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_TWOWAY";
- Pos = MAP_APPFONT ( 12 , 121 ) ;
- Size = MAP_APPFONT ( 183 , 10 ) ;
- Text [ en-US ] = "Copy ~back" ;
- };
- CheckBox CB_ATTRIB
- {
- HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_ATTRIB";
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 20 , 243 ) ;
- Size = MAP_APPFONT ( 83 , 10 ) ;
- Text [ en-US ] = "Attributes" ;
- };
- CheckBox CB_VALUE
- {
- HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_VALUE";
- Hide = TRUE ;
- Pos = MAP_APPFONT ( 230 , 243 ) ;
- Size = MAP_APPFONT ( 83 , 10 ) ;
- Text [ en-US ] = "Copy values only" ;
- };
- CheckBox CB_COPYALL
- {
- HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_COPYALL";
- Pos = MAP_APPFONT ( 12 , 135 ) ;
- Size = MAP_APPFONT ( 183 , 10 ) ;
- Text [ en-US ] = "Copy ~entire sheet" ;
- };
- CheckBox CB_PROTECT
- {
- HelpID = "sc:CheckBox:RID_SCDLG_NEWSCENARIO:CB_PROTECT";
- Pos = MAP_APPFONT ( 12 , 149 ) ;
- Size = MAP_APPFONT ( 183 , 10 ) ;
- Text [ en-US ] = "~Prevent changes" ;
- };
- String STR_EDIT
- {
- Text [ en-US ] = "Edit Scenario" ;
- };
- String STR_CREATEDBY
- {
- Text [ en-US ] = "Created by" ;
- };
- String STR_ON
- {
- Text [ en-US ] = "on" ;
- };
- String STR_COLOR
- {
- Text [ en-US ] = "Display border in" ;
- };
- FixedLine FL_NAME
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 192 , 8 ) ;
- Text [ en-US ] = "~Name of scenario";
- };
- FixedLine FL_COMMENT
- {
- Pos = MAP_APPFONT ( 6 , 32 ) ;
- Size = MAP_APPFONT ( 192 , 8 ) ;
- Text [ en-US ] = "~Comment";
- };
- FixedLine FL_OPTIONS
- {
- Pos = MAP_APPFONT ( 6 , 95 ) ;
- Size = MAP_APPFONT ( 192 , 8 ) ;
- Text [ en-US ] = "Settings";
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8c4039fcb77a..6cbd08b38822 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -869,7 +869,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( GetActiveDialogParent(), aName, RID_SCDLG_NEWSCENARIO, true,bSheetProtected);
+ AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg(GetActiveDialogParent(), aName, true, bSheetProtected);
OSL_ENSURE(pNewDlg, "Dialog create fail!");
pNewDlg->SetScenarioData( aName, aComment, aColor, nFlags );
if ( pNewDlg->Execute() == RET_OK )
diff --git a/sc/source/ui/inc/scendlg.hxx b/sc/source/ui/inc/scendlg.hxx
index dbbbe13aa515..ae5444aa384f 100644
--- a/sc/source/ui/inc/scendlg.hxx
+++ b/sc/source/ui/inc/scendlg.hxx
@@ -33,8 +33,7 @@
class ScNewScenarioDlg : public ModalDialog
{
public:
- ScNewScenarioDlg( Window* pParent, const OUString& rName, sal_Bool bEdit = false, sal_Bool bSheetProtected = false );
- ~ScNewScenarioDlg();
+ ScNewScenarioDlg(Window* pParent, const OUString& rName, sal_Bool bEdit = false, sal_Bool bSheetProtected = false);
void SetScenarioData( const OUString& rName, const OUString& rComment,
const Color& rColor, sal_uInt16 nFlags );
@@ -43,22 +42,14 @@ public:
Color& rColor, sal_uInt16& rFlags ) const;
private:
- FixedLine aFlName;
- Edit aEdName;
- FixedLine aFlComment;
- MultiLineEdit aEdComment;
- FixedLine aFlOptions;
- CheckBox aCbShowFrame;
- ColorListBox aLbColor;
- //CheckBox aCbPrintFrame;
- CheckBox aCbTwoWay;
- //CheckBox aCbAttrib;
- //CheckBox aCbValue;
- CheckBox aCbCopyAll;
- CheckBox aCbProtect;
- OKButton aBtnOk;
- CancelButton aBtnCancel;
- HelpButton aBtnHelp;
+ Edit* m_pEdName;
+ VclMultiLineEdit* m_pEdComment;
+ CheckBox* m_pCbShowFrame;
+ ColorListBox* m_pLbColor;
+ CheckBox* m_pCbTwoWay;
+ CheckBox* m_pCbCopyAll;
+ CheckBox* m_pCbProtect;
+ OKButton* m_pBtnOk;
const OUString aDefScenarioName;
sal_Bool bIsEdit;
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index a3c7893ad0cc..7b1a54f96340 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -493,7 +493,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg( pTabViewShell->GetDialogParent(), aName, RID_SCDLG_NEWSCENARIO, false,bSheetProtected);
+ AbstractScNewScenarioDlg* pNewDlg = pFact->CreateScNewScenarioDlg(pTabViewShell->GetDialogParent(), aName, false, bSheetProtected);
OSL_ENSURE(pNewDlg, "Dialog create fail!");
if ( pNewDlg->Execute() == RET_OK )
{
diff --git a/sc/uiconfig/scalc/ui/scenariodialog.ui b/sc/uiconfig/scalc/ui/scenariodialog.ui
new file mode 100644
index 000000000000..f32e353b2d9b
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/scenariodialog.ui
@@ -0,0 +1,382 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Wed Feb 5 11:06:31 2014 -->
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkDialog" id="ScenarioDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Create Scenario</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="hexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkEntry" id="name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Name of scenario</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkTextView" id="comment:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="accepts_tab">False</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Comment</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="hexpand">True</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="copyback">
+ <property name="label" translatable="yes">Copy _back</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="copysheet">
+ <property name="label" translatable="yes">Copy _entire sheet</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="preventchanges">
+ <property name="label" translatable="yes">_Prevent changes</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkCheckButton" id="showframe">
+ <property name="label" translatable="yes">_Display border</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <accessibility>
+ <relation type="label-for" target="bordercolor"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="svtlo-ColorListBox" id="bordercolor">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <accessibility>
+ <relation type="labelled-by" target="showframe"/>
+ </accessibility>
+ <child internal-child="accessible">
+ <object class="AtkObject" id="bordercolor-atkobject">
+ <property name="AtkObject::accessible-name" translatable="yes">Display border in</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Settings</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="alttitle">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes">Edit Scenario</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid4">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="createdft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Created by</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="onft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">on</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ </action-widgets>
+ </object>
+</interface>