Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, December 19, 2013 5:05:31 PM(UTC)
Daidaiyu

Groups: Registered
Posts: 9


Thanks very much !
I have another question here , is there any way to add a MouseRightClick event to a cell ?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, December 22, 2013 7:49:09 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


Daidaiyu,
We have split this post from the original thread because this is a new question.
We have right-mouse events implemented in our demos. For example, in our Medical Viewer demo you  can do various actions like Window leveling, Scale, Stack..etc by the right mouse button to be the action using SetAction() Method.

You can also implement user-defined actions, by casting the user-defined action ID into the actionType parameter. For more information, see the following help topics:
"AddAction Method"
"Applying Actions"

Is this what you want? Or do you want something else? If you want something else, please explain in details what is it that you want.

 
#3 Posted : Monday, December 23, 2013 4:23:37 PM(UTC)
Daidaiyu

Groups: Registered
Posts: 9


Thanks for replaying ~
When I adjust the window lever , I want to end this action by RightClick , but it doesn't work . Here is my code :
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
private void windowlevel_Click(object sender, System.Windows.RoutedEventArgs e)
{
_actionType = MedicalViewerActionType.WindowLevel;
setCellAction(_actionType);
medicalviewer.Cells[0].SetAction(MedicalViewerActionType.None, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active);
}
private void setCellAction(MedicalViewerActionType _actionType)
{
MedicalViewerActionFlags applyingOperation = (MedicalViewerActionFlags)0;
applyingOperation = MedicalViewerActionFlags.Selected;
applyingOperation ^= MedicalViewerActionFlags.RealTime;

foreach (MedicalViewerBaseCell viewerCell in medicalviewer.Cells)
viewerCell.SetAction(_actionType, MedicalViewerMouseButtons.Left, applyingOperation);
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks ~
 
#4 Posted : Monday, December 23, 2013 9:44:23 PM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


You have three issues in your code:
1) In the setCellAction() function, you are setting the Window leveling to the left mouse click button NOT the right click.
2) In the call to medicalviewer.Cells[0].SetAction() you are setting the mouse right-click to have no action.
3) If you use either calls (after fixing issues 1&2), it should give you the result you want. You don't need to call the two.

Here is the code you should use to enable Window Level action on the mouse righ-click:
==============================
private void windowlevel_Click(object sender, System.Windows.RoutedEventArgs e)
{
medicalViewer.Cells[0].SetAction(MedicalViewerActionType.WindowLevel, MedicalViewerMouseButtons.Right, MedicalViewerActionFlags.Active);
}
==============================

OR
==============================
private void windowlevel_Click(object sender, System.Windows.RoutedEventArgs e)
{
_actionType = MedicalViewerActionType.WindowLevel;
setCellAction(_actionType);
}
private void setCellAction(MedicalViewerActionType _actionType)
{
MedicalViewerActionFlags applyingOperation = (MedicalViewerActionFlags)0;
applyingOperation = MedicalViewerActionFlags.Selected;
applyingOperation ^= MedicalViewerActionFlags.RealTime;

foreach (MedicalViewerBaseCell viewerCell in medicalviewer.Cells)
viewerCell.SetAction(_actionType, MedicalViewerMouseButtons.Right, applyingOperation);
}
==============================

 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.057 seconds.