///------------------------------------------------------------------------------------------------- /// \fn public override void ShowAsSelected() /// /// \brief Shows as selected ///------------------------------------------------------------------------------------------------- public override void ShowAsSelected() { base.ShowAsSelected(); if (resizeButton == null) { resizeButton = new AdjustButton(MainWin.GetInstance().MainView(), this, new Point(endPoint.X - 3, endPoint.Y - 3), Cursors.SizeNS); resizeButton.SetBindingPoints( new Ref <Point>(() => endPoint, z => { endPoint = z; }) ); resizeButton.MouseDown += ResizeButton_MouseDown; resizeButton.MouseUp += ResizeButton_MouseUp; resizeButton.MouseMove += ResizeButton_MouseMove; moveButton = new MoveableButtonWithDoubleBuffering(MainWin.GetInstance().MainView(), this, new Point(startPoint.X - 3, startPoint.Y - 3), Cursors.SizeAll); moveButton.SetBindingPoints( new Ref <Point>(() => startPoint, z => { startPoint = z; }), new Ref <Point>(() => endPoint, z => { endPoint = z; }), new Ref <Point>(() => resizeButton.Location, z => { resizeButton.Location = z; }) ); moveButton.MouseDown += MoveButton_MouseDown; moveButton.MouseUp += MoveButton_MouseUp; moveButton.MouseMove += MoveButton_MouseMove; } Log.LogText("Select Circle"); }
///------------------------------------------------------------------------------------------------- /// \fn public override void ShowAsNotSelected() /// /// \brief Shows as not selected ///------------------------------------------------------------------------------------------------- public override void ShowAsNotSelected() { base.ShowAsNotSelected(); try { resizeButton.Visible = moveButton.Visible = false; resizeButton.Dispose(); moveButton.Dispose(); } catch (NullReferenceException) { ; } finally { resizeButton = null; moveButton = null; } }