public WindowLevelPropertiesDialog(MainForm owner, MedicalViewerCell selectedCell) { InitializeComponent(); _Viewer = owner.Viewer; if (selectedCell == null) { if (_Viewer.Cells.Count != 0) { selectedCell = (MedicalViewerCell)_Viewer.Cells[0]; } } _SelectedCell = selectedCell; if (selectedCell != null) { _txtCellIndex.Value = _Viewer.Cells.IndexOf(selectedCell); } if (selectedCell == null) { _windowLevel = MainForm.GlobalCell.GetActionProperties(MedicalViewerActionType.WindowLevel, 0) as MedicalViewerWindowLevel; _keys = MainForm.GlobalCell.GetActionKeys(MedicalViewerActionType.WindowLevel); } else { _windowLevel = selectedCell.GetActionProperties(MedicalViewerActionType.WindowLevel, 0) as MedicalViewerWindowLevel; _keys = selectedCell.GetActionKeys(MedicalViewerActionType.WindowLevel); } _cmbFillType.Items.Add(MedicalViewerLookupTableType.Linear); _cmbFillType.Items.Add(MedicalViewerLookupTableType.Logarithmic); _cmbFillType.Items.Add(MedicalViewerLookupTableType.Exponential); _cmbFillType.Items.Add(MedicalViewerLookupTableType.Sigmoid); _btnCursor.ButtonCursor = _windowLevel.ActionCursor; _lblStart.BoxColor = _windowLevel.StartColor; _lblEnd.BoxColor = _windowLevel.EndColor; _txtWidth.Value = (_windowLevel.Width == 0) ? 1 : _windowLevel.Width; _txtCenter.Value = _windowLevel.Center; int index = _cmbFillType.Items.IndexOf(_windowLevel.LookupTableType); _cmbFillType.SelectedIndex = index == -1 ? 0 : index; _txtSensitivity.Text = _windowLevel.Sensitivity.ToString(); _chkCircular.Checked = _windowLevel.CircularMouseMove; _cmbApplyToCell.SelectedIndex = 0; _cmbApplyToSubCell.SelectedIndex = 0; owner.AddKeysToCombo(_cmbLeftKey, _keys.MouseLeft); owner.AddKeysToCombo(_cmbRightKey, _keys.MouseRight); owner.AddKeysToCombo(_cmbBottomKey, _keys.MouseDown); owner.AddKeysToCombo(_cmbTopKey, _keys.MouseUp); owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers); _cmbApplyToCell.Enabled = (owner.Viewer.Cells.Count != 0); }
public OffsetPropertiesDialog(MainForm owner, MedicalViewerCell selectedCell) { InitializeComponent(); _Viewer = owner.Viewer; if (selectedCell == null) { if (_Viewer.Cells.Count != 0) { selectedCell = (MedicalViewerCell)_Viewer.Cells[0]; } } _SelectedCell = selectedCell; if (selectedCell != null) { _txtCellIndex.Value = _Viewer.Cells.IndexOf(selectedCell); } if (_SelectedCell != null) { _offset = (MedicalViewerOffset)(_SelectedCell.GetActionProperties(MedicalViewerActionType.Offset, _txtCellIndex.Value)); _keys = _SelectedCell.GetActionKeys(MedicalViewerActionType.Offset); } else { _offset = (MedicalViewerOffset)(MainForm.DefaultCell.GetActionProperties(MedicalViewerActionType.Offset, _txtCellIndex.Value)); _keys = MainForm.DefaultCell.GetActionKeys(MedicalViewerActionType.Offset); } _btnActionCursor.ButtonCursor = _offset.ActionCursor; _cmbApplyToCell.SelectedIndex = 0; _txtX.Value = _offset.X; _txtY.Value = _offset.Y; _txtSensitivity.Value = _offset.Sensitivity; _chkCircular.Checked = _offset.CircularMouseMove; owner.AddKeysToCombo(_cmbLeftKey, _keys.MouseLeft); owner.AddKeysToCombo(_cmbRightKey, _keys.MouseRight); owner.AddKeysToCombo(_cmbBottomKey, _keys.MouseDown); owner.AddKeysToCombo(_cmbTopKey, _keys.MouseUp); owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers); _cmbApplyToCell.Enabled = (owner.Viewer.Cells.Count != 0); }
public StackPropertiesDialog(MainForm owner, MedicalViewerCell selectedCell) { InitializeComponent(); _Viewer = owner.Viewer; if (selectedCell == null) { if (_Viewer.Cells.Count != 0) { selectedCell = (MedicalViewerCell)_Viewer.Cells[0]; } } _SelectedCell = selectedCell; if (selectedCell != null) { _txtCellIndex.Value = _Viewer.Cells.IndexOf(selectedCell); } if (selectedCell != null) { _stack = (MedicalViewerStack)(_SelectedCell.GetActionProperties(MedicalViewerActionType.Stack)); _keys = _SelectedCell.GetActionKeys(MedicalViewerActionType.Stack); } else { _stack = (MedicalViewerStack)(MainForm.GlobalCell.GetActionProperties(MedicalViewerActionType.Stack, _txtCellIndex.Value)); _keys = MainForm.GlobalCell.GetActionKeys(MedicalViewerActionType.Stack); } _btnActionCursor.ButtonCursor = _stack.ActionCursor; _txtSensitivity.Value = _stack.Sensitivity; _chkCircular.Checked = _stack.CircularMouseMove; _txtStack.Value = _stack.ScrollValue; _txtActiveSubCell.Value = _stack.ActiveSubCell; _cmbApplyToCells.SelectedIndex = 0; owner.AddKeysToCombo(_cmbTopKey, _keys.MouseUp); owner.AddKeysToCombo(_cmbBottomKey, _keys.MouseDown); owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers); _cmbApplyToCells.Enabled = (owner.Viewer.Cells.Count != 0); }
public ScalePropertiesDialog(MainForm owner, MedicalViewerCell selectedCell) { InitializeComponent(); _Viewer = owner.Viewer; if (selectedCell == null) { if (_Viewer.Cells.Count != 0) { selectedCell = (MedicalViewerCell)_Viewer.Cells[0]; } } _SelectedCell = selectedCell; if (selectedCell != null) { _txtCellIndex.Value = _Viewer.Cells.IndexOf(selectedCell); } if (_SelectedCell != null) { _scale = (MedicalViewerScale)(_SelectedCell.GetActionProperties(MedicalViewerActionType.Scale)); _keys = _SelectedCell.GetActionKeys(MedicalViewerActionType.Scale); _chkBoxDynamic.Checked = _SelectedCell.ScaleType == MedicalViewerScaleType.Dynamic; } else { _scale = (MedicalViewerScale)(MainForm.DefaultCell.GetActionProperties(MedicalViewerActionType.Scale)); _keys = MainForm.DefaultCell.GetActionKeys(MedicalViewerActionType.Scale); MainForm.DefaultCell.ScaleType = _chkBoxDynamic.Checked ? MedicalViewerScaleType.Dynamic : MedicalViewerScaleType.Normal; } _btnCursor.ButtonCursor = _scale.ActionCursor; _cmbApplyToCells.SelectedIndex = 0; _txtSensitivity.Value = _scale.Sensitivity; _chkCircular.Checked = _scale.CircularMouseMove; _txtScale.Value = _scale.Scale; owner.AddKeysToCombo(_cmbTopKey, _keys.MouseUp); owner.AddKeysToCombo(_cmbBottomKey, _keys.MouseDown); owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers); _cmbApplyToCells.Enabled = (owner.Viewer.Cells.Count != 0); }
public AlphaPropertiesDialog(MainForm owner, MedicalViewerCell selectedCell) { InitializeComponent(); _Viewer = owner.Viewer; if (selectedCell == null) { if (_Viewer.Cells.Count != 0) { selectedCell = (MedicalViewerCell)_Viewer.Cells[0]; } } _SelectedCell = selectedCell; _txtCellIndex.Value = _Viewer.Cells.IndexOf(_SelectedCell); _txtSubCellIndex.Value = 0; if (_SelectedCell != null) { _alpha = (MedicalViewerAlpha)(_SelectedCell.GetActionProperties(MedicalViewerActionType.Alpha)); _keys = _SelectedCell.GetActionKeys(MedicalViewerActionType.Alpha); } else { _alpha = (MedicalViewerAlpha)(MainForm.DefaultCell.GetActionProperties(MedicalViewerActionType.Alpha)); _keys = MainForm.DefaultCell.GetActionKeys(MedicalViewerActionType.Alpha); } _btnCursor.ButtonCursor = _alpha.ActionCursor; _txtFactor.Value = _alpha.Alpha; _txtSensitivity.Value = _alpha.Sensitivity; _chkCircular.Checked = _alpha.CircularMouseMove; _cmbApplyToCell.SelectedIndex = 0; _cmbApplyToSubCell.SelectedIndex = 0; owner.AddKeysToCombo(_cmbLeftKey, _keys.MouseLeft); owner.AddKeysToCombo(_cmbRightKey, _keys.MouseRight); owner.AddModifiersToCombo(_cmbModifiers, _keys.Modifiers); _cmbApplyToCell.Enabled = (owner.Viewer.Cells.Count != 0); }