Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - clicking disabled button in toolbar?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

clicking disabled button in toolbar?

 Post Reply Post Reply
Author
Message
Ashok View Drop Down
Senior Member
Senior Member


Joined: 02 May 2007
Status: Offline
Points: 164
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashok Quote  Post ReplyReply Direct Link To This Post Topic: clicking disabled button in toolbar?
    Posted: 08 June 2007 at 4:07am
Hi,
I have a problem when I am clicking the toolbar button. When I am going to click the disabled toolbar button I need to do the below code. But the commandbar doesn't supporting the code which is in red color (please see the below code). Is there is any alternate way in the commandbar code.
 
Note: Whenever I am going to click the disabled button it should not do anything.
 
The below code is in OnLButtonDown(...)

TOOLINFO ti = { 0 };

int nHit = OnToolHitTest( point, &ti );

int nDex = CommandToIndex( nHit );

if ( -1 < nDex && ( TBBS_DISABLED & GetButtonStyle( nDex )))

return;

Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2007 at 6:02am
Hi,
 
with CommandBars you need somthing like
CXTPControl* pControl = GetControls()->HitTest(point);
if (pControl && !pControl->GetEnabled())
    return;
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Ashok View Drop Down
Senior Member
Senior Member


Joined: 02 May 2007
Status: Offline
Points: 164
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ashok Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2007 at 6:19am
Hi Oleg,
   Many Thanks. It works.
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.047 seconds.