Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - [solved] v17 Flickering buttons in status bar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] v17 Flickering buttons in status bar

 Post Reply Post Reply
Author
Message
Dan View Drop Down
Groupie
Groupie


Joined: 11 June 2014
Status: Offline
Points: 16
Post Options Post Options   Thanks (1) Thanks(1)   Quote Dan Quote  Post ReplyReply Direct Link To This Post Topic: [solved] v17 Flickering buttons in status bar
    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

Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 15 February 2016 at 10:46am
Hello Dan,

Thank you for bringing this to our attention. I have added your changes to our code.

Regards,
 Oleksandr Lebed
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.