Changeset 87 for oup/current/Tools


Ignore:
Timestamp:
Jan 14, 2007, 11:59:34 PM (18 years ago)
Author:
alloc
Message:
 
Location:
oup/current/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Tools/BinEdit.dfm

    r61 r87  
    44  OnCloseQuery = FormCloseQuery
    55  OnKeyUp = FormKeyUp
    6   ExplicitWidth = 500
    7   ExplicitHeight = 450
    86  PixelsPerInch = 96
    97  TextHeight = 13
     8  inherited panel_files: TPanel
     9    inherited filelist: TListBox
     10      ExplicitTop = 153
     11      ExplicitHeight = 270
     12    end
     13  end
    1014  inherited content: TPanel
    1115    object Splitter2: TSplitter
  • oup/current/Tools/BinEdit.pas

    r75 r87  
    5757    procedure value_viewer_contextPopup(Sender: TObject);
    5858  private
    59     fileid: LongWord;
     59    fileid: Integer;
    6060  public
    6161  end;
     
    291291  if VST.RootNodeCount = 0 then
    292292  begin
    293     structs := LoadStructureDefinition(fileid);
     293    structs := LoadStructureDefinition(Connection, fileid);
    294294    if structs.Data then
    295295    begin
  • oup/current/Tools/Preview.dfm

    r46 r87  
    33  PixelsPerInch = 96
    44  TextHeight = 13
     5  inherited panel_files: TPanel
     6    inherited filelist: TListBox
     7      ExplicitTop = 153
     8      ExplicitHeight = 270
     9    end
     10  end
    511  inherited content: TPanel
    612    object lbl_notpossible: TLabel
  • oup/current/Tools/Preview.pas

    r86 r87  
    3232    bitmaps:   array of TBitmap;
    3333    actualimg: Byte;
    34     _fileid:   LongWord;
     34    _fileid:   Integer;
    3535  public
    3636  end;
     
    5555begin
    5656  _fileid := fileinfo.ID;
    57   lbl_notpossible.Visible := False;
    58   Self.img.Visible := True;
    59   Self.timer.Enabled := False;
    60   Self.panel_buttons.Visible := False;
    61   ext     := fileinfo.Extension;
    62   if (ext = 'PSpc') or (ext = 'TXMB') or (ext = 'TXMP') then
    63     PreviewImage
    64   else if ext = 'TXAN' then
    65     PreviewTXAN
    66   else
    67   begin
    68     Self.lbl_notpossible.Visible := True;
     57  if _fileid >= 0 then
     58  begin
     59    lbl_notpossible.Visible := False;
     60    Self.img.Visible := True;
     61    Self.timer.Enabled := False;
     62    Self.panel_buttons.Visible := False;
     63    ext     := fileinfo.Extension;
     64    if (ext = 'PSpc') or (ext = 'TXMB') or (ext = 'TXMP') then
     65      PreviewImage
     66    else if ext = 'TXAN' then
     67      PreviewTXAN
     68    else
     69    begin
     70      Self.lbl_notpossible.Visible := True;
     71      Self.img.Visible := False;
     72    end;
     73  end
     74  else
     75  begin
    6976    Self.img.Visible := False;
     77    lbl_notpossible.Visible := False;
     78    Self.timer.Enabled := False;
     79    Self.panel_buttons.Visible := False;
    7080  end;
    7181end;
  • oup/current/Tools/Template.pas

    r86 r87  
    102102begin
    103103  oldcon := combo_connection.Items.Strings[combo_connection.ItemIndex];
     104  combo_connection.ItemIndex := -1;
    104105  combo_connection.Items.Clear;
    105   for i := 0 to High(DataConnections) do
    106   begin
    107     level := DataConnections[i].LevelInfo.LevelNumber;
    108     fn := ExtractFileName(DataConnections[i].FileName);
    109     if DataConnections[i].Backend = ODB_Dat then
    110       datatype := 'ONI-.dat: '
    111     else if DataConnections[i].Backend = ODB_ADB then
    112       datatype := 'OUP-DB: '
    113     else
    114       datatype := 'Unknown: ';
    115     boxstring := datatype + fn + ' (Level: ' + IntToStr(level) + ')';
    116     combo_connection.Items.Add(boxstring);
    117     if oldcon = boxstring then
    118       combo_connection.ItemIndex := combo_connection.Items.Count - 1;
     106  if Length(DataConnections) > 0 then
     107  begin
     108    for i := 0 to High(DataConnections) do
     109    begin
     110      level := DataConnections[i].LevelInfo.LevelNumber;
     111      fn := ExtractFileName(DataConnections[i].FileName);
     112      if DataConnections[i].Backend = ODB_Dat then
     113        datatype := 'ONI-.dat: '
     114      else if DataConnections[i].Backend = ODB_ADB then
     115        datatype := 'OUP-DB: '
     116      else
     117        datatype := 'Unknown: ';
     118      boxstring := datatype + fn + ' (Level: ' + IntToStr(level) + ')';
     119      combo_connection.Items.Add(boxstring);
     120      if oldcon = boxstring then
     121        combo_connection.ItemIndex := combo_connection.Items.Count - 1;
     122    end;
     123    if combo_connection.ItemIndex = -1 then
     124    begin
     125      combo_connection.ItemIndex := 0;
     126      combo_connectionChange(Self);
     127    end;
     128  end
     129  else
     130  begin
     131    FConnection := nil;
     132    filelist.Items.Clear;
     133    combo_extension.Items.Clear;
     134    combo_connectionChange(Self);
     135    FSelectedFile := GetEmptyFileInfo;
     136    if Assigned(FOnNewFileSelected) then
     137      FOnNewFileSelected(FSelectedFile);
    119138  end;
    120139end;
     
    127146begin
    128147  combo_connection.Items.Clear;
    129   for i := 0 to High(DataConnections) do
    130   begin
    131     level := DataConnections[i].LevelInfo.LevelNumber;
    132     fn := ExtractFileName(DataConnections[i].FileName);
    133     if DataConnections[i].Backend = ODB_Dat then
    134       datatype := 'ONI-.dat: '
    135     else if DataConnections[i].Backend = ODB_ADB then
    136       datatype := 'OUP-DB: '
    137     else
    138       datatype := 'Unknown: ';
    139     combo_connection.Items.Add(datatype + fn + ' (Level: ' + IntToStr(level) + ')');
    140   end;
    141   FConnection := DataConnections[0];
    142   combo_connection.ItemIndex := 0;
    143   combo_connectionChange(Self);
     148  if Length(DataConnections) > 0 then
     149  begin
     150    for i := 0 to High(DataConnections) do
     151    begin
     152      level := DataConnections[i].LevelInfo.LevelNumber;
     153      fn := ExtractFileName(DataConnections[i].FileName);
     154      if DataConnections[i].Backend = ODB_Dat then
     155        datatype := 'ONI-.dat: '
     156      else if DataConnections[i].Backend = ODB_ADB then
     157        datatype := 'OUP-DB: '
     158      else
     159        datatype := 'Unknown: ';
     160      combo_connection.Items.Add(datatype + fn + ' (Level: ' + IntToStr(level) + ')');
     161    end;
     162    FConnection := DataConnections[0];
     163    combo_connection.ItemIndex := 0;
     164    combo_connectionChange(Self);
     165  end
     166  else
     167  begin
     168    FConnection := nil;
     169    filelist.Items.Clear;
     170    combo_extension.Items.Clear;
     171    combo_connectionChange(Self);
     172  end;
    144173end;
    145174
     
    150179begin
    151180  combo_extension.Items.Clear;
    152   combo_extension.Items.Add('_All files_ (' +
    153     IntToStr(FConnection.GetFilesCount) + ')');
    154   exts := FConnection.GetExtensionsList;
    155   for i := 0 to High(exts) do
    156     if Length(FAllowedExts) > 0 then
    157     begin
    158       if Pos(MidStr(exts[i],1,4), FAllowedExts) > 0 then
     181  if FConnection <> nil then
     182  begin
     183    combo_extension.Items.Add('_All files_ (' +
     184      IntToStr(FConnection.GetFilesCount) + ')');
     185    exts := FConnection.GetExtensionsList;
     186    for i := 0 to High(exts) do
     187      if Length(FAllowedExts) > 0 then
    159188      begin
     189        if Pos(MidStr(exts[i],1,4), FAllowedExts) > 0 then
     190        begin
     191          combo_extension.Items.Add(exts[i]);
     192        end;
     193      end else
    160194        combo_extension.Items.Add(exts[i]);
    161       end;
    162     end else
    163       combo_extension.Items.Add(exts[i]);
    164   combo_extension.ItemIndex := 0;
    165   combo_extensionClick(Self);
     195    combo_extension.ItemIndex := 0;
     196    combo_extensionClick(Self);
     197  end;
    166198end;
    167199
     
    177209  i: LongWord;
    178210begin
    179   Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);
    180   no_zero_bytes := not check_zerobyte.Checked;
    181   pattern := '';
    182   if check_filtername.Checked then
    183     pattern := edit_filtername.Text;
    184   if Extension = '_All' then
    185     if Length(FAllowedExts) > 0 then
    186       Extension := FAllowedExts
    187     else
    188       Extension := '';
    189 
    190   files := FConnection.GetFilesList(extension, pattern, no_zero_bytes, FSortBy);
    191 
    192   filelist.Visible := False;
    193   filelist.Items.Clear;
    194   if Length(files) > 0 then
    195     for i := 0 to High(files) do
    196       filelist.Items.Add(files[i]);
    197   filelist.Visible := True;
     211  if FConnection <> nil then
     212  begin
     213    Extension := MidStr(combo_extension.Items.Strings[combo_extension.ItemIndex], 1, 4);
     214    no_zero_bytes := not check_zerobyte.Checked;
     215    pattern := '';
     216    if check_filtername.Checked then
     217      pattern := edit_filtername.Text;
     218    if Extension = '_All' then
     219      if Length(FAllowedExts) > 0 then
     220        Extension := FAllowedExts
     221      else
     222        Extension := '';
     223
     224    files := FConnection.GetFilesList(extension, pattern, no_zero_bytes, FSortBy);
     225
     226    filelist.Visible := False;
     227    filelist.Items.Clear;
     228    if Length(files) > 0 then
     229      for i := 0 to High(files) do
     230        filelist.Items.Add(files[i]);
     231    filelist.Visible := True;
     232  end;
    198233end;
    199234
     
    296331  inherited;
    297332  RecreateList;
    298   FConnection := nil;
    299   FSelectedFile.ID := -1;
    300   FSelectedFile.FileName := '';
    301   FSelectedFile.FileNameHex := '';
     333  FSelectedFile := GetEmptyFileInfo;
    302334  if Length(ToolList) > 0 then
    303335  begin
Note: See TracChangeset for help on using the changeset viewer.