summaryrefslogtreecommitdiff
path: root/vcl/source/control/edit.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-01 13:40:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:22 +0100
commit9472cfb459e1c18778eda63b6666184c259ce524 (patch)
treea3e62aa6a9e248660b290abbe7def12046c61148 /vcl/source/control/edit.cxx
parent048c7974836fb2e1dc66a4267a40ad43546c4c82 (diff)
extend property snaffling to listboxes etc.
Diffstat (limited to 'vcl/source/control/edit.cxx')
-rw-r--r--vcl/source/control/edit.cxx45
1 files changed, 26 insertions, 19 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 8365dc8a8c98..fbe4d6d38604 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -200,8 +200,34 @@ Edit::Edit( Window* pParent, WinBits nStyle ) :
ImplInit( pParent, nStyle );
}
+Edit::Edit( Window* pParent, const ResId& rResId ) :
+ Control( WINDOW_EDIT )
+{
+ if (Dialog::replace_buildable(pParent, rResId.GetId(), *this))
+ return;
+
+ ImplInitEditData();
+ rResId.SetRT( RSC_EDIT );
+ WinBits nStyle = ImplInitRes( rResId );
+ ImplInit( pParent, nStyle );
+ ImplLoadRes( rResId );
+
+ // Derived MultiLineEdit takes care to call Show only after MultiLineEdit
+ // ctor has already started:
+ if ( !(nStyle & WB_HIDE) && rResId.GetRT() != RSC_MULTILINEEDIT )
+ Show();
+}
+
void Edit::take_properties(Window &rOther)
{
+ if (!GetParent())
+ {
+ ImplInitEditData();
+ ImplInit(rOther.GetParent(), rOther.GetStyle());
+ }
+
+ Control::take_properties(rOther);
+
Edit &rOtherEdit = static_cast<Edit&>(rOther);
maText = rOtherEdit.maText;
maSaveValue = rOtherEdit.maSaveValue;
@@ -221,25 +247,6 @@ void Edit::take_properties(Window &rOther)
mbIsSubEdit = rOtherEdit.mbIsSubEdit;
mbInMBDown = rOtherEdit.mbInMBDown;
mbActivePopup = rOtherEdit.mbActivePopup;
- Control::take_properties(rOther);
-}
-
-Edit::Edit( Window* pParent, const ResId& rResId ) :
- Control( WINDOW_EDIT )
-{
- if (Dialog::replace_buildable(pParent, rResId.GetId(), *this))
- return;
-
- ImplInitEditData();
- rResId.SetRT( RSC_EDIT );
- WinBits nStyle = ImplInitRes( rResId );
- ImplInit( pParent, nStyle );
- ImplLoadRes( rResId );
-
- // Derived MultiLineEdit takes care to call Show only after MultiLineEdit
- // ctor has already started:
- if ( !(nStyle & WB_HIDE) && rResId.GetRT() != RSC_MULTILINEEDIT )
- Show();
}
// -----------------------------------------------------------------------