Changeset 114


Ignore:
Timestamp:
Feb 26, 2007, 11:52:09 PM (18 years ago)
Author:
alloc
Message:
 
Location:
oup/current/Helper
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Helper/WhatLinksHere.dfm

    r107 r114  
    44  BorderStyle = bsSizeToolWin
    55  Caption = 'What links here?'
    6   ClientHeight = 296
    7   ClientWidth = 421
     6  ClientHeight = 232
     7  ClientWidth = 404
    88  Color = clBtnFace
     9  Constraints.MinHeight = 232
     10  Constraints.MinWidth = 275
    911  Font.Charset = DEFAULT_CHARSET
    1012  Font.Color = clWindowText
     
    1719  PixelsPerInch = 96
    1820  TextHeight = 13
    19   object label_what: TLabel
    20     AlignWithMargins = True
    21     Left = 3
    22     Top = 3
    23     Width = 415
    24     Height = 16
     21  object Splitter1: TSplitter
     22    Left = 0
     23    Top = 100
     24    Width = 404
     25    Height = 8
     26    Cursor = crVSplit
    2527    Align = alTop
    26     AutoSize = False
    27     Caption = 'What links to:'
    28     Font.Charset = DEFAULT_CHARSET
    29     Font.Color = clWindowText
    30     Font.Height = -11
    31     Font.Name = 'Tahoma'
    32     Font.Style = [fsBold]
    33     ParentFont = False
     28    AutoSnap = False
     29    Beveled = True
     30    MinSize = 100
     31    ExplicitTop = 171
     32    ExplicitWidth = 655
    3433  end
    35   object list: TListBox
    36     AlignWithMargins = True
    37     Left = 3
    38     Top = 25
    39     Width = 415
    40     Height = 268
     34  object Panel1: TPanel
     35    Left = 0
     36    Top = 0
     37    Width = 404
     38    Height = 100
     39    Align = alTop
     40    BevelOuter = bvNone
     41    TabOrder = 0
     42    ExplicitWidth = 267
     43    object label_what: TLabel
     44      AlignWithMargins = True
     45      Left = 3
     46      Top = 3
     47      Width = 398
     48      Height = 16
     49      Align = alTop
     50      AutoSize = False
     51      Caption = 'What links to:'
     52      Font.Charset = DEFAULT_CHARSET
     53      Font.Color = clWindowText
     54      Font.Height = -11
     55      Font.Name = 'Tahoma'
     56      Font.Style = [fsBold]
     57      ParentFont = False
     58      ExplicitLeft = 10
     59      ExplicitTop = 11
     60      ExplicitWidth = 415
     61    end
     62    object list_from: TListBox
     63      AlignWithMargins = True
     64      Left = 3
     65      Top = 25
     66      Width = 398
     67      Height = 72
     68      Align = alClient
     69      ItemHeight = 13
     70      TabOrder = 0
     71      OnDblClick = list_fromDblClick
     72      ExplicitLeft = 38
     73      ExplicitTop = 65
     74      ExplicitWidth = 415
     75      ExplicitHeight = 84
     76    end
     77  end
     78  object Panel2: TPanel
     79    Left = 0
     80    Top = 108
     81    Width = 404
     82    Height = 124
    4183    Align = alClient
    42     ItemHeight = 13
    43     TabOrder = 0
    44     OnDblClick = listDblClick
    45     ExplicitLeft = 4
    46     ExplicitTop = 52
    47     ExplicitWidth = 414
    48     ExplicitHeight = 237
     84    BevelOuter = bvNone
     85    TabOrder = 1
     86    ExplicitLeft = 28
     87    ExplicitTop = 212
     88    ExplicitWidth = 337
     89    ExplicitHeight = 169
     90    object label_to: TLabel
     91      AlignWithMargins = True
     92      Left = 3
     93      Top = 3
     94      Width = 398
     95      Height = 16
     96      Align = alTop
     97      AutoSize = False
     98      Caption = 'File links to:'
     99      Font.Charset = DEFAULT_CHARSET
     100      Font.Color = clWindowText
     101      Font.Height = -11
     102      Font.Name = 'Tahoma'
     103      Font.Style = [fsBold]
     104      ParentFont = False
     105      ExplicitLeft = 6
     106      ExplicitWidth = 179
     107    end
     108    object list_to: TListBox
     109      AlignWithMargins = True
     110      Left = 3
     111      Top = 25
     112      Width = 398
     113      Height = 96
     114      Align = alClient
     115      ItemHeight = 13
     116      TabOrder = 0
     117      OnDblClick = list_fromDblClick
     118      ExplicitLeft = -230
     119      ExplicitTop = -43
     120      ExplicitWidth = 415
     121      ExplicitHeight = 84
     122    end
    49123  end
    50124end
  • oup/current/Helper/WhatLinksHere.pas

    r107 r114  
    33uses
    44  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    5   Dialogs, StdCtrls, Template;
     5  Dialogs, StdCtrls, Template, ExtCtrls;
    66
    77type
    88  TForm_WhatLinksHere = class(TForm)
    9     list: TListBox;
     9    Panel1: TPanel;
     10    list_from: TListBox;
    1011    label_what: TLabel;
     12    Panel2: TPanel;
     13    label_to: TLabel;
     14    list_to: TListBox;
     15    Splitter1: TSplitter;
    1116    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    1217    procedure FormShow(Sender: TObject);
    13     procedure listDblClick(Sender: TObject);
     18    procedure list_fromDblClick(Sender: TObject);
    1419  private
    1520  public
     
    4247  i: Integer;
    4348  fullname: String;
     49  links_to: TDatLinkList;
    4450begin
    4551  Form_Main.Enabled := False;
    46   list.Items.Clear;
     52  list_from.Items.Clear;
     53  list_to.Items.Clear;
    4754  fileinfo := ConManager.Connection[ConID].GetFileInfo(FileID);
    4855  label_what.Caption := FormatNumber(fileinfo.ID, 5, '0') + '-' +
    4956      fileinfo.Name + '.' + fileinfo.Extension;
    50   links := TAccess_OUP_ADB(ConManager.Connection[ConID]).GetLinksToFile(fileinfo.ID);
    51   if Length(links.ByID) > 0 then
    52     for i := 0 to High(links.ByID) do
     57  links_to := ConManager.Connection[ConID].GetDatLinks(fileinfo.ID);
     58  if ConManager.Connection[ConID] is TAccess_OUP_ADB then begin
     59    links := TAccess_OUP_ADB(ConManager.Connection[ConID]).GetLinksToFile(fileinfo.ID);
     60    if Length(links.ByID) > 0 then
     61      for i := 0 to High(links.ByID) do
     62      begin
     63        fileinfo := ConManager.Connection[ConID].GetFileInfo(links.ByID[i].Destination);
     64        fullname := FormatNumber(fileinfo.ID, 5, '0') + '-' + fileinfo.Name + '.' + fileinfo.Extension;
     65        list_from.Items.Add(fullname + ' (Offset 0x' + IntToHex(links.ByID[i].SrcOffset, 8) + ')');
     66      end;
     67  end;
     68  if Length(links_to) > 0 then
     69  begin
     70    for i := 0 to High(links_to) do
    5371    begin
    54       fileinfo := ConManager.Connection[ConID].GetFileInfo(links.ByID[i].Destination);
    55       fullname := FormatNumber(fileinfo.ID, 5, '0') + '-' + fileinfo.Name + '.' + fileinfo.Extension;
    56       list.Items.Add(fullname + ' (Offset 0x' + IntToHex(links.ByID[i].SrcOffset, 8) + ')');
     72      if links_to[i].DestID >= 0 then
     73      begin
     74        fileinfo := ConManager.Connection[ConID].GetFileInfo(links_to[i].DestID);
     75        fullname := FormatNumber(fileinfo.ID, 5, '0') + '-' + fileinfo.Name + '.' + fileinfo.Extension;
     76      end else
     77        fullname := 'no link';
     78      list_to.Items.Add(fullname + ' (Offset 0x' + IntToHex(links_to[i].SrcOffset, 8) + ')');
    5779    end;
     80  end;
    5881end;
    5982
    60 procedure TForm_WhatLinksHere.listDblClick(Sender: TObject);
     83procedure TForm_WhatLinksHere.list_fromDblClick(Sender: TObject);
    6184var
    6285  id: Integer;
     86  box: TListBox;
     87  name: String;
    6388begin
    64   id := ConManager.Connection[ConID].ExtractFileIDOfName(list.Items.Strings[list.ItemIndex]);
     89  box := TListBox(Sender);
     90  name := box.Items.Strings[box.ItemIndex];
     91  if Pos('no link', name) > 0 then
     92    Exit
     93  else
     94    id := ConManager.Connection[ConID].ExtractFileIDOfName(name);
    6595  SenderForm.SelectFileID(ConID, id);
    6696  Form_Main.Enabled := True;
Note: See TracChangeset for help on using the changeset viewer.