summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-17 09:40:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-17 10:16:01 +0000
commitb33c7476e6975ecd7cfb233a7a0e8b417870bea5 (patch)
tree7f6999a32c77bf36c388d3324f8d2d301bf1830d
parent59fd33c1f0495231e741437d6e9702b7687fc766 (diff)
convert data field dialog to .ui
Change-Id: I68da93c1227e8140511f3ad4071c87b3cf0443c0
-rw-r--r--extras/source/glade/libreoffice-catalog.xml.in4
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/inc/helpids.h1
-rw-r--r--sc/inc/sc.hrc1
-rw-r--r--sc/inc/scabstdlg.hxx2
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx16
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx2
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx153
-rw-r--r--sc/source/ui/dbgui/pvfundlg.src137
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx2
-rw-r--r--sc/source/ui/inc/pvfundlg.hxx35
-rw-r--r--sc/uiconfig/scalc/ui/datafielddialog.ui352
12 files changed, 455 insertions, 251 deletions
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"/>
+ <glade-widget-class title="ScDPFunctionListBox" name="scuilo-ScDPFunctionListBox"
+ generic-name="DPFunctionListBox" parent="GtkTreeView"
+ icon-name="widget-gtk-treeview"/>
+
<glade-widget-class title="Recent Documents View" name="sfxlo-RecentDocsView"
generic-name="Icon View" parent="GtkIconView"
icon-name="widget-gtk-iconview"/>
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 <com/sun/star/sheet/DataPilotFieldShowItemsMode.hpp>
#include <tools/resary.hxx>
+#include <vcl/builder.hxx>
#include <vcl/msgbox.hxx>
#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<ScDPLabelData::Member>& 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<ScDPLabelData::Member>::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<AbstractScDPFunctionDlg> 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 <sfx2/itemconnect.hxx>
#include "pivot.hxx"
+#include <boost/scoped_ptr.hpp>
#include <boost/unordered_map.hpp>
// ============================================================================
@@ -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<ScDPListBoxWrapper> 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Fri Jan 17 09:55:40 2014 -->
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkDialog" id="DataFieldDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Data Field</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="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="scuilo-ScDPFunctionListBox" id="functions:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </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="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Function</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="GtkCheckButton" id="checkbutton1">
+ <property name="label" translatable="yes">Show it_ems without data</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="GtkGrid" id="grid3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Name:</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="name">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</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">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkExpander" id="expander">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="resize_toplevel">True</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="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Type</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">type</property>
+ <property name="ellipsize">end</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="basefieldft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Base field</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">basefield</property>
+ <property name="ellipsize">end</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="GtkLabel" id="baseitemft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Ba_se item</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">baseitem</property>
+ <property name="ellipsize">end</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="GtkComboBoxText" id="type">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes">Normal</item>
+ <item translatable="yes">Difference from</item>
+ <item translatable="yes">% of</item>
+ <item translatable="yes">% difference from</item>
+ <item translatable="yes">Running total in</item>
+ <item translatable="yes">% of row</item>
+ <item translatable="yes">% of column</item>
+ <item translatable="yes">% of total</item>
+ <item translatable="yes">Index</item>
+ </items>
+ </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>
+ <child>
+ <object class="GtkComboBoxText" id="basefield">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="baseitem">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <items>
+ <item translatable="yes">- previous item -</item>
+ <item translatable="yes">- next item -</item>
+ </items>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</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">Displayed value</property>
+ </object>
+ </child>
+ </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>
+ </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>