[solved]wrong serialization in CXTPControlComboBox |
Post Reply |
Author | |
lrenoux
Groupie Joined: 20 April 2009 Status: Offline Points: 62 |
Post Options
Thanks(0)
Posted: 28 November 2017 at 4:29am |
In save mode (schema _XTP_SCHEMA_1700), the code below is wrong, "Width" will always be saved with 0. void CXTPControlComboBox::DoPropExchange(CXTPPropExchange* pPX) { CXTPControlPopup::DoPropExchange(pPX); PX_Bool(pPX, _T("DropDown"), m_bDropDown, TRUE); // The Width property is already serialized in CXTPControl // so in order to avoid double DPI scaling it must not be read twice (ticket 35575), // however the value still must be read out to provide format backward compatibility (ticket 36079). int nUnusedWidth = 0; PX_DPI_X_Int(pPX, _T("Width"), nUnusedWidth, 0); UNUSED(nUnusedWidth); Introduced in version 18.2. I don't understand the comment. L.
|
|
jis
Groupie Joined: 28 September 2015 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
We have seen a similar issue with 18.2.0 where ComboBoxes have almost no width.
|
|
jis
Groupie Joined: 28 September 2015 Status: Offline Points: 11 |
Post Options
Thanks(0)
|
Ive done some, and it seems that if we do not load commandbars on launch, then the CXTPControlComboBox have a width that normal.
But when we load the commandbars the CXTPControlComboBox have a width of 0. It looks like all combos in the XML file look like this:
Possibly related to: http://forum.codejock.com/forum_posts.asp?TID=23508&KW=ComboBox&title=1820-wrong-serialization-in-cxtpcontrolcombobox ? |
|
mschumi
Groupie Joined: 21 May 2007 Location: Germany Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Hi Codejock Team,
the width related code in void CXTPControlComboBox::DoPropExchange(CXTPPropExchange* pPX) { CXTPControlPopup::DoPropExchange(pPX); PX_Bool(pPX, _T("DropDown"), m_bDropDown, TRUE); // The Width property is already serialized in CXTPControl // so in order to avoid double DPI scaling it must not be read twice (ticket 35575), // however the value still must be read out to provide format backward compatibility (ticket 36079). int nUnusedWidth = 0; PX_DPI_X_Int(pPX, _T("Width"), nUnusedWidth, 0); UNUSED(nUnusedWidth); ... is not correct, once again. In XTP1700 PX_DPI_X_Int(pPX, _T("Width"), m_nWidth, 0) was called twice; the two writes did no harm but the two reads somehow changed the member in case of HighDPI (when XTP_DPI_X returns a modified value) In XTP1801 PX_DPI_X_Int(pPX, _T("Width"), m_nWidth, 0) was called only once (in the base class) and for us, everything was fine (serializing to XML) In XTP1820 - PX_DPI_X_Int(pPX, _T("Width"), m_nWidth, 0) is called in the base class - PX_DPI_X_Int(pPX, _T("Width"), nUnusedWidth, 0) is called again in CXTPControlComboBox::DoPropExchange Now writing is buggy: - the base class (CXTPControl) writes e.g. Width=150 into xml - the derived class (CXTPControlComboBox) writes Width=0 into xml and... gone is the 150 My guess is the code in the derived class should only be called in the read case (IsLoading=true) I would appreciate it very much if the bug was fixed in the next version. Thank you and best regards, Michael |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello, We fixed this with
Regards, Oleksandr Lebed |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |