From 7549878fd63bb2792432865958874c644a948d45 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 24 Oct 2016 15:44:56 +0100 Subject: convert conditional format src fragment to .ui and layout this is a difficult widget Change-Id: If4ea45230679c46f7ad763f07c876dd74d4478d0 --- sc/source/ui/condformat/condformatdlg.cxx | 3 +- sc/source/ui/condformat/condformatdlgentry.cxx | 287 ++++++++++++------------ sc/source/ui/inc/condformatdlg.hrc | 55 ----- sc/source/ui/inc/condformatdlgentry.hxx | 6 +- sc/source/ui/src/condformatdlg.src | 294 ------------------------- 5 files changed, 152 insertions(+), 493 deletions(-) delete mode 100644 sc/source/ui/inc/condformatdlg.hrc delete mode 100644 sc/source/ui/src/condformatdlg.src (limited to 'sc/source') diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 82fb4068e576..4d03fcfb890f 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -8,7 +8,6 @@ */ #include "condformatdlg.hxx" -#include "condformatdlg.hrc" #include #include @@ -158,7 +157,7 @@ VCL_BUILDER_DECL_FACTORY(ScCondFormatList) Size ScCondFormatList::GetOptimalSize() const { - return LogicToPixel(Size(290, 185), MapUnit::MapAppFont); + return LogicToPixel(Size(300, 185), MapUnit::MapAppFont); } void ScCondFormatList::Resize() diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 8bfabeed39cc..415aa11274e5 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -9,7 +9,6 @@ #include "condformatdlg.hxx" #include "condformatdlgentry.hxx" -#include "condformatdlg.hrc" #include "conditio.hxx" #include "document.hxx" @@ -33,20 +32,25 @@ #include "colorformat.hxx" #include "globstr.hrc" +#include "sc.hrc" #include -ScCondFrmtEntry::ScCondFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos): - Control(pParent, ScResId( RID_COND_ENTRY ) ), - mbActive(false), - maFtCondNr( VclPtr::Create( this, ScResId( FT_COND_NR ) ) ), - maFtCondition( VclPtr::Create( this, ScResId( FT_CONDITION ) ) ), - mnIndex(0), - maStrCondition(ScResId(SCSTR_CONDITION).toString()), - maLbType( VclPtr::Create( this, ScResId( LB_TYPE ) ) ), - mpDoc(pDoc), - maPos(rPos) +ScCondFrmtEntry::ScCondFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos) + : VclContainer(pParent, WB_CLIPCHILDREN | WB_BORDER) + , mbActive(false) + , mnIndex(0) + , maStrCondition(ScResId(SCSTR_CONDITION).toString()) + , mpDoc(pDoc) + , maPos(rPos) { + m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "modules/scalc/ui/conditionalentry.ui"); + + get(maGrid, "grid"); + get(maFtCondNr, "number"); + get(maFtCondition, "condition"); + get(maLbType, "type"); + Color aBack(GetSettings().GetStyleSettings().GetWindowColor()); SetControlBackground(aBack); @@ -60,6 +64,8 @@ ScCondFrmtEntry::ScCondFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, const S maLbType->SetSelectHdl( LINK( pParent, ScCondFormatList, TypeListHdl ) ); maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl ); + + Show(); } ScCondFrmtEntry::~ScCondFrmtEntry() @@ -67,21 +73,33 @@ ScCondFrmtEntry::~ScCondFrmtEntry() disposeOnce(); } +Size ScCondFrmtEntry::calculateRequisition() const +{ + return getLayoutRequisition(*maGrid); +} + +void ScCondFrmtEntry::setAllocation(const Size &rAllocation) +{ + setLayoutPosSize(*maGrid, Point(0, 0), rAllocation); +} + void ScCondFrmtEntry::dispose() { - maFtCondNr.disposeAndClear(); - maFtCondition.disposeAndClear(); - maLbType.disposeAndClear(); - Control::dispose(); + maFtCondNr.clear(); + maFtCondition.clear(); + maLbType.clear(); + maGrid.clear(); + disposeBuilder(); + VclContainer::dispose(); } bool ScCondFrmtEntry::Notify( NotifyEvent& rNEvt ) { - if( rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN ) + if (rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN) { - ImplCallEventListenersAndHandler( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, [this] () { maClickHdl.Call(*this); } ); + maClickHdl.Call(*this); } - return Control::Notify(rNEvt); + return VclContainer::Notify(rNEvt); } void ScCondFrmtEntry::SetIndex(sal_Int32 nIndex) @@ -94,24 +112,11 @@ void ScCondFrmtEntry::SetIndex(sal_Int32 nIndex) void ScCondFrmtEntry::SetHeight() { - long nPad = LogicToPixel(Size(42,2), MapMode(MapUnit::MapAppFont)).getHeight(); - - // Calculate maximum height we need from visible widgets - sal_uInt16 nChildren = GetChildCount(); - - long nMaxHeight = 0; - for(sal_uInt16 i = 0; i < nChildren; i++) - { - vcl::Window *pChild = GetChild(i); - if(!pChild || !pChild->IsVisible()) - continue; - Point aPos = pChild->GetPosPixel(); - Size aSize = pChild->GetSizePixel(); - nMaxHeight = std::max(aPos.Y() + aSize.Height(), nMaxHeight); - } - Size aSize = GetSizePixel(); - if(nMaxHeight > 0) + const long nMaxHeight = get_preferred_size().Height(); + if (nMaxHeight > 0) { + Size aSize = GetSizePixel(); + const long nPad = LogicToPixel(Size(0, 2), MapMode(MapUnit::MapAppFont)).getHeight(); aSize.Height() = nMaxHeight + nPad; SetSizePixel(aSize); } @@ -186,20 +191,20 @@ const ScConditionMode ScConditionFrmtEntry::mpEntryToCond[ScConditionFrmtEntry:: SC_COND_NOT_CONTAINS_TEXT }; -ScConditionFrmtEntry::ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, - const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry ): - ScCondFrmtEntry( pParent, pDoc, rPos ), - maLbCondType( VclPtr::Create( this, ScResId( LB_CELLIS_TYPE ) ) ), - maEdVal1( VclPtr::Create( this, nullptr, nullptr, ScResId( ED_VAL1 ) ) ), - maEdVal2( VclPtr::Create( this, nullptr, nullptr, ScResId( ED_VAL2 ) ) ), - maFtVal( VclPtr::Create( this, ScResId( FT_VAL ) ) ), - maFtStyle( VclPtr::Create( this, ScResId( FT_STYLE ) ) ), - maLbStyle( VclPtr::Create( this, ScResId( LB_STYLE ) ) ), - maWdPreview( VclPtr::Create( this, ScResId( WD_PREVIEW ) ) ), - mbIsInStyleCreate(false) +ScConditionFrmtEntry::ScConditionFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, + const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry) + : ScCondFrmtEntry(pParent, pDoc, rPos) + , mbIsInStyleCreate(false) { + get(maLbCondType, "typeis"); + get(maEdVal1, "val1"); + get(maEdVal2, "val2"); + get(maFtVal, "valueft"); + get(maFtStyle, "styleft"); + get(maLbStyle, "style"); + get(maWdPreview, "preview"); + maWdPreview->set_height_request(maLbStyle->get_preferred_size().Height()); - FreeResource(); maLbType->SelectEntryPos(1); Init(pDialogParent); @@ -252,13 +257,13 @@ ScConditionFrmtEntry::~ScConditionFrmtEntry() void ScConditionFrmtEntry::dispose() { - maLbCondType.disposeAndClear(); - maEdVal1.disposeAndClear(); - maEdVal2.disposeAndClear(); - maFtVal.disposeAndClear(); - maFtStyle.disposeAndClear(); - maLbStyle.disposeAndClear(); - maWdPreview.disposeAndClear(); + maLbCondType.clear(); + maEdVal1.clear(); + maEdVal2.clear(); + maFtVal.clear(); + maFtStyle.clear(); + maLbStyle.clear(); + maWdPreview.clear(); ScCondFrmtEntry::dispose(); } @@ -348,7 +353,6 @@ void ScConditionFrmtEntry::Deselect() ScCondFrmtEntry::Deselect(); } - sal_Int32 ScConditionFrmtEntry::ConditionModeToEntryPos( ScConditionMode eMode ) { for ( sal_Int32 i = 0; i < NUM_COND_ENTRIES; ++i ) @@ -552,16 +556,17 @@ IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl, ListBox&, void) // formula -ScFormulaFrmtEntry::ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormat ): - ScCondFrmtEntry( pParent, pDoc, rPos ), - maFtStyle( VclPtr::Create( this, ScResId( FT_STYLE ) ) ), - maLbStyle( VclPtr::Create( this, ScResId( LB_STYLE ) ) ), - maWdPreview( VclPtr::Create( this, ScResId( WD_PREVIEW ) ) ), - maEdFormula( VclPtr::Create(this, nullptr, nullptr, ScResId( ED_FORMULA ) ) ) +ScFormulaFrmtEntry::ScFormulaFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, ScCondFormatDlg* pDialogParent, const ScAddress& rPos, const ScCondFormatEntry* pFormat ) + : ScCondFrmtEntry(pParent, pDoc, rPos) { + get(maFtStyle, "styleft"); + get(maLbStyle, "style"); + get(maWdPreview, "preview"); + maWdPreview->set_height_request(maLbStyle->get_preferred_size().Height()); + get(maEdFormula, "formula"); + Init(pDialogParent); - FreeResource(); maLbType->SelectEntryPos(2); if(pFormat) @@ -584,10 +589,10 @@ ScFormulaFrmtEntry::~ScFormulaFrmtEntry() void ScFormulaFrmtEntry::dispose() { - maFtStyle.disposeAndClear(); - maLbStyle.disposeAndClear(); - maWdPreview.disposeAndClear(); - maEdFormula.disposeAndClear(); + maFtStyle.clear(); + maLbStyle.clear(); + maWdPreview.clear(); + maEdFormula.clear(); ScCondFrmtEntry::dispose(); } @@ -733,16 +738,17 @@ ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListB } -ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ): - ScCondFrmtEntry( pParent, pDoc, rPos ), - maLbColorFormat( VclPtr::Create( this, ScResId( LB_COLOR_FORMAT ) ) ), - maLbEntryTypeMin( VclPtr::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ), - maLbEntryTypeMax( VclPtr::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ), - maEdMin( VclPtr::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ), - maEdMax( VclPtr::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ), - maLbColMin( VclPtr::Create( this, ScResId( LB_COL_MIN ) ) ), - maLbColMax( VclPtr::Create( this, ScResId( LB_COL_MAX ) ) ) +ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ) + : ScCondFrmtEntry(pParent, pDoc, rPos) { + get(maLbColorFormat, "colorformat"); + get(maLbEntryTypeMin, "colscalemin"); + get(maLbEntryTypeMax, "colscalemax"); + get(maEdMin, "edcolscalemin"); + get(maEdMax, "edcolscalemax"); + get(maLbColMin, "lbcolmin"); + get(maLbColMax, "lbcolmax"); + // remove the automatic entry from color scales maLbEntryTypeMin->RemoveEntry(0); maLbEntryTypeMax->RemoveEntry(0); @@ -762,7 +768,6 @@ ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( vcl::Window* pParent, ScDocument maLbEntryTypeMin->SelectEntryPos(0); maLbEntryTypeMax->SelectEntryPos(1); } - FreeResource(); maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); @@ -777,13 +782,13 @@ ScColorScale2FrmtEntry::~ScColorScale2FrmtEntry() void ScColorScale2FrmtEntry::dispose() { - maLbColorFormat.disposeAndClear(); - maLbEntryTypeMin.disposeAndClear(); - maLbEntryTypeMax.disposeAndClear(); - maEdMin.disposeAndClear(); - maEdMax.disposeAndClear(); - maLbColMin.disposeAndClear(); - maLbColMax.disposeAndClear(); + maLbColorFormat.clear(); + maLbEntryTypeMin.clear(); + maLbEntryTypeMax.clear(); + maEdMin.clear(); + maEdMax.clear(); + maLbColMin.clear(); + maLbColMax.clear(); ScCondFrmtEntry::dispose(); } @@ -899,19 +904,20 @@ IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox&, rBox, void ) pEd->Disable(); } -ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ): - ScCondFrmtEntry( pParent, pDoc, rPos ), - maLbColorFormat( VclPtr::Create( this, ScResId( LB_COLOR_FORMAT ) ) ), - maLbEntryTypeMin( VclPtr::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ), - maLbEntryTypeMiddle( VclPtr::Create( this, ScResId( LB_TYPE_COL_SCALE_MIDDLE ) ) ), - maLbEntryTypeMax( VclPtr::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ), - maEdMin( VclPtr::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ), - maEdMiddle( VclPtr::Create( this, ScResId( ED_COL_SCALE_MIDDLE ) ) ), - maEdMax( VclPtr::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ), - maLbColMin( VclPtr::Create( this, ScResId( LB_COL_MIN ) ) ), - maLbColMiddle( VclPtr::Create( this, ScResId( LB_COL_MIDDLE ) ) ), - maLbColMax( VclPtr::Create( this, ScResId( LB_COL_MAX ) ) ) +ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ) + : ScCondFrmtEntry(pParent, pDoc, rPos) { + get(maLbColorFormat, "colorformat"); + get(maLbEntryTypeMin, "colscalemin"); + get(maLbEntryTypeMiddle, "colscalemiddle"); + get(maLbEntryTypeMax, "colscalemax"); + get(maEdMin, "edcolscalemin"); + get(maEdMiddle, "edcolscalemiddle"); + get(maEdMax, "edcolscalemax"); + get(maLbColMin, "lbcolmin"); + get(maLbColMiddle, "lbcolmiddle"); + get(maLbColMax, "lbcolmax"); + // remove the automatic entry from color scales maLbEntryTypeMin->RemoveEntry(0); maLbEntryTypeMiddle->RemoveEntry(0); @@ -938,7 +944,6 @@ ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( vcl::Window* pParent, ScDocument maLbEntryTypeMax->SelectEntryPos(1); maEdMiddle->SetText(OUString::number(50)); } - FreeResource(); maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); EntryTypeHdl(*maLbEntryTypeMin.get()); @@ -953,16 +958,16 @@ ScColorScale3FrmtEntry::~ScColorScale3FrmtEntry() void ScColorScale3FrmtEntry::dispose() { - maLbColorFormat.disposeAndClear(); - maLbEntryTypeMin.disposeAndClear(); - maLbEntryTypeMiddle.disposeAndClear(); - maLbEntryTypeMax.disposeAndClear(); - maEdMin.disposeAndClear(); - maEdMiddle.disposeAndClear(); - maEdMax.disposeAndClear(); - maLbColMin.disposeAndClear(); - maLbColMiddle.disposeAndClear(); - maLbColMax.disposeAndClear(); + maLbColorFormat.clear(); + maLbEntryTypeMin.clear(); + maLbEntryTypeMiddle.clear(); + maLbEntryTypeMax.clear(); + maEdMin.clear(); + maEdMiddle.clear(); + maEdMax.clear(); + maLbColMin.clear(); + maLbColMiddle.clear(); + maLbColMax.clear(); ScCondFrmtEntry::dispose(); } @@ -1149,15 +1154,16 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Ed } -ScDataBarFrmtEntry::ScDataBarFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat ): - ScCondFrmtEntry( pParent, pDoc, rPos ), - maLbColorFormat( VclPtr::Create( this, ScResId( LB_COLOR_FORMAT ) ) ), - maLbDataBarMinType( VclPtr::Create( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ) ), - maLbDataBarMaxType( VclPtr::Create( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ) ), - maEdDataBarMin( VclPtr::Create( this, ScResId( ED_COL_SCALE_MIN ) ) ), - maEdDataBarMax( VclPtr::Create( this, ScResId( ED_COL_SCALE_MAX ) ) ), - maBtOptions( VclPtr::Create( this, ScResId( BTN_OPTIONS ) ) ) +ScDataBarFrmtEntry::ScDataBarFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat ) + : ScCondFrmtEntry(pParent, pDoc, rPos) { + get(maLbColorFormat, "colorformat"); + get(maLbDataBarMinType, "colscalemin"); + get(maLbDataBarMaxType, "colscalemax"); + get(maEdDataBarMin, "edcolscalemin"); + get(maEdDataBarMax, "edcolscalemax"); + get(maBtOptions, "options"); + maLbColorFormat->SelectEntryPos(2); maLbType->SelectEntryPos(0); if(pFormat) @@ -1176,8 +1182,6 @@ ScDataBarFrmtEntry::ScDataBarFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, Init(); maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); - - FreeResource(); } ScDataBarFrmtEntry::~ScDataBarFrmtEntry() @@ -1187,12 +1191,12 @@ ScDataBarFrmtEntry::~ScDataBarFrmtEntry() void ScDataBarFrmtEntry::dispose() { - maLbColorFormat.disposeAndClear(); - maLbDataBarMinType.disposeAndClear(); - maLbDataBarMaxType.disposeAndClear(); - maEdDataBarMin.disposeAndClear(); - maEdDataBarMax.disposeAndClear(); - maBtOptions.disposeAndClear(); + maLbColorFormat.clear(); + maLbDataBarMinType.clear(); + maLbDataBarMaxType.clear(); + maEdDataBarMin.clear(); + maEdDataBarMax.clear(); + maBtOptions.clear(); ScCondFrmtEntry::dispose(); } @@ -1288,16 +1292,17 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl, Button*, void ) } } -ScDateFrmtEntry::ScDateFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat ): - ScCondFrmtEntry( pParent, pDoc, ScAddress() ), - maLbDateEntry( VclPtr::Create( this, ScResId( LB_DATE_TYPE ) ) ), - maFtStyle( VclPtr::Create( this, ScResId( FT_STYLE ) ) ), - maLbStyle( VclPtr::Create( this, ScResId( LB_STYLE ) ) ), - maWdPreview( VclPtr::Create( this, ScResId( WD_PREVIEW ) ) ), - mbIsInStyleCreate(false) +ScDateFrmtEntry::ScDateFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, const ScCondDateFormatEntry* pFormat) + : ScCondFrmtEntry(pParent, pDoc, ScAddress()) + , mbIsInStyleCreate(false) { + get(maLbDateEntry, "datetype"); + get(maFtStyle, "styleft"); + get(maLbStyle, "style"); + get(maWdPreview, "preview"); + maWdPreview->set_height_request(maLbStyle->get_preferred_size().Height()); + Init(); - FreeResource(); StartListening(*pDoc->GetStyleSheetPool(), true); @@ -1320,10 +1325,10 @@ ScDateFrmtEntry::~ScDateFrmtEntry() void ScDateFrmtEntry::dispose() { - maLbDateEntry.disposeAndClear(); - maFtStyle.disposeAndClear(); - maLbStyle.disposeAndClear(); - maWdPreview.disposeAndClear(); + maLbDateEntry.clear(); + maFtStyle.clear(); + maLbStyle.clear(); + maWdPreview.clear(); ScCondFrmtEntry::dispose(); } @@ -1524,13 +1529,13 @@ void ScIconSetFrmtDataEntry::SetFirstEntry() maLbEntryType->SelectEntryPos(1); } -ScIconSetFrmtEntry::ScIconSetFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat ): - ScCondFrmtEntry( pParent, pDoc, rPos ), - maLbColorFormat( VclPtr::Create( this, ScResId( LB_COLOR_FORMAT ) ) ), - maLbIconSetType( VclPtr::Create( this, ScResId( LB_ICONSET_TYPE ) ) ) +ScIconSetFrmtEntry::ScIconSetFrmtEntry(vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat) + : ScCondFrmtEntry(pParent, pDoc, rPos) { + get(maLbColorFormat, "colorformat"); + get(maLbIconSetType, "iconsettype"); + Init(); - FreeResource(); maLbColorFormat->SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); if(pFormat) @@ -1566,8 +1571,8 @@ void ScIconSetFrmtEntry::dispose() for (auto it = maEntries.begin(); it != maEntries.end(); ++it) it->disposeAndClear(); maEntries.clear(); - maLbColorFormat.disposeAndClear(); - maLbIconSetType.disposeAndClear(); + maLbColorFormat.clear(); + maLbIconSetType.clear(); ScCondFrmtEntry::dispose(); } diff --git a/sc/source/ui/inc/condformatdlg.hrc b/sc/source/ui/inc/condformatdlg.hrc deleted file mode 100644 index 5390597d8843..000000000000 --- a/sc/source/ui/inc/condformatdlg.hrc +++ /dev/null @@ -1,55 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "sc.hrc" - -#define BTN_OK 1 -#define BTN_CANCEL 2 - -#define BTN_ADD 10 -#define BTN_REMOVE 11 - -#define LB_TYPE 14 -#define FT_COND_NR 15 -#define FT_CONDITION 16 -#define LB_CELLIS_TYPE 17 -#define ED_VAL1 18 -#define ED_VAL2 19 -#define LB_STYLE 20 -#define FT_STYLE 21 -#define LB_COLOR_FORMAT 22 - -#define WD_PREVIEW 26 -#define BTN_OPTIONS 30 - -#define FT_RANGE 32 -#define ED_RANGE 33 -#define RB_RANGE 34 - -#define ED_FORMULA 35 - -#define ED_COL_SCALE_MIN 36 -#define ED_COL_SCALE_MIDDLE 37 -#define ED_COL_SCALE_MAX 38 - -#define LB_COL_MIN 39 -#define LB_COL_MIDDLE 40 -#define LB_COL_MAX 41 - -#define LB_TYPE_COL_SCALE_MIN 42 -#define LB_TYPE_COL_SCALE_MIDDLE 43 -#define LB_TYPE_COL_SCALE_MAX 44 - -#define LB_DATE_TYPE 45 - -#define LB_ICONSET_TYPE 47 - -#define FT_VAL 51 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx index d5c99b72ad9f..cba12245772f 100644 --- a/sc/source/ui/inc/condformatdlgentry.hxx +++ b/sc/source/ui/inc/condformatdlgentry.hxx @@ -38,7 +38,8 @@ enum ScCondFrmtEntryType } -class ScCondFrmtEntry : public Control +class ScCondFrmtEntry : public VclContainer + , public VclBuilderContainer { private: bool mbActive; @@ -46,6 +47,7 @@ private: Link maClickHdl; //general ui elements + VclPtr maGrid; VclPtr maFtCondNr; VclPtr maFtCondition; @@ -65,6 +67,8 @@ protected: public: ScCondFrmtEntry( vcl::Window* pParent, ScDocument* pDoc, const ScAddress& rPos ); virtual ~ScCondFrmtEntry() override; + virtual Size calculateRequisition() const override; + virtual void setAllocation(const Size &rAllocation) override; virtual void dispose() override; virtual bool Notify( NotifyEvent& rNEvt ) override; diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src deleted file mode 100644 index 70d5b36ed27b..000000000000 --- a/sc/source/ui/src/condformatdlg.src +++ /dev/null @@ -1,294 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include "condformatdlg.hrc" - -Control RID_COND_ENTRY -{ - Pos = MAP_APPFONT( 0, 0 ); - Size = MAP_APPFONT( 290, 40 ); - Border = TRUE; - DialogControl = TRUE; - - FixedText FT_COND_NR - { - Pos = MAP_APPFONT( 2, 2 ); - Size = MAP_APPFONT( 50, 10 ); - }; - - FixedText FT_CONDITION - { - Pos = MAP_APPFONT( 60, 2 ); - Size = MAP_APPFONT( 120, 10 ); - }; - - ListBox LB_TYPE - { - Pos = MAP_APPFONT( 5, 15 ); - Size = MAP_APPFONT( 80, 60 ); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "All Cells"; - "Cell value is"; - "Formula is"; - "Date is"; - }; - }; - ListBox LB_CELLIS_TYPE - { - Pos = MAP_APPFONT( 90, 15 ); - Size = MAP_APPFONT( 80, 80 ); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "equal to"; - "less than"; - "greater than"; - "less than or equal to"; - "greater than or equal to"; - "not equal to"; - "between"; - "not between"; - "duplicate"; - "not duplicate"; - "top 10 elements"; - "bottom 10 elements"; - "top 10 percent"; - "bottom 10 percent"; - "above average"; - "below average"; - "above or equal average"; - "below or equal average"; - "Error"; - "No Error"; - "Begins with"; - "Ends with"; - "Contains"; - "Not Contains"; - }; - }; - Edit ED_VAL1 - { - Pos = MAP_APPFONT( 175, 15 ); - Size = MAP_APPFONT( 50, 12 ); - Border = TRUE; - }; - Edit ED_FORMULA - { - Pos = MAP_APPFONT( 90, 15 ); - Size = MAP_APPFONT( 135, 12 ); - Border = TRUE; - }; - Edit ED_VAL2 - { - Pos = MAP_APPFONT( 230, 15 ); - Size = MAP_APPFONT( 50, 12 ); - Border = TRUE; - }; - ListBox LB_COLOR_FORMAT - { - Pos = MAP_APPFONT( 100, 15 ); - Size = MAP_APPFONT( 80, 60); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "Color Scale (2 Entries)"; - "Color Scale (3 Entries)"; - "Data Bar"; - "Icon Set"; - }; - }; - FixedText FT_STYLE - { - Pos = MAP_APPFONT( 5, 32 ); - Size = MAP_APPFONT( 50, 14 ); - Text [ en-US ] = "Apply Style"; - }; - ListBox LB_STYLE - { - Pos = MAP_APPFONT( 90, 32 ); - Size = MAP_APPFONT( 80, 80 ); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "New Style..."; - }; - }; - ListBox LB_TYPE_COL_SCALE_MIN - { - Pos = MAP_APPFONT( 5, 32 ); - Size = MAP_APPFONT( 80, 60 ); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "Automatic"; - "Min"; - "Max"; - "Percentile"; - "Value"; - "Percent"; - "Formula"; - }; - }; - ListBox LB_TYPE_COL_SCALE_MIDDLE - { - Pos = MAP_APPFONT( 100, 32 ); - Size = MAP_APPFONT( 80, 60 ); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "Automatic"; - "Min"; - "Max"; - "Percentile"; - "Value"; - "Percent"; - "Formula"; - }; - }; - ListBox LB_TYPE_COL_SCALE_MAX - { - Pos = MAP_APPFONT( 195, 32 ); - Size = MAP_APPFONT( 80, 60 ); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "Automatic"; - "Min"; - "Max"; - "Percentile"; - "Value"; - "Percent"; - "Formula"; - }; - }; - Window WD_PREVIEW - { - Pos = MAP_APPFONT( 175, 32 ); - Size = MAP_APPFONT( 105, 14 ); - Text [ en-US ] = "Example"; - Border = TRUE; - }; - FixedText FT_VAL - { - Pos = MAP_APPFONT( 5, 48 ); - Size = MAP_APPFONT( 300, 12 ); - Text[ en-US ] = "Enter a value!"; - }; - Edit ED_COL_SCALE_MIN - { - Pos = MAP_APPFONT( 5, 48 ); - Size = MAP_APPFONT( 80, 12 ); - Border = TRUE; - }; - Edit ED_COL_SCALE_MIDDLE - { - Pos = MAP_APPFONT( 100, 48 ); - Size = MAP_APPFONT( 80, 12 ); - Border = TRUE; - }; - Edit ED_COL_SCALE_MAX - { - Pos = MAP_APPFONT( 195, 48 ); - Size = MAP_APPFONT( 80, 12 ); - Border = TRUE; - }; - ListBox LB_COL_MIN - { - Pos = MAP_APPFONT( 5, 62 ); - Size = MAP_APPFONT( 80, 40 ); - Border = TRUE; - DropDown = TRUE; - }; - ListBox LB_COL_MIDDLE - { - Pos = MAP_APPFONT( 100, 62 ); - Size = MAP_APPFONT( 80, 40 ); - Border = TRUE; - DropDown = TRUE; - }; - ListBox LB_COL_MAX - { - Pos = MAP_APPFONT( 195, 62 ); - Size = MAP_APPFONT( 80, 40 ); - Border = TRUE; - DropDown = TRUE; - }; - PushButton BTN_OPTIONS - { - Pos = MAP_APPFONT( 120, 62 ); - Size = MAP_APPFONT( 60, 14 ); - Text [ en-US ] = "More Options..."; - }; - ListBox LB_DATE_TYPE - { - Pos = MAP_APPFONT( 100, 15 ); - Size = MAP_APPFONT( 100, 60 ); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "Today"; - "Yesterday"; - "Tomorrow"; - "Last 7 days"; - "This week"; - "Last week"; - "Next week"; - "This month"; - "Last month"; - "Next month"; - "This year"; - "Last year"; - "Next year"; - }; - }; - ListBox LB_ICONSET_TYPE - { - Pos = MAP_APPFONT( 200, 15 ); - Size = MAP_APPFONT( 80, 50 ); - Border = TRUE; - DropDown = TRUE; - StringList [ en-US ] = - { - "3 Arrows"; - "3 Gray Arrows"; - "3 Flags"; - "3 Traffic Lights 1"; - "3 Traffic Lights 2"; - "3 Signs"; - "3 Symbols 1"; - "3 Symbols 2"; - "3 Smileys"; - "3 Stars"; - "3 Triangles"; - "3 Colored Smileys"; - "4 Arrows"; - "4 Gray Arrows"; - "4 Circles Red to Black"; - "4 Ratings"; - "4 Traffic Lights"; - "5 Arrows"; - "5 Gray Arrows"; - "5 Ratings"; - "5 Quarters"; - "5 Boxes"; - }; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit