Kaydet (Commit) 28ca8eee authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: #i117782# convert calculate page to .ui format

Change-Id: Iab0028ad1bfd8a841a3cf87aadbe0dc9d9ad830e
üst 35f846ff
......@@ -210,6 +210,10 @@
generic-name="NoSpace Edit" parent="GtkEntry"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Double Field" name="scuilo-ScDoubleField"
generic-name="Double Field" parent="GtkEntry"
icon-name="widget-gtk-textentry"/>
<glade-widget-class title="Cursor Reference Edit" name="sclo-ScCursorRefEdit"
generic-name="Cursor Reference Edit" parent="foruilo-RefEdit"
icon-name="widget-gtk-textentry"/>
......
......@@ -78,6 +78,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/leftfooterdialog \
sc/uiconfig/scalc/ui/leftheaderdialog \
sc/uiconfig/scalc/ui/managenamesdialog \
sc/uiconfig/scalc/ui/optcalculatepage \
sc/uiconfig/scalc/ui/printeroptions \
sc/uiconfig/scalc/ui/protectsheetdlg \
sc/uiconfig/scalc/ui/sheetprintpage \
......
......@@ -60,7 +60,6 @@
#define HID_SC_PIVOTSUBT "SC_HID_SC_PIVOTSUBT"
#define HID_SCPAGE_SUBT_OPTIONS "SC_HID_SCPAGE_SUBT_OPTIONS"
#define HID_SCPAGE_SUBT_GROUP "SC_HID_SCPAGE_SUBT_GROUP"
#define HID_SCPAGE_CALC "SC_HID_SCPAGE_CALC"
#define HID_SCPAGE_FORMULA "SC_HID_SCPAGE_FORMULA"
#define HID_SCPAGE_USERLISTS "SC_HID_SCPAGE_USERLISTS"
#define HID_SCPAGE_AREAS "SC_HID_SCPAGE_AREAS"
......
......@@ -25,6 +25,7 @@
#include <comphelper/string.hxx>
#include <rtl/math.hxx>
#include <unotools/localedatawrapper.hxx>
#include <vcl/builder.hxx>
#include "global.hxx"
// ============================================================================
......@@ -50,6 +51,17 @@ ScDoubleField::ScDoubleField( Window* pParent, const ResId& rResId ) :
{
}
ScDoubleField::ScDoubleField( Window* pParent, WinBits nStyle ) :
Edit( pParent, nStyle )
{
}
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScDoubleField(Window *pParent, VclBuilder::stringmap &rMap)
{
VclBuilder::ensureDefaultWidthChars(rMap);
return new ScDoubleField(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK);
}
bool ScDoubleField::GetValue( double& rfValue ) const
{
OUString aStr(comphelper::string::strip(GetText(), ' '));
......
......@@ -29,6 +29,7 @@ class ScDoubleField : public Edit
{
public:
explicit ScDoubleField( Window* pParent, const ResId& rResId );
explicit ScDoubleField( Window* pParent, WinBits nStyle );
bool GetValue( double& rfValue ) const;
void SetValue( double fValue,
......
......@@ -30,27 +30,6 @@
#define TP_INPUT 13
#define TP_FORMULA 15
// TP_CALC:
#define BTN_ITERATE 1
#define FT_STEPS 2
#define FT_EPS 3
#define ED_STEPS 4
#define ED_EPS 5
#define GB_ZREFS 6
#define ED_PREC 7
#define FT_PREC 8
#define BTN_DATESTD 9
#define BTN_DATESC10 10
#define BTN_DATE1904 11
#define FT_VALUE 13
#define GB_DATE 14
#define BTN_CASE 15
#define BTN_CALC 17
#define BTN_MATCH 18
#define BTN_LOOKUP 19
#define BTN_REGEX 20
#define BTN_GENERAL_PREC 21
// TP_VIEW:
#define BTN_GRID 6
......
......@@ -48,34 +48,30 @@ private:
~ScTpCalcOptions();
private:
FixedLine aGbZRefs;
CheckBox aBtnIterate;
FixedText aFtSteps;
NumericField aEdSteps;
FixedText aFtEps;
ScDoubleField aEdEps;
FixedLine aSeparatorFL;
FixedLine aGbDate;
RadioButton aBtnDateStd;
RadioButton aBtnDateSc10;
RadioButton aBtnDate1904;
CheckBox aBtnCase;
CheckBox aBtnCalc;
CheckBox aBtnMatch;
CheckBox aBtnRegex;
CheckBox aBtnLookUp;
CheckBox aBtnGeneralPrec;
FixedText aFtPrec;
NumericField aEdPrec;
CheckBox* m_pBtnIterate;
FixedText* m_pFtSteps;
NumericField* m_pEdSteps;
FixedText* m_pFtEps;
ScDoubleField* m_pEdEps;
RadioButton* m_pBtnDateStd;
RadioButton* m_pBtnDateSc10;
RadioButton* m_pBtnDate1904;
CheckBox* m_pBtnCase;
CheckBox* m_pBtnCalc;
CheckBox* m_pBtnMatch;
CheckBox* m_pBtnRegex;
CheckBox* m_pBtnLookUp;
CheckBox* m_pBtnGeneralPrec;
FixedText* m_pFtPrec;
NumericField* m_pEdPrec;
ScDocOptions* pOldOptions;
ScDocOptions* pLocalOptions;
sal_uInt16 nWhichCalc;
#ifdef _TPCALC_CXX
private:
void Init();
......@@ -83,8 +79,6 @@ private:
// Handler:
DECL_LINK( RadioClickHdl, RadioButton* );
DECL_LINK( CheckClickHdl, CheckBox* );
#endif
};
......
......@@ -34,50 +34,38 @@
#include "sc.hrc" // -> Slot-IDs
#include "optdlg.hrc"
#define _TPCALC_CXX
#include "tpcalc.hxx"
#undef _TPCALC_CXX
#include <math.h>
//========================================================================
ScTpCalcOptions::ScTpCalcOptions( Window* pParent,
const SfxItemSet& rCoreAttrs )
: SfxTabPage ( pParent,
ScResId( RID_SCPAGE_CALC ),
rCoreAttrs ),
aGbZRefs ( this, ScResId( GB_ZREFS ) ),
aBtnIterate ( this, ScResId( BTN_ITERATE ) ),
aFtSteps ( this, ScResId( FT_STEPS ) ),
aEdSteps ( this, ScResId( ED_STEPS ) ),
aFtEps ( this, ScResId( FT_EPS ) ),
aEdEps ( this, ScResId( ED_EPS ) ),
aSeparatorFL ( this, ScResId( FL_SEPARATOR ) ),
aGbDate ( this, ScResId( GB_DATE ) ),
aBtnDateStd ( this, ScResId( BTN_DATESTD ) ),
aBtnDateSc10 ( this, ScResId( BTN_DATESC10 ) ),
aBtnDate1904 ( this, ScResId( BTN_DATE1904 ) ),
aBtnCase ( this, ScResId( BTN_CASE ) ),
aBtnCalc ( this, ScResId( BTN_CALC ) ),
aBtnMatch ( this, ScResId( BTN_MATCH ) ),
aBtnRegex ( this, ScResId( BTN_REGEX ) ),
aBtnLookUp ( this, ScResId( BTN_LOOKUP ) ),
aBtnGeneralPrec ( this, ScResId( BTN_GENERAL_PREC ) ),
aFtPrec ( this, ScResId( FT_PREC ) ),
aEdPrec ( this, ScResId( ED_PREC ) ),
pOldOptions ( new ScDocOptions(
((const ScTpCalcItem&)rCoreAttrs.Get(
GetWhich( SID_SCDOCOPTIONS ))).
GetDocOptions() ) ),
pLocalOptions ( new ScDocOptions ),
nWhichCalc ( GetWhich( SID_SCDOCOPTIONS ) )
ScTpCalcOptions::ScTpCalcOptions(Window* pParent, const SfxItemSet& rCoreAttrs)
: SfxTabPage(pParent, "OptCalculatePage",
"modules/scalc/ui/optcalculatepage.ui", rCoreAttrs)
, pOldOptions(new ScDocOptions(
((const ScTpCalcItem&)rCoreAttrs.Get(
GetWhich(SID_SCDOCOPTIONS))).GetDocOptions()))
, pLocalOptions(new ScDocOptions)
, nWhichCalc(GetWhich(SID_SCDOCOPTIONS))
{
aSeparatorFL.SetStyle( aSeparatorFL.GetStyle() | WB_VERT );
get(m_pBtnIterate, "iterate");
get(m_pFtSteps, "stepsft");
get(m_pEdSteps, "steps");
get(m_pFtEps, "minchangeft");
get(m_pEdEps, "minchange");
get(m_pBtnDateStd, "datestd");
get(m_pBtnDateSc10, "datesc10");
get(m_pBtnDate1904, "date1904");
get(m_pBtnCase, "case");
get(m_pBtnCalc, "calc");
get(m_pBtnMatch, "match");
get(m_pBtnRegex, "regex");
get(m_pBtnLookUp, "lookup");
get(m_pBtnGeneralPrec, "generalprec");
get(m_pFtPrec, "precft");
get(m_pEdPrec, "prec");
Init();
FreeResource();
SetExchangeSupport();
}
......@@ -93,11 +81,11 @@ ScTpCalcOptions::~ScTpCalcOptions()
void ScTpCalcOptions::Init()
{
aBtnIterate .SetClickHdl( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
aBtnGeneralPrec.SetClickHdl( LINK(this, ScTpCalcOptions, CheckClickHdl) );
aBtnDateStd .SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
aBtnDateSc10.SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
aBtnDate1904.SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
m_pBtnIterate->SetClickHdl( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
m_pBtnGeneralPrec->SetClickHdl( LINK(this, ScTpCalcOptions, CheckClickHdl) );
m_pBtnDateStd->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
m_pBtnDateSc10->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
m_pBtnDate1904->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
}
//-----------------------------------------------------------------------
......@@ -115,46 +103,46 @@ void ScTpCalcOptions::Reset( const SfxItemSet& /* rCoreAttrs */ )
*pLocalOptions = *pOldOptions;
aBtnCase .Check( !pLocalOptions->IsIgnoreCase() );
aBtnCalc .Check( pLocalOptions->IsCalcAsShown() );
aBtnMatch .Check( pLocalOptions->IsMatchWholeCell() );
aBtnRegex .Check( pLocalOptions->IsFormulaRegexEnabled() );
aBtnLookUp .Check( pLocalOptions->IsLookUpColRowNames() );
aBtnIterate.Check( pLocalOptions->IsIter() );
aEdSteps .SetValue( pLocalOptions->GetIterCount() );
aEdEps .SetValue( pLocalOptions->GetIterEps(), 6 );
m_pBtnCase->Check( !pLocalOptions->IsIgnoreCase() );
m_pBtnCalc->Check( pLocalOptions->IsCalcAsShown() );
m_pBtnMatch->Check( pLocalOptions->IsMatchWholeCell() );
m_pBtnRegex->Check( pLocalOptions->IsFormulaRegexEnabled() );
m_pBtnLookUp->Check( pLocalOptions->IsLookUpColRowNames() );
m_pBtnIterate->Check( pLocalOptions->IsIter() );
m_pEdSteps->SetValue( pLocalOptions->GetIterCount() );
m_pEdEps->SetValue( pLocalOptions->GetIterEps(), 6 );
pLocalOptions->GetDate( d, m, y );
switch ( y )
{
case 1899:
aBtnDateStd.Check();
m_pBtnDateStd->Check();
break;
case 1900:
aBtnDateSc10.Check();
m_pBtnDateSc10->Check();
break;
case 1904:
aBtnDate1904.Check();
m_pBtnDate1904->Check();
break;
}
sal_uInt16 nPrec = pLocalOptions->GetStdPrecision();
if (nPrec == SvNumberFormatter::UNLIMITED_PRECISION)
{
aFtPrec.Disable();
aEdPrec.Disable();
aBtnGeneralPrec.Check(false);
m_pFtPrec->Disable();
m_pEdPrec->Disable();
m_pBtnGeneralPrec->Check(false);
}
else
{
aBtnGeneralPrec.Check();
aFtPrec.Enable();
aEdPrec.Enable();
aEdPrec.SetValue(nPrec);
m_pBtnGeneralPrec->Check();
m_pFtPrec->Enable();
m_pEdPrec->Enable();
m_pEdPrec->SetValue(nPrec);
}
CheckClickHdl( &aBtnIterate );
CheckClickHdl(m_pBtnIterate);
}
......@@ -163,16 +151,16 @@ void ScTpCalcOptions::Reset( const SfxItemSet& /* rCoreAttrs */ )
sal_Bool ScTpCalcOptions::FillItemSet( SfxItemSet& rCoreAttrs )
{
// alle weiteren Optionen werden in den Handlern aktualisiert
pLocalOptions->SetIterCount( (sal_uInt16)aEdSteps.GetValue() );
pLocalOptions->SetIgnoreCase( !aBtnCase.IsChecked() );
pLocalOptions->SetCalcAsShown( aBtnCalc.IsChecked() );
pLocalOptions->SetMatchWholeCell( aBtnMatch.IsChecked() );
pLocalOptions->SetFormulaRegexEnabled( aBtnRegex.IsChecked() );
pLocalOptions->SetLookUpColRowNames( aBtnLookUp.IsChecked() );
if (aBtnGeneralPrec.IsChecked())
pLocalOptions->SetIterCount( (sal_uInt16)m_pEdSteps->GetValue() );
pLocalOptions->SetIgnoreCase( !m_pBtnCase->IsChecked() );
pLocalOptions->SetCalcAsShown( m_pBtnCalc->IsChecked() );
pLocalOptions->SetMatchWholeCell( m_pBtnMatch->IsChecked() );
pLocalOptions->SetFormulaRegexEnabled( m_pBtnRegex->IsChecked() );
pLocalOptions->SetLookUpColRowNames( m_pBtnLookUp->IsChecked() );
if (m_pBtnGeneralPrec->IsChecked())
pLocalOptions->SetStdPrecision(
static_cast<sal_uInt16>(aEdPrec.GetValue()) );
static_cast<sal_uInt16>(m_pEdPrec->GetValue()) );
else
pLocalOptions->SetStdPrecision( SvNumberFormatter::UNLIMITED_PRECISION );
......@@ -192,7 +180,7 @@ int ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
int nReturn = KEEP_PAGE;
double fEps;
if( aEdEps.GetValue( fEps ) && (fEps > 0.0) )
if( m_pEdEps->GetValue( fEps ) && (fEps > 0.0) )
{
pLocalOptions->SetIterEps( fEps );
nReturn = LEAVE_PAGE;
......@@ -205,7 +193,7 @@ int ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
ScGlobal::GetRscString( STR_INVALID_EPS )
).Execute();
aEdEps.GrabFocus();
m_pEdEps->GrabFocus();
}
else if ( pSetP )
FillItemSet( *pSetP );
......@@ -218,15 +206,15 @@ int ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
IMPL_LINK( ScTpCalcOptions, RadioClickHdl, RadioButton*, pBtn )
{
if ( pBtn == &aBtnDateStd )
if (pBtn == m_pBtnDateStd)
{
pLocalOptions->SetDate( 30, 12, 1899 );
}
else if ( pBtn == &aBtnDateSc10 )
else if (pBtn == m_pBtnDateSc10)
{
pLocalOptions->SetDate( 1, 1, 1900 );
}
else if ( pBtn == &aBtnDate1904 )
else if (pBtn == m_pBtnDate1904)
{
pLocalOptions->SetDate( 1, 1, 1904 );
}
......@@ -238,32 +226,32 @@ IMPL_LINK( ScTpCalcOptions, RadioClickHdl, RadioButton*, pBtn )
IMPL_LINK( ScTpCalcOptions, CheckClickHdl, CheckBox*, pBtn )
{
if (pBtn == &aBtnGeneralPrec)
if (pBtn == m_pBtnGeneralPrec)
{
if (pBtn->IsChecked())
{
aEdPrec.Enable();
aFtPrec.Enable();
m_pEdPrec->Enable();
m_pFtPrec->Enable();
}
else
{
aEdPrec.Disable();
aFtPrec.Disable();
m_pEdPrec->Disable();
m_pFtPrec->Disable();
}
}
else if (pBtn == &aBtnIterate)
else if (pBtn == m_pBtnIterate)
{
if ( pBtn->IsChecked() )
{
pLocalOptions->SetIter( sal_True );
aFtSteps.Enable(); aEdSteps.Enable();
aFtEps .Enable(); aEdEps .Enable();
pLocalOptions->SetIter( true );
m_pFtSteps->Enable(); m_pEdSteps->Enable();
m_pFtEps->Enable(); m_pEdEps->Enable();
}
else
{
pLocalOptions->SetIter( false );
aFtSteps.Disable(); aEdSteps.Disable();
aFtEps .Disable(); aEdEps .Disable();
m_pFtSteps->Disable(); m_pEdSteps->Disable();
m_pFtEps->Disable(); m_pEdEps->Disable();
}
}
......
......@@ -18,153 +18,6 @@
*/
#include "optdlg.hrc"
TabPage RID_SCPAGE_CALC
{
HelpId = HID_SCPAGE_CALC ;
SVLook = TRUE ;
Hide = TRUE ;
Pos = MAP_APPFONT ( 0 , 0 ) ;
Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
CheckBox BTN_ITERATE
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_ITERATE";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
Text [ en-US ] = "~Iterations" ;
};
FixedText FT_STEPS
{
Pos = MAP_APPFONT ( 20 , 28 ) ;
Size = MAP_APPFONT ( 58 , 8 ) ;
Text [ en-US ] = "~Steps" ;
};
FixedText FT_EPS
{
Pos = MAP_APPFONT ( 20 , 42 ) ;
Size = MAP_APPFONT ( 58 , 16 ) ;
Text [ en-US ] = "~Minimum Change" ;
WordBreak = TRUE ;
};
NumericField ED_STEPS
{
HelpID = "sc:NumericField:RID_SCPAGE_CALC:ED_STEPS";
Border = TRUE ;
Pos = MAP_APPFONT ( 82 , 26 ) ;
Size = MAP_APPFONT ( 42 , 12 ) ;
TabStop = TRUE ;
Minimum = 1 ;
Maximum = 1000 ;
Left = TRUE ;
};
Edit ED_EPS
{
HelpID = "sc:Edit:RID_SCPAGE_CALC:ED_EPS";
Border = TRUE ;
Pos = MAP_APPFONT ( 82 , 42 ) ;
Size = MAP_APPFONT ( 42 , 12 ) ;
};
FixedLine GB_ZREFS
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 121 , 8 ) ;
Text [ en-US ] = "Iterative references" ;
};
RadioButton BTN_DATESTD
{
HelpID = "sc:RadioButton:RID_SCPAGE_CALC:BTN_DATESTD";
Pos = MAP_APPFONT ( 139 , 14 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
Text [ en-US ] = "12/30/1899 (defa~ult)" ;
QuickHelpText [ en-US ] = "Value 0 corresponds to 12/30/1899" ;
};
RadioButton BTN_DATESC10
{
HelpID = "sc:RadioButton:RID_SCPAGE_CALC:BTN_DATESC10";
Pos = MAP_APPFONT ( 139 , 28 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
Text [ en-US ] = "01/01/1900 (Star~Calc 1.0)" ;
QuickHelpText [ en-US ] = "Value 0 corresponds to 01/01/1900" ;
};
RadioButton BTN_DATE1904
{
HelpID = "sc:RadioButton:RID_SCPAGE_CALC:BTN_DATE1904";
Pos = MAP_APPFONT ( 139 , 42 ) ;
Size = MAP_APPFONT ( 112 , 10 ) ;
Text [ en-US ] = "~01/01/1904" ;
QuickHelpText [ en-US ] = "0 corresponds to 01/01/1904" ;
};
FixedLine FL_SEPARATOR
{
Pos = MAP_APPFONT ( 130 , 14 ) ;
Size = MAP_APPFONT ( 1 , 44 ) ;
};
FixedLine GB_DATE
{
Pos = MAP_APPFONT ( 133 , 3 ) ;
Size = MAP_APPFONT ( 121 , 8 ) ;
Text [ en-US ] = "Date" ;
};
CheckBox BTN_CASE
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_CASE";
Pos = MAP_APPFONT ( 12 , 77 ) ;
Size = MAP_APPFONT ( 130 , 10 ) ;
Text [ en-US ] = "Case se~nsitive" ;
};
CheckBox BTN_CALC
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_CALC";
Pos = MAP_APPFONT ( 12 , 91 ) ;
Size = MAP_APPFONT ( 239 , 10 ) ;
Text [ en-US ] = "~Precision as shown" ;
};
CheckBox BTN_MATCH
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_MATCH";
Pos = MAP_APPFONT ( 12 , 105 ) ;
Size = MAP_APPFONT ( 239 , 10 ) ;
Text [ en-US ] = "Search criteria = and <> must apply to ~whole cells" ;
};
CheckBox BTN_REGEX
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_REGEX";
Pos = MAP_APPFONT ( 12 , 119 ) ;
Size = MAP_APPFONT ( 239 , 10 ) ;
Text [ en-US ] = "~Enable regular expressions in formulas" ;
};
CheckBox BTN_LOOKUP
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_LOOKUP";
Pos = MAP_APPFONT ( 12 , 133 ) ;
Size = MAP_APPFONT ( 239 , 10 ) ;
Text [ en-US ] = "~Automatically find column and row labels " ;
};
CheckBox BTN_GENERAL_PREC
{
HelpID = "sc:CheckBox:RID_SCPAGE_CALC:BTN_GENERAL_PREC";
Pos = MAP_APPFONT ( 12 , 147 ) ;
Size = MAP_APPFONT ( 164 , 10 ) ;
Text [ en-US ] = "~Limit decimals for general number format" ;
};
FixedText FT_PREC
{
Pos = MAP_APPFONT ( 169 , 147 ) ;
Size = MAP_APPFONT ( 53 , 8 ) ;
Text [ en-US ] = "~Decimal places" ;
Right = TRUE ;
};
NumericField ED_PREC
{
HelpID = "sc:NumericField:RID_SCPAGE_CALC:ED_PREC";
Border = TRUE ;
Pos = MAP_APPFONT ( 226 , 145 ) ;
Size = MAP_APPFONT ( 25 , 12 ) ;
Maximum = 20 ;
Spin = TRUE ;
Repeat = TRUE ;
};
};
TabPage RID_SCPAGE_FORMULA
{
HelpId = HID_SCPAGE_FORMULA ;
......
This diff is collapsed.
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