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

weld SvxBulletPickTabPage

Change-Id: I0b3e48cc63984208c8e4a090d6630dd5325d776e
Reviewed-on: https://gerrit.libreoffice.org/60257Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b4ccfe73
......@@ -37,6 +37,7 @@
#define MN_GALLERY_ENTRY 100
class NumValueSet;
class SvxColorListBox;
class SvxNumRule;
class SvxBmpNumValueSet;
......@@ -121,7 +122,6 @@ class SvxBulletPickTabPage final : public SfxTabPage
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
VclPtr<SvxNumValueSet> m_pExamplesVS;
std::unique_ptr<SvxNumRule> pActNum;
std::unique_ptr<SvxNumRule> pSaveNum;
sal_uInt16 nActNumLvl;
......@@ -131,11 +131,13 @@ class SvxBulletPickTabPage final : public SfxTabPage
OUString sBulletCharFormatName;
DECL_LINK(NumSelectHdl_Impl, ValueSet*, void);
DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void);
std::unique_ptr<NumValueSet> m_xExamplesVS;
std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin;
DECL_LINK(NumSelectHdl_Impl, SvtValueSet*, void);
DECL_LINK(DoubleClickHdl_Impl, SvtValueSet*, void);
public:
SvxBulletPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet);
SvxBulletPickTabPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~SvxBulletPickTabPage() override;
virtual void dispose() override;
......
......@@ -357,19 +357,19 @@ IMPL_LINK_NOARG(SvxSingleNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
}
SvxBulletPickTabPage::SvxBulletPickTabPage(vcl::Window* pParent,
const SfxItemSet& rSet)
: SfxTabPage(pParent, "PickBulletPage", "cui/ui/pickbulletpage.ui", &rSet)
SvxBulletPickTabPage::SvxBulletPickTabPage(TabPageParent pParent, const SfxItemSet& rSet)
: SfxTabPage(pParent, "cui/ui/pickbulletpage.ui", "PickBulletPage", &rSet)
, nActNumLvl(SAL_MAX_UINT16)
, bModified(false)
, bPreset(false)
, nNumItemId(SID_ATTR_NUMBERING_RULE)
, m_xExamplesVS(new NumValueSet)
, m_xExamplesVSWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xExamplesVS))
{
SetExchangeSupport();
get(m_pExamplesVS, "valueset");
m_pExamplesVS->init(NumberingPageType::BULLET);
m_pExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl));
m_pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl));
m_xExamplesVS->init(NumberingPageType::BULLET);
m_xExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl));
m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl));
}
SvxBulletPickTabPage::~SvxBulletPickTabPage()
......@@ -379,16 +379,15 @@ SvxBulletPickTabPage::~SvxBulletPickTabPage()
void SvxBulletPickTabPage::dispose()
{
pActNum.reset();
pSaveNum.reset();
m_pExamplesVS.clear();
m_xExamplesVSWin.reset();
m_xExamplesVS.reset();
SfxTabPage::dispose();
}
VclPtr<SfxTabPage> SvxBulletPickTabPage::Create( TabPageParent pParent,
const SfxItemSet* rAttrSet)
VclPtr<SfxTabPage> SvxBulletPickTabPage::Create(TabPageParent pParent,
const SfxItemSet* rAttrSet)
{
return VclPtr<SvxBulletPickTabPage>::Create(pParent.pParent, *rAttrSet);
return VclPtr<SvxBulletPickTabPage>::Create(pParent, *rAttrSet);
}
bool SvxBulletPickTabPage::FillItemSet( SfxItemSet* rSet )
......@@ -422,13 +421,13 @@ void SvxBulletPickTabPage::ActivatePage(const SfxItemSet& rSet)
if(pActNum && *pSaveNum != *pActNum)
{
*pActNum = *pSaveNum;
m_pExamplesVS->SetNoSelection();
m_xExamplesVS->SetNoSelection();
}
if(pActNum && (!lcl_IsNumFmtSet(pActNum.get(), nActNumLvl) || bIsPreset))
{
m_pExamplesVS->SelectItem(1);
NumSelectHdl_Impl(m_pExamplesVS);
m_xExamplesVS->SelectItem(1);
NumSelectHdl_Impl(m_xExamplesVS.get());
bPreset = true;
}
bPreset |= bIsPreset;
......@@ -468,13 +467,13 @@ void SvxBulletPickTabPage::Reset( const SfxItemSet* rSet )
*pActNum = *pSaveNum;
}
IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, SvtValueSet*, void)
{
if(pActNum)
{
bPreset = false;
bModified = true;
sal_Unicode cChar = aBulletTypes[m_pExamplesVS->GetSelectedItemId() - 1];
sal_Unicode cChar = aBulletTypes[m_xExamplesVS->GetSelectedItemId() - 1];
const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
sal_uInt16 nMask = 1;
......@@ -498,15 +497,13 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
}
}
IMPL_LINK_NOARG(SvxBulletPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
IMPL_LINK_NOARG(SvxBulletPickTabPage, DoubleClickHdl_Impl, SvtValueSet*, void)
{
NumSelectHdl_Impl(m_pExamplesVS);
NumSelectHdl_Impl(m_xExamplesVS.get());
PushButton& rOk = GetTabDialog()->GetOKButton();
rOk.GetClickHdl().Call(&rOk);
}
void SvxBulletPickTabPage::PageCreated(const SfxAllItemSet& aSet)
{
const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false);
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.0"/>
<object class="GtkFrame" id="PickBulletPage">
<property name="visible">True</property>
<property name="can_focus">False</property>
......@@ -18,11 +19,29 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="svxlo-SvxNumValueSet" id="valueset">
<object class="GtkScrolledWindow" id="valuesetwin">
<property name="visible">True</property>
<property name="can_focus">False</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>
<property name="shadow_type">in</property>
<child>
<object class="GtkViewport">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkDrawingArea" id="valueset">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
......
......@@ -88,6 +88,44 @@ public:
const css::lang::Locale& rLocale);
};
class SVX_DLLPUBLIC NumValueSet : public SvtValueSet
{
NumberingPageType ePageType;
tools::Rectangle aOrgRect;
VclPtr<VirtualDevice> pVDev;
css::uno::Reference<css::text::XNumberingFormatter> xFormatter;
css::lang::Locale aLocale;
css::uno::Sequence<
css::uno::Sequence<
css::beans::PropertyValue> > aNumSettings;
css::uno::Sequence<
css::uno::Reference<
css::container::XIndexAccess> > aOutlineSettings;
public:
NumValueSet();
void init(NumberingPageType eType);
virtual ~NumValueSet() override;
virtual void UserDraw( const UserDrawEvent& rUDEvt ) override;
void SetNumberingSettings(
const css::uno::Sequence<
css::uno::Sequence<css::beans::PropertyValue> >& aNum,
css::uno::Reference<css::text::XNumberingFormatter> const & xFormatter,
const css::lang::Locale& rLocale );
void SetOutlineNumberingSettings(
css::uno::Sequence<
css::uno::Reference<css::container::XIndexAccess> > const & rOutline,
css::uno::Reference<css::text::XNumberingFormatter> const & xFormatter,
const css::lang::Locale& rLocale);
};
class SVX_DLLPUBLIC SvxBmpNumValueSet final : public SvxNumValueSet
{
Idle aFormatIdle;
......
......@@ -65,6 +65,7 @@ public:
void CaptureMouse() { m_pDrawingArea->grab_add(); }
bool IsMouseCaptured() const { return m_pDrawingArea->has_grab(); }
void EnableRTL(bool bEnable) { m_pDrawingArea->set_direction(bEnable); }
bool IsRTLEnabled() const { return m_pDrawingArea->get_direction(); }
void ReleaseMouse() { m_pDrawingArea->grab_remove(); }
void SetHelpId(const OString& rHelpId) { m_pDrawingArea->set_help_id(rHelpId); }
void SetAccessibleName(const OUString& rName) { m_pDrawingArea->set_accessible_name(rName); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment