From b33c7476e6975ecd7cfb233a7a0e8b417870bea5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 17 Jan 2014 09:40:03 +0000 Subject: convert data field dialog to .ui Change-Id: I68da93c1227e8140511f3ad4071c87b3cf0443c0 --- extras/source/glade/libreoffice-catalog.xml.in | 4 + 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 | 153 +++++------ sc/source/ui/dbgui/pvfundlg.src | 137 ---------- sc/source/ui/dbgui/pvlaydlg.cxx | 2 +- sc/source/ui/inc/pvfundlg.hxx | 35 ++- sc/uiconfig/scalc/ui/datafielddialog.ui | 352 +++++++++++++++++++++++++ 12 files changed, 455 insertions(+), 251 deletions(-) create mode 100644 sc/uiconfig/scalc/ui/datafielddialog.ui diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 6d7a6dcbe731..56572f206c28 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -578,6 +578,10 @@ generic-name="CondFormatList" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> + + diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 9fb69cfce895..729ae6966609 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -73,6 +73,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ sc/uiconfig/scalc/ui/covariancedialog \ sc/uiconfig/scalc/ui/createnamesdialog \ sc/uiconfig/scalc/ui/databaroptions \ + sc/uiconfig/scalc/ui/datafielddialog \ sc/uiconfig/scalc/ui/dataform \ sc/uiconfig/scalc/ui/datastreams \ sc/uiconfig/scalc/ui/definedatabaserangedialog \ diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index 67c6156ebd44..2e0cf5ed5542 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -152,7 +152,6 @@ #define HID_SC_DRAW_RENAME "SC_HID_SC_DRAW_RENAME" -#define HID_SC_DPDATAFIELD "SC_HID_SC_DPDATAFIELD" #define HID_SC_DPSUBT_OPT "SC_HID_SC_DPSUBT_OPT" #define HID_SC_DPSUBT_HIDE "SC_HID_SC_DPSUBT_HIDE" #define HID_SC_DPNUMGROUP "SC_HID_SC_DPNUMGROUP" diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index e6a61f444ec7..97630f8d8419 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1080,7 +1080,6 @@ #define RID_SCDLG_DAPIDATA (SC_DIALOGS_START + 131) -#define RID_SCDLG_DPDATAFIELD (SC_DIALOGS_START + 133) #define RID_SCDLG_DPSUBTOTAL_OPT (SC_DIALOGS_START + 134) #define RID_SCDLG_DPNUMGROUP (SC_DIALOGS_START + 135) #define RID_SCDLG_DPDATEGROUP (SC_DIALOGS_START + 136) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 52d52bca884f..9b63ee015264 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -416,7 +416,7 @@ public: virtual AbstractScPivotFilterDlg * CreateScPivotFilterDlg ( Window* pParent, const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId ) = 0; - virtual AbstractScDPFunctionDlg * CreateScDPFunctionDlg( Window* pParent, int nId, + virtual AbstractScDPFunctionDlg * CreateScDPFunctionDlg( Window* pParent, const ScDPLabelDataVector& rLabelVec, const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) = 0; diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index cf1208efbef8..01a2c54325f2 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -881,24 +881,12 @@ AbstractScPivotFilterDlg * ScAbstractDialogFactory_Impl::CreateScPivotFilterDlg } AbstractScDPFunctionDlg * ScAbstractDialogFactory_Impl::CreateScDPFunctionDlg ( Window* pParent, - int nId, const ScDPLabelDataVector& rLabelVec, const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) { - ScDPFunctionDlg * pDlg=NULL; - switch ( nId ) - { - case RID_SCDLG_DPDATAFIELD : - pDlg = new ScDPFunctionDlg( pParent, rLabelVec, rLabelData, rFuncData ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractScDPFunctionDlg_Impl( pDlg ); - return 0; + ScDPFunctionDlg * pDlg = new ScDPFunctionDlg( pParent, rLabelVec, rLabelData, rFuncData ); + return new AbstractScDPFunctionDlg_Impl( pDlg ); } AbstractScDPSubtotalDlg * ScAbstractDialogFactory_Impl::CreateScDPSubtotalDlg ( Window* pParent, diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 604357423560..69443d04c99d 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -485,7 +485,7 @@ public: virtual AbstractScPivotFilterDlg * CreateScPivotFilterDlg ( Window* pParent, const SfxItemSet& rArgSet, sal_uInt16 nSourceTab , int nId ); - virtual AbstractScDPFunctionDlg * CreateScDPFunctionDlg( Window* pParent, int nId, + virtual AbstractScDPFunctionDlg * CreateScDPFunctionDlg( Window* pParent, const ScDPLabelDataVector& rLabelVec, const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ); diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 40e431eb7f7b..6ca97fec319b 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -28,6 +28,7 @@ #include #include +#include #include #include "scresid.hxx" @@ -155,12 +156,27 @@ static const ScDPListBoxWrapper::MapEntryType spShowFromMap[] = // ============================================================================ -ScDPFunctionListBox::ScDPFunctionListBox( Window* pParent, const ResId& rResId ) : - MultiListBox( pParent, rResId ) +ScDPFunctionListBox::ScDPFunctionListBox(Window* pParent, WinBits nStyle) + : MultiListBox(pParent, nStyle) { FillFunctionNames(); } +ScDPFunctionListBox::ScDPFunctionListBox(Window* pParent, const ResId& rResId) + : MultiListBox(pParent, rResId) +{ + FillFunctionNames(); +} + +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeScDPFunctionListBox(Window *pParent, VclBuilder::stringmap &rMap) +{ + WinBits nWinStyle = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nWinStyle |= WB_BORDER; + return new ScDPFunctionListBox(pParent, nWinStyle); +} + void ScDPFunctionListBox::SetSelection( sal_uInt16 nFuncMask ) { if( (nFuncMask == PIVOT_FUNC_NONE) || (nFuncMask == PIVOT_FUNC_AUTO) ) @@ -191,45 +207,41 @@ void ScDPFunctionListBox::FillFunctionNames() ScDPFunctionDlg::ScDPFunctionDlg( Window* pParent, const ScDPLabelDataVector& rLabelVec, - const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData ) : - ModalDialog ( pParent, ScResId( RID_SCDLG_DPDATAFIELD ) ), - maFlFunc ( this, ScResId( FL_FUNC ) ), - maLbFunc ( this, ScResId( LB_FUNC ) ), - maFtNameLabel ( this, ScResId( FT_NAMELABEL ) ), - maFtName ( this, ScResId( FT_NAME ) ), - maFlDisplay ( this, ScResId( FL_DISPLAY ) ), - maFtType ( this, ScResId( FT_TYPE ) ), - maLbType ( this, ScResId( LB_TYPE ) ), - maFtBaseField ( this, ScResId( FT_BASEFIELD ) ), - maLbBaseField ( this, ScResId( LB_BASEFIELD ) ), - maFtBaseItem ( this, ScResId( FT_BASEITEM ) ), - maLbBaseItem ( this, ScResId( LB_BASEITEM ) ), - maBtnOk ( this, ScResId( BTN_OK ) ), - maBtnCancel ( this, ScResId( BTN_CANCEL ) ), - maBtnHelp ( this, ScResId( BTN_HELP ) ), - maBtnMore ( this, ScResId( BTN_MORE ) ), - maLbTypeWrp ( maLbType, spRefTypeMap ), - mrLabelVec ( rLabelVec ), - mbEmptyItem ( false ) -{ - FreeResource(); + const ScDPLabelData& rLabelData, const ScPivotFuncData& rFuncData) + : ModalDialog(pParent, "DataFieldDialog", + "modules/scalc/ui/datafielddialog.ui") + , mrLabelVec(rLabelVec) + , mbEmptyItem(false) +{ + get(mpFtName, "name"); + get(mpLbType, "type"); + mxLbTypeWrp.reset(new ScDPListBoxWrapper(*mpLbType, spRefTypeMap)); + get(mpLbFunc, "functions"); + mpLbFunc->set_height_request(mpLbFunc->GetTextHeight() * 8); + get(mpFtBaseField, "basefieldft"); + get(mpLbBaseField, "basefield"); + get(mpFtBaseItem, "baseitemft"); + get(mpLbBaseItem, "baseitem"); + get(mpBtnOk, "ok"); + Init( rLabelData, rFuncData ); - maLbFunc.EnableMultiSelection(false); + + mpLbFunc->EnableMultiSelection(false); } sal_uInt16 ScDPFunctionDlg::GetFuncMask() const { - return maLbFunc.GetSelection(); + return mpLbFunc->GetSelection(); } DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const { DataPilotFieldReference aRef; - aRef.ReferenceType = maLbTypeWrp.GetControlValue(); - aRef.ReferenceField = GetBaseFieldName(maLbBaseField.GetSelectEntry()); + aRef.ReferenceType = mxLbTypeWrp->GetControlValue(); + aRef.ReferenceField = GetBaseFieldName(mpLbBaseField->GetSelectEntry()); - sal_uInt16 nBaseItemPos = maLbBaseItem.GetSelectEntryPos(); + sal_uInt16 nBaseItemPos = mpLbBaseItem->GetSelectEntryPos(); switch( nBaseItemPos ) { case SC_BASEITEM_PREV_POS: @@ -242,7 +254,7 @@ DataPilotFieldReference ScDPFunctionDlg::GetFieldRef() const { aRef.ReferenceItemType = DataPilotFieldReferenceItemType::NAMED; if( !mbEmptyItem || (nBaseItemPos > SC_BASEITEM_USER_POS) ) - aRef.ReferenceItemName = GetBaseItemName(maLbBaseItem.GetSelectEntry()); + aRef.ReferenceItemName = GetBaseItemName(mpLbBaseItem->GetSelectEntry()); } } @@ -253,30 +265,21 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa { // list box sal_uInt16 nFuncMask = (rFuncData.mnFuncMask == PIVOT_FUNC_NONE) ? PIVOT_FUNC_SUM : rFuncData.mnFuncMask; - maLbFunc.SetSelection( nFuncMask ); + mpLbFunc->SetSelection( nFuncMask ); // field name - maFtName.SetText(rLabelData.getDisplayName()); - - // "More button" controls - maBtnMore.AddWindow( &maFlDisplay ); - maBtnMore.AddWindow( &maFtType ); - maBtnMore.AddWindow( &maLbType ); - maBtnMore.AddWindow( &maFtBaseField ); - maBtnMore.AddWindow( &maLbBaseField ); - maBtnMore.AddWindow( &maFtBaseItem ); - maBtnMore.AddWindow( &maLbBaseItem ); + mpFtName->SetText(rLabelData.getDisplayName()); // handlers - maLbFunc.SetDoubleClickHdl( LINK( this, ScDPFunctionDlg, DblClickHdl ) ); - maLbType.SetSelectHdl( LINK( this, ScDPFunctionDlg, SelectHdl ) ); - maLbBaseField.SetSelectHdl( LINK( this, ScDPFunctionDlg, SelectHdl ) ); + mpLbFunc->SetDoubleClickHdl( LINK( this, ScDPFunctionDlg, DblClickHdl ) ); + mpLbType->SetSelectHdl( LINK( this, ScDPFunctionDlg, SelectHdl ) ); + mpLbBaseField->SetSelectHdl( LINK( this, ScDPFunctionDlg, SelectHdl ) ); // base field list box OUString aSelectedEntry; for( ScDPLabelDataVector::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt ) { - maLbBaseField.InsertEntry(aIt->getDisplayName()); + mpLbBaseField->InsertEntry(aIt->getDisplayName()); maBaseFieldNameMap.insert( NameMapType::value_type(aIt->getDisplayName(), aIt->maName)); if (aIt->maName == rFuncData.maFieldRef.ReferenceField) @@ -284,41 +287,41 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScPivotFuncDa } // base item list box - maLbBaseItem.SetSeparatorPos( SC_BASEITEM_USER_POS - 1 ); + mpLbBaseItem->SetSeparatorPos( SC_BASEITEM_USER_POS - 1 ); // select field reference type - maLbTypeWrp.SetControlValue( rFuncData.maFieldRef.ReferenceType ); - SelectHdl( &maLbType ); // enables base field/item list boxes + mxLbTypeWrp->SetControlValue( rFuncData.maFieldRef.ReferenceType ); + SelectHdl( mpLbType ); // enables base field/item list boxes // select base field - maLbBaseField.SelectEntry(aSelectedEntry); - if( maLbBaseField.GetSelectEntryPos() >= maLbBaseField.GetEntryCount() ) - maLbBaseField.SelectEntryPos( 0 ); - SelectHdl( &maLbBaseField ); // fills base item list, selects base item + mpLbBaseField->SelectEntry(aSelectedEntry); + if( mpLbBaseField->GetSelectEntryPos() >= mpLbBaseField->GetEntryCount() ) + mpLbBaseField->SelectEntryPos( 0 ); + SelectHdl( mpLbBaseField ); // fills base item list, selects base item // select base item switch( rFuncData.maFieldRef.ReferenceItemType ) { case DataPilotFieldReferenceItemType::PREVIOUS: - maLbBaseItem.SelectEntryPos( SC_BASEITEM_PREV_POS ); + mpLbBaseItem->SelectEntryPos( SC_BASEITEM_PREV_POS ); break; case DataPilotFieldReferenceItemType::NEXT: - maLbBaseItem.SelectEntryPos( SC_BASEITEM_NEXT_POS ); + mpLbBaseItem->SelectEntryPos( SC_BASEITEM_NEXT_POS ); break; default: { if( mbEmptyItem && rFuncData.maFieldRef.ReferenceItemName.isEmpty() ) { // select special "(empty)" entry added before other items - maLbBaseItem.SelectEntryPos( SC_BASEITEM_USER_POS ); + mpLbBaseItem->SelectEntryPos( SC_BASEITEM_USER_POS ); } else { sal_uInt16 nStartPos = mbEmptyItem ? (SC_BASEITEM_USER_POS + 1) : SC_BASEITEM_USER_POS; sal_uInt16 nPos = FindBaseItemPos( rFuncData.maFieldRef.ReferenceItemName, nStartPos ); - if( nPos >= maLbBaseItem.GetEntryCount() ) - nPos = (maLbBaseItem.GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS; - maLbBaseItem.SelectEntryPos( nPos ); + if( nPos >= mpLbBaseItem->GetEntryCount() ) + nPos = (mpLbBaseItem->GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS; + mpLbBaseItem->SelectEntryPos( nPos ); } } } @@ -340,10 +343,10 @@ sal_uInt16 ScDPFunctionDlg::FindBaseItemPos( const OUString& rEntry, sal_uInt16 { sal_uInt16 nPos = nStartPos; bool bFound = false; - while (nPos < maLbBaseItem.GetEntryCount()) + while (nPos < mpLbBaseItem->GetEntryCount()) { // translate the displayed field name back to its original field name. - const OUString& rName = GetBaseItemName(maLbBaseItem.GetEntry(nPos)); + const OUString& rName = GetBaseItemName(mpLbBaseItem->GetEntry(nPos)); if (rName.equals(rEntry)) { bFound = true; @@ -356,10 +359,10 @@ sal_uInt16 ScDPFunctionDlg::FindBaseItemPos( const OUString& rEntry, sal_uInt16 IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox ) { - if( pLBox == &maLbType ) + if( pLBox == mpLbType ) { bool bEnableField, bEnableItem; - switch( maLbTypeWrp.GetControlValue() ) + switch( mxLbTypeWrp->GetControlValue() ) { case DataPilotFieldReferenceType::ITEM_DIFFERENCE: case DataPilotFieldReferenceType::ITEM_PERCENTAGE: @@ -376,27 +379,27 @@ IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox ) bEnableField = bEnableItem = false; } - bEnableField &= maLbBaseField.GetEntryCount() > 0; - maFtBaseField.Enable( bEnableField ); - maLbBaseField.Enable( bEnableField ); + bEnableField &= mpLbBaseField->GetEntryCount() > 0; + mpFtBaseField->Enable( bEnableField ); + mpLbBaseField->Enable( bEnableField ); bEnableItem &= bEnableField; - maFtBaseItem.Enable( bEnableItem ); - maLbBaseItem.Enable( bEnableItem ); + mpFtBaseItem->Enable( bEnableItem ); + mpLbBaseItem->Enable( bEnableItem ); } - else if( pLBox == &maLbBaseField ) + else if( pLBox == mpLbBaseField ) { // keep "previous" and "next" entries - while( maLbBaseItem.GetEntryCount() > SC_BASEITEM_USER_POS ) - maLbBaseItem.RemoveEntry( SC_BASEITEM_USER_POS ); + while( mpLbBaseItem->GetEntryCount() > SC_BASEITEM_USER_POS ) + mpLbBaseItem->RemoveEntry( SC_BASEITEM_USER_POS ); // update item list for current base field mbEmptyItem = false; - size_t nBasePos = maLbBaseField.GetSelectEntryPos(); + size_t nBasePos = mpLbBaseField->GetSelectEntryPos(); if( nBasePos < mrLabelVec.size() ) { const vector& rMembers = mrLabelVec[nBasePos].maMembers; - mbEmptyItem = lclFillListBox( maLbBaseItem, rMembers, SC_BASEITEM_USER_POS ); + mbEmptyItem = lclFillListBox(*mpLbBaseItem, rMembers, SC_BASEITEM_USER_POS); // build cache for base names. NameMapType aMap; vector::const_iterator itr = rMembers.begin(), itrEnd = rMembers.end(); @@ -406,15 +409,15 @@ IMPL_LINK( ScDPFunctionDlg, SelectHdl, ListBox*, pLBox ) } // select base item - sal_uInt16 nItemPos = (maLbBaseItem.GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS; - maLbBaseItem.SelectEntryPos( nItemPos ); + sal_uInt16 nItemPos = (mpLbBaseItem->GetEntryCount() > SC_BASEITEM_USER_POS) ? SC_BASEITEM_USER_POS : SC_BASEITEM_PREV_POS; + mpLbBaseItem->SelectEntryPos( nItemPos ); } return 0; } IMPL_LINK_NOARG(ScDPFunctionDlg, DblClickHdl) { - maBtnOk.Click(); + mpBtnOk->Click(); return 0; } diff --git a/sc/source/ui/dbgui/pvfundlg.src b/sc/source/ui/dbgui/pvfundlg.src index 7af9bc810d04..a826665524dd 100644 --- a/sc/source/ui/dbgui/pvfundlg.src +++ b/sc/source/ui/dbgui/pvfundlg.src @@ -39,143 +39,6 @@ StringArray SCSTR_DPFUNCLISTBOX // ---------------------------------------------------------------------------- -ModalDialog RID_SCDLG_DPDATAFIELD -{ - OutputSize = TRUE ; - HelpId = HID_SC_DPDATAFIELD ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 220 , 99 ) ; - Moveable = TRUE ; - Closeable = FALSE ; - Hide = TRUE ; - FixedLine FL_FUNC - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 152 , 8 ) ; - Text [ en-US ] = "~Function" ; - }; - MultiListBox LB_FUNC - { - HelpID = "sc:MultiListBox:RID_SCDLG_DPDATAFIELD:LB_FUNC"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 140 , 65 ) ; - TabStop = TRUE ; - AutoHScroll = TRUE ; - SimpleMode = TRUE ; - }; - FixedText FT_NAMELABEL - { - Pos = MAP_APPFONT ( 6 , 85 ) ; - Size = MAP_APPFONT ( 25 , 8 ) ; - Text [ en-US ] = "Name:" ; - }; - FixedText FT_NAME - { - Pos = MAP_APPFONT ( 32 , 85 ) ; - Size = MAP_APPFONT ( 126 , 8 ) ; - }; - FixedLine FL_DISPLAY - { - Pos = MAP_APPFONT( 6, 99 ); - Size = MAP_APPFONT( 152, 8 ); - Text [ en-US ] = "Displayed value"; - }; - FixedText FT_TYPE - { - Pos = MAP_APPFONT( 12, 112 ); - Size = MAP_APPFONT( 60, 8 ); - Text [ en-US ] = "~Type"; - }; - ListBox LB_TYPE - { - HelpID = "sc:ListBox:RID_SCDLG_DPDATAFIELD:LB_TYPE"; - Pos = MAP_APPFONT( 75, 110 ); - Size = MAP_APPFONT( 77, 120 ); - TabStop = TRUE; - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "Normal"; Default; >; - < "Difference from"; Default; >; - < "% of"; Default; >; - < "% difference from"; Default; >; - < "Running total in"; Default; >; - < "% of row"; Default; >; - < "% of column"; Default; >; - < "% of total"; Default; >; - < "Index"; Default; >; - }; - }; - FixedText FT_BASEFIELD - { - Pos = MAP_APPFONT( 12, 128 ); - Size = MAP_APPFONT( 60, 8 ); - Text [ en-US ] = "~Base field"; - }; - ListBox LB_BASEFIELD - { - HelpID = "sc:ListBox:RID_SCDLG_DPDATAFIELD:LB_BASEFIELD"; - Pos = MAP_APPFONT( 75, 126 ); - Size = MAP_APPFONT( 77, 120 ); - TabStop = TRUE; - Border = TRUE; - DropDown = TRUE; - }; - FixedText FT_BASEITEM - { - Pos = MAP_APPFONT( 12, 144 ); - Size = MAP_APPFONT( 60, 8 ); - Text [ en-US ] = "Ba~se item"; - }; - ListBox LB_BASEITEM - { - HelpID = "sc:ListBox:RID_SCDLG_DPDATAFIELD:LB_BASEITEM"; - Pos = MAP_APPFONT( 75, 142 ); - Size = MAP_APPFONT( 77, 120 ); - TabStop = TRUE; - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - < "- previous item -"; Default; >; - < "- next item -"; Default; >; - }; - }; - 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 ; - }; - MoreButton BTN_MORE - { - HelpID = "sc:MoreButton:RID_SCDLG_DPDATAFIELD:BTN_MORE"; - Pos = MAP_APPFONT ( 164 , 79 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - MapUnit = MAP_APPFONT ; - Delta = 61 ; - }; - Text [ en-US ] = "Data Field" ; -}; - -// ---------------------------------------------------------------------------- - ModalDialog RID_SCDLG_PIVOTSUBT { OutputSize = TRUE ; diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index e4a9beb2ad3b..ec09af1f5f05 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -806,7 +806,7 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI ScPivotFuncData& rFuncData = maWndData.GetFuncData(nFieldIndex); boost::scoped_ptr pDlg( pFact->CreateScDPFunctionDlg( - this, RID_SCDLG_DPDATAFIELD, maLabelData, *pData, rFuncData)); + this, maLabelData, *pData, rFuncData)); if ( pDlg->Execute() == RET_OK ) { diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index a89ab3882ad7..e30798f9bd74 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -34,6 +34,7 @@ #include #include "pivot.hxx" +#include #include // ============================================================================ @@ -47,7 +48,8 @@ class ScDPObject; class ScDPFunctionListBox : public MultiListBox { public: - explicit ScDPFunctionListBox( Window* pParent, const ResId& rResId ); + ScDPFunctionListBox(Window* pParent, WinBits nStyle); + ScDPFunctionListBox(Window* pParent, const ResId& rResId); void SetSelection( sal_uInt16 nFuncMask ); sal_uInt16 GetSelection() const; @@ -81,29 +83,22 @@ private: DECL_LINK( DblClickHdl, void* ); private: - FixedLine maFlFunc; - ScDPFunctionListBox maLbFunc; - FixedText maFtNameLabel; - FixedInfo maFtName; - FixedLine maFlDisplay; - FixedText maFtType; - ListBox maLbType; - FixedText maFtBaseField; - ListBox maLbBaseField; - FixedText maFtBaseItem; - ListBox maLbBaseItem; - OKButton maBtnOk; - CancelButton maBtnCancel; - HelpButton maBtnHelp; - MoreButton maBtnMore; + ScDPFunctionListBox* mpLbFunc; + FixedText* mpFtName; + ListBox* mpLbType; + FixedText* mpFtBaseField; + ListBox* mpLbBaseField; + FixedText* mpFtBaseItem; + ListBox* mpLbBaseItem; + OKButton* mpBtnOk; - NameMapType maBaseFieldNameMap; // cache for base field display -> original name. - NameMapType maBaseItemNameMap; // cache for base item display -> original name. + NameMapType maBaseFieldNameMap; // cache for base field display -> original name. + NameMapType maBaseItemNameMap; // cache for base item display -> original name. - ScDPListBoxWrapper maLbTypeWrp; /// Wrapper for direct usage of API constants. + boost::scoped_ptr mxLbTypeWrp; /// Wrapper for direct usage of API constants. const ScDPLabelDataVector& mrLabelVec; /// Data of all labels. - bool mbEmptyItem; /// true = Empty base item in listbox. + bool mbEmptyItem; /// true = Empty base item in listbox. }; // ============================================================================ diff --git a/sc/uiconfig/scalc/ui/datafielddialog.ui b/sc/uiconfig/scalc/ui/datafielddialog.ui new file mode 100644 index 000000000000..da0decc8b6d6 --- /dev/null +++ b/sc/uiconfig/scalc/ui/datafielddialog.ui @@ -0,0 +1,352 @@ + + + + + + + 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 + + + + + False + True + end + 0 + + + + + True + False + True + True + 12 + + + True + False + True + 0 + none + + + True + False + 6 + True + 6 + 12 + + + True + False + 6 + + + True + True + True + True + + + + + + 0 + 0 + 1 + 1 + + + + + + + + + True + False + Function + + + + + + + + 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 + + + + + True + True + True + + + True + False + 6 + True + 6 + 12 + + + True + False + 6 + 12 + + + True + False + 0 + _Type + True + type + end + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + _Base field + True + basefield + end + + + 0 + 1 + 1 + 1 + + + + + True + False + 0 + Ba_se item + True + baseitem + end + + + 0 + 2 + 1 + 1 + + + + + True + False + + Normal + Difference from + % of + % difference from + Running total in + % of row + % of column + % of total + Index + + + + 1 + 0 + 1 + 1 + + + + + True + False + + + 1 + 1 + 1 + 1 + + + + + True + False + + - previous item - + - next item - + + + + 1 + 2 + 1 + 1 + + + + + + + + + True + False + Displayed value + + + + + 0 + 3 + 1 + 1 + + + + + False + True + 1 + + + + + + ok + cancel + + + -- cgit