public void SetChildTable(TableControl te) { childTable = te; join.SetChildTable(te.GetTableEntity()); lastChildX = te.Bounds.X + te.Width / 2; lastChildY = te.Bounds.Y + te.Height / 2; GUICoordsEntity coords = join.GetCoords(); coords.SetPosX(this.Bounds.X); coords.SetPosY(this.Bounds.Y); coords.SetWidth(this.Width); coords.SetHeight(this.Height); }
private bool IsObjectMoved(TableControl mainTable, TableControl childTable, int thresholdX, int thresholdY) { if (lastMainX != mainTable.Bounds.X || lastMainY != mainTable.Bounds.Y || lastChildX != childTable.Bounds.X || lastChildY != childTable.Bounds.Y) { int delta = 0; delta = lastMainX - mainTable.Bounds.X; if (Math.Abs(delta) > thresholdX) { lastMainX = mainTable.Bounds.X; return(true); } ; delta = lastMainY - mainTable.Bounds.Y; if (Math.Abs(delta) > thresholdY) { lastMainY = mainTable.Bounds.Y; return(true); } ; delta = lastChildX - childTable.Bounds.X; if (Math.Abs(delta) > thresholdX) { lastChildX = childTable.Bounds.X; return(true); } ; delta = lastChildY - childTable.Bounds.Y; if (Math.Abs(delta) > thresholdY) { lastChildY = childTable.Bounds.Y; return(true); } ; return(false); } else { return(false); } }