/// <summary> /// 漫游 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolStripButton_Pan_Click(object sender, EventArgs e) { ITool tool = new PanTool(); ICommand command = tool as ICommand; command.OnCreate(axMapControl2); axMapControl2.CurrentTool = tool; }
private void tspPan_Click(object sender, EventArgs e) { HookHelper mHook = HookHelper.Instance(); ICommand pCmd = new PanTool(); pCmd.OnCreate(mHook); mHook.MapControl.CurrentTool = pCmd as ITool; }
private void InitPanTool() { _panTool = new PanTool(); _panTool.SetCanvas(this); _panTool.SetWaiting(); this.MouseMove += _panTool.CanvasTool_MouseMove; this.MouseDown += _panTool.CanvasTool_MouseDown; this.MouseUp += _panTool.CanvasTool_MouseUp; }
/// <summary> /// Creates the tiling controller. /// </summary> /// <param name="tiling">The tiling.</param> /// <returns></returns> private TilingController CreateTilingController([NotNull] Tiling tiling) { Debug.Assert(tiling != null, "tiling != null"); TilingController tc = new TilingController(tiling, this); tc.EditLine.OptionsChanged += TilingController_EditLineTool_OptionsChanged; tc.EditLine.ChangeLineOption.ValueChanged += v => _changeLineTypeCmb.SelectedItem = v; _changeLineTypeCmb.SelectedItem = tc.EditLine.ChangeLineOption.Value; tc.StyleManagerChanged += (sender, args) => IsDirty = true; tc.CurrentToolChanged += controller_CurrentToolChanged; _panTool = new PanTool(tc, this); _selectTileTool = new SelectTileTool(tc); _toolBtns.Add(_panTool, _panToolBtn); UpdateTools(); return(tc); }
public void SetPanTool() { Tool = new PanTool(this, CustomCursorFactory.OpenHandGrabCursor); }
/// <summary> /// Creates the tiling controller. /// </summary> /// <param name="tiling">The tiling.</param> /// <returns></returns> private TilingController CreateTilingController([NotNull] Tiling tiling) { Debug.Assert(tiling != null, "tiling != null"); TilingController tc = new TilingController(tiling, this); tc.EditLine.OptionsChanged += TilingController_EditLineTool_OptionsChanged; tc.EditLine.ChangeLineOption.ValueChanged += v => _changeLineTypeCmb.SelectedItem = v; _changeLineTypeCmb.SelectedItem = tc.EditLine.ChangeLineOption.Value; tc.StyleManagerChanged += (sender, args) => IsDirty = true; tc.CurrentToolChanged += controller_CurrentToolChanged; _panTool = new PanTool(tc, this); _selectTileTool = new SelectTileTool(tc); _toolBtns.Add(_panTool, _panToolBtn); UpdateTools(); return tc; }