Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - mousewheel in CXTPControlEdit
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

mousewheel in CXTPControlEdit

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


Joined: 04 September 2007
Status: Offline
Points: 122
Post Options Post Options   Thanks (0) Thanks(0)   Quote vjedlicka Quote  Post ReplyReply Direct Link To This Post Topic: mousewheel in CXTPControlEdit
    Posted: 04 August 2009 at 3:05am
Hello,
 
I need an editbox with spin buttons on a tooolbar - exactly as demonstrated in the CommandBarsControls sample.
 

 CXTPControlEdit* pControlEdit = (CXTPControlEdit*)pToolBarEdit->GetControls()->Add(xtpControlEdit, ID_FILE_NEW);
 pControlEdit->ShowSpinButtons(TRUE);
 
Is it possible to add mousewheel support, so that users can change the numerical value by the mouse wheel?
 
 
Thank you
Vaclav
---------------------
ToolkitPro 20.1.0
VS2010-2022, Windows 11
Back to Top
Satyen View Drop Down
Groupie
Groupie
Avatar

Joined: 22 December 2008
Location: India
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Satyen Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2010 at 5:05am
Yes. Codejock control can be treated like standard windows controls (e.g. spinner on a dialog). You will need to implement mousewheel event.
Do something like this -
 

// Scroll Handling.

BOOL CSpinnerCtrl::OnHookMouseWheel(UINT nFlags, short zDelta, CPoint point)
{

  int nVal = 0;

  CString strSelection = GetEditText();

  if(zDelta > 0) // Increased

  {

  nVal = (int)((int)_tstoi(strSelection) + 1);

  }
  else // Decreased

  {

    nVal = (int)((int)_tstoi(strSelection) - 1);

   }

   CXTPControlEdit::OnHookMouseWheel(nFlags, zDelta, point);

   return TRUE;
}

 
Thanks & Regards,
Satyenjit Bagal.
Software Development Engineer.
SIEMENS Automation and Drives.
Back to Top
vjedlicka View Drop Down
Senior Member
Senior Member


Joined: 04 September 2007
Status: Offline
Points: 122
Post Options Post Options   Thanks (0) Thanks(0)   Quote vjedlicka Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2010 at 2:49am
Thanks!
Thank you
Vaclav
---------------------
ToolkitPro 20.1.0
VS2010-2022, Windows 11
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.250 seconds.