procedure TForm10.ACFlowReloadExecute(Sender: TObject);
begin
ACFlowDestroyExecute(Sender);
with DataModule1 do begin
with qdummy01 do begin
sql.Clear;
sql.add('select * from tblFlowchart');
open;
if recordcount > 0 then SetLength(FlowChartObj,recordcount);
while not eof do begin
FlowChartObj[recno-1].pid := fieldbyname('id').AsInteger;
FlowChartObj[recno-1].panel := TLMDSimplePanel.Create(Self);
FlowChartObj[recno-1].panel.Parent := zeichenflaeche; //Parent ist das Panel
FlowChartObj[recno-1].panel.transparent := True;
FlowChartObj[recno-1].panel.sizegrip := false;
FlowChartObj[recno-1].panel.AllowSizing := false;
FlowChartObj[recno-1].panel.color := zeichenflaeche.Color;
FlowChartObj[recno-1].panel.tag := fieldbyname('id').AsInteger;
FlowChartObj[recno-1].panel.Top := fieldbyname('rTop').AsInteger;
FlowChartObj[recno-1].panel.Left := fieldbyname('rLeft').AsInteger;
FlowChartObj[recno-1].panel.Width := 100; //erstmal feste Größen nehmen
FlowChartObj[recno-1].panel.Height := 100;
FlowChartObj[recno-1].panel.OnMouseDown := WinControlMouseDown; //Ereigniss MouseDown
FlowChartObj[recno-1].panel.OnMouseUp := WinControlMouseUp; //Ereigniss MouseDown
FlowChartObj[recno-1].panel.OnMouseEnter := WinControlMouseEnter; //Ereigniss MouseDown
FlowChartObj[recno-1].panel.OnMouseExit := WinControlMouseLeave; //Ereigniss MouseDown
FlowChartObj[recno-1].panel.OnMousemove := WinControlMouseMove; //Ereigniss MouseDown
FlowChartObj[recno-1].panel.OnClick := WinControlOnClick; //Ereigniss MouseDown
FlowChartObj[recno-1].oShape := TADVShape.Create(self);
FlowChartObj[recno-1].oShape.Parent := FlowChartObj[recno-1].panel;
case fieldbyname('shapetype').AsInteger of
1 : begin
FlowChartObj[recno-1].oShape.Shape := stRectangle;
FlowChartObj[recno-1].oShape.RotationAngle := 0;
end;
2 : begin
FlowChartObj[recno-1].oShape.Shape := stRectangle;
FlowChartObj[recno-1].oShape.RotationAngle := 45;
end;
3 : begin
FlowChartObj[recno-1].oShape.Shape := stCircle;
FlowChartObj[recno-1].oShape.RotationAngle := 0;
end;
end;
FlowChartObj[recno-1].oShape.autosize := true;
FlowChartObj[recno-1].oShape.Top := 30;
FlowChartObj[recno-1].oShape.Left := 15;
FlowChartObj[recno-1].oShape.Width := 70;
FlowChartObj[recno-1].oShape.Height := 70;
//FlowChartObj[recno].oShape.OnMouseDown := WinControlMouseDown; //Ereigniss MouseDown
FlowChartObj[recno-1].oShape.Appearance.ColorTo := clSkyBlue;
FlowChartObj[recno-1].oButton := TcxButton.Create(self);
FlowChartObj[recno-1].oButton.Parent := FlowChartObj[recno-1].panel;
FlowChartObj[recno-1].oButton.Top := 2;
FlowChartObj[recno-1].oButton.Left := 2;
FlowChartObj[recno-1].oButton.Width := 25;
FlowChartObj[recno-1].oButton.Height := 25;
FlowChartObj[recno-1].oButton.action := ACButton;
next;
end;
end;
end;
ACFlowConnectRefreshExecute(Sender);
end;