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

weld SwOutlineSettingsTabPage

Change-Id: I5032c0d446cee1eae443a4c0876f862c3a6af81a
Reviewed-on: https://gerrit.libreoffice.org/53838Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 71bbb098
This diff is collapsed.
...@@ -67,9 +67,12 @@ public: ...@@ -67,9 +67,12 @@ public:
NumberingTypeListBox(weld::ComboBoxText* pWidget); NumberingTypeListBox(weld::ComboBoxText* pWidget);
~NumberingTypeListBox(); ~NumberingTypeListBox();
void connect_changed(const Link<weld::ComboBoxText&, void>& rLink) { m_xWidget->connect_changed(rLink); }
void Reload(SwInsertNumTypes nTypeFlags); void Reload(SwInsertNumTypes nTypeFlags);
SvxNumType GetSelectedNumberingType(); SvxNumType GetSelectedNumberingType();
bool SelectNumberingType(SvxNumType nType); bool SelectNumberingType(SvxNumType nType);
void SetNoSelection() { m_xWidget->set_active(-1); }
}; };
#endif #endif
......
...@@ -59,6 +59,56 @@ class NumberingPreview : public vcl::Window ...@@ -59,6 +59,56 @@ class NumberingPreview : public vcl::Window
}; };
class SwNumberingPreview
{
std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
Size m_aSize;
const SwNumRule* pActNum;
vcl::Font aStdFont;
long nPageWidth;
const OUString* pOutlineNames;
bool bPosition;
sal_uInt16 nActLevel;
private:
DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
DECL_LINK(DoResize, const Size& rSize, void);
public:
SwNumberingPreview(weld::DrawingArea* pDrawingArea)
: m_xDrawingArea(pDrawingArea)
, pActNum(nullptr)
, nPageWidth(0)
, pOutlineNames(nullptr)
, bPosition(false)
, nActLevel(USHRT_MAX)
{
m_xDrawingArea->connect_size_allocate(LINK(this, SwNumberingPreview, DoResize));
m_xDrawingArea->connect_draw(LINK(this, SwNumberingPreview, DoPaint));
}
void queue_draw()
{
m_xDrawingArea->queue_draw();
}
void SetNumRule(const SwNumRule* pNum)
{
pActNum = pNum;
queue_draw();
}
void SetPageWidth(long nPgWidth)
{nPageWidth = nPgWidth;}
void SetOutlineNames(const OUString* pNames)
{pOutlineNames = pNames;}
void SetPositionMode()
{ bPosition = true;}
void SetLevel(sal_uInt16 nSet) {nActLevel = nSet;}
};
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -82,46 +82,44 @@ public: ...@@ -82,46 +82,44 @@ public:
class SwOutlineSettingsTabPage : public SfxTabPage class SwOutlineSettingsTabPage : public SfxTabPage
{ {
VclPtr<ListBox> m_pLevelLB;
VclPtr<ListBox> m_pCollBox;
VclPtr<SwNumberingTypeListBox> m_pNumberBox;
VclPtr<ListBox> m_pCharFormatLB;
VclPtr<FixedText> m_pAllLevelFT;
VclPtr<NumericField> m_pAllLevelNF;
VclPtr<Edit> m_pPrefixED;
VclPtr<Edit> m_pSuffixED;
VclPtr<NumericField> m_pStartEdit;
VclPtr<NumberingPreview> m_pPreviewWIN;
OUString aNoFormatName; OUString aNoFormatName;
OUString aSaveCollNames[MAXLEVEL]; OUString aSaveCollNames[MAXLEVEL];
SwWrtShell* pSh; SwWrtShell* pSh;
SwNumRule* pNumRule; SwNumRule* pNumRule;
OUString* pCollNames; OUString* pCollNames;
sal_uInt16 nActLevel; sal_uInt16 nActLevel;
DECL_LINK( LevelHdl, ListBox&, void ); std::unique_ptr<weld::TreeView> m_xLevelLB;
DECL_LINK( ToggleComplete, Edit&, void ); std::unique_ptr<weld::ComboBoxText> m_xCollBox;
DECL_LINK( CollSelect, ListBox&, void ); std::unique_ptr<NumberingTypeListBox> m_xNumberBox;
DECL_LINK( CollSelectGetFocus, Control&, void ); std::unique_ptr<weld::ComboBoxText> m_xCharFormatLB;
DECL_LINK( NumberSelect, ListBox&, void ); std::unique_ptr<weld::Label> m_xAllLevelFT;
DECL_LINK( DelimModify, Edit&, void ); std::unique_ptr<weld::SpinButton> m_xAllLevelNF;
DECL_LINK( StartModified, Edit&, void ); std::unique_ptr<weld::Entry> m_xPrefixED;
DECL_LINK( CharFormatHdl, ListBox&, void ); std::unique_ptr<weld::Entry> m_xSuffixED;
std::unique_ptr<weld::SpinButton> m_xStartEdit;
std::unique_ptr<SwNumberingPreview> m_xPreviewWIN;
DECL_LINK( LevelHdl, weld::TreeView&, void );
DECL_LINK( ToggleComplete, weld::SpinButton&, void );
DECL_LINK( CollSelect, weld::ComboBoxText&, void );
DECL_LINK( CollSelectGetFocus, weld::Widget&, void );
DECL_LINK( NumberSelect, weld::ComboBoxText&, void );
DECL_LINK( DelimModify, weld::Entry&, void );
DECL_LINK( StartModified, weld::SpinButton&, void );
DECL_LINK( CharFormatHdl, weld::ComboBoxText&, void );
void Update(); void Update();
void SetModified(){m_pPreviewWIN->Invalidate();} void SetModified() { m_xPreviewWIN->queue_draw(); }
void CheckForStartValue_Impl(sal_uInt16 nNumberingType); void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
using SfxTabPage::ActivatePage; using SfxTabPage::ActivatePage;
using SfxTabPage::DeactivatePage; using SfxTabPage::DeactivatePage;
public: public:
SwOutlineSettingsTabPage(vcl::Window* pParent, const SfxItemSet& rSet); SwOutlineSettingsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
virtual ~SwOutlineSettingsTabPage() override; virtual ~SwOutlineSettingsTabPage() override;
virtual void dispose() override;
void SetWrtShell(SwWrtShell* pShell); void SetWrtShell(SwWrtShell* pShell);
...@@ -135,7 +133,7 @@ public: ...@@ -135,7 +133,7 @@ public:
void SetNumRule(SwNumRule *pRule) void SetNumRule(SwNumRule *pRule)
{ {
pNumRule = pRule; pNumRule = pRule;
m_pPreviewWIN->SetNumRule(pNumRule); m_xPreviewWIN->SetNumRule(pNumRule);
} }
}; };
......
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