summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-12-30 16:03:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-12-30 16:12:02 +0000
commit9f5df4cda93eb470fb79fc4b8014d9a6dde2284b (patch)
tree2ee3579071b96a14bf13ec30d655cb991cb72218 /sc/source/ui
parentd1a1dc8e5ba108e8973db5b95669bf882d4fcc67 (diff)
convert solver options dialog to .ui
Change-Id: I319210233dd1b71f6e717c7322b953de8f093150
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/solveroptions.hxx12
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx73
-rw-r--r--sc/source/ui/src/solveroptions.src92
3 files changed, 36 insertions, 141 deletions
diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx
index 5ce5ec774571..74925d73e581 100644
--- a/sc/source/ui/inc/solveroptions.hxx
+++ b/sc/source/ui/inc/solveroptions.hxx
@@ -37,15 +37,9 @@ namespace com { namespace sun { namespace star {
class ScSolverOptionsDialog : public ModalDialog
{
- FixedText maFtEngine;
- ListBox maLbEngine;
- FixedText maFtSettings;
- SvxCheckListBox maLbSettings;
- PushButton maBtnEdit;
- FixedLine maFlButtons;
- HelpButton maBtnHelp;
- OKButton maBtnOk;
- CancelButton maBtnCancel;
+ ListBox* m_pLbEngine;
+ SvxCheckListBox* m_pLbSettings;
+ PushButton* m_pBtnEdit;
SvLBoxButtonData* mpCheckButtonData;
com::sun::star::uno::Sequence<OUString> maImplNames;
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 256f33428447..94e53b38165b 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -113,32 +113,27 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( Window* pParent,
const uno::Sequence<OUString>& rDescriptions,
const OUString& rEngine,
const uno::Sequence<beans::PropertyValue>& rProperties )
- : ModalDialog( pParent, ScResId( RID_SCDLG_SOLVEROPTIONS ) ),
- maFtEngine ( this, ScResId( FT_ENGINE ) ),
- maLbEngine ( this, ScResId( LB_ENGINE ) ),
- maFtSettings ( this, ScResId( FT_SETTINGS ) ),
- maLbSettings ( this, ScResId( LB_SETTINGS ) ),
- maBtnEdit ( this, ScResId( BTN_EDIT ) ),
- maFlButtons ( this, ScResId( FL_BUTTONS ) ),
- maBtnHelp ( this, ScResId( BTN_HELP ) ),
- maBtnOk ( this, ScResId( BTN_OK ) ),
- maBtnCancel ( this, ScResId( BTN_CANCEL ) ),
- mpCheckButtonData( NULL ),
- maImplNames( rImplNames ),
- maDescriptions( rDescriptions ),
- maEngine( rEngine ),
- maProperties( rProperties )
+ : ModalDialog(pParent, "SolverOptionsDialog",
+ "modules/scalc/ui/solveroptionsdialog.ui")
+ , mpCheckButtonData(NULL)
+ , maImplNames(rImplNames)
+ , maDescriptions(rDescriptions)
+ , maEngine(rEngine)
+ , maProperties(rProperties)
{
- maLbEngine.SetSelectHdl( LINK( this, ScSolverOptionsDialog, EngineSelectHdl ) );
+ get(m_pLbEngine, "engine");
+ get(m_pLbSettings, "settings");
+ get(m_pBtnEdit, "edit");
- maBtnEdit.SetClickHdl( LINK( this, ScSolverOptionsDialog, ButtonHdl ) );
+ m_pLbEngine->SetSelectHdl( LINK( this, ScSolverOptionsDialog, EngineSelectHdl ) );
- maLbSettings.SetStyle( maLbSettings.GetStyle()|WB_CLIPCHILDREN|WB_FORCE_MAKEVISIBLE );
- maLbSettings.SetHelpId( HID_SC_SOLVEROPTIONS_LB );
- maLbSettings.SetHighlightRange();
+ m_pBtnEdit->SetClickHdl( LINK( this, ScSolverOptionsDialog, ButtonHdl ) );
- maLbSettings.SetSelectHdl( LINK( this, ScSolverOptionsDialog, SettingsSelHdl ) );
- maLbSettings.SetDoubleClickHdl( LINK( this, ScSolverOptionsDialog, SettingsDoubleClickHdl ) );
+ m_pLbSettings->SetStyle( m_pLbSettings->GetStyle()|WB_CLIPCHILDREN|WB_FORCE_MAKEVISIBLE );
+ m_pLbSettings->SetHighlightRange();
+
+ m_pLbSettings->SetSelectHdl( LINK( this, ScSolverOptionsDialog, SettingsSelHdl ) );
+ m_pLbSettings->SetDoubleClickHdl( LINK( this, ScSolverOptionsDialog, SettingsDoubleClickHdl ) );
sal_Int32 nSelect = -1;
sal_Int32 nImplCount = maImplNames.getLength();
@@ -146,7 +141,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( Window* pParent,
{
OUString aImplName( maImplNames[nImpl] );
OUString aDescription( maDescriptions[nImpl] ); // user-visible descriptions in list box
- maLbEngine.InsertEntry( aDescription );
+ m_pLbEngine->InsertEntry( aDescription );
if ( aImplName == maEngine )
nSelect = nImpl;
}
@@ -162,13 +157,11 @@ ScSolverOptionsDialog::ScSolverOptionsDialog( Window* pParent,
maProperties.realloc(0); // don't use options from different engine
}
if ( nSelect >= 0 ) // select in list box
- maLbEngine.SelectEntryPos( static_cast<sal_uInt16>(nSelect) );
+ m_pLbEngine->SelectEntryPos( static_cast<sal_uInt16>(nSelect) );
if ( !maProperties.getLength() )
ReadFromComponent(); // fill maProperties from component (using maEngine)
FillListBox(); // using maProperties
-
- FreeResource();
}
ScSolverOptionsDialog::~ScSolverOptionsDialog()
@@ -186,7 +179,7 @@ const uno::Sequence<beans::PropertyValue>& ScSolverOptionsDialog::GetProperties(
// update maProperties from list box content
// order of entries in list box and maProperties is the same
sal_Int32 nEntryCount = maProperties.getLength();
- SvTreeList* pModel = maLbSettings.GetModel();
+ SvTreeList* pModel = m_pLbSettings->GetModel();
if ( nEntryCount == (sal_Int32)pModel->GetEntryCount() )
{
for (sal_Int32 nEntryPos=0; nEntryPos<nEntryCount; ++nEntryPos)
@@ -211,7 +204,7 @@ const uno::Sequence<beans::PropertyValue>& ScSolverOptionsDialog::GetProperties(
}
if ( !bHasData )
ScUnoHelpFunctions::SetBoolInAny( rValue,
- maLbSettings.GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED );
+ m_pLbSettings->GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED );
}
}
else
@@ -252,14 +245,14 @@ void ScSolverOptionsDialog::FillListBox()
// fill the list box
- maLbSettings.SetUpdateMode(false);
- maLbSettings.Clear();
+ m_pLbSettings->SetUpdateMode(false);
+ m_pLbSettings->Clear();
OUString sEmpty;
if (!mpCheckButtonData)
- mpCheckButtonData = new SvLBoxButtonData( &maLbSettings );
+ mpCheckButtonData = new SvLBoxButtonData(m_pLbSettings);
- SvTreeList* pModel = maLbSettings.GetModel();
+ SvTreeList* pModel = m_pLbSettings->GetModel();
SvTreeListEntry* pEntry = NULL;
for (sal_Int32 nPos=0; nPos<nCount; nPos++)
@@ -305,7 +298,7 @@ void ScSolverOptionsDialog::FillListBox()
pModel->Insert( pEntry );
}
- maLbSettings.SetUpdateMode(sal_True);
+ m_pLbSettings->SetUpdateMode(sal_True);
}
void ScSolverOptionsDialog::ReadFromComponent()
@@ -315,7 +308,7 @@ void ScSolverOptionsDialog::ReadFromComponent()
void ScSolverOptionsDialog::EditOption()
{
- SvTreeListEntry* pEntry = maLbSettings.GetCurEntry();
+ SvTreeListEntry* pEntry = m_pLbSettings->GetCurEntry();
if (pEntry)
{
sal_uInt16 nItemCount = pEntry->ItemCount();
@@ -333,7 +326,7 @@ void ScSolverOptionsDialog::EditOption()
if ( aValDialog.Execute() == RET_OK )
{
pStringItem->SetDoubleValue( aValDialog.GetValue() );
- maLbSettings.InvalidateEntry( pEntry );
+ m_pLbSettings->InvalidateEntry( pEntry );
}
}
else
@@ -344,7 +337,7 @@ void ScSolverOptionsDialog::EditOption()
if ( aIntDialog.Execute() == RET_OK )
{
pStringItem->SetIntValue( aIntDialog.GetValue() );
- maLbSettings.InvalidateEntry( pEntry );
+ m_pLbSettings->InvalidateEntry( pEntry );
}
}
}
@@ -354,7 +347,7 @@ void ScSolverOptionsDialog::EditOption()
IMPL_LINK( ScSolverOptionsDialog, ButtonHdl, PushButton*, pBtn )
{
- if ( pBtn == &maBtnEdit )
+ if (pBtn == m_pBtnEdit)
EditOption();
return 0;
@@ -368,7 +361,7 @@ IMPL_LINK_NOARG(ScSolverOptionsDialog, SettingsDoubleClickHdl)
IMPL_LINK_NOARG(ScSolverOptionsDialog, EngineSelectHdl)
{
- sal_uInt16 nSelectPos = maLbEngine.GetSelectEntryPos();
+ sal_uInt16 nSelectPos = m_pLbEngine->GetSelectEntryPos();
if ( nSelectPos < maImplNames.getLength() )
{
OUString aNewEngine( maImplNames[nSelectPos] );
@@ -386,7 +379,7 @@ IMPL_LINK_NOARG(ScSolverOptionsDialog, SettingsSelHdl)
{
sal_Bool bCheckbox = false;
- SvTreeListEntry* pEntry = maLbSettings.GetCurEntry();
+ SvTreeListEntry* pEntry = m_pLbSettings->GetCurEntry();
if (pEntry)
{
SvLBoxItem* pItem = pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON);
@@ -394,7 +387,7 @@ IMPL_LINK_NOARG(ScSolverOptionsDialog, SettingsSelHdl)
bCheckbox = true;
}
- maBtnEdit.Enable( !bCheckbox );
+ m_pBtnEdit->Enable( !bCheckbox );
return 0;
}
diff --git a/sc/source/ui/src/solveroptions.src b/sc/source/ui/src/solveroptions.src
deleted file mode 100644
index ae825a49fcc9..000000000000
--- a/sc/source/ui/src/solveroptions.src
+++ /dev/null
@@ -1,92 +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 "solveroptions.hrc"
-
-ModalDialog RID_SCDLG_SOLVEROPTIONS
-{
- OutputSize = TRUE ;
- HelpId = HID_SC_SOLVEROPTIONS ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 218 , 156 ) ;
- Moveable = TRUE ;
- FixedText FT_ENGINE
- {
- Pos = MAP_APPFONT ( 6 , 8 ) ;
- Size = MAP_APPFONT ( 59 , 8 ) ;
- Text [ en-US ] = "Solver engine" ;
- };
- ListBox LB_ENGINE
- {
- HelpID = "sc:ListBox:RID_SCDLG_SOLVEROPTIONS:LB_ENGINE";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 67 , 6 ) ;
- Size = MAP_APPFONT ( 145 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedText FT_SETTINGS
- {
- Pos = MAP_APPFONT ( 6 , 24 ) ;
- Size = MAP_APPFONT ( 156 , 8 ) ;
- Text [ en-US ] = "Settings:" ;
- };
- Control LB_SETTINGS
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 35 ) ;
- Size = MAP_APPFONT ( 206 , 67 ) ;
- TabStop = TRUE ;
- };
- PushButton BTN_EDIT
- {
- HelpID = "sc:PushButton:RID_SCDLG_SOLVEROPTIONS:BTN_EDIT";
- Pos = MAP_APPFONT ( 6 , 108 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Edit..." ;
- };
- FixedLine FL_BUTTONS
- {
- Pos = MAP_APPFONT ( 0 , 125 ) ;
- Size = MAP_APPFONT ( 218 , 8 ) ;
- };
- HelpButton BTN_HELP
- {
- Pos = MAP_APPFONT ( 6 , 136 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- OKButton BTN_OK
- {
- Pos = MAP_APPFONT ( 106 , 136 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BTN_CANCEL
- {
- Pos = MAP_APPFONT ( 162 , 136 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- Text [ en-US ] = "Options" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */