[ Bug ] [ Button ] Bug introduced with v 17.1.0 |
Post Reply |
Author | |
Alexis
Newbie Joined: 09 March 2016 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 09 March 2016 at 6:09am |
Hi
Description of issue ----------------------- Since version 17.1.0 a new behavior has been introduced. Until this version, in method OnInitDialog we are now unable to use m_myButton.SetChecked ( true ) to change a check state on my button. Since v 17.1.0, using that method will change the visual state of the control, but not the MFC internal state BST_CHECKED. Reproducing steps ---------------------- - In OnInitDialog, call m_myButton.SetChecked ( true ) - Your button is visually checked (pushed) - Put a breakpoint in CXTPButton::OnSetCheck - Click on your button to uncheck it What you'll have -------------------- - Breakpoint hits in OnSetCheck, with parameter wParam being 1, which in turn call SetChecked ( true ) What you should expect ----------------------------- - Breakpoint hits in OnSetCheck, with parameter wParam being 0, which in turn would call SetChecked ( false ) Appears that in OnInitDialog, calling m_myButton.SetChecked ( true ) is not setting the internal BST_CHECKED state on the MFC control, but will set the state m_bChecked in CXTPButton, which make each state mismatching. Workaround --------------- in OnInitDialog, do not call m_myButton.SetChecked ( true ) but m_myButton.SendMessage ( BM_SETCHECK, true, 0 ) which works as expected.
|
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
Noticed that here too.
I added a call to RedrawButton() at the end of CXTPButton::OnSetCheck in the XTP v17.1 sources and it seems to be working as expected now. - Mark R.
|
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello,
Please say, are changes in http://forum.codejock.com/forum_posts.asp?TID=22891 useful for fixing this issue ? Regards, Oleksandr Lebed |
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
Hi Oleksandr,
Those changes were rolled into v17.1, and I don't think they have any bearing on this problem. The first think I tried was reverting the CXTPButton::OnSetCheck() back to the code in v17.0, but that resolve the issue being described here. To me it just looks like the control isn't redrawing itself after the change in check state. - Mark R.
|
|
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
|
Really surprising to me that 17.2 was released without fixing this bug.
- Mark R.
|
|
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 |