[solved] v17 Flickering buttons in status bar |
Post Reply |
Author | |
Dan
Groupie Joined: 11 June 2014 Status: Offline Points: 16 |
Post Options
Thanks(1)
Posted: 11 February 2016 at 10:39am |
Hi,
After upgrading from v16.3.1 to v17, the CXTPButton sub-classed buttons on the status-bar of our application have started to flicker (going from their unpressed state to pressed state) as you move the mouse around. Each of these buttons have command update handlers which are called during idle processing time to make sure they have the correct state. e.g. something like... void CMainFrame::OnUpdateUtilsParallelto(CCmdUI* pCmdUI) { pCmdUI->Enable(allow_snap); pCmdUI->SetCheck(current_snap_type() == SNAP_PARALLEL); } I think the problem is related to this new code in XTPButton.cpp (introduced since v16.3.1)... LRESULT CXTPButton::OnSetCheck(WPARAM wParam, LPARAM /*lParam*/) { BOOL bVisible = GetStyle() & WS_VISIBLE; if (bVisible) ModifyStyle(WS_VISIBLE, 0); Default(); if (bVisible) ModifyStyle(0, WS_VISIBLE); if (IsPushButton()) { SetChecked(!GetChecked()); } ... The line in bold seems to assume that because a button is a push button that calling OnSetCheck should toggle the state, when in fact, the wParam parameter indicates the desired state which could be the same as it was previously. Changing that line to... SetChecked(wParam==BST_CHECKED); Fixes the problem for our application. Dan |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello Dan,
Thank you for bringing this to our attention. I have added your changes to our code. 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 |