summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-02 09:23:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-02 22:37:17 +0200
commitc7f9599f685a8e297be32fe6db5de04068b22d05 (patch)
treef371e617f8cabe325f04c1ac8b30052357da280e /vcl/source/app
parentdfb9138b8b5a239b46f189a717999bcaff19aa79 (diff)
weld SvxTextAnimationPage
Change-Id: I5aadf86648483be254157d3ca148eb16258980e1 Reviewed-on: https://gerrit.libreoffice.org/53723 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/salvtables.cxx74
1 files changed, 66 insertions, 8 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index aecefcffbd88..3ec78eb95013 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -345,16 +345,14 @@ public:
virtual void connect_focus_in(const Link<Widget&, void>& rLink) override
{
- assert(!m_aFocusInHdl.IsSet());
- m_xWidget->AddEventListener(LINK( this, SalInstanceWidget, FocusInListener));
- m_aFocusInHdl = rLink;
+ m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, FocusInListener));
+ weld::Widget::connect_focus_in(rLink);
}
virtual void connect_focus_out(const Link<Widget&, void>& rLink) override
{
- assert(!m_aFocusOutHdl.IsSet());
- m_xWidget->AddEventListener(LINK( this, SalInstanceWidget, FocusOutListener));
- m_aFocusOutHdl = rLink;
+ m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, FocusOutListener));
+ weld::Widget::connect_focus_out(rLink);
}
virtual void grab_add() override
@@ -372,9 +370,9 @@ public:
virtual ~SalInstanceWidget() override
{
if (m_aFocusInHdl.IsSet())
- m_xWidget->RemoveEventListener(LINK( this, SalInstanceWidget, FocusInListener));
+ m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, FocusInListener));
if (m_aFocusOutHdl.IsSet())
- m_xWidget->RemoveEventListener(LINK( this, SalInstanceWidget, FocusOutListener));
+ m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, FocusOutListener));
if (m_bTakeOwnership)
m_xWidget.disposeAndClear();
}
@@ -978,6 +976,60 @@ IMPL_LINK_NOARG(SalInstanceRadioButton, ToggleHdl, ::RadioButton&, void)
signal_toggled();
}
+class SalInstanceToggleButton : public SalInstanceButton, public virtual weld::ToggleButton
+{
+private:
+ VclPtr<PushButton> m_xToggleButton;
+
+ DECL_LINK(ToggleListener, VclWindowEvent&, void);
+
+public:
+ SalInstanceToggleButton(PushButton* pButton, bool bTakeOwnership)
+ : SalInstanceButton(pButton, bTakeOwnership)
+ , m_xToggleButton(pButton)
+ {
+ }
+
+ virtual void connect_toggled(const Link<ToggleButton&, void>& rLink) override
+ {
+ assert(!m_aToggleHdl.IsSet());
+ m_xToggleButton->AddEventListener(LINK(this, SalInstanceToggleButton, ToggleListener));
+ weld::ToggleButton::connect_toggled(rLink);
+ }
+
+ virtual void set_active(bool active) override
+ {
+ m_xToggleButton->Check(active);
+ }
+
+ virtual bool get_active() const override
+ {
+ return m_xToggleButton->IsChecked();
+ }
+
+ virtual void set_inconsistent(bool inconsistent) override
+ {
+ m_xToggleButton->SetState(inconsistent ? TRISTATE_INDET : TRISTATE_FALSE);
+ }
+
+ virtual bool get_inconsistent() const override
+ {
+ return m_xToggleButton->GetState() == TRISTATE_INDET;
+ }
+
+ virtual ~SalInstanceToggleButton() override
+ {
+ if (m_aToggleHdl.IsSet())
+ m_xToggleButton->RemoveEventListener(LINK(this, SalInstanceToggleButton, ToggleListener));
+ }
+};
+
+IMPL_LINK(SalInstanceToggleButton, ToggleListener, VclWindowEvent&, rEvent, void)
+{
+ if (rEvent.GetId() == VclEventId::PushbuttonToggle)
+ signal_toggled();
+}
+
class SalInstanceCheckButton : public SalInstanceButton, public virtual weld::CheckButton
{
private:
@@ -1990,6 +2042,12 @@ public:
return pButton ? new SalInstanceMenuButton(pButton, bTakeOwnership) : nullptr;
}
+ virtual weld::ToggleButton* weld_toggle_button(const OString &id, bool bTakeOwnership) override
+ {
+ PushButton* pToggleButton = m_xBuilder->get<PushButton>(id);
+ return pToggleButton ? new SalInstanceToggleButton(pToggleButton, bTakeOwnership) : nullptr;
+ }
+
virtual weld::RadioButton* weld_radio_button(const OString &id, bool bTakeOwnership) override
{
RadioButton* pRadioButton = m_xBuilder->get<RadioButton>(id);