CXTPControlBomboBox bug with Manual Updat |
Post Reply |
Author | |||
vladsch
Newbie Joined: 04 February 2004 Location: Canada Status: Offline Points: 30 |
Post Options
Thanks(0)
Posted: 28 March 2004 at 11:25am |
||
Bug occurs if the CXTPControlComboBox control is set to manual update and SetDropDownListStyle(false). To duplicate modify the CustomThemes sample to create a manual update combobox (make sure to delete the saved toolbars from the registry otherwise the old stored non-manual control will be used) 1. drop the list by clicking on the combobox The combo box repaints with the new item even though it was not selected. Moving the mouse over the combobox causes it to repaint with the correct content. The problem is caused during repaint while the list is dropped. The current selection for the list changes to follow the mouse movements so when GetText() method for the combobox is called from OnPaint while the list is dropped it uses the list's current selection to extract the string which will be the last hovered over item instead of the last selected item. The solution that I used was to store the last selected item before poping up the list and restoring it when the popup is closed. This stored selection is modifed to the new selection in the OnSetSelected and OnExecute so that restoring the last selected value will not undo the new selection. new or changed code is bold CXTPControlComboBox.h add a new protected members to CXTPControlComboBox
in CXTPControlComboBox.cpp in the Constructor Clear the new member to -1, not really needed but good practice
Change/Add the following functions:
Edited by vladsch |
|||
vladsch
Newbie Joined: 04 February 2004 Location: Canada Status: Offline Points: 30 |
Post Options
Thanks(0)
|
||
Edited original post to add a call to base class in OnExecute.
|
|||
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 |