private void DesignPane_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) { mouseDown = false; mMouseMode = MOUSE_MODE.NONE; if (e.X == initialPosition.X && e.Y == initialPosition.Y) { object t = FindObjectAt(initialPosition.X, initialPosition.Y); if (t != null) { if (this.mControlPressed) { if (this.selectedObjects.Contains(t)) { if (OnSelectionChanged != null) { OnSelectionChanged((ICustomPaint)t, 2); } } else { if (OnSelectionChanged != null) { OnSelectionChanged((ICustomPaint)t, 1); } } } else { if (OnSelectionChanged != null) { OnSelectionChanged((ICustomPaint)t, 0); } } } else { if (OnSelectionChanged != null) { OnSelectionChanged(null, 0); } } } if (shouldRepaint) { shouldRepaint = false; DoPaint(); if (OnMoveFinished != null && selectedObjects.Count > 0) { OnMoveFinished((ICustomPaint)selectedObjects[selectedObjects.Count - 1]); } } }
public override bool OnMouseUp(MouseEventArgs e, KeyModifier eKeyMod, int iOldX, int iOldY) { if (Dragmode == MOUSE_MODE.UI_AREA_SELECT) { // 범위내의 Shape 들을 전부 Select } if (Dragmode == MOUSE_MODE.UI_MOVE || Dragmode == MOUSE_MODE.UI_COPY) { foreach (UIShapeBase shape in m_selectedShapeList) { EditorManager.Actions.Add(new SetPropertyAction(shape, "PosX", shape.PosX)); EditorManager.Actions.Add(new SetPropertyAction(shape, "PosY", shape.PosY)); } } else if (Dragmode == MOUSE_MODE.UI_SIZE) { foreach (UIShapeBase shape in m_selectedShapeList) { EditorManager.Actions.Add(new SetPropertyAction(shape, "SizeX", shape.SizeX)); EditorManager.Actions.Add(new SetPropertyAction(shape, "SizeY", shape.SizeY)); } } else { // bool addSelection = false; // bool toggleSelection = false; // // if ((eKeyMod & KeyModifier.Ctrl) > 0 && (eKeyMod & KeyModifier.Shift) > 0) // addSelection = true; // // UIShapeBase hitShape = this.GetUIShape(e.X, e.Y); // // if (addSelection) // View.Gizmo.AddShape(hitShape, false); // else if (toggleSelection) // View.Gizmo.AddShape(hitShape, true); // else // View.Gizmo.SetSingleShape(hitShape); } // m_selectedShapeList.Clear(); m_UICopyShapeList.Clear(); Dragmode = MOUSE_MODE.UI_NONE; m_bCopying = false; //m_selectedShape = null; return(false); }
private void DesignPane_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { mouseDown = true; if (this.Cursor == Cursors.SizeNS || this.Cursor == Cursors.SizeWE) { mMouseMode = MOUSE_MODE.SELECTED; return; } ptStart = new Point(e.X, e.Y); initialPosition = new Point(e.X, e.Y); if (this.Cursor == Cursors.SizeAll) { mMouseMode = MOUSE_MODE.SELECTED; } }
private void horizontalStopToolStripMenuItem_Click(object sender, EventArgs e) { Cursor = Cursors.SizeWE; mouseMode = MOUSE_MODE.STOP_HORIZ; }
private void westStartToolStripMenuItem_Click(object sender, EventArgs e) { Cursor = Cursors.PanWest; mouseMode = MOUSE_MODE.START_WEST; }
public override bool OnMouseDown(MouseEventArgs e, KeyModifier eKeyMod, int iOldX, int iOldY) { // 1. 현재 마우스 포지션의 UI 를 가지고 온다 // 2. UI 가 있고, 커서가 경계에 겹칠 경우 - Select 해주고 마우스 커서 변경 , Move Mode 로 Position 변경 // 3. UI 가 있고, 커서가 경계 안에 있을 경우 - 사이즈 변경 if (e.Button == MouseButtons.Left) { UIShapeBase selectedShape = null; if (View.Cursor == Cursors.Arrow) // 화살표일 경우 선택 모드 { m_selectedShapeList.Clear(); selectedShape = this.GetUIShape(e.X, e.Y, false); } else if (View.Cursor == Cursors.Cross) { selectedShape = this.GetUIShape(e.X, e.Y, false); } else// 화살표가 아니면 선택된 아이템중에 선택 { selectedShape = this.GetUIShapeFromSelection(e.X, e.Y); } if (eKeyMod == KeyModifier.Shift) // Shift 누르면 복사 { m_bCopying = true; Dragmode = MOUSE_MODE.UI_COPY; } if (selectedShape != null) { if (m_selectedShapeList.Contains(selectedShape) == false) { m_selectedShapeList.Add(selectedShape); } } } // if (EditorManager.SelectedShapes.Contains(m_selectedShape) == false ) // { // EditorManager.SelectedShapes = new CSharpFramework.ShapeCollection(); // EditorManager.SelectedShapes.Add(m_selectedShape); // } if (m_selectedShapeList.Count >= 1) { if (View.Cursor == Cursors.SizeAll) { if (eKeyMod == KeyModifier.Shift && Dragmode == MOUSE_MODE.UI_COPY) // 시프트키 눌리고 , 셀렉티드 쉐입에 , Move Mode 이면 복사 { m_bCopying = true; foreach (UIShapeBase shape in m_selectedShapeList) { if (shape != null) { UIShapeBase copyShape = CreateNewShape(shape, m_baseDialog, shape.PosX, shape.PosY); m_UICopyShapeList.Add(copyShape); } } m_selectedShapeList.Clear(); m_selectedShapeList.AddRange(m_UICopyShapeList); m_UIShapeList.AddRange(m_UICopyShapeList); // // foreach (UIShapeBase shape in m_UICopyShapeList) // { // EditorManager.Actions.Add(new AddShapeAction(shape, m_baseDialog, shape.ParentLayer, true)); // } // // EditorManager.SelectedShapes.Clear(); // 기존 선택된 UI 들 지우고 // EditorManager.SelectedShapes.AddRange(m_UICopyShapeList); // 복사된거만 선택 m_bCopying = false; //UIShapeBase copyShape = CreateNewShape(m_selectedShape, m_baseDialog, m_selectedShape.PosX, m_selectedShape.PosY); //m_selectedShape = copyShape; //UIShapeBase copyShape = (UIShapeBase)m_selectedShape.Clone(); //m_UICopyShapeList.Add(copyShape); } else { Dragmode = MOUSE_MODE.UI_MOVE; } } else if (View.Cursor == Cursors.Arrow) { } else { Dragmode = MOUSE_MODE.UI_SIZE; } } if (Dragmode == MOUSE_MODE.UI_COPY) { ShapeCollection collection = new CSharpFramework.ShapeCollection(); collection.AddRange(m_UICopyShapeList); EditorManager.SelectedShapes = collection; } else { ShapeCollection collection = new CSharpFramework.ShapeCollection(); collection.AddRange(m_selectedShapeList); EditorManager.SelectedShapes = collection; } return(false); }
private void trafficLightToolStripMenuItem_Click(object sender, EventArgs e) { Cursor = Cursors.SizeAll; mouseMode = MOUSE_MODE.SIGNAL; }
private void verticalStopToolStripMenuItem_Click(object sender, EventArgs e) { Cursor = Cursors.SizeNS; mouseMode = MOUSE_MODE.STOP_VERT; }
private void roadToolStripMenuItem_Click(object sender, EventArgs e) { mapType = MapTile.TYPE.ROAD; Cursor = Cursors.Arrow; mouseMode = MOUSE_MODE.TILE; }
private void southStartToolStripMenuItem_Click(object sender, EventArgs e) { Cursor = Cursors.PanSouth; mouseMode = MOUSE_MODE.START_SOUTH; }
public override bool OnMouseDown(MouseEventArgs e, KeyModifier eKeyMod, int iOldX, int iOldY) { // 1. 현재 마우스 포지션의 UI 를 가지고 온다 // 2. UI 가 있고, 커서가 경계에 겹칠 경우 - Select 해주고 마우스 커서 변경 , Move Mode 로 Position 변경 // 3. UI 가 있고, 커서가 경계 안에 있을 경우 - 사이즈 변경 if (e.Button == MouseButtons.Left) { UIShapeBase selectedShape = null; if (View.Cursor == Cursors.Arrow ) // 화살표일 경우 선택 모드 { m_selectedShapeList.Clear(); selectedShape = this.GetUIShape(e.X, e.Y, false); } else if ( View.Cursor == Cursors.Cross ) { selectedShape = this.GetUIShape(e.X, e.Y, false); } else// 화살표가 아니면 선택된 아이템중에 선택 { selectedShape = this.GetUIShapeFromSelection(e.X, e.Y); } if (eKeyMod == KeyModifier.Shift) // Shift 누르면 복사 { m_bCopying = true; Dragmode = MOUSE_MODE.UI_COPY; } if (selectedShape != null) { if (m_selectedShapeList.Contains(selectedShape ) == false ) m_selectedShapeList.Add(selectedShape); } } // if (EditorManager.SelectedShapes.Contains(m_selectedShape) == false ) // { // EditorManager.SelectedShapes = new CSharpFramework.ShapeCollection(); // EditorManager.SelectedShapes.Add(m_selectedShape); // } if (m_selectedShapeList.Count >= 1 ) { if (View.Cursor == Cursors.SizeAll) { if (eKeyMod == KeyModifier.Shift && Dragmode == MOUSE_MODE.UI_COPY) // 시프트키 눌리고 , 셀렉티드 쉐입에 , Move Mode 이면 복사 { m_bCopying = true; foreach (UIShapeBase shape in m_selectedShapeList ) { if (shape != null) { UIShapeBase copyShape = CreateNewShape(shape, m_baseDialog, shape.PosX, shape.PosY); m_UICopyShapeList.Add(copyShape); } } m_selectedShapeList.Clear(); m_selectedShapeList.AddRange(m_UICopyShapeList); m_UIShapeList.AddRange(m_UICopyShapeList); // // foreach (UIShapeBase shape in m_UICopyShapeList) // { // EditorManager.Actions.Add(new AddShapeAction(shape, m_baseDialog, shape.ParentLayer, true)); // } // // EditorManager.SelectedShapes.Clear(); // 기존 선택된 UI 들 지우고 // EditorManager.SelectedShapes.AddRange(m_UICopyShapeList); // 복사된거만 선택 m_bCopying = false; //UIShapeBase copyShape = CreateNewShape(m_selectedShape, m_baseDialog, m_selectedShape.PosX, m_selectedShape.PosY); //m_selectedShape = copyShape; //UIShapeBase copyShape = (UIShapeBase)m_selectedShape.Clone(); //m_UICopyShapeList.Add(copyShape); } else { Dragmode = MOUSE_MODE.UI_MOVE; } } else if ( View.Cursor == Cursors.Arrow ) { } else { Dragmode = MOUSE_MODE.UI_SIZE; } } if (Dragmode == MOUSE_MODE.UI_COPY) { ShapeCollection collection = new CSharpFramework.ShapeCollection(); collection.AddRange(m_UICopyShapeList); EditorManager.SelectedShapes = collection; } else { ShapeCollection collection = new CSharpFramework.ShapeCollection(); collection.AddRange(m_selectedShapeList); EditorManager.SelectedShapes = collection; } return false; }
private void InitModes() { mapType = MapTile.TYPE.ROAD; Cursor = Cursors.Arrow; mouseMode = MOUSE_MODE.TILE; DetermineEnables(); }
private void companyToolStripMenuItem_Click(object sender, EventArgs e) { mapType = MapTile.TYPE.COMPANY; Cursor = Cursors.Arrow; mouseMode = MOUSE_MODE.TILE; }
private void companyNameToolStripMenuItem_Click(object sender, EventArgs e) { Cursor = Cursors.Cross; mouseMode = MOUSE_MODE.COMPANY; }
private void clearToolStripMenuItem_Click(object sender, EventArgs e) { Cursor = Cursors.No; mouseMode = MOUSE_MODE.CLEAR; }
private void busStopToolStripMenuItem_Click(object sender, EventArgs e) { mapType = MapTile.TYPE.BUS_STOP; Cursor = Cursors.Arrow; mouseMode = MOUSE_MODE.TILE; }
public override bool OnMouseUp(MouseEventArgs e, KeyModifier eKeyMod, int iOldX, int iOldY) { if (Dragmode == MOUSE_MODE.UI_AREA_SELECT) { // 범위내의 Shape 들을 전부 Select } if (Dragmode == MOUSE_MODE.UI_MOVE || Dragmode == MOUSE_MODE.UI_COPY ) { foreach (UIShapeBase shape in m_selectedShapeList) { EditorManager.Actions.Add(new SetPropertyAction(shape, "PosX", shape.PosX)); EditorManager.Actions.Add(new SetPropertyAction(shape, "PosY", shape.PosY)); } } else if (Dragmode == MOUSE_MODE.UI_SIZE) { foreach (UIShapeBase shape in m_selectedShapeList) { EditorManager.Actions.Add(new SetPropertyAction(shape, "SizeX", shape.SizeX)); EditorManager.Actions.Add(new SetPropertyAction(shape, "SizeY", shape.SizeY)); } } else { // bool addSelection = false; // bool toggleSelection = false; // // if ((eKeyMod & KeyModifier.Ctrl) > 0 && (eKeyMod & KeyModifier.Shift) > 0) // addSelection = true; // // UIShapeBase hitShape = this.GetUIShape(e.X, e.Y); // // if (addSelection) // View.Gizmo.AddShape(hitShape, false); // else if (toggleSelection) // View.Gizmo.AddShape(hitShape, true); // else // View.Gizmo.SetSingleShape(hitShape); } // m_selectedShapeList.Clear(); m_UICopyShapeList.Clear(); Dragmode = MOUSE_MODE.UI_NONE; m_bCopying = false; //m_selectedShape = null; return false; }