示例#1
0
        public void Initialize(MainForm owner, MedicalViewerActionType actionType)
        {
            InitializeComponent();

            cell   = MainForm.DefaultCell;
            viewer = owner.Viewer;
            _owner = owner;


            _owner.CobbAngleStarted = false;


            _actionType = actionType;
            this.Text   = "Set " + GetSeparatedText(actionType.ToString()) + " Action";

            if (cell.IsValidForAction(actionType, MedicalViewerMouseButtons.Wheel))
            {
                _cmbMouseButton.Items.Insert(4, "Wheel");
            }

            if (cell.IsValidForAction(actionType, MedicalViewerActionFlags.Selected))
            {
                _cmbApplyTo.Items.Add("Selected Cells");
                _cmbApplyTo.Items.Add("All Cells");
            }

            if (cell.IsValidForAction(actionType, MedicalViewerActionFlags.Selected))
            {
                _cmbApplyingMethod.Items.Add("On Release");
            }

            MedicalViewerActionFlags actionFlags = cell.GetActionFlags(actionType);


            if ((actionFlags | MedicalViewerActionFlags.OnRelease) == actionFlags)
            {
                _cmbApplyingMethod.SelectedIndex = 1;
            }
            else
            {
                _cmbApplyingMethod.SelectedIndex = 0;
            }

            if ((actionFlags & MedicalViewerActionFlags.Selected) == MedicalViewerActionFlags.Selected)
            {
                _cmbApplyTo.SelectedIndex = 1;
            }
            else if ((actionFlags & MedicalViewerActionFlags.AllCells) == MedicalViewerActionFlags.AllCells)
            {
                _cmbApplyTo.SelectedIndex = 2;
            }
            else
            {
                _cmbApplyTo.SelectedIndex = 0;
            }

            _cmbMouseButton.SelectedIndex = (int)cell.GetActionButton(actionType);
        }
        public SetNudgeShrinkActionDialog(MainForm owner)
        {
            InitializeComponent();

            cell   = MainForm.DefaultCell;
            viewer = owner.Viewer;
            _owner = owner;

            if (cell.IsValidForAction(MedicalViewerActionType.NudgeTool, MedicalViewerMouseButtons.Wheel))
            {
                _cmbNudgeMouseButton.Items.Insert(4, "Wheel");
            }
            if (cell.IsValidForAction(MedicalViewerActionType.ShrinkTool, MedicalViewerMouseButtons.Wheel))
            {
                _cmbShrinkMouseButton.Items.Insert(4, "Wheel");
            }

            if (cell.IsValidForAction(MedicalViewerActionType.NudgeTool, MedicalViewerActionFlags.Selected))
            {
                _cmbNudgeApplyTo.Items.Add("Selected Cells");
                _cmbNudgeApplyTo.Items.Add("All Cells");
            }
            if (cell.IsValidForAction(MedicalViewerActionType.ShrinkTool, MedicalViewerActionFlags.Selected))
            {
                _cmbShrinkApplyTo.Items.Add("Selected Cells");
                _cmbShrinkApplyTo.Items.Add("All Cells");
            }

            if (cell.IsValidForAction(MedicalViewerActionType.NudgeTool, MedicalViewerActionFlags.Selected))
            {
                _cmbNudgeApplyingMethod.Items.Add("On Release");
            }
            if (cell.IsValidForAction(MedicalViewerActionType.ShrinkTool, MedicalViewerActionFlags.Selected))
            {
                _cmbNudgeMouseButton.Items.Add("On Release");
            }

            MedicalViewerActionFlags actionFlags = cell.GetActionFlags(MedicalViewerActionType.NudgeTool);

            if ((actionFlags | MedicalViewerActionFlags.OnRelease) == actionFlags)
            {
                _cmbNudgeApplyingMethod.SelectedIndex = 1;
            }
            else
            {
                _cmbNudgeApplyingMethod.SelectedIndex = 0;
            }

            if ((actionFlags & MedicalViewerActionFlags.Selected) == MedicalViewerActionFlags.Selected)
            {
                _cmbNudgeApplyTo.SelectedIndex = 1;
            }
            else if ((actionFlags & MedicalViewerActionFlags.AllCells) == MedicalViewerActionFlags.AllCells)
            {
                _cmbNudgeApplyTo.SelectedIndex = 2;
            }
            else
            {
                _cmbNudgeApplyTo.SelectedIndex = 0;
            }

            _cmbNudgeMouseButton.SelectedIndex = (int)cell.GetActionButton(MedicalViewerActionType.NudgeTool);


            actionFlags = cell.GetActionFlags(MedicalViewerActionType.ShrinkTool);
            if ((actionFlags | MedicalViewerActionFlags.OnRelease) == actionFlags)
            {
                _cmbShrinkApplyingMethod.SelectedIndex = 1;
            }
            else
            {
                _cmbShrinkApplyingMethod.SelectedIndex = 0;
            }

            if ((actionFlags & MedicalViewerActionFlags.Selected) == MedicalViewerActionFlags.Selected)
            {
                _cmbShrinkApplyTo.SelectedIndex = 1;
            }
            else if ((actionFlags & MedicalViewerActionFlags.AllCells) == MedicalViewerActionFlags.AllCells)
            {
                _cmbShrinkApplyTo.SelectedIndex = 2;
            }
            else
            {
                _cmbShrinkApplyTo.SelectedIndex = 0;
            }

            _cmbShrinkMouseButton.SelectedIndex = (int)cell.GetActionButton(MedicalViewerActionType.ShrinkTool);
        }