summaryrefslogtreecommitdiff
path: root/vcl/source/control/button.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/button.cxx')
-rw-r--r--vcl/source/control/button.cxx96
1 files changed, 71 insertions, 25 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 2028bf6eb02a..8721cbd988d8 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1220,6 +1220,17 @@ PushButton::PushButton( Window* pParent, const ResId& rResId ) :
Show();
}
+void PushButton::take_properties(Window &rOther)
+{
+ if (!GetParent())
+ {
+ ImplInitPushButtonData();
+ ImplInit(rOther.GetParent(), rOther.GetStyle());
+ }
+
+ Button::take_properties(rOther);
+}
+
// -----------------------------------------------------------------------
PushButton::~PushButton()
@@ -1763,6 +1774,13 @@ OKButton::OKButton( Window* pParent, const ResId& rResId ) :
Show();
}
+void OKButton::take_properties(Window &rOther)
+{
+ if (!GetParent())
+ ImplInit(rOther.GetParent(), rOther.GetStyle());
+ PushButton::take_properties(rOther);
+}
+
// -----------------------------------------------------------------------
void OKButton::Click()
@@ -1833,6 +1851,13 @@ CancelButton::CancelButton( Window* pParent, const ResId& rResId ) :
Show();
}
+void CancelButton::take_properties(Window &rOther)
+{
+ if (!GetParent())
+ ImplInit(rOther.GetParent(), rOther.GetStyle());
+ PushButton::take_properties(rOther);
+}
+
// -----------------------------------------------------------------------
void CancelButton::Click()
@@ -1903,6 +1928,13 @@ HelpButton::HelpButton( Window* pParent, const ResId& rResId ) :
Show();
}
+void HelpButton::take_properties(Window &rOther)
+{
+ if (!GetParent())
+ ImplInit(rOther.GetParent(), rOther.GetStyle());
+ PushButton::take_properties(rOther);
+}
+
// -----------------------------------------------------------------------
void HelpButton::Click()
@@ -2456,6 +2488,29 @@ RadioButton::RadioButton( Window* pParent, const ResId& rResId ) :
Show();
}
+void RadioButton::take_properties(Window &rOther)
+{
+ if (!GetParent())
+ {
+ ImplInitRadioButtonData();
+ ImplInit(rOther.GetParent(), rOther.GetStyle());
+ }
+
+ Button::take_properties(rOther);
+
+ RadioButton &rOtherRadio = static_cast<RadioButton&>(rOther);
+ if (rOtherRadio.m_xGroup.get())
+ {
+ rOtherRadio.m_xGroup->erase(&rOtherRadio);
+ rOtherRadio.m_xGroup->insert(this);
+ }
+ std::swap(m_xGroup, rOtherRadio.m_xGroup);
+ mbChecked = rOtherRadio.mbChecked;
+ mbSaveValue = rOtherRadio.mbSaveValue;
+ mbRadioCheck = rOtherRadio.mbRadioCheck;
+ mbStateChanged = rOtherRadio.mbStateChanged;
+}
+
// -----------------------------------------------------------------------
void RadioButton::ImplLoadRes( const ResId& rResId )
@@ -2831,22 +2886,6 @@ void RadioButton::SetState( sal_Bool bCheck )
}
}
-void RadioButton::take_properties(Window &rOther)
-{
- RadioButton &rOtherRadio = static_cast<RadioButton&>(rOther);
- if (rOtherRadio.m_xGroup.get())
- {
- rOtherRadio.m_xGroup->erase(&rOtherRadio);
- rOtherRadio.m_xGroup->insert(this);
- }
- std::swap(m_xGroup, rOtherRadio.m_xGroup);
- mbChecked = rOtherRadio.mbChecked;
- mbSaveValue = rOtherRadio.mbSaveValue;
- mbRadioCheck = rOtherRadio.mbRadioCheck;
- mbStateChanged = rOtherRadio.mbStateChanged;
- Button::take_properties(rOther);
-}
-
bool RadioButton::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
{
if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("active")))
@@ -3419,6 +3458,22 @@ CheckBox::CheckBox( Window* pParent, const ResId& rResId ) :
Show();
}
+void CheckBox::take_properties(Window &rOther)
+{
+ if (!GetParent())
+ {
+ ImplInitCheckBoxData();
+ ImplInit(rOther.GetParent(), rOther.GetStyle());
+ }
+
+ Button::take_properties(rOther);
+
+ CheckBox &rOtherCheck = static_cast<CheckBox&>(rOther);
+ meState = rOtherCheck.meState;
+ meSaveValue = rOtherCheck.meSaveValue;
+ mbTriState = rOtherCheck.mbTriState;
+}
+
// -----------------------------------------------------------------------
void CheckBox::MouseButtonDown( const MouseEvent& rMEvt )
@@ -3803,15 +3858,6 @@ void CheckBox::SetState( TriState eState )
}
}
-void CheckBox::take_properties(Window &rOther)
-{
- CheckBox &rOtherCheck = static_cast<CheckBox&>(rOther);
- meState = rOtherCheck.meState;
- meSaveValue = rOtherCheck.meSaveValue;
- mbTriState = rOtherCheck.mbTriState;
- Button::take_properties(rOther);
-}
-
bool CheckBox::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
{
if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("active")))