Re: Diagram Studio v1.9 released

From: Wagner R. Landgraf (wagner_at_automa.com.br)
Date: 02/19/05


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


Relevant Pages

  • Re: multiple prely fields
    ... I am trying to add a comment functionality to my webapp that includes ... learning HTML and JavaScript. ... var doc = this.document; ...
    (comp.lang.javascript)
  • Re: Conditional Formatting
    ... you're not fair :-) - who want to conditioanl format such a formua ... > this 'functionality'. ... format copying may not work (esp. ... > There's garbage now appearing as a drawn object in cell A1 obscuring ...
    (microsoft.public.excel.worksheet.functions)
  • Re: autocompletion of cell input based on databse list
    ... There really isn't any straightforward way to mimic this functionality in a ... > cell begin to autofill based on matching letters I have typed. ... > Then lookup the other data corresponding to that city. ...
    (microsoft.public.excel.programming)
  • Re: Excel: how to convert text to upper case upon entry?
    ... Right-click the worksheet TAB you want this functionality on.... ... I am running Excel 2003. ... > be converted to upper case when I hit the Enter or Tab key? ... > case in the SAME CELL I just entered it into as lower case text. ...
    (microsoft.public.excel.misc)
  • Re: Things we remember...
    ... irritating, to say the least. ... Not doing it is no loss of functionality, ... (That one's also an answering machine, ... That was certainly much easier to program than my cell ...
    (rec.arts.sf.written)