diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-03-11 14:55:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-03-16 22:17:05 +0100 |
commit | 338e562639f947f9aa5fcd7340fe87a57b0f3601 (patch) | |
tree | e35d311d2aeb44e264697bc2228a341408fa8f9d | |
parent | dd552855ea0185954c3c622f54147eb1e6baf0d7 (diff) |
weld ScAutoFormatDlg
Change-Id: I700034eefe9fb25ee331645283bd3611c88faf5b
Reviewed-on: https://gerrit.libreoffice.org/69052
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | extras/source/glade/libreoffice-catalog.xml.in | 3 | ||||
-rw-r--r-- | sc/inc/scabstdlg.hxx | 2 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests6/autoFormat.py | 10 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 10 | ||||
-rw-r--r-- | sc/source/ui/inc/autofmt.hxx | 12 | ||||
-rw-r--r-- | sc/source/ui/inc/scuiautofmt.hxx | 49 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/autofmt.cxx | 40 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/scuiautofmt.cxx | 215 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh3.cxx | 4 | ||||
-rw-r--r-- | sc/uiconfig/scalc/ui/autoformattable.ui | 235 | ||||
-rwxr-xr-x | solenv/bin/native-code.py | 1 |
12 files changed, 310 insertions, 288 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index a420ad7f9864..d1583ef900ef 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -189,9 +189,6 @@ <glade-widget-class title="Table Preview" name="swuilo-AutoFmtPreview" generic-name="Table Preview Window" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> - <glade-widget-class title="Calc Table Preview" name="sclo-ScAutoFmtPreview" - generic-name="Calc Table Preview Window" parent="GtkDrawingArea" - icon-name="widget-gtk-drawingarea"/> <glade-widget-class title="Extension List" name="deploymentgui-ExtensionBox" generic-name="Extensions List" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 3c6812562c48..4a5d326049a1 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -400,7 +400,7 @@ public: virtual VclPtr<AbstractScTextImportOptionsDlg> CreateScTextImportOptionsDlg(weld::Window* pParent) = 0; - virtual VclPtr<AbstractScAutoFormatDlg> CreateScAutoFormatDlg(vcl::Window* pParent, + virtual VclPtr<AbstractScAutoFormatDlg> CreateScAutoFormatDlg(weld::Window* pParent, ScAutoFormat* pAutoFormat, const ScAutoFormatData* pSelFormatData, ScViewData *pViewData) = 0; diff --git a/sc/qa/uitest/calc_tests6/autoFormat.py b/sc/qa/uitest/calc_tests6/autoFormat.py index e5ecb485e935..c38165f36c36 100644 --- a/sc/qa/uitest/calc_tests6/autoFormat.py +++ b/sc/qa/uitest/calc_tests6/autoFormat.py @@ -32,9 +32,8 @@ class autoFormat(UITestCase): alignmentcb = xDialog.getChild("alignmentcb") autofitcb = xDialog.getChild("autofitcb") - props = {"TEXT": "Financial"} - actionProps = mkPropertyValues(props) - formatlb.executeAction("SELECT", actionProps) + entry = formatlb.getChild("7") #Financial + entry.executeAction("SELECT", tuple()) numformatcb.executeAction("CLICK", tuple()) bordercb.executeAction("CLICK", tuple()) fontcb.executeAction("CLICK", tuple()) @@ -57,9 +56,8 @@ class autoFormat(UITestCase): alignmentcb = xDialog.getChild("alignmentcb") autofitcb = xDialog.getChild("autofitcb") - props = {"TEXT": "Financial"} - actionProps = mkPropertyValues(props) - formatlb.executeAction("SELECT", actionProps) + entry = formatlb.getChild("7") #Financial + entry.executeAction("SELECT", tuple()) self.assertEqual(get_state_as_dict(numformatcb)["Selected"], "false") self.assertEqual(get_state_as_dict(bordercb)["Selected"], "false") self.assertEqual(get_state_as_dict(fontcb)["Selected"], "false") diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 86d8966b0409..88a153120400 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -71,7 +71,11 @@ #include <conditio.hxx> IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl); + +short AbstractScAutoFormatDlg_Impl::Execute() +{ + return m_xDlg->run(); +} short AbstractScColRowLabelDlg_Impl::Execute() { @@ -269,15 +273,15 @@ void AbstractScImportAsciiDlg_Impl::SaveParameters() sal_uInt16 AbstractScAutoFormatDlg_Impl::GetIndex() const { - return pDlg->GetIndex(); + return m_xDlg->GetIndex(); } OUString AbstractScAutoFormatDlg_Impl::GetCurrFormatName() { - return pDlg->GetCurrFormatName(); + return m_xDlg->GetCurrFormatName(); } -bool AbstractScColRowLabelDlg_Impl::IsCol() +bool AbstractScColRowLabelDlg_Impl::IsCol() { return m_xDlg->IsCol(); } @@ -763,13 +767,12 @@ VclPtr<AbstractScTextImportOptionsDlg> ScAbstractDialogFactory_Impl::CreateScTex return VclPtr<AbstractScTextImportOptionsDlg_Impl>::Create(std::make_unique<ScTextImportOptionsDlg>(pParent)); } -VclPtr<AbstractScAutoFormatDlg> ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg(vcl::Window* pParent, +VclPtr<AbstractScAutoFormatDlg> ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg(weld::Window* pParent, ScAutoFormat* pAutoFormat, const ScAutoFormatData* pSelFormatData, ScViewData *pViewData) { - VclPtr<ScAutoFormatDlg> pDlg = VclPtr<ScAutoFormatDlg>::Create(pParent, pAutoFormat, pSelFormatData, pViewData); - return VclPtr<AbstractScAutoFormatDlg_Impl>::Create(pDlg); + return VclPtr<AbstractScAutoFormatDlg_Impl>::Create(std::make_unique<ScAutoFormatDlg>(pParent, pAutoFormat, pSelFormatData, pViewData)); } VclPtr<AbstractScColRowLabelDlg> ScAbstractDialogFactory_Impl::CreateScColRowLabelDlg(weld::Window* pParent, diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 471d22a9e8cb..c752101f82af 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -105,7 +105,13 @@ class AbstractScImportAsciiDlg_Impl : public AbstractScImportAsciiDlg class AbstractScAutoFormatDlg_Impl : public AbstractScAutoFormatDlg { - DECL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl, ScAutoFormatDlg) + std::unique_ptr<ScAutoFormatDlg> m_xDlg; +public: + explicit AbstractScAutoFormatDlg_Impl(std::unique_ptr<ScAutoFormatDlg> p) + : m_xDlg(std::move(p)) + { + } + virtual short Execute() override; virtual sal_uInt16 GetIndex() const override; virtual OUString GetCurrFormatName() override; }; @@ -586,7 +592,7 @@ public: virtual VclPtr<AbstractScTextImportOptionsDlg> CreateScTextImportOptionsDlg(weld::Window* pParent) override; - virtual VclPtr<AbstractScAutoFormatDlg> CreateScAutoFormatDlg(vcl::Window* pParent, + virtual VclPtr<AbstractScAutoFormatDlg> CreateScAutoFormatDlg(weld::Window* pParent, ScAutoFormat* pAutoFormat, const ScAutoFormatData* pSelFormatData, ScViewData *pViewData) override; diff --git a/sc/source/ui/inc/autofmt.hxx b/sc/source/ui/inc/autofmt.hxx index 723e1ba555f9..84a29c6b6d19 100644 --- a/sc/source/ui/inc/autofmt.hxx +++ b/sc/source/ui/inc/autofmt.hxx @@ -22,7 +22,7 @@ #include <svx/framelinkarray.hxx> #include <scdllapi.h> -#include <vcl/window.hxx> +#include <vcl/customweld.hxx> namespace com { namespace sun { namespace star { namespace i18n { class XBreakIterator; } } } } @@ -33,13 +33,13 @@ class SvNumberFormatter; class VirtualDevice; class ScViewData; -class SC_DLLPUBLIC ScAutoFmtPreview : public vcl::Window +class SC_DLLPUBLIC ScAutoFmtPreview : public weld::CustomWidgetController { public: - ScAutoFmtPreview(vcl::Window* pParent); + ScAutoFmtPreview(); void DetectRTL(const ScViewData *pViewData); + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; virtual ~ScAutoFmtPreview() override; - virtual void dispose() override; void NotifyChange( ScAutoFormatData* pNewData ); @@ -85,8 +85,8 @@ private: SAL_DLLPRIVATE void DrawString(vcl::RenderContext& rRenderContext, size_t nCol, size_t nRow); SAL_DLLPRIVATE void DrawBackground(vcl::RenderContext& rRenderContext); - SAL_DLLPRIVATE void MakeFonts(sal_uInt16 nIndex, vcl::Font& rFont, - vcl::Font& rCJKFont, vcl::Font& rCTLFont ); + SAL_DLLPRIVATE void MakeFonts(vcl::RenderContext const& rRenderContext, sal_uInt16 nIndex, + vcl::Font& rFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont); }; #endif // INCLUDED_SC_SOURCE_UI_INC_AUTOFMT_HXX diff --git a/sc/source/ui/inc/scuiautofmt.hxx b/sc/source/ui/inc/scuiautofmt.hxx index a00beb1e68de..6ddaf400ac94 100644 --- a/sc/source/ui/inc/scuiautofmt.hxx +++ b/sc/source/ui/inc/scuiautofmt.hxx @@ -18,35 +18,23 @@ */ #ifndef INCLUDED_SC_SOURCE_UI_INC_SCUIAUTOFMT_HXX #define INCLUDED_SC_SOURCE_UI_INC_SCUIAUTOFMT_HXX + +#include <vcl/customweld.hxx> #include "autofmt.hxx" -class ScAutoFormatDlg : public ModalDialog +class ScAutoFormatDlg : public weld::GenericDialogController { public: - ScAutoFormatDlg(vcl::Window* pParent, + ScAutoFormatDlg(weld::Window* pParent, ScAutoFormat* pAutoFormat, const ScAutoFormatData* pSelFormatData, const ScViewData *pViewData); virtual ~ScAutoFormatDlg() override; - virtual void dispose() override; sal_uInt16 GetIndex() const { return nIndex; } OUString GetCurrFormatName(); private: - VclPtr<ListBox> m_pLbFormat; - VclPtr<ScAutoFmtPreview> m_pWndPreview; - VclPtr<OKButton> m_pBtnOk; - VclPtr<CancelButton> m_pBtnCancel; - VclPtr<PushButton> m_pBtnAdd; - VclPtr<PushButton> m_pBtnRemove; - VclPtr<PushButton> m_pBtnRename; - VclPtr<CheckBox> m_pBtnNumFormat; - VclPtr<CheckBox> m_pBtnBorder; - VclPtr<CheckBox> m_pBtnFont; - VclPtr<CheckBox> m_pBtnPattern; - VclPtr<CheckBox> m_pBtnAlignment; - VclPtr<CheckBox> m_pBtnAdjust; OUString const aStrTitle; OUString const aStrLabel; OUString const aStrClose; @@ -59,16 +47,31 @@ private: bool bCoreDataChanged; bool bFmtInserted; + ScAutoFmtPreview m_aWndPreview; + std::unique_ptr<weld::TreeView> m_xLbFormat; + std::unique_ptr<weld::Button> m_xBtnOk; + std::unique_ptr<weld::Button> m_xBtnCancel; + std::unique_ptr<weld::Button> m_xBtnAdd; + std::unique_ptr<weld::Button> m_xBtnRemove; + std::unique_ptr<weld::Button> m_xBtnRename; + std::unique_ptr<weld::CheckButton> m_xBtnNumFormat; + std::unique_ptr<weld::CheckButton> m_xBtnBorder; + std::unique_ptr<weld::CheckButton> m_xBtnFont; + std::unique_ptr<weld::CheckButton> m_xBtnPattern; + std::unique_ptr<weld::CheckButton> m_xBtnAlignment; + std::unique_ptr<weld::CheckButton> m_xBtnAdjust; + std::unique_ptr<weld::CustomWeld> m_xWndPreview; + void Init (); void UpdateChecks (); - DECL_LINK( CheckHdl, Button*, void ); - DECL_LINK( AddHdl, Button*, void ); - DECL_LINK( RemoveHdl, Button*, void ); - DECL_LINK( SelFmtHdl, ListBox&, void ); - DECL_LINK( CloseHdl, Button *, void ); - DECL_LINK( DblClkHdl, ListBox&, void ); - DECL_LINK( RenameHdl, Button*, void ); + DECL_LINK( CheckHdl, weld::ToggleButton&, void ); + DECL_LINK( AddHdl, weld::Button&, void ); + DECL_LINK( RemoveHdl, weld::Button&, void ); + DECL_LINK( SelFmtHdl, weld::TreeView&, void ); + DECL_LINK( CloseHdl, weld::Button&, void ); + DECL_LINK( DblClkHdl, weld::TreeView&, void ); + DECL_LINK( RenameHdl, weld::Button&, void ); }; #endif diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index e031ccbca417..a64104548f2b 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -49,10 +49,8 @@ // ScAutoFmtPreview -ScAutoFmtPreview::ScAutoFmtPreview(vcl::Window* pParent) - : Window(pParent) - , pCurData(nullptr) - , aVD(*this) +ScAutoFmtPreview::ScAutoFmtPreview() + : pCurData(nullptr) , bFitWidth(false) , mbRTL(false) , aStrJan(ScResId(STR_JAN)) @@ -67,11 +65,16 @@ ScAutoFmtPreview::ScAutoFmtPreview(vcl::Window* pParent) Init(); } -VCL_BUILDER_FACTORY(ScAutoFmtPreview) +void ScAutoFmtPreview::SetDrawingArea(weld::DrawingArea* pDrawingArea) +{ + aVD.disposeAndReset(VclPtr<VirtualDevice>::Create(pDrawingArea->get_ref_device())); + CustomWidgetController::SetDrawingArea(pDrawingArea); +} void ScAutoFmtPreview::Resize() { - aPrvSize = Size(GetSizePixel().Width() - 6, GetSizePixel().Height() - 30); + Size aSize(GetOutputSizePixel()); + aPrvSize = Size(aSize.Width() - 6, aSize.Height() - 30); mnLabelColWidth = (aPrvSize.Width() - 4) / 4 - 12; mnDataColWidth1 = (aPrvSize.Width() - 4 - 2 * mnLabelColWidth) / 3; mnDataColWidth2 = (aPrvSize.Width() - 4 - 2 * mnLabelColWidth) / 4; @@ -81,13 +84,6 @@ void ScAutoFmtPreview::Resize() ScAutoFmtPreview::~ScAutoFmtPreview() { - disposeOnce(); -} - -void ScAutoFmtPreview::dispose() -{ - pNumFmt.reset(); - vcl::Window::dispose(); } static void lcl_SetFontProperties( @@ -105,12 +101,12 @@ static void lcl_SetFontProperties( rFont.SetItalic ( rPostureItem.GetValue() ); } -void ScAutoFmtPreview::MakeFonts( sal_uInt16 nIndex, vcl::Font& rFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont ) +void ScAutoFmtPreview::MakeFonts(vcl::RenderContext const& rRenderContext, sal_uInt16 nIndex, vcl::Font& rFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont) { if ( pCurData ) { - rFont = rCJKFont = rCTLFont = GetFont(); - Size aFontSize( rFont.GetFontSize().Width(), 10 * GetDPIScaleFactor() ); + rFont = rCJKFont = rCTLFont = rRenderContext.GetFont(); + Size aFontSize(rFont.GetFontSize().Width(), 10 * rRenderContext.GetDPIScaleFactor()); const SvxFontItem* pFontItem = pCurData->GetItem( nIndex, ATTR_FONT ); const SvxWeightItem* pWeightItem = pCurData->GetItem( nIndex, ATTR_FONT_WEIGHT ); @@ -134,7 +130,7 @@ void ScAutoFmtPreview::MakeFonts( sal_uInt16 nIndex, vcl::Font& rFont, vcl::Font Color aColor( pColorItem->GetValue() ); if( aColor == COL_TRANSPARENT ) - aColor = GetSettings().GetStyleSettings().GetWindowTextColor(); + aColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor(); #define SETONALLFONTS( MethodName, Value ) \ rFont.MethodName( Value ); rCJKFont.MethodName( Value ); rCTLFont.MethodName( Value ); @@ -263,7 +259,7 @@ void ScAutoFmtPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCo vcl::Font aFont, aCJKFont, aCTLFont; Size theMaxStrSize; - MakeFonts( nFmtIndex, aFont, aCJKFont, aCTLFont ); + MakeFonts(rRenderContext, nFmtIndex, aFont, aCJKFont, aCTLFont); theMaxStrSize = Size(basegfx::fround(cellRange.getWidth()), basegfx::fround(cellRange.getHeight())); theMaxStrSize.AdjustWidth( -(FRAME_OFFSET) ); @@ -413,9 +409,7 @@ void ScAutoFmtPreview::PaintCells(vcl::RenderContext& rRenderContext) void ScAutoFmtPreview::Init() { - SetBorderStyle( WindowBorderStyle::MONO ); maArray.Initialize( 5, 5 ); -// maArray.SetUseDiagDoubleClipping( false ); mnLabelColWidth = 0; mnDataColWidth1 = 0; mnDataColWidth2 = 0; @@ -491,14 +485,15 @@ void ScAutoFmtPreview::NotifyChange( ScAutoFormatData* pNewData ) CalcCellArray( bFitWidth ); CalcLineMap(); - Invalidate(tools::Rectangle(Point(0,0), GetSizePixel())); + Invalidate(); } void ScAutoFmtPreview::DoPaint(vcl::RenderContext& rRenderContext) { + rRenderContext.Push(PushFlags::ALL); DrawModeFlags nOldDrawMode = aVD->GetDrawMode(); - Size aWndSize(GetSizePixel()); + Size aWndSize(GetOutputSizePixel()); vcl::Font aFont(aVD->GetFont()); Color aBackCol(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); tools::Rectangle aRect(Point(), aWndSize); @@ -521,6 +516,7 @@ void ScAutoFmtPreview::DoPaint(vcl::RenderContext& rRenderContext) aPos.setX( -aPos.X() ); rRenderContext.DrawOutDev(aPos, aWndSize, Point(), aWndSize, *aVD); aVD->SetDrawMode(nOldDrawMode); + rRenderContext.Pop(); } void ScAutoFmtPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index 4593ef712e17..fa5ced63c8b2 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -37,12 +37,11 @@ // AutoFormat-Dialog: -ScAutoFormatDlg::ScAutoFormatDlg(vcl::Window* pParent, +ScAutoFormatDlg::ScAutoFormatDlg(weld::Window* pParent, ScAutoFormat* pAutoFormat, const ScAutoFormatData* pSelFormatData, const ScViewData *pViewData) - : ModalDialog(pParent, "AutoFormatTableDialog", - "modules/scalc/ui/autoformattable.ui") + : GenericDialogController(pParent, "modules/scalc/ui/autoformattable.ui", "AutoFormatTableDialog") , aStrTitle(ScResId(STR_ADD_AUTOFORMAT_TITLE)) , aStrLabel(ScResId(STR_ADD_AUTOFORMAT_LABEL)) , aStrClose(ScResId(STR_BTN_AUTOFORMAT_CLOSE)) @@ -53,83 +52,69 @@ ScAutoFormatDlg::ScAutoFormatDlg(vcl::Window* pParent, , nIndex(0) , bCoreDataChanged(false) , bFmtInserted(false) + , m_xLbFormat(m_xBuilder->weld_tree_view("formatlb")) + , m_xBtnOk(m_xBuilder->weld_button("ok")) + , m_xBtnCancel(m_xBuilder->weld_button("cancel")) + , m_xBtnAdd(m_xBuilder->weld_button("add")) + , m_xBtnRemove(m_xBuilder->weld_button("remove")) + , m_xBtnRename(m_xBuilder->weld_button("rename")) + , m_xBtnNumFormat(m_xBuilder->weld_check_button("numformatcb")) + , m_xBtnBorder(m_xBuilder->weld_check_button("bordercb")) + , m_xBtnFont(m_xBuilder->weld_check_button("fontcb")) + , m_xBtnPattern(m_xBuilder->weld_check_button("patterncb")) + , m_xBtnAlignment(m_xBuilder->weld_check_button("alignmentcb")) + , m_xBtnAdjust(m_xBuilder->weld_check_button("autofitcb")) + , m_xWndPreview(new weld::CustomWeld(*m_xBuilder, "preview", m_aWndPreview)) { - get(m_pLbFormat, "formatlb"); - get(m_pWndPreview, "preview"); - m_pWndPreview->DetectRTL(pViewData); - get(m_pBtnOk, "ok"); - get(m_pBtnCancel, "cancel"); - get(m_pBtnAdd, "add"); - get(m_pBtnRemove, "remove"); - get(m_pBtnRename, "rename"); - get(m_pBtnNumFormat, "numformatcb"); - get(m_pBtnBorder, "bordercb"); - get(m_pBtnFont, "fontcb"); - get(m_pBtnPattern, "patterncb"); - get(m_pBtnAlignment, "alignmentcb"); - get(m_pBtnAdjust, "autofitcb"); + m_aWndPreview.DetectRTL(pViewData); + + const int nWidth = m_xLbFormat->get_approximate_digit_width() * 32; + const int nHeight = m_xLbFormat->get_height_rows(8); + m_xLbFormat->set_size_request(nWidth, nHeight); + m_xWndPreview->set_size_request(nWidth, nHeight); Init(); ScAutoFormat::iterator it = pFormat->begin(); - m_pWndPreview->NotifyChange(it->second.get()); + m_aWndPreview.NotifyChange(it->second.get()); } ScAutoFormatDlg::~ScAutoFormatDlg() { - disposeOnce(); -} - -void ScAutoFormatDlg::dispose() -{ - m_pLbFormat.clear(); - m_pWndPreview.clear(); - m_pBtnOk.clear(); - m_pBtnCancel.clear(); - m_pBtnAdd.clear(); - m_pBtnRemove.clear(); - m_pBtnRename.clear(); - m_pBtnNumFormat.clear(); - m_pBtnBorder.clear(); - m_pBtnFont.clear(); - m_pBtnPattern.clear(); - m_pBtnAlignment.clear(); - m_pBtnAdjust.clear(); - ModalDialog::dispose(); } void ScAutoFormatDlg::Init() { - m_pLbFormat->SetSelectHdl( LINK( this, ScAutoFormatDlg, SelFmtHdl ) ); - m_pBtnNumFormat->SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) ); - m_pBtnBorder->SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) ); - m_pBtnFont->SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) ); - m_pBtnPattern->SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) ); - m_pBtnAlignment->SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) ); - m_pBtnAdjust->SetClickHdl ( LINK( this, ScAutoFormatDlg, CheckHdl ) ); - m_pBtnAdd->SetClickHdl ( LINK( this, ScAutoFormatDlg, AddHdl ) ); - m_pBtnRemove->SetClickHdl ( LINK( this, ScAutoFormatDlg, RemoveHdl ) ); - m_pBtnOk->SetClickHdl ( LINK( this, ScAutoFormatDlg, CloseHdl ) ); - m_pBtnCancel->SetClickHdl ( LINK( this, ScAutoFormatDlg, CloseHdl ) ); - m_pBtnRename->SetClickHdl ( LINK( this, ScAutoFormatDlg, RenameHdl ) ); - m_pLbFormat->SetDoubleClickHdl( LINK( this, ScAutoFormatDlg, DblClkHdl ) ); + m_xLbFormat->connect_changed( LINK( this, ScAutoFormatDlg, SelFmtHdl ) ); + m_xBtnNumFormat->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); + m_xBtnBorder->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); + m_xBtnFont->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); + m_xBtnPattern->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); + m_xBtnAlignment->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); + m_xBtnAdjust->connect_toggled( LINK( this, ScAutoFormatDlg, CheckHdl ) ); + m_xBtnAdd->connect_clicked ( LINK( this, ScAutoFormatDlg, AddHdl ) ); + m_xBtnRemove->connect_clicked ( LINK( this, ScAutoFormatDlg, RemoveHdl ) ); + m_xBtnOk->connect_clicked ( LINK( this, ScAutoFormatDlg, CloseHdl ) ); + m_xBtnCancel->connect_clicked ( LINK( this, ScAutoFormatDlg, CloseHdl ) ); + m_xBtnRename->connect_clicked ( LINK( this, ScAutoFormatDlg, RenameHdl ) ); + m_xLbFormat->connect_row_activated( LINK( this, ScAutoFormatDlg, DblClkHdl ) ); for (const auto& rEntry : *pFormat) - m_pLbFormat->InsertEntry(rEntry.second->GetName()); + m_xLbFormat->append_text(rEntry.second->GetName()); if (pFormat->size() == 1) - m_pBtnRemove->Disable(); + m_xBtnRemove->set_sensitive(false); - m_pLbFormat->SelectEntryPos( 0 ); - m_pBtnRename->Disable(); - m_pBtnRemove->Disable(); + m_xLbFormat->select(0); + m_xBtnRename->set_sensitive(false); + m_xBtnRemove->set_sensitive(false); nIndex = 0; UpdateChecks(); if ( !pSelFmtData ) { - m_pBtnAdd->Disable(); - m_pBtnRemove->Disable(); + m_xBtnAdd->set_sensitive(false); + m_xBtnRemove->set_sensitive(false); bFmtInserted = true; } } @@ -138,63 +123,63 @@ void ScAutoFormatDlg::UpdateChecks() { const ScAutoFormatData* pData = pFormat->findByIndex(nIndex); - m_pBtnNumFormat->Check( pData->GetIncludeValueFormat() ); - m_pBtnBorder->Check( pData->GetIncludeFrame() ); - m_pBtnFont->Check( pData->GetIncludeFont() ); - m_pBtnPattern->Check( pData->GetIncludeBackground() ); - m_pBtnAlignment->Check( pData->GetIncludeJustify() ); - m_pBtnAdjust->Check( pData->GetIncludeWidthHeight() ); + m_xBtnNumFormat->set_active( pData->GetIncludeValueFormat() ); + m_xBtnBorder->set_active( pData->GetIncludeFrame() ); + m_xBtnFont->set_active( pData->GetIncludeFont() ); + m_xBtnPattern->set_active( pData->GetIncludeBackground() ); + m_xBtnAlignment->set_active( pData->GetIncludeJustify() ); + m_xBtnAdjust->set_active( pData->GetIncludeWidthHeight() ); } // Handler: -IMPL_LINK( ScAutoFormatDlg, CloseHdl, Button *, pBtn, void ) +IMPL_LINK(ScAutoFormatDlg, CloseHdl, weld::Button&, rBtn, void) { - if (pBtn == m_pBtnOk || pBtn == m_pBtnCancel) + if (&rBtn == m_xBtnOk.get() || &rBtn == m_xBtnCancel.get()) { if ( bCoreDataChanged ) ScGlobal::GetOrCreateAutoFormat()->Save(); - EndDialog( (pBtn == m_pBtnOk) ? RET_OK : RET_CANCEL ); + m_xDialog->response( (&rBtn == m_xBtnOk.get()) ? RET_OK : RET_CANCEL ); } } -IMPL_LINK_NOARG(ScAutoFormatDlg, DblClkHdl, ListBox&, void) +IMPL_LINK_NOARG(ScAutoFormatDlg, DblClkHdl, weld::TreeView&, void) { if ( bCoreDataChanged ) ScGlobal::GetOrCreateAutoFormat()->Save(); - EndDialog( RET_OK ); + m_xDialog->response( RET_OK ); } -IMPL_LINK( ScAutoFormatDlg, CheckHdl, Button *, pBtn, void ) +IMPL_LINK(ScAutoFormatDlg, CheckHdl, weld::ToggleButton&, rBtn, void) { ScAutoFormatData* pData = pFormat->findByIndex(nIndex); - bool bCheck = static_cast<CheckBox*>(pBtn)->IsChecked(); + bool bCheck = rBtn.get_active(); - if ( pBtn == m_pBtnNumFormat ) + if (&rBtn == m_xBtnNumFormat.get()) pData->SetIncludeValueFormat( bCheck ); - else if ( pBtn == m_pBtnBorder ) + else if (&rBtn == m_xBtnBorder.get()) pData->SetIncludeFrame( bCheck ); - else if ( pBtn == m_pBtnFont ) + else if (&rBtn == m_xBtnFont.get()) pData->SetIncludeFont( bCheck ); - else if ( pBtn == m_pBtnPattern ) + else if (&rBtn == m_xBtnPattern.get()) pData->SetIncludeBackground( bCheck ); - else if ( pBtn == m_pBtnAlignment ) + else if (&rBtn == m_xBtnAlignment.get()) pData->SetIncludeJustify( bCheck ); - else if ( pBtn == m_pBtnAdjust ) + else if (&rBtn == m_xBtnAdjust.get()) pData->SetIncludeWidthHeight( bCheck ); if ( !bCoreDataChanged ) { - m_pBtnCancel->SetText( aStrClose ); + m_xBtnCancel->set_label(aStrClose); bCoreDataChanged = true; } - m_pWndPreview->NotifyChange( pData ); + m_aWndPreview.NotifyChange( pData ); } -IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl, Button*, void) +IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl, weld::Button&, void) { if ( !bFmtInserted && pSelFmtData ) { @@ -204,7 +189,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl, Button*, void) while ( !bOk ) { - ScStringInputDlg aDlg(GetFrameWeld(), aStrTitle, aStrLabel, aFormatName, + ScStringInputDlg aDlg(m_xDialog.get(), aStrTitle, aStrLabel, aFormatName, HID_SC_ADD_AUTOFMT, HID_SC_AUTOFMT_NAME); if (aDlg.run() == RET_OK) @@ -223,24 +208,24 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl, Button*, void) if ( bFmtInserted ) { size_t nPos = std::distance(pFormat->begin(), it); - m_pLbFormat->InsertEntry(aFormatName, nPos); - m_pLbFormat->SelectEntry( aFormatName ); - m_pBtnAdd->Disable(); + m_xLbFormat->insert_text(nPos, aFormatName); + m_xLbFormat->select_text( aFormatName ); + m_xBtnAdd->set_sensitive(false); if ( !bCoreDataChanged ) { - m_pBtnCancel->SetText( aStrClose ); + m_xBtnCancel->set_label( aStrClose ); bCoreDataChanged = true; } - SelFmtHdl( *m_pLbFormat.get() ); + SelFmtHdl( *m_xLbFormat.get() ); bOk = true; } } if ( !bFmtInserted ) { - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Error, VclButtonsType::OkCancel, ScResId(STR_INVALID_AFNAME))); @@ -255,30 +240,30 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl, Button*, void) } } -IMPL_LINK_NOARG(ScAutoFormatDlg, RemoveHdl, Button*, void) +IMPL_LINK_NOARG(ScAutoFormatDlg, RemoveHdl, weld::Button&, void) { - if ( (nIndex > 0) && (m_pLbFormat->GetEntryCount() > 0) ) + if ( (nIndex > 0) && (m_xLbFormat->n_children() > 0) ) { OUString aMsg = aStrDelMsg.getToken( 0, '#' ) - + m_pLbFormat->GetSelectedEntry() + + m_xLbFormat->get_selected_text() + aStrDelMsg.getToken( 1, '#' ); - std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Question, VclButtonsType::YesNo, aMsg)); xQueryBox->set_default_response(RET_YES); if (RET_YES == xQueryBox->run()) { - m_pLbFormat->RemoveEntry( nIndex ); - m_pLbFormat->SelectEntryPos( nIndex-1 ); + m_xLbFormat->remove(nIndex); + m_xLbFormat->select(nIndex-1); if ( nIndex-1 == 0 ) - m_pBtnRemove->Disable(); + m_xBtnRemove->set_sensitive(false); if ( !bCoreDataChanged ) { - m_pBtnCancel->SetText( aStrClose ); + m_xBtnCancel->set_label( aStrClose ); bCoreDataChanged = true; } @@ -287,23 +272,23 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RemoveHdl, Button*, void) pFormat->erase(it); nIndex--; - SelFmtHdl( *m_pLbFormat.get() ); + SelFmtHdl( *m_xLbFormat.get() ); } } - SelFmtHdl( *m_pLbFormat.get() ); + SelFmtHdl( *m_xLbFormat.get() ); } -IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl, Button*, void) +IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl, weld::Button&, void) { bool bOk = false; while( !bOk ) { - OUString aFormatName = m_pLbFormat->GetSelectedEntry(); + OUString aFormatName = m_xLbFormat->get_selected_text(); OUString aEntry; - ScStringInputDlg aDlg(GetFrameWeld(), aStrRename, aStrLabel, aFormatName, + ScStringInputDlg aDlg(m_xDialog.get(), aStrRename, aStrLabel, aFormatName, HID_SC_REN_AFMT_DLG, HID_SC_REN_AFMT_NAME); if (aDlg.run() == RET_OK) { @@ -323,7 +308,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl, Button*, void) { // no format with this name yet, so we can rename - m_pLbFormat->RemoveEntry(nIndex ); + m_xLbFormat->remove(nIndex); const ScAutoFormatData* p = pFormat->findByIndex(nIndex); std::unique_ptr<ScAutoFormatData> pNewData(new ScAutoFormatData(*p)); @@ -335,31 +320,31 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl, Button*, void) pFormat->insert(std::move(pNewData)); - m_pLbFormat->SetUpdateMode(false); - m_pLbFormat->Clear(); + m_xLbFormat->freeze(); + m_xLbFormat->clear(); for (it = pFormat->begin(); it != itEnd; ++it) { aEntry = it->second->GetName(); - m_pLbFormat->InsertEntry( aEntry ); + m_xLbFormat->append_text(aEntry); } - m_pLbFormat->SetUpdateMode(true); - m_pLbFormat->SelectEntry( aFormatName); + m_xLbFormat->thaw(); + m_xLbFormat->select_text(aFormatName); if ( !bCoreDataChanged ) { - m_pBtnCancel->SetText( aStrClose ); + m_xBtnCancel->set_label( aStrClose ); bCoreDataChanged = true; } - SelFmtHdl( *m_pLbFormat.get() ); + SelFmtHdl( *m_xLbFormat.get() ); bOk = true; bFmtRenamed = true; } } if( !bFmtRenamed ) { - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Error, VclButtonsType::OkCancel, ScResId(STR_INVALID_AFNAME))); @@ -371,24 +356,24 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl, Button*, void) } } -IMPL_LINK_NOARG(ScAutoFormatDlg, SelFmtHdl, ListBox&, void) +IMPL_LINK_NOARG(ScAutoFormatDlg, SelFmtHdl, weld::TreeView&, void) { - nIndex = m_pLbFormat->GetSelectedEntryPos(); + nIndex = m_xLbFormat->get_selected_index(); UpdateChecks(); if ( nIndex == 0 ) { - m_pBtnRename->Disable(); - m_pBtnRemove->Disable(); + m_xBtnRename->set_sensitive(false); + m_xBtnRemove->set_sensitive(false); } else { - m_pBtnRename->Enable(); - m_pBtnRemove->Enable(); + m_xBtnRename->set_sensitive(true); + m_xBtnRemove->set_sensitive(true); } ScAutoFormatData* p = pFormat->findByIndex(nIndex); - m_pWndPreview->NotifyChange(p); + m_aWndPreview.NotifyChange(p); } OUString ScAutoFormatDlg::GetCurrFormatName() diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 5167e50a50d5..2cf985c02e2d 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -819,7 +819,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) case SID_AUTOFORMAT: { - vcl::Window* pDlgParent = pTabViewShell->GetDialogParent(); + weld::Window* pDlgParent = pTabViewShell->GetFrameWeld(); SCCOL nStartCol; SCROW nStartRow; SCTAB nStartTab; @@ -877,7 +877,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) } else { - std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pDlgParent ? pDlgParent->GetFrameWeld() : nullptr, + std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pDlgParent, VclMessageType::Warning, VclButtonsType::Ok, ScResId(STR_INVALID_AFAREA))); xErrorBox->run(); diff --git a/sc/uiconfig/scalc/ui/autoformattable.ui b/sc/uiconfig/scalc/ui/autoformattable.ui index eedb29905b06..21036d7284e4 100644 --- a/sc/uiconfig/scalc/ui/autoformattable.ui +++ b/sc/uiconfig/scalc/ui/autoformattable.ui @@ -1,72 +1,41 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> -<interface domain="sc"> +<!-- Generated with glade 3.22.1 --> +<interface domain="sw"> <requires lib="gtk+" version="3.18"/> - <requires lib="LibreOffice" version="1.0"/> + <object class="GtkTreeStore" id="liststore1"> + <columns> + <!-- column-name text --> + <column type="gchararray"/> + <!-- column-name id --> + <column type="gchararray"/> + </columns> + </object> <object class="GtkDialog" id="AutoFormatTableDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="autoformattable|AutoFormatTableDialog">AutoFormat</property> - <property name="type_hint">normal</property> + <property name="resizable">False</property> + <property name="modal">True</property> + <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</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="orientation">vertical</property> <property name="homogeneous">True</property> - <property name="layout_style">start</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="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> + <property name="layout_style">end</property> <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="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> - <child> - <object class="GtkButton" id="add"> - <property name="label">gtk-add</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="receives_default">False</property> <property name="use_stock">True</property> </object> <packing> @@ -76,11 +45,13 @@ </packing> </child> <child> - <object class="GtkButton" id="remove"> - <property name="label">gtk-delete</property> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="receives_default">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">False</property> <property name="use_stock">True</property> </object> <packing> @@ -90,16 +61,18 @@ </packing> </child> <child> - <object class="GtkButton" id="rename"> - <property name="label" translatable="yes" context="autoformattable|rename">Rename</property> + <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="receives_default">False</property> + <property name="use_stock">True</property> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> <property name="position">5</property> + <property name="secondary">True</property> </packing> </child> </object> @@ -129,51 +102,128 @@ <property name="top_padding">6</property> <property name="left_padding">12</property> <child> - <object class="GtkGrid" id="grid2"> - <property name="width_request">400</property> - <property name="height_request">200</property> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">6</property> + <property name="column_spacing">12</property> <child> - <object class="sclo-ScAutoFmtPreview" id="preview"> - <property name="width_request">200</property> - <property name="height_request">200</property> + <object class="GtkGrid" id="grid2"> <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">6</property> + <property name="column_spacing">6</property> + <property name="column_homogeneous">True</property> + <child> + <object class="GtkDrawingArea" id="preview"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="shadow_type">in</property> + <child> + <object class="GtkTreeView" id="formatlb"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="model">liststore1</property> + <property name="headers_visible">False</property> + <property name="headers_clickable">False</property> + <property name="search_column">0</property> + <property name="show_expanders">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </child> + <child> + <object class="GtkTreeViewColumn" id="treeviewcolumn1"> + <child> + <object class="GtkCellRendererText" id="cellrenderertext1"/> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> + </object> + </child> + </object> + </child> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> </object> <packing> - <property name="left_attach">1</property> + <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="GtkScrolledWindow" id="scrolledwindow1"> + <object class="GtkButtonBox"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="shadow_type">in</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <property name="layout_style">start</property> <child> - <object class="GtkTreeView" id="formatlb"> + <object class="GtkButton" id="add"> + <property name="label">gtk-add</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="vexpand">True</property> - <property name="show_expanders">False</property> - <child internal-child="selection"> - <object class="GtkTreeSelection" id="treeview-selection1"/> - </child> + <property name="receives_default">False</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="remove"> + <property name="label">gtk-delete</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</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="rename"> + <property name="label" translatable="yes" context="autoformattable|rename">Rename</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> </child> </object> <packing> - <property name="left_attach">0</property> + <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> @@ -217,7 +267,7 @@ <property name="column_spacing">12</property> <child> <object class="GtkCheckButton" id="numformatcb"> - <property name="label" translatable="yes" context="autoformattable|numformatcb">_Number format</property> + <property name="label" translatable="yes" context="autoformattable|numformatcb">Number format</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -228,13 +278,11 @@ <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="bordercb"> - <property name="label" translatable="yes" context="autoformattable|bordercb">_Borders</property> + <property name="label" translatable="yes" context="autoformattable|bordercb">Borders</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -245,13 +293,11 @@ <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="GtkCheckButton" id="fontcb"> - <property name="label" translatable="yes" context="autoformattable|fontcb">F_ont</property> + <property name="label" translatable="yes" context="autoformattable|fontcb">Font</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -262,13 +308,11 @@ <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="GtkCheckButton" id="patterncb"> - <property name="label" translatable="yes" context="autoformattable|patterncb">_Pattern</property> + <property name="label" translatable="yes" context="autoformattable|patterncb">Pattern</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -279,13 +323,11 @@ <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="GtkCheckButton" id="alignmentcb"> - <property name="label" translatable="yes" context="autoformattable|alignmentcb">Alignmen_t</property> + <property name="label" translatable="yes" context="autoformattable|alignmentcb">Alignment</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -296,8 +338,6 @@ <packing> <property name="left_attach">2</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -313,8 +353,6 @@ <packing> <property name="left_attach">2</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -349,12 +387,9 @@ </object> </child> <action-widgets> - <action-widget response="-5">ok</action-widget> <action-widget response="-6">cancel</action-widget> + <action-widget response="-5">ok</action-widget> <action-widget response="-11">help</action-widget> - <action-widget response="0">add</action-widget> - <action-widget response="0">remove</action-widget> - <action-widget response="0">rename</action-widget> </action-widgets> </object> </interface> diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py index 8bb29e18c108..506ac91d760a 100755 --- a/solenv/bin/native-code.py +++ b/solenv/bin/native-code.py @@ -470,7 +470,6 @@ custom_widgets = [ 'RubyEdit', 'RubyPreview', 'SameContentListBox', - 'ScAutoFmtPreview', 'ScCondFormatList', 'ScCsvTableBox', 'ScCursorRefEdit', |