LEADTOOLS Support
General
General Questions
How can I know the MedicalViewerActionType assigned to the button of the mouse ?
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, February 5, 2012 9:42:45 PM(UTC)
Groups: Registered
Posts: 6
How can I know the MedicalViewerActionType assigned to the button of the mouse ?
I tried it with the following code.
but it is not work.
It become error.
Please advise me .
-----------------------------------------------------------------------------------------------------------------
private MedicalViewerActionType GetMouseActionType(ref MedicalViewerMultiCell cell, MedicalViewerMouseButtons MouseButtom){
MedicalViewerActionType type;
try
{
type = MedicalViewerActionType.Alpha;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}
type = MedicalViewerActionType.AnnotationAngle;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}
type = MedicalViewerActionType.AnnotationArrow;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}
type = MedicalViewerActionType.AnnotationAudio;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}
type = MedicalViewerActionType.AnnotationButton;
if (MouseButtom == cell.GetActionButton(type))
{
return type;
}
....... all action type of code ......
return MedicalViewerActionType.None;
}
catch(Exception ex)
{
OutputErrorWithMethodName("GetMouseActionType例外発生", ex);
return MedicalViewerActionType.None;
}
}
-----------------------------------------------------------------------------------------------------------------
#2
Posted
:
Monday, February 6, 2012 1:11:10 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Before calling the cell.GetActionButton() method, you have to make sure that the specified action is already added to the container. You can do this using the cell.IsActionAdded() method. The code will be something as follows:
+--------------+
MedicalViewerActionType type = new MedicalViewerActionType();
MedicalViewerMultiCell cell = _medicalViewer.Cells[0] as MedicalViewerMultiCell;
MedicalViewerMouseButtons MouseButtom = MedicalViewerMouseButtons.Left;
bool Added = true;
try
{
type = MedicalViewerActionType.Alpha;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}
type = MedicalViewerActionType.AnnotationAngle;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}
type = MedicalViewerActionType.AnnotationArrow;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}
type = MedicalViewerActionType.AnnotationAudio;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}
type = MedicalViewerActionType.AnnotationButton;
Added = cell.IsActionAdded(type);
if (Added)
{
if (MouseButtom == cell.GetActionButton(type))
{
MessageBox.Show(type.ToString() + " , " + MouseButtom.ToString());
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
+--------------+
If the problem persists, please tell me what is the error that you get?
And what is the function the shows the error?
Thanks,
Maen Badwan
LEADTOOLS Technical Support
LEADTOOLS Support
General
General Questions
How can I know the MedicalViewerActionType assigned to the button of the mouse ?
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.