summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-24 14:29:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-24 15:06:41 +0100
commitd0e204942332cd825edc3a38ebf331c02fd4dcfe (patch)
treeadd8d372444891f3bec731357d0e0acf5c87d82e
parent51593c41efd7471777adb520814dede4d3f51044 (diff)
convert ScIconSetFrmtDataEntry to .ui and layout
Change-Id: I38ab8ef4ac642b73f4a4bcd5b1c44ba987e2a55c
-rw-r--r--sc/UIConfig_scalc.mk1
-rw-r--r--sc/inc/sc.hrc2
-rw-r--r--sc/source/ui/condformat/condformatdlgentry.cxx89
-rw-r--r--sc/source/ui/inc/condformatdlg.hrc4
-rw-r--r--sc/source/ui/src/condformatdlg.src38
-rw-r--r--sc/uiconfig/scalc/ui/functionpanel.ui2
6 files changed, 55 insertions, 81 deletions
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index d50164b6073f..db0f9a22fefe 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -101,6 +101,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/colwidthdialog \
sc/uiconfig/scalc/ui/condformatmanager \
sc/uiconfig/scalc/ui/conditionalformatdialog \
+ sc/uiconfig/scalc/ui/conditionaliconset \
sc/uiconfig/scalc/ui/conflictsdialog \
sc/uiconfig/scalc/ui/consolidatedialog \
sc/uiconfig/scalc/ui/correlationdialog \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 8cfc7f3e0efd..07844b5d9b12 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1094,8 +1094,6 @@
#define RID_POPUP_FILTER (SC_DIALOGS_START + 153)
#define RID_COND_ENTRY (SC_DIALOGS_START + 156)
-#define RID_ICON_SET_ENTRY (SC_DIALOGS_START + 158)
-
#define RID_SCDLG_COND_FORMAT_MANAGER (SC_DIALOGS_START + 159)
#define WID_CONDFRMT_REF (SC_DIALOGS_START + 163)
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx
index 32ba4edcc7a2..8bfabeed39cc 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1392,32 +1392,38 @@ IMPL_LINK_NOARG( ScDateFrmtEntry, StyleSelectHdl, ListBox&, void )
mbIsInStyleCreate = false;
}
-class ScIconSetFrmtDataEntry : public Control
-{
- private:
- VclPtr<FixedImage> maImgIcon;
- VclPtr<FixedText> maFtEntry;
- VclPtr<Edit> maEdEntry;
- VclPtr<ListBox> maLbEntryType;
-
- public:
- ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc,
- sal_Int32 i, const ScColorScaleEntry* pEntry = nullptr );
- virtual ~ScIconSetFrmtDataEntry() override;
- virtual void dispose() override;
-
- ScColorScaleEntry* CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const;
-
- void SetFirstEntry();
+class ScIconSetFrmtDataEntry : public VclContainer
+ , public VclBuilderContainer
+{
+private:
+ VclPtr<VclGrid> maGrid;
+ VclPtr<FixedImage> maImgIcon;
+ VclPtr<FixedText> maFtEntry;
+ VclPtr<Edit> maEdEntry;
+ VclPtr<ListBox> maLbEntryType;
+
+public:
+ ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc,
+ sal_Int32 i, const ScColorScaleEntry* pEntry = nullptr );
+ virtual ~ScIconSetFrmtDataEntry() override;
+ virtual Size calculateRequisition() const override;
+ virtual void setAllocation(const Size &rAllocation) override;
+ virtual void dispose() override;
+
+ ScColorScaleEntry* CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const;
+
+ void SetFirstEntry();
};
-ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc, sal_Int32 i, const ScColorScaleEntry* pEntry ):
- Control( pParent, ScResId( RID_ICON_SET_ENTRY ) ),
- maImgIcon( VclPtr<FixedImage>::Create( this, ScResId( IMG_ICON ) ) ),
- maFtEntry( VclPtr<FixedText>::Create( this, ScResId( FT_ICON_SET_ENTRY_TEXT ) ) ),
- maEdEntry( VclPtr<Edit>::Create( this, ScResId( ED_ICON_SET_ENTRY_VALUE ) ) ),
- maLbEntryType( VclPtr<ListBox>::Create( this, ScResId( LB_ICON_SET_ENTRY_TYPE ) ) )
+ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(vcl::Window* pParent, ScIconSetType eType, ScDocument* pDoc, sal_Int32 i, const ScColorScaleEntry* pEntry)
+ : VclContainer(pParent)
{
+ m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "modules/scalc/ui/conditionaliconset.ui");
+ get(maGrid, "ConditionalIconSet");
+ get(maImgIcon, "icon");
+ get(maFtEntry, "label");
+ get(maEdEntry, "entry");
+ get(maLbEntryType, "listbox");
maImgIcon->SetImage(Image(ScIconSetFormat::getBitmap(pDoc->GetIconSetBitmapMap(), eType, i)));
if(pEntry)
{
@@ -1447,7 +1453,16 @@ ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry( vcl::Window* pParent, ScIconSetT
{
maLbEntryType->SelectEntryPos(1);
}
- FreeResource();
+}
+
+Size ScIconSetFrmtDataEntry::calculateRequisition() const
+{
+ return getLayoutRequisition(*maGrid);
+}
+
+void ScIconSetFrmtDataEntry::setAllocation(const Size &rAllocation)
+{
+ setLayoutPosSize(*maGrid, Point(0, 0), rAllocation);
}
ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
@@ -1457,11 +1472,13 @@ ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
void ScIconSetFrmtDataEntry::dispose()
{
- maImgIcon.disposeAndClear();
- maFtEntry.disposeAndClear();
- maEdEntry.disposeAndClear();
- maLbEntryType.disposeAndClear();
- Control::dispose();
+ maImgIcon.clear();
+ maFtEntry.clear();
+ maEdEntry.clear();
+ maLbEntryType.clear();
+ maGrid.clear();
+ disposeBuilder();
+ VclContainer::dispose();
}
ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const ScAddress& rPos) const
@@ -1528,9 +1545,10 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc,
{
maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create(
this, eType, pDoc, i, pIconSetFormatData->m_Entries[i].get()));
- Point aPos = maEntries[0]->GetPosPixel();
- aPos.Y() += maEntries[0]->GetSizePixel().Height() * i * 1.2;
- maEntries[i]->SetPosPixel( aPos );
+ Size aSize(maEntries[0]->get_preferred_size());
+ Point aPos(0, LogicToPixel(Size(0, 35), MapMode(MapUnit::MapAppFont)).getHeight());
+ aPos.Y() += aSize.Height() * i * 1.2;
+ maEntries[i]->SetPosSizePixel(aPos, aSize);
}
maEntries[0]->SetFirstEntry();
}
@@ -1576,9 +1594,10 @@ IMPL_LINK_NOARG( ScIconSetFrmtEntry, IconSetTypeHdl, ListBox&, void )
for(size_t i = 0; i < nElements; ++i)
{
maEntries.push_back( VclPtr<ScIconSetFrmtDataEntry>::Create( this, static_cast<ScIconSetType>(nPos), mpDoc, i ) );
- Point aPos = maEntries[0]->GetPosPixel();
- aPos.Y() += maEntries[0]->GetSizePixel().Height() * i * 1.2;
- maEntries[i]->SetPosPixel( aPos );
+ Size aSize(maEntries[0]->get_preferred_size());
+ Point aPos(0, LogicToPixel(Size(0, 35), MapMode(MapUnit::MapAppFont)).getHeight());
+ aPos.Y() += aSize.Height() * i * 1.2;
+ maEntries[i]->SetPosSizePixel(aPos, aSize);
maEntries[i]->Show();
}
maEntries[0]->SetFirstEntry();
diff --git a/sc/source/ui/inc/condformatdlg.hrc b/sc/source/ui/inc/condformatdlg.hrc
index a35e9d60556c..5390597d8843 100644
--- a/sc/source/ui/inc/condformatdlg.hrc
+++ b/sc/source/ui/inc/condformatdlg.hrc
@@ -48,11 +48,7 @@
#define LB_DATE_TYPE 45
-#define IMG_ICON 46
#define LB_ICONSET_TYPE 47
-#define LB_ICON_SET_ENTRY_TYPE 48
-#define FT_ICON_SET_ENTRY_TEXT 49
-#define ED_ICON_SET_ENTRY_VALUE 50
#define FT_VAL 51
diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src
index ded2aa671a08..70d5b36ed27b 100644
--- a/sc/source/ui/src/condformatdlg.src
+++ b/sc/source/ui/src/condformatdlg.src
@@ -291,42 +291,4 @@ Control RID_COND_ENTRY
};
};
-Control RID_ICON_SET_ENTRY
-{
- Pos = MAP_APPFONT( 0, 35 );
- Size = MAP_APPFONT(300, 16);
- // Picture of the Icon
- FixedImage IMG_ICON
- {
- Pos = MAP_APPFONT( 5, 0 );
- Size = MAP_APPFONT( 16, 16 );
- };
- FixedText FT_ICON_SET_ENTRY_TEXT
- {
- Pos = MAP_APPFONT( 40, 0 );
- Size = MAP_APPFONT(40, 14);
- Text [en-US] = " >= ";
- };
- Edit ED_ICON_SET_ENTRY_VALUE
- {
- Pos = MAP_APPFONT( 90, 0 );
- Size = MAP_APPFONT( 40, 14 );
- Border = TRUE;
- };
- ListBox LB_ICON_SET_ENTRY_TYPE
- {
- Pos = MAP_APPFONT( 140, 0 );
- Size = MAP_APPFONT( 60, 40 );
- Border = TRUE;
- DropDown = TRUE;
- StringList [ en-US ] =
- {
- "Value";
- "Percent";
- "Percentile";
- "Formula";
- };
- };
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/uiconfig/scalc/ui/functionpanel.ui b/sc/uiconfig/scalc/ui/functionpanel.ui
index c0696602c088..1f367cee0535 100644
--- a/sc/uiconfig/scalc/ui/functionpanel.ui
+++ b/sc/uiconfig/scalc/ui/functionpanel.ui
@@ -101,7 +101,6 @@
</object>
<packing>
<property name="resize">True</property>
- <property name="shrink">True</property>
</packing>
</child>
<child>
@@ -117,7 +116,6 @@
</object>
<packing>
<property name="resize">False</property>
- <property name="shrink">True</property>
</packing>
</child>
</object>