Subversion Repositories oidplus

Rev

Rev 733 | Rev 735 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 733 Rev 734
Line 1... Line 1...
1
program OIDPLUS;
1
program OIDPLUS;
2
 
2
 
3
(************************************************)
3
(************************************************)
4
(* OIDPLUS.PAS                                  *)
4
(* OIDPLUS.PAS                                  *)
5
(* Author:   Daniel Marschall                   *)
5
(* Author:   Daniel Marschall                   *)
6
(* Revision: 2022-02-13                         *)
6
(* Revision: 2022-02-14                         *)
7
(* License:  Apache 2.0                         *)
7
(* License:  Apache 2.0                         *)
8
(* This file contains:                          *)
8
(* This file contains:                          *)
9
(* - "OIDplus for DOS" program                  *)
9
(* - "OIDplus for DOS" program                  *)
10
(************************************************)
10
(************************************************)
11
 
11
 
12
uses
12
uses
13
  Dos, Crt, StrList, VtsFuncs, VtsCui, OidFile, OidUtils;
13
  Dos, Crt, StrList, VtsFuncs, VtsCui, OidFile, OidUtils;
14
 
14
 
15
const
15
const
16
  VERSIONINFO = 'Revision: 2022-02-13';
16
  VERSIONINFO = 'Revision: 2022-02-14';
17
  DEFAULT_STATUSBAR = '(C)2020-2022 ViaThinkSoft. Licensed under the terms of the Apache 2.0 license.';
17
  DEFAULT_STATUSBAR = '(C)2020-2022 ViaThinkSoft. Licensed under the terms of the Apache 2.0 license.';
18
  DISKIO_SOUND_DEBUGGING = false;
18
  DISKIO_SOUND_DEBUGGING = false;
19
  DISKIO_SOUND_DELAY = 500;
19
  DISKIO_SOUND_DELAY = 500;
20
  ASNEDIT_LINES = 10;
20
  ASNEDIT_LINES = 10;
21
  DESCEDIT_LINES = 10;
21
  DESCEDIT_LINES = 10;
Line 247... Line 247...
247
              DESCEDIT_LINES,
247
              DESCEDIT_LINES,
248
              'EDIT DESCRIPTION',
248
              'EDIT DESCRIPTION',
249
              2) then
249
              2) then
250
  begin
250
  begin
251
    oid^.description := sInput;
251
    oid^.description := sInput;
252
    DescEditor := true; (* enable write file *)
252
    DescEditor := true; (* request caller to save @oid *)
253
  end;
253
  end;
254
end;
254
end;
255
 
255
 
256
function NextPossibleFileID: string;
256
function NextPossibleFileID: string;
257
var
257
var
Line 345... Line 345...
345
      begin
345
      begin
346
        if parentOID^.DotNotation = '' then
346
        if parentOID^.DotNotation = '' then
347
          oid^.DotNotation := sInput
347
          oid^.DotNotation := sInput
348
        else
348
        else
349
          oid^.DotNotation := parentOID^.DotNotation + '.' + sInput;
349
          oid^.DotNotation := parentOID^.DotNotation + '.' + sInput;
350
        NumIdEditor := true;
350
        NumIdEditor := true; (* request caller to save @oid *)
351
        Exit;
351
        Exit;
352
      end;
352
      end;
353
    end
353
    end
354
    else
354
    else
355
    begin
355
    begin
Line 366... Line 366...
366
  NewOidEditor := false;
366
  NewOidEditor := false;
367
 
367
 
368
  InitOidDef(@newoid);
368
  InitOidDef(@newoid);
369
  newoid.FileId := NextPossibleFileID;
369
  newoid.FileId := NextPossibleFileID;
370
  newoid.Parent := oid^.FileId + oid^.DotNotation;
370
  newoid.Parent := oid^.FileId + oid^.DotNotation;
371
  if not NumIdEditor(@newoid, oid) then exit;
371
  if NumIdEditor(@newoid, oid) and
372
  if not AsnEditor(@newoid) then exit;
372
     AsnEditor(@newoid) and
373
  if not DescEditor(@newoid) then exit;
373
     DescEditor(@newoid) then
374
 
374
  begin
375
  newfilename := newoid.FileId + '.OID';
375
    newfilename := newoid.FileId + '.OID';
376
  _WriteOidFile(newfilename, @newoid);
376
    _WriteOidFile(newfilename, @newoid);
377
 
377
 
378
  (* Add link to original file and enable the saving of it *)
378
    (* Add link to original file and enable the saving of it *)
379
  ListAppend(oid^.SubIds, newoid.FileId + newoid.DotNotation);
379
    ListAppend(oid^.SubIds, newoid.FileId + newoid.DotNotation);
-
 
380
    NewOidEditor := true; (* request caller to save @oid *)
-
 
381
  end;
380
  NewOidEditor := true;
382
  FreeOidDef(@newoid);
381
end;
383
end;
382
 
384
 
383
procedure DeleteChildrenRecursive(oid: POID);
385
procedure DeleteChildrenRecursive(oid: POID);
384
var
386
var
385
  i: integer;
387
  i: integer;
Line 574... Line 576...
574
    begin
576
    begin
575
      ListAppend(subsel, 'Delete OID');
577
      ListAppend(subsel, 'Delete OID');
576
      ListAppend(subfiles, ID_DELETE);
578
      ListAppend(subfiles, ID_DELETE);
577
    end;
579
    end;
578
 
580
 
-
 
581
    (* Show menu *)
-
 
582
 
579
    subselres := DrawSelectionList(menuX, menuY,
583
    subselres := DrawSelectionList(menuX, menuY,
580
                                   ScreenWidth-2,
584
                                   ScreenWidth-2,
581
                                   NAVBAR_SIZE,
585
                                   NAVBAR_SIZE,
582
                                   subsel,
586
                                   subsel,
583
                                   true,
587
                                   true,
584
                                   'SELECT ACTION',
588
                                   'SELECT ACTION',
585
                                   1);
589
                                   1);
-
 
590
 
-
 
591
    (* Process user selection *)
-
 
592
 
586
    if subselres = -1 then
593
    if subselres = -1 then
587
    begin
594
    begin
588
      exit;
595
      exit;
589
    end
596
    end
590
    else
597
    else