Re: Diagram Studio v1.9 released
From: Wagner R. Landgraf (wagner_at_automa.com.br)
Date: 02/19/05
- Next message: Roy M Klever: "Re: Graphics library"
- Previous message: Joe Hendricks: "Re: Introducing the RemObjects Framework"
- In reply to: Billy: "Re: Diagram Studio v1.9 released"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Feb 2005 21:02:01 -0300
> 1-How much code did you have to write to implement this functionality?
> would you mind sharing the code snippet ? abasitATissisincdotcom.
Sure, the code is so simple I can put it here, at the end of the e-mail.
> 2-How easy it is to show multiple text items in different parts of the
> rectangle object. May be by direct draw to canvas etc.
There is a property TextCells in the block class where you can just add the
cells and set their position, text, font, etc.. Each cell is independant,
while editing end-user can tab through each text cell, etc.. It is designed
for that.
> I had download the components early last year and the demos only showed
> functionality like visio which I do not need.
I invite you to download it again (new features were added), and if you have
any question to use it, please contact me directly. Here is the code that
makes an automatic connection while adding a block with shift key pressed:
procedure TfmMain.FDiagramInsertDControl(Sender: TObject;
ADControl: TDiagramControl);
begin
if (GetKeyState(VK_SHIFT) < 0) and (ADControl is TDSPDiagramBlock) then
DoAutomaticLink(TDSPDiagramBlock(ADControl));
end;
procedure TfmMain.DoAutomaticLink(ABlock: TDSPDiagramBlock);
procedure BuildBlockLink(Source, Target: TDSPDiagramBlock);
var
ALink: TDiagramSideLine;
begin
ALink := TDiagramSideLine.Create(FDiagram.Owner);
ALink.SourceLinkPoint.AnchorIndex := 0;
ALink.SourceLinkPoint.Anchor := Source;
ALink.TargetLinkPoint.AnchorIndex := 1;
ALink.TargetLinkPoint.Anchor := Target;
ALink.Diagram := FDiagram;
ALink.Name := SomeMethodToFindComponentName;
end;
function FindPreviousBlock: TDSPDiagramBlock;
var
c: integer;
begin
result := nil;
c := FDiagram.DControlCount - 2;
if (c >= 0) and (FDiagram.DControls[c] is TDSPDiagramBlock) then
result := TDSPDiagramBlock(FDiagram.DControls[c]);
end;
begin
if FindPreviousBlock <> nil then
BuildBlockLink(FindPreviousBlock, ABlock);
end;
-- Kind regards, Wagner R. Landgraf Automa Consultoria & Informática Ltda. TMS Technology Partner wagner@automa.com.br
- Next message: Roy M Klever: "Re: Graphics library"
- Previous message: Joe Hendricks: "Re: Introducing the RemObjects Framework"
- In reply to: Billy: "Re: Diagram Studio v1.9 released"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|