summaryrefslogtreecommitdiff
path: root/vcl/source/control/spinfld.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/spinfld.cxx')
-rw-r--r--vcl/source/control/spinfld.cxx40
1 files changed, 23 insertions, 17 deletions
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 5570ae8f2309..9487d2ff76a2 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -352,14 +352,34 @@ SpinField::SpinField( Window* pParent, WinBits nWinStyle ) :
ImplInit( pParent, nWinStyle );
}
+SpinField::SpinField( Window* pParent, const ResId& rResId ) :
+ Edit( WINDOW_SPINFIELD )
+{
+ ImplInitSpinFieldData();
+ rResId.SetRT( RSC_SPINFIELD );
+ WinBits nStyle = ImplInitRes( rResId );
+ ImplInit( pParent, nStyle );
+ ImplLoadRes( rResId );
+
+ if ( !(nStyle & WB_HIDE) )
+ Show();
+}
+
void SpinField::take_properties(Window &rOther)
{
fprintf(stderr, "SpinField::take_properties\n");
+ if (!GetParent())
+ {
+ ImplInitSpinFieldData();
+ ImplInit(rOther.GetParent(), rOther.GetStyle());
+ }
+
+ Edit::take_properties(rOther);
+
SpinField &rOtherField = static_cast<SpinField&>(rOther);
- assert(!mpEdit && rOther.mpEdit);
- mpEdit = new Edit(this, WB_NOBORDER);
- SetSubEdit(mpEdit);
+ assert(mpEdit && rOther.mpEdit);
mpEdit->take_properties(*rOtherField.mpEdit);
+
maUpperRect = rOtherField.maUpperRect;
maLowerRect = rOtherField.maLowerRect;
maDropDownRect = rOtherField.maDropDownRect;
@@ -371,24 +391,10 @@ void SpinField::take_properties(Window &rOther)
mbUpperIn = rOtherField.mbUpperIn;
mbLowerIn = rOtherField.mbLowerIn;
mbInDropDown = rOtherField.mbInDropDown;
-
- Edit::take_properties(rOther);
-
fprintf(stderr, "SpinField::take_properties %p %d\n", this, IsVisible());
}
-SpinField::SpinField( Window* pParent, const ResId& rResId ) :
- Edit( WINDOW_SPINFIELD )
-{
- ImplInitSpinFieldData();
- rResId.SetRT( RSC_SPINFIELD );
- WinBits nStyle = ImplInitRes( rResId );
- ImplInit( pParent, nStyle );
- ImplLoadRes( rResId );
- if ( !(nStyle & WB_HIDE) )
- Show();
-}
// --------------------------------------------------------------------