Kaydet (Commit) a2304f62 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld writer page style dialog and SvxBorderBackgroundDlg

writer, format page is complete

Change-Id: I09f6e4354461c4374cdb0d0e0754dfee35415b45
Reviewed-on: https://gerrit.libreoffice.org/60058
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1a86f564
......@@ -242,7 +242,8 @@ bool VCLWidgets::VisitCXXDestructorDecl(const CXXDestructorDecl* pCXXDestructorD
StringRef filename = getFileNameOfSpellingLoc(spellingLocation);
if ( !(loplugin::isSamePathname(filename, SRCDIR "/vcl/source/window/window.cxx"))
&& !(loplugin::isSamePathname(filename, SRCDIR "/vcl/source/gdi/virdev.cxx"))
&& !(loplugin::isSamePathname(filename, SRCDIR "/vcl/qa/cppunit/lifecycle.cxx")) )
&& !(loplugin::isSamePathname(filename, SRCDIR "/vcl/qa/cppunit/lifecycle.cxx"))
&& !(loplugin::isSamePathname(filename, SRCDIR "/sfx2/source/dialog/tabdlg.cxx")) )
{
report(
DiagnosticsEngine::Warning,
......
......@@ -164,9 +164,9 @@ public:
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
{
CustomWidgetController::SetDrawingArea(pDrawingArea);
pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 10,
pDrawingArea->get_text_height() * 2);
CustomWidgetController::SetDrawingArea(pDrawingArea);
}
void SetColor(const Color& rCol)
......@@ -202,9 +202,9 @@ public:
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
{
CustomWidgetController::SetDrawingArea(pDrawingArea);
pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 40,
pDrawingArea->get_text_height() * 10);
CustomWidgetController::SetDrawingArea(pDrawingArea);
}
virtual ~ColorFieldControl() override
......@@ -548,8 +548,8 @@ ColorSliderControl::ColorSliderControl()
void ColorSliderControl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 3, -1);
CustomWidgetController::SetDrawingArea(pDrawingArea);
pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 3, -1);
}
ColorSliderControl::~ColorSliderControl()
......
......@@ -1136,6 +1136,7 @@ SvxShowText::SvxShowText(const VclPtr<VirtualDevice>& rVirDev)
void SvxShowText::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
CustomWidgetController::SetDrawingArea(pDrawingArea);
vcl::Font aFont = m_xVirDev->GetFont();
Size aFontSize(aFont.GetFontSize().Width() * 5, aFont.GetFontSize().Height() * 5);
aFont.SetFontSize(aFontSize);
......@@ -1143,7 +1144,6 @@ void SvxShowText::SetDrawingArea(weld::DrawingArea* pDrawingArea)
m_xVirDev->SetFont(aFont);
pDrawingArea->set_size_request(m_xVirDev->approximate_digit_width() + 2 * 12,
m_xVirDev->LogicToPixel(aFontSize).Height() * 2);
CustomWidgetController::SetDrawingArea(pDrawingArea);
m_xVirDev->Pop();
}
......
......@@ -1150,17 +1150,15 @@ VclPtr<AbstractSvxSearchSimilarityDialog> AbstractDialogFactory_Impl::CreateSvxS
}
VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg(
vcl::Window* pParent,
weld::Window* pParent,
const SfxItemSet& rCoreSet,
bool bEnableDrawingLayerFillStyles)
{
VclPtrInstance<SvxBorderBackgroundDlg> pDlg(
return VclPtr<CuiAbstractTabController_Impl>::Create(o3tl::make_unique<SvxBorderBackgroundDlg>(
pParent,
rCoreSet,
/*bEnableSelector*/true,
bEnableDrawingLayerFillStyles);
return VclPtr<CuiAbstractTabDialog_Impl>::Create(pDlg);
bEnableDrawingLayerFillStyles));
}
VclPtr<AbstractSvxTransformTabDialog> AbstractDialogFactory_Impl::CreateSvxTransformTabDialog(weld::Window* pParent,
......
......@@ -668,7 +668,7 @@ public:
virtual VclPtr<AbstractSvxZoomDialog> CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) override;
// add for SvxBorderBackgroundDlg
virtual VclPtr<SfxAbstractTabDialog> CreateSvxBorderBackgroundDlg(
vcl::Window* pParent,
weld::Window* pParent,
const SfxItemSet& rCoreSet,
bool bEnableDrawingLayerFillStyles) override;
......
......@@ -25,21 +25,18 @@
Description: bunch the border background pages
--------------------------------------------------------------------*/
class SvxBorderBackgroundDlg: public SfxTabDialog
class SvxBorderBackgroundDlg: public SfxTabDialogController
{
public:
SvxBorderBackgroundDlg(vcl::Window *pParent,
SvxBorderBackgroundDlg(weld::Window *pParent,
const SfxItemSet& rCoreSet,
bool bEnableSelector,
bool bEnableDrawingLayerFillStyles);
protected:
virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) override;
virtual void PageCreated(const OString& rPageId, SfxTabPage& rTabPage) override;
private:
bool mbEnableBackgroundSelector : 1; ///< for Border/Background
sal_uInt16 m_nBackgroundPageId;
sal_uInt16 m_nAreaPageId;
sal_uInt16 m_nTransparencePageId;
};
#endif
......
......@@ -609,14 +609,14 @@ private:
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
SvxPixelCtl m_aCtlPixel;
XRectPreview m_aCtlPreview;
std::unique_ptr<SvxPixelCtl> m_xCtlPixel;
std::unique_ptr<ColorListBox> m_xLbColor;
std::unique_ptr<ColorListBox> m_xLbBackgroundColor;
std::unique_ptr<PresetListBox> m_xPatternLB;
std::unique_ptr<weld::Button> m_xBtnAdd;
std::unique_ptr<weld::Button> m_xBtnModify;
std::unique_ptr<weld::CustomWeld> m_xCtlPixel;
std::unique_ptr<weld::CustomWeld> m_xCtlPixelWin;
std::unique_ptr<weld::CustomWeld> m_xCtlPreview;
std::unique_ptr<weld::CustomWeld> m_xPatternLBWin;
std::unique_ptr<SvxBitmapCtl> m_xBitmapCtl;
......
......@@ -23,39 +23,36 @@
#include <svx/svxids.hrc>
#include <cuitabarea.hxx>
SvxBorderBackgroundDlg::SvxBorderBackgroundDlg(vcl::Window *pParent,
SvxBorderBackgroundDlg::SvxBorderBackgroundDlg(weld::Window *pParent,
const SfxItemSet& rCoreSet,
bool bEnableSelector,
bool bEnableDrawingLayerFillStyles)
: SfxTabDialog(pParent,
bEnableDrawingLayerFillStyles
? OUString("BorderAreaTransparencyDialog")
: OUString("BorderBackgroundDialog"),
: SfxTabDialogController(pParent,
bEnableDrawingLayerFillStyles
? OUString("cui/ui/borderareatransparencydialog.ui")
: OUString("cui/ui/borderbackgrounddialog.ui"),
bEnableDrawingLayerFillStyles
? OString("BorderAreaTransparencyDialog")
: OString("BorderBackgroundDialog"),
&rCoreSet)
, mbEnableBackgroundSelector(bEnableSelector)
, m_nBackgroundPageId(0)
, m_nAreaPageId(0)
, m_nTransparencePageId(0)
{
AddTabPage("borders", SvxBorderTabPage::Create, nullptr );
if (bEnableDrawingLayerFillStyles)
{
// Here we want full DrawingLayer FillStyle access, so add Area and Transparency TabPages
m_nAreaPageId = AddTabPage("area", SvxAreaTabPage::Create, nullptr);
m_nTransparencePageId = AddTabPage("transparence", SvxTransparenceTabPage::Create, nullptr);
AddTabPage("area", SvxAreaTabPage::Create, nullptr);
AddTabPage("transparence", SvxTransparenceTabPage::Create, nullptr);
}
else
{
m_nBackgroundPageId = AddTabPage("background", SvxBackgroundTabPage::Create, nullptr );
AddTabPage("background", SvxBackgroundTabPage::Create, nullptr );
}
}
void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
void SvxBorderBackgroundDlg::PageCreated(const OString& rPageId, SfxTabPage& rTabPage)
{
if (nPageId == m_nBackgroundPageId)
if (rPageId == "background")
{
// allow switching between Color/graphic
if(mbEnableBackgroundSelector)
......@@ -69,7 +66,7 @@ void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPa
// these pages find the needed attributes for fill style suggestions.
// These are added in SwDocStyleSheet::GetItemSet() for the SfxStyleFamily::Para on
// demand, but could also be directly added from the DrawModel.
else if (nPageId == m_nAreaPageId)
else if (rPageId == "area")
{
SfxItemSet aNew(
*GetInputSetImpl()->GetPool(),
......@@ -83,7 +80,7 @@ void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPa
rTabPage.PageCreated(aNew);
}
else if (nPageId == m_nTransparencePageId)
else if (rPageId == "transparence")
{
rTabPage.PageCreated(*GetInputSetImpl());
}
......
......@@ -118,7 +118,10 @@ SvxAreaTabPage::SvxAreaTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs
SetExchangeSupport();
TabPageParent aFillTab(m_xFillTab.get());
TabPageParent aFillTab(m_xFillTab.get(), pParent.pController);
// TEMP
if (!aFillTab.pController)
aFillTab.pParent = GetParentDialog();
// Calculate optimal size of all pages..
m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(aFillTab, &m_rXFSet));
......@@ -346,9 +349,16 @@ IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, weld::ToggleButton&, rButton,
{
maBox.SelectButton(&rButton);
FillType eFillType = static_cast<FillType>(maBox.GetCurrentButtonPos());
m_pFillTabPage.disposeAndReset(lcl_CreateFillStyleTabPage(eFillType, m_xFillTab.get(), m_rXFSet));
TabPageParent aFillTab(m_xFillTab.get(), GetDialogController());
// TEMP
if (!aFillTab.pController)
aFillTab.pParent = GetParentDialog();
m_pFillTabPage.disposeAndReset(lcl_CreateFillStyleTabPage(eFillType, aFillTab, m_rXFSet));
if (m_pFillTabPage)
{
m_pFillTabPage->SetTabDialog(GetTabDialog());
m_pFillTabPage->SetDialogController(GetDialogController());
}
CreatePage( eFillType , m_pFillTabPage);
}
}
......
......@@ -522,7 +522,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, PresetListBox*, void)
OUString aName( m_pBitmapList->GetBitmap( nPos )->GetName() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
bool bLoop = true;
while( bLoop && pDlg->Execute() == RET_OK )
......@@ -543,7 +543,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, PresetListBox*, void)
}
else
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
xBox->run();
}
......@@ -558,7 +558,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl, PresetListBox*, void)
if( nPos != VALUESET_ITEM_NOTFOUND )
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog"));
if (xQueryBox->run() == RET_YES)
......@@ -708,7 +708,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyTileOffsetHdl, weld::MetricSpinButton&,
IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void)
{
SvxOpenGraphicDialog aDlg("Import", GetTabDialog()->GetFrameWeld());
SvxOpenGraphicDialog aDlg("Import", GetDialogFrameWeld());
aDlg.EnableLink(false);
long nCount = m_pBitmapList->Count();
......@@ -728,7 +728,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void)
OUString aName;
INetURLObject aURL( aDlg.GetPath() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aURL.GetName().getToken(0, '.'), aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aURL.GetName().getToken(0, '.'), aDesc));
nError = ErrCode(1);
while( pDlg->Execute() == RET_OK )
......@@ -746,7 +746,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void)
break;
}
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
if (xBox->run() != RET_OK)
break;
......@@ -771,7 +771,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void)
else
{
// graphic couldn't be loaded
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog"));
xBox->run();
}
......
......@@ -341,7 +341,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void)
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
sal_uInt16 nError = 1;
while (pDlg->Execute() == RET_OK)
......@@ -355,7 +355,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void)
break;
}
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
if (xWarnBox->run() != RET_OK)
break;
......@@ -395,7 +395,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl, weld::Button&, void)
aColorDlg.SetColor (aCurrentColor);
aColorDlg.SetMode( svtools::ColorPickerMode::Modify );
if (aColorDlg.Execute(GetTabDialog()->GetFrameWeld()) == RET_OK)
if (aColorDlg.Execute(GetDialogFrameWeld()) == RET_OK)
{
Color aPreviewColor = aColorDlg.GetColor();
aCurrentColor = aPreviewColor;
......
......@@ -64,9 +64,9 @@ SvxGradientTabPage::SvxGradientTabPage(TabPageParent pParent, const SfxItemSet&
, m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FUNIT_DEGREE))
, m_xMtrBorder(m_xBuilder->weld_metric_spin_button("bordermtr", FUNIT_PERCENT))
, m_xSliderBorder(m_xBuilder->weld_scale("borderslider"))
, m_xLbColorFrom(new ColorListBox(m_xBuilder->weld_menu_button("colorfromlb"), GetFrameWeld()))
, m_xLbColorFrom(new ColorListBox(m_xBuilder->weld_menu_button("colorfromlb"), pParent.GetFrameWeld()))
, m_xMtrColorFrom(m_xBuilder->weld_metric_spin_button("colorfrommtr", FUNIT_PERCENT))
, m_xLbColorTo(new ColorListBox(m_xBuilder->weld_menu_button("colortolb"), GetFrameWeld()))
, m_xLbColorTo(new ColorListBox(m_xBuilder->weld_menu_button("colortolb"), pParent.GetFrameWeld()))
, m_xMtrColorTo(m_xBuilder->weld_metric_spin_button("colortomtr", FUNIT_PERCENT))
, m_xGradientLB(new PresetListBox(m_xBuilder->weld_scrolled_window("gradientpresetlistwin")))
, m_xMtrIncrement(m_xBuilder->weld_spin_button("incrementmtr"))
......@@ -351,7 +351,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, weld::Button&, void)
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
sal_uInt16 nError = 1;
while (pDlg->Execute() == RET_OK)
......@@ -366,7 +366,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, weld::Button&, void)
break;
}
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
if (xWarnBox->run() != RET_OK)
break;
......@@ -443,7 +443,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl, PresetListBox*, void)
if( nPos != VALUESET_ITEM_NOTFOUND )
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletegradientdialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querydeletegradientdialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelGradientDialog"));
if (xQueryBox->run() == RET_YES)
{
......@@ -476,7 +476,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, PresetListBox*, void)
OUString aName( m_pGradientList->GetGradient( nPos )->GetName() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
bool bLoop = true;
while( bLoop && pDlg->Execute() == RET_OK )
......@@ -497,7 +497,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, PresetListBox*, void)
}
else
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
xBox->run();
}
......
......@@ -60,9 +60,9 @@ SvxHatchTabPage::SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAtt
, m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FUNIT_DEGREE))
, m_xSliderAngle(m_xBuilder->weld_scale("angleslider"))
, m_xLbLineType(m_xBuilder->weld_combo_box_text("linetypelb"))
, m_xLbLineColor(new ColorListBox(m_xBuilder->weld_menu_button("linecolorlb"), GetFrameWeld()))
, m_xLbLineColor(new ColorListBox(m_xBuilder->weld_menu_button("linecolorlb"), pParent.GetFrameWeld()))
, m_xCbBackgroundColor(m_xBuilder->weld_check_button("backgroundcolor"))
, m_xLbBackgroundColor(new ColorListBox(m_xBuilder->weld_menu_button("backgroundcolorlb"), GetFrameWeld()))
, m_xLbBackgroundColor(new ColorListBox(m_xBuilder->weld_menu_button("backgroundcolorlb"), pParent.GetFrameWeld()))
, m_xHatchLB(new PresetListBox(m_xBuilder->weld_scrolled_window("hatchpresetlistwin")))
, m_xBtnAdd(m_xBuilder->weld_button("add"))
, m_xBtnModify(m_xBuilder->weld_button("modify"))
......@@ -425,7 +425,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, weld::Button&, void)
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
sal_uInt16 nError = 1;
while( pDlg->Execute() == RET_OK )
......@@ -439,7 +439,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, weld::Button&, void)
break;
}
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
if (xWarnBox->run() != RET_OK)
break;
......@@ -507,7 +507,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl, PresetListBox*, void)
if( nPos != VALUESET_ITEM_NOTFOUND )
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletehatchdialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querydeletehatchdialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelHatchDialog"));
if (xQueryBox->run() == RET_YES)
{
......@@ -537,7 +537,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, PresetListBox*, void )
OUString aName( m_pHatchingList->GetHatch( nPos )->GetName() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
bool bLoop = true;
while( bLoop && pDlg->Execute() == RET_OK )
......@@ -558,7 +558,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickRenameHdl_Impl, PresetListBox*, void )
}
else
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
xBox->run();
}
......
......@@ -90,13 +90,13 @@ SvxPatternTabPage::SvxPatternTabPage(TabPageParent pParent, const SfxItemSet& rI
, m_pnColorListState(nullptr)
, m_aXFillAttr(rInAttrs.GetPool())
, m_rXFSet(m_aXFillAttr.GetItemSet())
, m_aCtlPixel(this)
, m_xLbColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_COLOR"), GetFrameWeld()))
, m_xLbBackgroundColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_BACKGROUND_COLOR"), GetFrameWeld()))
, m_xCtlPixel(new SvxPixelCtl(this))
, m_xLbColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_COLOR"), pParent.GetFrameWeld()))
, m_xLbBackgroundColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_BACKGROUND_COLOR"), pParent.GetFrameWeld()))
, m_xPatternLB(new PresetListBox(m_xBuilder->weld_scrolled_window("patternpresetlistwin")))
, m_xBtnAdd(m_xBuilder->weld_button("BTN_ADD"))
, m_xBtnModify(m_xBuilder->weld_button("BTN_MODIFY"))
, m_xCtlPixel(new weld::CustomWeld(*m_xBuilder, "CTL_PIXEL", m_aCtlPixel))
, m_xCtlPixelWin(new weld::CustomWeld(*m_xBuilder, "CTL_PIXEL", *m_xCtlPixel))
, m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "CTL_PREVIEW", m_aCtlPreview))
, m_xPatternLBWin(new weld::CustomWeld(*m_xBuilder, "patternpresetlist", *m_xPatternLB))
{
......@@ -133,10 +133,11 @@ void SvxPatternTabPage::dispose()
{
m_xPatternLBWin.reset();
m_xCtlPreview.reset();
m_xCtlPixel.reset();
m_xCtlPixelWin.reset();
m_xPatternLB.reset();
m_xLbBackgroundColor.reset();
m_xLbColor.reset();
m_xCtlPixel.reset();
SvxTabPage::dispose();
}
......@@ -219,7 +220,7 @@ void SvxPatternTabPage::Reset( const SfxItemSet* )
{
m_xBitmapCtl->SetPixelColor( m_xLbColor->GetSelectEntryColor() );
m_xBitmapCtl->SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() );
m_xBitmapCtl->SetBmpArray( m_aCtlPixel.GetBitmapPixelPtr() );
m_xBitmapCtl->SetBmpArray( m_xCtlPixel->GetBitmapPixelPtr() );
// get bitmap and display it
const XFillBitmapItem aBmpItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx()));
......@@ -294,13 +295,13 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, SvtValueSet*, void)
if(bIs8x8)
{
m_aCtlPixel.SetPaintable( true );
m_xCtlPixel->SetPaintable( true );
m_xBtnModify->set_sensitive(true);
m_xBtnAdd->set_sensitive(true);
// setting the pixel control
m_aCtlPixel.SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx());
m_xCtlPixel->SetXBitmap(pGraphicObject->GetGraphic().GetBitmapEx());
Color aPixelColor = aFront.GetColor();
Color aBackColor = aBack.GetColor();
......@@ -319,13 +320,13 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangePatternHdl_Impl, SvtValueSet*, void)
}
else
{
m_aCtlPixel.Reset();
m_aCtlPixel.SetPaintable( false );
m_xCtlPixel->Reset();
m_xCtlPixel->SetPaintable( false );
m_xBtnModify->set_sensitive(false);
m_xBtnAdd->set_sensitive(false);
}
m_aCtlPixel.Invalidate();
m_xCtlPixel->Invalidate();
}
}
......@@ -347,7 +348,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, weld::Button&, void)
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
sal_uInt16 nError(1);
while( pDlg->Execute() == RET_OK )
......@@ -361,7 +362,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, weld::Button&, void)
break;
}
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
if (xWarnBox->run() != RET_OK)
break;
......@@ -372,7 +373,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, weld::Button&, void)
if( !nError )
{
std::unique_ptr<XBitmapEntry> pEntry;
if( m_aCtlPixel.IsEnabled() )
if( m_xCtlPixel->IsEnabled() )
{
const BitmapEx aBitmapEx(m_xBitmapCtl->GetBitmapEx());
......@@ -447,7 +448,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, PresetListBox*, void)
OUString aName(m_pPatternList->GetBitmap(nPos)->GetName());
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetDialogFrameWeld(), aName, aDesc));
bool bLoop = true;
......@@ -470,7 +471,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickRenameHdl_Impl, PresetListBox*, void)
}
else
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
xWarnBox->run();
}
......@@ -485,7 +486,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickDeleteHdl_Impl, PresetListBox*, void)
if( nPos != VALUESET_ITEM_NOTFOUND )
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetDialogFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog"));
if (xQueryBox->run() == RET_YES)
{
......@@ -496,7 +497,7 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickDeleteHdl_Impl, PresetListBox*, void)
m_xPatternLB->Resize();
m_aCtlPreview.Invalidate();
m_aCtlPixel.Invalidate();
m_xCtlPixel->Invalidate();
ChangePatternHdl_Impl(m_xPatternLB.get());
......@@ -518,9 +519,9 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ChangeColorHdl_Impl, ColorListBox&, void)
void SvxPatternTabPage::ChangeColor_Impl()
{
m_aCtlPixel.SetPixelColor( m_xLbColor->GetSelectEntryColor() );
m_aCtlPixel.SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() );
m_aCtlPixel.Invalidate();
m_xCtlPixel->SetPixelColor( m_xLbColor->GetSelectEntryColor() );
m_xCtlPixel->SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() );
m_xCtlPixel->Invalidate();
m_xBitmapCtl->SetPixelColor( m_xLbColor->GetSelectEntryColor() );
m_xBitmapCtl->SetBackgroundColor( m_xLbBackgroundColor->GetSelectEntryColor() );
......@@ -538,9 +539,9 @@ void SvxPatternTabPage::PointChanged( vcl::Window*, RectPoint )
void SvxPatternTabPage::PointChanged(weld::DrawingArea* pDrawingArea, RectPoint)
{
if (pDrawingArea == m_aCtlPixel.GetDrawingArea())
if (pDrawingArea == m_xCtlPixel->GetDrawingArea())
{
m_xBitmapCtl->SetBmpArray(m_aCtlPixel.GetBitmapPixelPtr());
m_xBitmapCtl->SetBmpArray(m_xCtlPixel->GetBitmapPixelPtr());
// get bitmap and display it
m_rXFSet.Put(XFillBitmapItem(OUString(), Graphic(m_xBitmapCtl->GetBitmapEx())));
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<!-- interface-requires LibreOffice 1.0 -->
<object class="GtkBox" id="AreaTabPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="border_width">6</property>
<property name="spacing">6</property>
<child>
......
......@@ -40,7 +40,7 @@
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="pixbuf">res/sc10350.png</property>
<property name="icon_name">res/sc10350.png</property>
</object>
<object class="GtkBox" id="ColorPage">
<property name="visible">True</property>
......@@ -134,6 +134,7 @@
<object class="GtkDrawingArea" id="recentcolorset">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
......@@ -254,6 +255,7 @@
<object class="GtkDrawingArea" id="colorset">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
......@@ -311,6 +313,7 @@
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
......@@ -321,7 +324,7 @@
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
......@@ -640,7 +643,7 @@
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
......
This diff is collapsed.
......@@ -45,7 +45,6 @@
<object class="GtkScrolledWindow" id="hatchpresetlistwin">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
<property name="vscrollbar_policy">never</property>
......@@ -58,7 +57,7 @@