Print Page | Close Window

mousewheel in CXTPControlEdit

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=14901
Printed Date: 28 November 2024 at 11:46pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: mousewheel in CXTPControlEdit
Posted By: vjedlicka
Subject: mousewheel in CXTPControlEdit
Date 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



Replies:
Posted By: Satyen
Date 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.


Posted By: vjedlicka
Date Posted: 29 July 2010 at 2:49am
Thanks!


-------------
Thank you
Vaclav
---------------------
ToolkitPro 20.1.0
VS2010-2022, Windows 11



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net