home *** CD-ROM | disk | FTP | other *** search
- unit Conninfo;
-
- interface
-
- uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
- StdCtrls, ExtCtrls, ITGraph, SysUtils, Dialogs;
-
- type
- TConnInfoDlg = class(TForm)
- OKBtn: TBitBtn;
- CancelBtn: TBitBtn;
- Bevel1: TBevel;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- ConnLabel: TMemo;
- ConnId: TEdit;
- ConnData: TEdit;
- RemoveBtn: TButton;
- Label4: TLabel;
- ConnectionSource: TEdit;
- Label5: TLabel;
- ConnectionTarget: TEdit;
- Label6: TLabel;
- PanelConnColor: TPanel;
- ColorDialog1: TColorDialog;
- Label7: TLabel;
- ComboArrowHeads: TComboBox;
- Label8: TLabel;
- ComboAlignLabel: TComboBox;
- Label9: TLabel;
- ScrollLineWidth: TScrollBar;
- EditLineWidth: TEdit;
- procedure FormShow(Sender: TObject);
- procedure OKBtnClick(Sender: TObject);
- procedure RemoveBtnClick(Sender: TObject);
- procedure PanelConnColorClick(Sender: TObject);
- procedure ScrollLineWidthChange(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- itgTheGraph : ^TITGraph;
- end;
-
- var
- ConnInfoDlg: TConnInfoDlg;
-
- implementation
-
- {$R *.DFM}
-
- procedure TConnInfoDlg.FormShow(Sender: TObject);
- begin
- ConnectionSource.Text := itgTheGraph^.List(.itgTheGraph^. ConnectFromIndex.);
- ConnectionTarget.Text := itgTheGraph^.List(.itgTheGraph^.ConnectToIndex.);
- ConnLabel.Text := itgTheGraph^.ConnectionLabel;
- ConnId.Text := IntToStr(itgTheGraph^.ConnectionId);
- ConnData.Text := IntToStr(itgTheGraph^.ConnectionData);
- PanelConnColor.Color := itgTheGraph^.ConnectionColor;
- ComboArrowHeads.ItemIndex := itgTheGraph^.ConnectionArrow;
- ComboAlignLabel.ItemIndex := itgTheGraph^.ConnectionAlign;
- ScrollLineWidth.Position := itgTheGraph^.ConnectionLineWidth;
- EditLineWidth.Text := IntToStr(itgTheGraph^.ConnectionLineWidth);
- end;
-
- procedure TConnInfoDlg.OKBtnClick(Sender: TObject);
- begin
- itgTheGraph^.ConnectionLabel := ConnLabel.Text;
- itgTheGraph^.ConnectionData := StrToInt(ConnData.Text);
- itgTheGraph^.ConnectionColor := PanelConnColor.Color;
- itgTheGraph^.ConnectionArrow := ComboArrowHeads.ItemIndex;
- itgTheGraph^.ConnectionAlign := ComboAlignLabel.ItemIndex;
- itgTheGraph^.ConnectionLineWidth := ScrollLineWidth.Position;
- end;
-
- procedure TConnInfoDlg.RemoveBtnClick(Sender: TObject);
- var
- fromIx, toIx: Integer;
- begin
- fromIx := itgTheGraph^.ConnectFromIndex;
- toIx := itgTheGraph^.ConnectToIndex;
- itgTheGraph^.RemoveFrom(.fromIx.) := toIx;
- ConnInfoDlg.Close
- end;
-
- procedure TConnInfoDlg.PanelConnColorClick(Sender: TObject);
- begin
- ColorDialog1.Color := PanelConnColor.Color;
- if ColorDialog1.Execute then
- PanelConnColor.Color := ColorDialog1.Color
- end;
-
- procedure TConnInfoDlg.ScrollLineWidthChange(Sender: TObject);
- begin
- EditLineWidth.Text := IntToStr(ScrollLineWidth.Position)
- end;
-
- end.
-