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 @@ ...@@ -37,6 +37,7 @@
#define MN_GALLERY_ENTRY 100 #define MN_GALLERY_ENTRY 100
class NumValueSet;
class SvxColorListBox; class SvxColorListBox;
class SvxNumRule; class SvxNumRule;
class SvxBmpNumValueSet; class SvxBmpNumValueSet;
...@@ -121,7 +122,6 @@ class SvxBulletPickTabPage final : public SfxTabPage ...@@ -121,7 +122,6 @@ class SvxBulletPickTabPage final : public SfxTabPage
using TabPage::ActivatePage; using TabPage::ActivatePage;
using TabPage::DeactivatePage; using TabPage::DeactivatePage;
VclPtr<SvxNumValueSet> m_pExamplesVS;
std::unique_ptr<SvxNumRule> pActNum; std::unique_ptr<SvxNumRule> pActNum;
std::unique_ptr<SvxNumRule> pSaveNum; std::unique_ptr<SvxNumRule> pSaveNum;
sal_uInt16 nActNumLvl; sal_uInt16 nActNumLvl;
...@@ -131,11 +131,13 @@ class SvxBulletPickTabPage final : public SfxTabPage ...@@ -131,11 +131,13 @@ class SvxBulletPickTabPage final : public SfxTabPage
OUString sBulletCharFormatName; OUString sBulletCharFormatName;
DECL_LINK(NumSelectHdl_Impl, ValueSet*, void); std::unique_ptr<NumValueSet> m_xExamplesVS;
DECL_LINK(DoubleClickHdl_Impl, ValueSet*, void); std::unique_ptr<weld::CustomWeld> m_xExamplesVSWin;
DECL_LINK(NumSelectHdl_Impl, SvtValueSet*, void);
DECL_LINK(DoubleClickHdl_Impl, SvtValueSet*, void);
public: public:
SvxBulletPickTabPage(vcl::Window* pParent, SvxBulletPickTabPage(TabPageParent pParent, const SfxItemSet& rSet);
const SfxItemSet& rSet);
virtual ~SvxBulletPickTabPage() override; virtual ~SvxBulletPickTabPage() override;
virtual void dispose() override; virtual void dispose() override;
......
...@@ -357,19 +357,19 @@ IMPL_LINK_NOARG(SvxSingleNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, void) ...@@ -357,19 +357,19 @@ IMPL_LINK_NOARG(SvxSingleNumPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
} }
SvxBulletPickTabPage::SvxBulletPickTabPage(vcl::Window* pParent, SvxBulletPickTabPage::SvxBulletPickTabPage(TabPageParent pParent, const SfxItemSet& rSet)
const SfxItemSet& rSet) : SfxTabPage(pParent, "cui/ui/pickbulletpage.ui", "PickBulletPage", &rSet)
: SfxTabPage(pParent, "PickBulletPage", "cui/ui/pickbulletpage.ui", &rSet)
, nActNumLvl(SAL_MAX_UINT16) , nActNumLvl(SAL_MAX_UINT16)
, bModified(false) , bModified(false)
, bPreset(false) , bPreset(false)
, nNumItemId(SID_ATTR_NUMBERING_RULE) , nNumItemId(SID_ATTR_NUMBERING_RULE)
, m_xExamplesVS(new NumValueSet)
, m_xExamplesVSWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xExamplesVS))
{ {
SetExchangeSupport(); SetExchangeSupport();
get(m_pExamplesVS, "valueset"); m_xExamplesVS->init(NumberingPageType::BULLET);
m_pExamplesVS->init(NumberingPageType::BULLET); m_xExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl));
m_pExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl)); m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl));
m_pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl));
} }
SvxBulletPickTabPage::~SvxBulletPickTabPage() SvxBulletPickTabPage::~SvxBulletPickTabPage()
...@@ -379,16 +379,15 @@ SvxBulletPickTabPage::~SvxBulletPickTabPage() ...@@ -379,16 +379,15 @@ SvxBulletPickTabPage::~SvxBulletPickTabPage()
void SvxBulletPickTabPage::dispose() void SvxBulletPickTabPage::dispose()
{ {
pActNum.reset(); m_xExamplesVSWin.reset();
pSaveNum.reset(); m_xExamplesVS.reset();
m_pExamplesVS.clear();
SfxTabPage::dispose(); SfxTabPage::dispose();
} }
VclPtr<SfxTabPage> SvxBulletPickTabPage::Create( TabPageParent pParent, VclPtr<SfxTabPage> SvxBulletPickTabPage::Create(TabPageParent pParent,
const SfxItemSet* rAttrSet) const SfxItemSet* rAttrSet)
{ {
return VclPtr<SvxBulletPickTabPage>::Create(pParent.pParent, *rAttrSet); return VclPtr<SvxBulletPickTabPage>::Create(pParent, *rAttrSet);
} }
bool SvxBulletPickTabPage::FillItemSet( SfxItemSet* rSet ) bool SvxBulletPickTabPage::FillItemSet( SfxItemSet* rSet )
...@@ -422,13 +421,13 @@ void SvxBulletPickTabPage::ActivatePage(const SfxItemSet& rSet) ...@@ -422,13 +421,13 @@ void SvxBulletPickTabPage::ActivatePage(const SfxItemSet& rSet)
if(pActNum && *pSaveNum != *pActNum) if(pActNum && *pSaveNum != *pActNum)
{ {
*pActNum = *pSaveNum; *pActNum = *pSaveNum;
m_pExamplesVS->SetNoSelection(); m_xExamplesVS->SetNoSelection();
} }
if(pActNum && (!lcl_IsNumFmtSet(pActNum.get(), nActNumLvl) || bIsPreset)) if(pActNum && (!lcl_IsNumFmtSet(pActNum.get(), nActNumLvl) || bIsPreset))
{ {
m_pExamplesVS->SelectItem(1); m_xExamplesVS->SelectItem(1);
NumSelectHdl_Impl(m_pExamplesVS); NumSelectHdl_Impl(m_xExamplesVS.get());
bPreset = true; bPreset = true;
} }
bPreset |= bIsPreset; bPreset |= bIsPreset;
...@@ -468,13 +467,13 @@ void SvxBulletPickTabPage::Reset( const SfxItemSet* rSet ) ...@@ -468,13 +467,13 @@ void SvxBulletPickTabPage::Reset( const SfxItemSet* rSet )
*pActNum = *pSaveNum; *pActNum = *pSaveNum;
} }
IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void) IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, SvtValueSet*, void)
{ {
if(pActNum) if(pActNum)
{ {
bPreset = false; bPreset = false;
bModified = true; bModified = true;
sal_Unicode cChar = aBulletTypes[m_pExamplesVS->GetSelectedItemId() - 1]; sal_Unicode cChar = aBulletTypes[m_xExamplesVS->GetSelectedItemId() - 1];
const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont(); const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
sal_uInt16 nMask = 1; sal_uInt16 nMask = 1;
...@@ -498,15 +497,13 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void) ...@@ -498,15 +497,13 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
} }
} }
IMPL_LINK_NOARG(SvxBulletPickTabPage, DoubleClickHdl_Impl, SvtValueSet*, void)
IMPL_LINK_NOARG(SvxBulletPickTabPage, DoubleClickHdl_Impl, ValueSet*, void)
{ {
NumSelectHdl_Impl(m_pExamplesVS); NumSelectHdl_Impl(m_xExamplesVS.get());
PushButton& rOk = GetTabDialog()->GetOKButton(); PushButton& rOk = GetTabDialog()->GetOKButton();
rOk.GetClickHdl().Call(&rOk); rOk.GetClickHdl().Call(&rOk);
} }
void SvxBulletPickTabPage::PageCreated(const SfxAllItemSet& aSet) void SvxBulletPickTabPage::PageCreated(const SfxAllItemSet& aSet)
{ {
const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false); const SfxStringItem* pBulletCharFmt = aSet.GetItem<SfxStringItem>(SID_BULLET_CHAR_FMT, false);
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="cui"> <interface domain="cui">
<!-- interface-requires gtk+ 3.0 --> <requires lib="gtk+" version="3.0"/>
<object class="GtkFrame" id="PickBulletPage"> <object class="GtkFrame" id="PickBulletPage">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -18,11 +19,29 @@ ...@@ -18,11 +19,29 @@
<property name="top_padding">6</property> <property name="top_padding">6</property>
<property name="left_padding">12</property> <property name="left_padding">12</property>
<child> <child>
<object class="svxlo-SvxNumValueSet" id="valueset"> <object class="GtkScrolledWindow" id="valuesetwin">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">True</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">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> </object>
</child> </child>
</object> </object>
......
...@@ -88,6 +88,44 @@ public: ...@@ -88,6 +88,44 @@ public:
const css::lang::Locale& rLocale); 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 class SVX_DLLPUBLIC SvxBmpNumValueSet final : public SvxNumValueSet
{ {
Idle aFormatIdle; Idle aFormatIdle;
......
...@@ -65,6 +65,7 @@ public: ...@@ -65,6 +65,7 @@ public:
void CaptureMouse() { m_pDrawingArea->grab_add(); } void CaptureMouse() { m_pDrawingArea->grab_add(); }
bool IsMouseCaptured() const { return m_pDrawingArea->has_grab(); } bool IsMouseCaptured() const { return m_pDrawingArea->has_grab(); }
void EnableRTL(bool bEnable) { m_pDrawingArea->set_direction(bEnable); } void EnableRTL(bool bEnable) { m_pDrawingArea->set_direction(bEnable); }
bool IsRTLEnabled() const { return m_pDrawingArea->get_direction(); }
void ReleaseMouse() { m_pDrawingArea->grab_remove(); } void ReleaseMouse() { m_pDrawingArea->grab_remove(); }
void SetHelpId(const OString& rHelpId) { m_pDrawingArea->set_help_id(rHelpId); } void SetHelpId(const OString& rHelpId) { m_pDrawingArea->set_help_id(rHelpId); }
void SetAccessibleName(const OUString& rName) { m_pDrawingArea->set_accessible_name(rName); } 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