From 8634c127d488a5aa8e994664b9ebc80860055fbf Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 17 Jan 2014 11:01:13 +0000 Subject: convert pivot table subtotals data field dialog to .ui Change-Id: I4ac7fb3a13cdc03d3c75cdd730bf39a7d814de99 --- sc/UIConfig_scalc.mk | 1 + sc/inc/helpids.h | 1 - sc/inc/sc.hrc | 1 - sc/inc/scabstdlg.hxx | 2 +- sc/source/ui/attrdlg/scdlgfact.cxx | 16 +- sc/source/ui/attrdlg/scdlgfact.hxx | 2 +- sc/source/ui/dbgui/pvfundlg.cxx | 72 ++++---- sc/source/ui/dbgui/pvfundlg.src | 100 ----------- sc/source/ui/dbgui/pvlaydlg.cxx | 2 +- sc/source/ui/inc/pvfundlg.hxx | 28 ++- sc/uiconfig/scalc/ui/pivotfielddialog.ui | 282 +++++++++++++++++++++++++++++++ 11 files changed, 335 insertions(+), 172 deletions(-) create mode 100644 sc/uiconfig/scalc/ui/pivotfielddialog.ui diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 729ae6966609..f688073e6704 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -119,6 +119,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/pagetemplatedialog \ sc/uiconfig/scalc/ui/paradialog \ sc/uiconfig/scalc/ui/paratemplatedialog \ + sc/uiconfig/scalc/ui/pivotfielddialog \ sc/uiconfig/scalc/ui/printareasdialog \ sc/uiconfig/scalc/ui/printeroptions \ sc/uiconfig/scalc/ui/protectsheetdlg \ diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index 2e0cf5ed5542..f9fd155b586a 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -53,7 +53,6 @@ // Hilfe IDs fuer Dialoge / Pages (max.70) ----------------------------------- #define HID_SC_PIVOTFILTER "SC_HID_SC_PIVOTFILTER" #define HID_SC_INPORTOPT "SC_HID_SC_INPORTOPT" -#define HID_SC_PIVOTSUBT "SC_HID_SC_PIVOTSUBT" #define HID_SC_NAVIGATOR "SC_HID_SC_NAVIGATOR" diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 97630f8d8419..9c51d903c7c5 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1017,7 +1017,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_PIVOTSUBT (SC_DIALOGS_START + 38) #define RID_SCDLG_NEWSCENARIO (SC_DIALOGS_START + 39) #define RID_SCDLG_INSERT_TABLE (SC_DIALOGS_START + 42) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 9b63ee015264..068e54405758 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -421,7 +421,7 @@ public: const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) = 0; - virtual AbstractScDPSubtotalDlg * CreateScDPSubtotalDlg( Window* pParent, int nId, + virtual AbstractScDPSubtotalDlg * CreateScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj, const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData, diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 01a2c54325f2..0229bfb712f5 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -890,26 +890,14 @@ AbstractScDPFunctionDlg * ScAbstractDialogFactory_Impl::CreateScDPFunctionDlg ( } AbstractScDPSubtotalDlg * ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg ( Window* pParent, - int nId, ScDPObject& rDPObj, const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData, const ScDPNameVec& rDataFields, bool bEnableLayout ) { - ScDPSubtotalDlg * pDlg=NULL; - switch ( nId ) - { - case RID_SCDLG_PIVOTSUBT : - pDlg = new ScDPSubtotalDlg( pParent, rDPObj, rLabelData, rFuncData, rDataFields, bEnableLayout ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractScDPSubtotalDlg_Impl( pDlg ); - return 0; + ScDPSubtotalDlg * pDlg = new ScDPSubtotalDlg( pParent, rDPObj, rLabelData, rFuncData, rDataFields, bEnableLayout ); + return new AbstractScDPSubtotalDlg_Impl( pDlg ); } AbstractScDPNumGroupDlg * ScAbstractDialogFactory_Impl::CreateScDPNumGroupDlg( diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 69443d04c99d..c819c28e94c0 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -490,7 +490,7 @@ public: const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ); - virtual AbstractScDPSubtotalDlg * CreateScDPSubtotalDlg( Window* pParent, int nId, + virtual AbstractScDPSubtotalDlg * CreateScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj, const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData, diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 6ca97fec319b..c6f5e1347a7f 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -425,26 +425,24 @@ IMPL_LINK_NOARG(ScDPFunctionDlg, DblClickHdl) ScDPSubtotalDlg::ScDPSubtotalDlg( Window* pParent, ScDPObject& rDPObj, const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData, - const ScDPNameVec& rDataFields, bool bEnableLayout ) : - ModalDialog ( pParent, ScResId( RID_SCDLG_PIVOTSUBT ) ), - maFlSubt ( this, ScResId( FL_FUNC ) ), - maRbNone ( this, ScResId( RB_NONE ) ), - maRbAuto ( this, ScResId( RB_AUTO ) ), - maRbUser ( this, ScResId( RB_USER ) ), - maLbFunc ( this, ScResId( LB_FUNC ) ), - maFtNameLabel ( this, ScResId( FT_NAMELABEL ) ), - maFtName ( this, ScResId( FT_NAME ) ), - maCbShowAll ( this, ScResId( CB_SHOWALL ) ), - maBtnOk ( this, ScResId( BTN_OK ) ), - maBtnCancel ( this, ScResId( BTN_CANCEL ) ), - maBtnHelp ( this, ScResId( BTN_HELP ) ), - maBtnOptions ( this, ScResId( BTN_OPTIONS ) ), - mrDPObj ( rDPObj ), - mrDataFields ( rDataFields ), - maLabelData ( rLabelData ), - mbEnableLayout ( bEnableLayout ) + const ScDPNameVec& rDataFields, bool bEnableLayout ) + : ModalDialog(pParent, "PivotFieldDialog", + "modules/scalc/ui/pivotfielddialog.ui") + , mrDPObj(rDPObj) + , mrDataFields(rDataFields) + , maLabelData(rLabelData) + , mbEnableLayout(bEnableLayout) { - FreeResource(); + get(mpBtnOk, "ok"); + get(mpBtnOptions, "options"); + get(mpCbShowAll, "showall"); + get(mpFtName, "name"); + get(mpLbFunc, "functions"); + mpLbFunc->set_height_request(mpLbFunc->GetTextHeight() * 8); + get(mpRbNone, "none"); + get(mpRbAuto, "auto"); + get(mpRbUser, "user"); + Init( rLabelData, rFuncData ); } @@ -452,10 +450,10 @@ sal_uInt16 ScDPSubtotalDlg::GetFuncMask() const { sal_uInt16 nFuncMask = PIVOT_FUNC_NONE; - if( maRbAuto.IsChecked() ) + if( mpRbAuto->IsChecked() ) nFuncMask = PIVOT_FUNC_AUTO; - else if( maRbUser.IsChecked() ) - nFuncMask = maLbFunc.GetSelection(); + else if( mpRbUser->IsChecked() ) + nFuncMask = mpLbFunc->GetSelection(); return nFuncMask; } @@ -464,7 +462,7 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const { rLabelData.mnFuncMask = GetFuncMask(); rLabelData.mnUsedHier = maLabelData.mnUsedHier; - rLabelData.mbShowAll = maCbShowAll.IsChecked(); + rLabelData.mbShowAll = mpCbShowAll->IsChecked(); rLabelData.maMembers = maLabelData.maMembers; rLabelData.maSortInfo = maLabelData.maSortInfo; rLabelData.maLayoutInfo = maLabelData.maLayoutInfo; @@ -474,51 +472,51 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) { // field name - maFtName.SetText(rLabelData.getDisplayName()); + mpFtName->SetText(rLabelData.getDisplayName()); // radio buttons - maRbNone.SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); - maRbAuto.SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); - maRbUser.SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); + mpRbNone->SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); + mpRbAuto->SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); + mpRbUser->SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); RadioButton* pRBtn = 0; switch( rFuncData.mnFuncMask ) { - case PIVOT_FUNC_NONE: pRBtn = &maRbNone; break; - case PIVOT_FUNC_AUTO: pRBtn = &maRbAuto; break; - default: pRBtn = &maRbUser; + case PIVOT_FUNC_NONE: pRBtn = mpRbNone; break; + case PIVOT_FUNC_AUTO: pRBtn = mpRbAuto; break; + default: pRBtn = mpRbUser; } pRBtn->Check(); RadioClickHdl( pRBtn ); // list box - maLbFunc.SetSelection( rFuncData.mnFuncMask ); - maLbFunc.SetDoubleClickHdl( LINK( this, ScDPSubtotalDlg, DblClickHdl ) ); + mpLbFunc->SetSelection( rFuncData.mnFuncMask ); + mpLbFunc->SetDoubleClickHdl( LINK( this, ScDPSubtotalDlg, DblClickHdl ) ); // show all - maCbShowAll.Check( rLabelData.mbShowAll ); + mpCbShowAll->Check( rLabelData.mbShowAll ); // options - maBtnOptions.SetClickHdl( LINK( this, ScDPSubtotalDlg, ClickHdl ) ); + mpBtnOptions->SetClickHdl( LINK( this, ScDPSubtotalDlg, ClickHdl ) ); } // ---------------------------------------------------------------------------- IMPL_LINK( ScDPSubtotalDlg, RadioClickHdl, RadioButton*, pBtn ) { - maLbFunc.Enable( pBtn == &maRbUser ); + mpLbFunc->Enable( pBtn == mpRbUser ); return 0; } IMPL_LINK_NOARG(ScDPSubtotalDlg, DblClickHdl) { - maBtnOk.Click(); + mpBtnOk->Click(); return 0; } IMPL_LINK( ScDPSubtotalDlg, ClickHdl, PushButton*, pBtn ) { - if( pBtn == &maBtnOptions ) + if (pBtn == mpBtnOptions) { ScDPSubtotalOptDlg* pDlg = new ScDPSubtotalOptDlg( this, mrDPObj, maLabelData, mrDataFields, mbEnableLayout ); if( pDlg->Execute() == RET_OK ) diff --git a/sc/source/ui/dbgui/pvfundlg.src b/sc/source/ui/dbgui/pvfundlg.src index a826665524dd..3fc2210dc6a5 100644 --- a/sc/source/ui/dbgui/pvfundlg.src +++ b/sc/source/ui/dbgui/pvfundlg.src @@ -39,106 +39,6 @@ StringArray SCSTR_DPFUNCLISTBOX // ---------------------------------------------------------------------------- -ModalDialog RID_SCDLG_PIVOTSUBT -{ - OutputSize = TRUE ; - HelpId = HID_SC_PIVOTSUBT ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 220 , 155 ) ; - Text [ en-US ] = "Data Field" ; - Moveable = TRUE ; - Closeable = FALSE ; - Hide = TRUE ; - RadioButton RB_NONE - { - HelpID = "sc:RadioButton:RID_SCDLG_PIVOTSUBT:RB_NONE"; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 140 , 10 ) ; - Text [ en-US ] = "~None" ; - TabStop = TRUE ; - }; - RadioButton RB_AUTO - { - HelpID = "sc:RadioButton:RID_SCDLG_PIVOTSUBT:RB_AUTO"; - Pos = MAP_APPFONT ( 12 , 28 ) ; - Size = MAP_APPFONT ( 140 , 10 ) ; - Text [ en-US ] = "~Automatic" ; - TabStop = TRUE ; - }; - RadioButton RB_USER - { - HelpID = "sc:RadioButton:RID_SCDLG_PIVOTSUBT:RB_USER"; - Pos = MAP_APPFONT ( 12 , 42 ) ; - Size = MAP_APPFONT ( 140 , 10 ) ; - Text [ en-US ] = "~User-defined" ; - TabStop = TRUE ; - }; - MultiListBox LB_FUNC - { - HelpID = "sc:MultiListBox:RID_SCDLG_PIVOTSUBT:LB_FUNC"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 56 ) ; - Size = MAP_APPFONT ( 140 , 65 ) ; - TabStop = TRUE ; - AutoHScroll = TRUE ; - SimpleMode = TRUE ; - }; - FixedLine FL_FUNC - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 152 , 8 ) ; - Text [ en-US ] = "Subtotals" ; - }; - CheckBox CB_SHOWALL - { - HelpID = "sc:CheckBox:RID_SCDLG_PIVOTSUBT:CB_SHOWALL"; - Pos = MAP_APPFONT ( 6 , 127 ) ; - Size = MAP_APPFONT ( 152 , 10 ) ; - Text [ en-US ] = "Show it~ems without data"; - TabStop = TRUE ; - }; - FixedText FT_NAMELABEL - { - Pos = MAP_APPFONT ( 6 , 141 ) ; - Size = MAP_APPFONT ( 25 , 8 ) ; - Text [ en-US ] = "Name:" ; - }; - FixedText FT_NAME - { - Pos = MAP_APPFONT ( 32 , 141 ) ; - Size = MAP_APPFONT ( 126 , 8 ) ; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 164 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 164 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 164 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - PushButton BTN_OPTIONS - { - HelpID = "sc:PushButton:RID_SCDLG_PIVOTSUBT:BTN_OPTIONS"; - Pos = MAP_APPFONT ( 164 , 135 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Options..."; - }; -}; - -// ---------------------------------------------------------------------------- - ModalDialog RID_SCDLG_DPSUBTOTAL_OPT { OutputSize = TRUE; diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index ec09af1f5f05..d7e43d55ea55 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -790,7 +790,7 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI boost::scoped_ptr pDlg( pFact->CreateScDPSubtotalDlg( - this, RID_SCDLG_PIVOTSUBT, *mxDlgDPObject, *pData, rFunc, + this, *mxDlgDPObject, *pData, rFunc, aDataFieldNames, bLayout)); if ( pDlg->Execute() == RET_OK ) diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index e30798f9bd74..a88554181090 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -122,24 +122,20 @@ private: DECL_LINK( ClickHdl, PushButton* ); private: - FixedLine maFlSubt; - RadioButton maRbNone; - RadioButton maRbAuto; - RadioButton maRbUser; - ScDPFunctionListBox maLbFunc; - FixedText maFtNameLabel; - FixedInfo maFtName; - CheckBox maCbShowAll; - OKButton maBtnOk; - CancelButton maBtnCancel; - HelpButton maBtnHelp; - PushButton maBtnOptions; + RadioButton* mpRbNone; + RadioButton* mpRbAuto; + RadioButton* mpRbUser; + ScDPFunctionListBox* mpLbFunc; + FixedText* mpFtName; + CheckBox* mpCbShowAll; + OKButton* mpBtnOk; + PushButton* mpBtnOptions; - ScDPObject& mrDPObj; /// The DataPilot object (for member names). - const ScDPNameVec& mrDataFields; /// The list of all data field names. + ScDPObject& mrDPObj; /// The DataPilot object (for member names). + const ScDPNameVec& mrDataFields; /// The list of all data field names. - ScDPLabelData maLabelData; /// Cache for sub dialog. - bool mbEnableLayout; /// true = Enable Layout mode controls. + ScDPLabelData maLabelData; /// Cache for sub dialog. + bool mbEnableLayout; /// true = Enable Layout mode controls. }; // ============================================================================ diff --git a/sc/uiconfig/scalc/ui/pivotfielddialog.ui b/sc/uiconfig/scalc/ui/pivotfielddialog.ui new file mode 100644 index 000000000000..dcf9127d7887 --- /dev/null +++ b/sc/uiconfig/scalc/ui/pivotfielddialog.ui @@ -0,0 +1,282 @@ + + + + + + + False + 6 + Data Field + dialog + + + False + True + True + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + _Options... + True + True + True + True + + + False + True + 3 + True + + + + + False + True + end + 0 + + + + + True + False + True + True + 12 + + + True + False + True + 0 + none + + + True + False + 6 + True + 6 + 12 + + + True + False + 6 + + + _None + True + True + False + True + 0 + True + True + auto + + + 0 + 0 + 1 + 1 + + + + + _Automatic + True + True + False + True + 0 + True + user + + + 0 + 1 + 1 + 1 + + + + + _User-defined + True + True + False + True + 0 + True + none + + + 0 + 2 + 1 + 1 + + + + + True + True + True + True + + + + + + 0 + 3 + 1 + 1 + + + + + + + + + True + False + Subtotals + + + + + + + + 0 + 0 + 1 + 1 + + + + + Show it_ems without data + True + True + False + True + 0 + True + + + 0 + 1 + 1 + 1 + + + + + True + False + 12 + + + True + False + 0 + Name: + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + + + 1 + 0 + 1 + 1 + + + + + 0 + 2 + 1 + 1 + + + + + False + True + 1 + + + + + + ok + cancel + + + -- cgit value='libreoffice-4-3-7'>libreoffice-4-3-7 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author