Mousemove event and moving entity
Moderators: SDS, support, admin
Mousemove event and moving entity
Hello,
i wrote following code for mousemove event:
But my point is not moving with mouse move.. instead it moves, only after i do mouse click.
even if i change window, then also it moves the mouse as per i moved mouse.
What's missing in above code?
i wrote following code for mousemove event:
Code: Select all
method MainForm.CadEditorCtrl_PictureBox_MouseMove(sender: System.Object; e: System.Windows.Forms.MouseEventArgs);
var
Pos_CAD : CADImport.DPoint;
begin
Pos_CAD := new CADImport.DPoint(e.X, e.Y, 0);
Pos_CAD := cadEditorControl1.GetRealPoint(e.X, e.Y);
entPt.Point := Pos_CAD;
entPt.Loaded(cadEditorControl1.Image.Converter);
cadEditorControl1.Invalidate();
end;
even if i change window, then also it moves the mouse as per i moved mouse.
What's missing in above code?
Re: Mousemove event and moving entity
I hope you've some solution for above post!
As we are in very critical stage for our project design, i need your help!
As we are in very critical stage for our project design, i need your help!
Re: Mousemove event and moving entity
Hello Khyati.
Moving entity with mouse relates to visual functionality. Method that you use to change entity location not correct for such task. Demo applications provides moving selected entities when mouse left button is down. The functionality is common for CAD editing and implemented in CADEditorControl component. We're not sure why need another solution or that is the purpose of created method. Selected entities can be moved on MouseMove without mouse button down like this:If you're not like select entities by mouse then you can do it programmatically.
Alexander.
Moving entity with mouse relates to visual functionality. Method that you use to change entity location not correct for such task. Demo applications provides moving selected entities when mouse left button is down. The functionality is common for CAD editing and implemented in CADEditorControl component. We're not sure why need another solution or that is the purpose of created method. Selected entities can be moved on MouseMove without mouse button down like this:
Code: Select all
public class MainForm : System.Windows.Forms.Form
{
private int cX, cY;
....
private void cadEditorControl_MouseMove(object sender, MouseEventArgs e)
{
if (cadEditorControl.Image == null)
return;
if (cadEditorControl.Image.SelectEntitiesCount > 0)
{
cadEditorControl.ChangeEntityOnMouseMove(new Point(e.X, e.Y));
PointF imp = cadEditorControl.ImagePosition;
PointF cr = new PointF(imp.X - (cX - e.X), imp.Y - (cY - e.Y));
cadEditorControl.ImagePosition = cr;
cadEditorControl.Invalidate();
cX = e.X;
cY = e.Y;
}
}
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support