home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2 - Developers' Solutions / Delphi 2 Developers' Solutions.iso / dds / chap06 / howto05 / delphi10 / ufmgr34.pas < prev   
Encoding:
Pascal/Delphi Source File  |  1996-01-05  |  56.9 KB  |  1,635 lines

  1. unit Ufmgr34;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, ShellAPI, FileCtrl,
  8.    DRWSUtl1, DRWSUtl4, Grids;
  9.  
  10. type
  11.   TCCFileMgrForm = class(TForm)
  12.     Panel1: TPanel;
  13.     Panel2: TPanel;
  14.     BitBtn1: TBitBtn;
  15.     Panel3: TPanel;
  16.     Label1: TLabel;
  17.     BitBtn2: TBitBtn;
  18.     BitBtn3: TBitBtn;
  19.     BitBtn4: TBitBtn;
  20.     BitBtn5: TBitBtn;
  21.     BitBtn6: TBitBtn;
  22.     BitBtn7: TBitBtn;
  23.     OpenDialog1: TOpenDialog;
  24.     BitBtn8: TBitBtn;
  25.     BitBtn9: TBitBtn;
  26.     OpenDialog2: TOpenDialog;
  27.     BitBtn10: TBitBtn;
  28.     Panel4: TPanel;
  29.     Panel5: TPanel;
  30.     Panel6: TPanel;
  31.     Panel7: TPanel;
  32.     Label2: TLabel;
  33.     Label3: TLabel;
  34.     Label4: TLabel;
  35.     BitBtn11: TBitBtn;
  36.     Shape1: TShape;
  37.     ColorDialog1: TColorDialog;
  38.     procedure FormResize(Sender: TObject);
  39.     procedure FormCreate(Sender: TObject);
  40.     procedure BitBtn7Click(Sender: TObject);
  41.     procedure BitBtn1Click(Sender: TObject);
  42.     procedure BitBtn2Click(Sender: TObject);
  43.     procedure BitBtn3Click(Sender: TObject);
  44.     procedure BitBtn4Click(Sender: TObject);
  45.     procedure BitBtn5Click(Sender: TObject);
  46.     procedure FormPaint(Sender: TObject);
  47.     procedure BitBtn8Click(Sender: TObject);
  48.     procedure BitBtn9Click(Sender: TObject);
  49.     procedure BitBtn6Click(Sender: TObject);
  50.     procedure BitBtn1DragDrop(Sender, Source: TObject; X, Y: Integer);
  51.     procedure BitBtn1DragOver(Sender, Source: TObject; X, Y: Integer;
  52.       State: TDragState; var Accept: Boolean);
  53.     procedure BitBtn2DragDrop(Sender, Source: TObject; X, Y: Integer);
  54.     procedure BitBtn3DragDrop(Sender, Source: TObject; X, Y: Integer);
  55.     procedure BitBtn4DragDrop(Sender, Source: TObject; X, Y: Integer);
  56.     procedure BitBtn10Click(Sender: TObject);
  57.     procedure FormDestroy(Sender: TObject);
  58.     procedure FormKeyDown(Sender: TObject; var Key: Word;
  59.       Shift: TShiftState);
  60.     procedure BitBtn9KeyDown(Sender: TObject; var Key: Word;
  61.       Shift: TShiftState);
  62.     procedure Label2Click(Sender: TObject);
  63.     procedure Label3Click(Sender: TObject);
  64.     procedure Label4Click(Sender: TObject);
  65.     procedure Panel2MouseMove(Sender: TObject; Shift: TShiftState; X,
  66.       Y: Integer);
  67.     procedure Panel1MouseMove(Sender: TObject; Shift: TShiftState; X,
  68.       Y: Integer);
  69.     procedure Panel4MouseMove(Sender: TObject; Shift: TShiftState; X,
  70.       Y: Integer);
  71.     procedure Panel3MouseMove(Sender: TObject; Shift: TShiftState; X,
  72.       Y: Integer);
  73.     procedure BitBtn1MouseMove(Sender: TObject; Shift: TShiftState; X,
  74.       Y: Integer);
  75.     procedure BitBtn2MouseMove(Sender: TObject; Shift: TShiftState; X,
  76.       Y: Integer);
  77.     procedure BitBtn3MouseMove(Sender: TObject; Shift: TShiftState; X,
  78.       Y: Integer);
  79.     procedure BitBtn4MouseMove(Sender: TObject; Shift: TShiftState; X,
  80.       Y: Integer);
  81.     procedure BitBtn5MouseMove(Sender: TObject; Shift: TShiftState; X,
  82.       Y: Integer);
  83.     procedure BitBtn8MouseMove(Sender: TObject; Shift: TShiftState; X,
  84.       Y: Integer);
  85.     procedure BitBtn9MouseMove(Sender: TObject; Shift: TShiftState; X,
  86.       Y: Integer);
  87.     procedure BitBtn6MouseMove(Sender: TObject; Shift: TShiftState; X,
  88.       Y: Integer);
  89.     procedure BitBtn7MouseMove(Sender: TObject; Shift: TShiftState; X,
  90.       Y: Integer);
  91.     procedure BitBtn10MouseMove(Sender: TObject; Shift: TShiftState; X,
  92.       Y: Integer);
  93.     procedure Panel5MouseMove(Sender: TObject; Shift: TShiftState; X,
  94.       Y: Integer);
  95.     procedure Panel6MouseMove(Sender: TObject; Shift: TShiftState; X,
  96.       Y: Integer);
  97.     procedure Panel7MouseMove(Sender: TObject; Shift: TShiftState; X,
  98.       Y: Integer);
  99.     procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton;
  100.       Shift: TShiftState; X, Y: Integer);
  101.     procedure BitBtn1MouseUp(Sender: TObject; Button: TMouseButton;
  102.       Shift: TShiftState; X, Y: Integer);
  103.     procedure BitBtn2MouseUp(Sender: TObject; Button: TMouseButton;
  104.       Shift: TShiftState; X, Y: Integer);
  105.     procedure BitBtn3MouseUp(Sender: TObject; Button: TMouseButton;
  106.       Shift: TShiftState; X, Y: Integer);
  107.     procedure BitBtn4MouseUp(Sender: TObject; Button: TMouseButton;
  108.       Shift: TShiftState; X, Y: Integer);
  109.     procedure BitBtn11Click(Sender: TObject);
  110.     procedure Shape1MouseUp(Sender: TObject; Button: TMouseButton;
  111.       Shift: TShiftState; X, Y: Integer);
  112.   private
  113.     { Private declarations }
  114.   public
  115.     { Public declarations }
  116.     DirectoryListBox1 : TDirectoryListBox;
  117.     FileListBox1 : TIconFileListBox;
  118.     ScrollBox1 : TFileIconPanelScrollbox;
  119.   end;
  120. var
  121.   CCFileMgrForm      : TCCFileMgrForm;
  122.   CurrentView        : Integer;  { This holds the current view setting      }
  123.  
  124. implementation
  125.  
  126. {$R *.DFM}
  127.  
  128. uses DDDFUnit,  { Include custom directory selection form }
  129.      CfmpfUn,   { Include custom options dialog           }
  130.      CCPrnMgr;  { Include printer manager unit            }
  131.  
  132. { Set up the resize to replace the icon buttons }
  133. procedure TCCFileMgrForm.FormResize(Sender: TObject);
  134. begin
  135.   { Send in the panel and global buttons list }
  136.   SpacePanelButtons( Panel2 );
  137. end;
  138.  
  139. { Delphi wrote this; use it to set everything up }
  140. procedure TCCFileMgrForm.FormCreate(Sender: TObject);
  141. var TheIconPanel : TFileIconPanel;
  142.     CurrentPath : String;
  143. begin
  144.   { Create the directory list box }
  145.   SavedForm := Self;
  146.   GlobalTransparentColor := clWhite;
  147.   DirectoryListBox1 := TDirectoryListBox.Create( Panel1 );
  148.   DirectoryListBox1.Parent := Panel1;
  149.   DirectoryListBox1.Visible := true;
  150.   DirectoryListbox1.Top := 17;
  151.   DirectoryListbox1.Left := 0;
  152.   DirectoryListbox1.Height := Panel1.Height - 32;
  153.   DirectoryListbox1.Width := 0;
  154.   { Create the file list box }
  155.   FileListBox1 := TIconFileListBox.Create( Panel1 );
  156.   FileListBox1.Parent := Panel1;
  157.   FileListbox1.Top := 17;
  158.   FileListbox1.Left := 146;
  159.   FileListbox1.Height := Panel1.Height - 32;
  160.   FileListbox1.Width := 0;
  161.   FileListBox1.Visible := true;
  162.   FileListBox1.ShowGlyphs := true;
  163.   FileListBox1.MultiSelect := true;
  164.   FileListBox1.DragMode := dmAutomatic;
  165.   { Set intercomponent interactions }
  166.   DirectoryListBox1.FileList := FileListbox1;
  167.   DirectoryListBox1.DirLabel := Label1;
  168.   { Create the scrollbox }
  169.   ScrollBox1 := TFileIconPanelScrollBox.Create( Panel1 );
  170.   ScrollBox1.Parent := Panel1;
  171.   ScrollBox1.align := alClient;
  172.   ScrollBox1.Left := 0;
  173.   ScrollBox1.Top := 0;
  174.   ScrollBox1.Width := Panel1.Width - 32;
  175.   ScrollBox1.Height := Panel1.Height - 32;
  176.   ScrollBox1.IconsNeedRefreshing := false;
  177.   ScrollBox1.TheStoredHandle := Self.Handle;
  178.   ScrollBox1.TheParentForm := Self;
  179.   { Get the current directory with 0 parameter }
  180.   GetDir( 0 , CurrentPath );
  181.   { Set the display caption }
  182.   Label1.Caption := CurrentPath;
  183.   { Add a trailing \ if not root }
  184.   CurrentPath := ScrollBox1.TheFWB.ForceTrailingBackSlash( CurrentPath );
  185.   { Get the icons display using scrollbox1 }
  186.   ScrollBox1.GetIconsForEntireDirectory( CurrentPath );
  187.   { Set the Icon View as default }
  188.   CurrentView := 1;
  189.   { Start the FIP IOManager }
  190.   if not assigned( TheIOManager ) then
  191.   begin
  192.     TheIOManager := TIOManager.Create( Self );
  193.     TheIOManager.Parent := Self;
  194.     TheIOManager.InitLocks;
  195.   end;
  196.   if not Assigned( TheMouseManager ) then
  197.   begin
  198.     TheMouseManager := TMouseManager.Create( Self );
  199.     TheMouseManager.InitializeNormal;
  200.   end;
  201.   { Load the special cursor to toggle the LOCK keys }
  202.   Screen.Cursors[ CR_KEYSET ] := LoadCursor( hInstance , 'KEYSET' );
  203.   Screen.Cursors[ CR_NULL ] := LoadCursor( hInstance , 'BLANKCUR' );
  204.   Panel5.Cursor := CR_KEYSET;
  205.   Panel6.Cursor := CR_KEYSET;
  206.   Panel7.Cursor := CR_KEYSET;
  207.   Label2.Visible := TheIOManager.IsCapsLockDown;
  208.   Label3.Visible := TheIOManager.IsNumLockDown;
  209.   Label4.Visible := TheIOManager.IsScrollLockDown;
  210. end;
  211.  
  212. { Delphi wrote this; use it to close the application }
  213. procedure TCCFileMgrForm.BitBtn7Click(Sender: TObject);
  214. begin
  215.   Close;
  216. end;
  217.  
  218. { Delphi wrote this use it to perform a copy on all selected files }
  219. procedure TCCFileMgrForm.BitBtn1Click(Sender: TObject);
  220. var ThePosition  : Integer;       { Loop counter   }
  221.     CurrentName ,                 { Holds work name}
  222.     TheOldString : String;        { Holds Dir      }
  223.     finished     : Boolean;       { Loop control   }
  224.     WorkingDir   : String;        { Holds mod wd   }
  225.     TargetDir    : String;        { target of op   }
  226.     TheResult    : Integer;       { Modal res hold }
  227. begin
  228.   { Get current directory and save it for later }
  229.   GetDir( 0 , TheOldString );
  230.   { Check for need to add trailing \ }
  231.   WorkingDir := TheOldString;
  232.   WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( WorkingDir );
  233.   { Display the Windows-based directory input form }
  234.   TheResult := DestDDForm.ShowModal;
  235.   { If not cancelled do the copy }
  236.   if TheResult = mrOK then
  237.   begin
  238.     { Get the target directory with \ OK }
  239.     TargetDir := DestDDForm.GetTargetDirectory;
  240.     { Show the hourglass to indicate waiting }
  241.     Screen.Cursor := crHourGlass;
  242.     { Setup to get all selections }
  243.     ThePosition := 1;
  244.     finished := false;
  245.     while not finished do
  246.     begin
  247.       { Call generic file getting routine based on current view}
  248.       case CurrentView of
  249.         1 : CurrentName := ScrollBox1.GetNextSelection( WorkingDir ,
  250.              ThePosition );
  251.         2 : CurrentName := FileListBox1.GetNextSelection( WorkingDir ,
  252.              ThePosition );
  253.       end;
  254.       { If returns blank string out of selections so exit }
  255.       if CurrentName = '' then finished := true else
  256.       begin
  257.         { If a directory signal error }
  258.         if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  259.         begin
  260.           if MessageDlg( 'Copy Directory ' + CurrentName + ' to ' + TargetDir
  261.            +'?', mtConfirmation , mbYesNoCancel , 0 ) = mryes then
  262.           begin
  263.             ScrollBox1.TheFWB.RecursivelyCopyDirectory( CurrentName ,
  264.              TargetDir );
  265.           end;
  266.         end
  267.         else
  268.         begin
  269.           Scrollbox1.TheFWB.CopyTheFile( CurrentName , TargetDir );
  270.         end;
  271.       end;
  272.     end;
  273.     { Reset to normal cursor }
  274.     Screen.Cursor := crDefault;
  275.   end;
  276.   { Reset to the original directory }
  277.   ChDir( TheOldString );
  278. end;
  279.  
  280. { Delphi wrote this, use it to move files which are selected }
  281. procedure TCCFileMgrForm.BitBtn2Click(Sender: TObject);
  282. var ThePosition  : Integer;       { Loop counter   }
  283.     CurrentName ,                 { Holds work name}
  284.     TheOldString : String;        { Holds Dir      }
  285.     finished     : Boolean;       { Loop control   }
  286.     WorkingDir   : String;        { Holds mod wd   }
  287.     TargetDir    : String;        { target of op   }
  288.     TheResult    : Integer;       { Modal res hold }
  289. begin
  290.   { Get current directory and save it for later }
  291.   GetDir( 0 , TheOldString );
  292.   { Check for need to add trailing \ }
  293.   WorkingDir := TheOldString;
  294.   WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( WorkingDIr );
  295.   { Display the Windows-based directory input form }
  296.   TheResult := DestDDForm.ShowModal;
  297.   { If not cancelled do the copy }
  298.   if TheResult = mrOK then
  299.   begin
  300.     { Get the target directory with \ OK }
  301.     TargetDir := DestDDForm.GetTargetDirectory;
  302.     { Show the hourglass to indicate waiting }
  303.     Screen.Cursor := crHourGlass;
  304.     { Set up to get all current selections }
  305.     ThePosition := 1;
  306.     finished := false;
  307.     while not finished do
  308.     begin
  309.       { Call generic file getting routine based on current view}
  310.       case CurrentView of
  311.         1 : CurrentName := ScrollBox1.GetNextSelection( WorkingDir ,
  312.              ThePosition );
  313.         2 : CurrentName := FileListBox1.GetNextSelection( WorkingDir ,
  314.              ThePosition );
  315.       end;
  316.       { If returns blank string then out of selections }
  317.       if CurrentName = '' then finished := true else
  318.       begin
  319.         { If a directory signal error }
  320.         if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  321.         begin
  322.           if MessageDlg( 'Move Directory ' + CurrentName + ' to ' + TargetDir +
  323.            '?' , mtConfirmation , mbYesNoCancel , 0 ) = mrYes then
  324.             ScrollBox1.TheFWB.RecursivelyMoveDirectory( CurrentName ,
  325.              TargetDir );
  326.         end
  327.         else
  328.         begin
  329.           Scrollbox1.TheFWB.MoveTheFile( CurrentName , TargetDir );
  330.         end;
  331.       end;
  332.       { Reset to normal cursor }
  333.       Screen.Cursor := crDefault;
  334.     end;
  335.   end;
  336.   { Reset to the original directory }
  337.   ChDir( TheOldString );
  338.   if CurrentView = 1 then { Reset icon display if in view }
  339.    ScrollBox1.Update else FileListBox1.Update; { Otherwise update the FLB }
  340. end;
  341.  
  342. { Delphi wrote this, use it to delete files which are selected }
  343. procedure TCCFileMgrForm.BitBtn3Click(Sender: TObject);
  344. var ThePosition  : Integer;       { Loop counter   }
  345.     CurrentName ,                 { Holds work name}
  346.     TheOldString : String;        { Holds Dir      }
  347.     finished     : Boolean;       { Loop control   }
  348.     WorkingDir   : String;        { Holds mod wd   }
  349. begin
  350.   { Get current directory and save it for later }
  351.   GetDir( 0 , TheOldString );
  352.   { Check for need to add trailing \ }
  353.   WorkingDir := TheOldString;
  354.   WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( WorkingDIr );
  355.   { Set up to do loop for selected files }
  356.   ThePosition := 1;
  357.   finished := false;
  358.   while not finished do
  359.   begin
  360.     { Call generic file getting routine based on current view}
  361.     case CurrentView of
  362.       1 : CurrentName := ScrollBox1.GetNextSelection( WorkingDir ,
  363.            ThePosition );
  364.       2 : CurrentName := FileListBox1.GetNextSelection( WorkingDir ,
  365.            ThePosition );
  366.     end;
  367.     { if returns blank string out of selections }
  368.     if CurrentName = '' then finished := true else
  369.     begin
  370.       { If its a directory signal error }
  371.       if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  372.       begin
  373.         if MessageDlg( 'Delete Directory ' + CurrentName + '?' , mtConfirmation,
  374.          mbYesNoCancel , 0 ) = mrYes then
  375.         begin
  376.           ScrollBox1.TheFWB.RecursivelyDeleteDirectory( CurrentName );
  377.           Scrollbox1.TheFWB.RemoveDirectory( Currentname );
  378.         end;
  379.       end
  380.       else
  381.       begin
  382.         { Otherwise get confirmation message and if OKed delete file }
  383.         if MessageDlg( 'Delete file ' + CurrentName + '?', mtConfirmation ,
  384.          mbYesNoCancel , 0 ) = mrYes then
  385.         begin
  386.           ScrollBox1.TheFWB.DeleteTheFile( Currentname );
  387.         end;
  388.       end;
  389.     end;
  390.   end;
  391.   if CurrentView = 1 then { Reset icon display if in view }
  392.    ScrollBox1.Update else FileListBox1.Update; { Otherwise update the FLB }
  393. end;
  394.  
  395. { Delphi wrote this; use it to rename selected files }
  396. procedure TCCFileMgrForm.BitBtn4Click(Sender: TObject);
  397. var ThePosition  : Integer;       { Loop counter   }
  398.     CurrentName ,                 { Holds work name}
  399.     TheOldString : String;        { Holds Dir      }
  400.     finished     : Boolean;       { Loop control   }
  401.     WorkingDir   : String;        { Holds mod wd   }
  402. begin
  403.   { Get current directory for later }
  404.   GetDir( 0 , TheOldString );
  405.   { Check for need to add trailing \ }
  406.   WorkingDir := TheOldString;
  407.   WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( WorkingDIr );
  408.   { Set up to do loop for selected files }
  409.   ThePosition := 1;
  410.   finished := false;
  411.   while not finished do
  412.   begin
  413.     { Call generic file getting routine based on current view}
  414.     case CurrentView of
  415.       1 : CurrentName := ScrollBox1.GetNextSelection( WorkingDir ,
  416.            ThePosition );
  417.       2 : CurrentName := FileListBox1.GetNextSelection( WorkingDir ,
  418.            ThePosition );
  419.     end;
  420.     { If returns blank string then out of selections }
  421.     if CurrentName = '' then finished := true else
  422.     begin
  423.       { Otherwise set up the opendialog with filename and caption }
  424.       OpenDialog1.Filename := ExtractFilename( CurrentName );
  425.       { Use this to prevent error from changing directories }
  426.       OpenDialog1.Options := [ofNoChangeDir];
  427.       OpenDialog1.Title := 'Rename File';
  428.       { If not cancelled then do rename or signal error }
  429.       if OpenDialog1.Execute then
  430.       begin
  431.         ScrollBox1.TheFWB.RenameTheFile( CurrentName , OpenDialog1.Filename );
  432.       end;
  433.     end;
  434.   end;
  435.   if CurrentView = 1 then { Reset icon display if in view }
  436.    ScrollBox1.Update else FileListBox1.Update; { Otherwise update the FLB }
  437. end;
  438.  
  439. { Delphi wrote this; use it to make a new directory under current one }
  440. procedure TCCFileMgrForm.BitBtn5Click(Sender: TObject);
  441. begin
  442.   { Set up the dialog to get the new directory name }
  443.   OpenDialog2.FileName := '*.*';
  444.   OpenDialog2.Title := 'Enter Directory Name';
  445.   if OpenDialog1.Execute then
  446.   begin
  447.     { If not cancelled make new directory }
  448.     Scrollbox1.TheFWB.CreateNewDirectory( OpenDialog1.Filename );
  449.   end;
  450.   if CurrentView = 1 then { Reset icon display if in view }
  451.    ScrollBox1.Update else FileListBox1.Update; { Otherwise update the FLB }
  452. end;
  453.  
  454. { Delphi wrote this; use it to handle refreshing the scrollbox }
  455. procedure TCCFileMgrForm.FormPaint(Sender: TObject);
  456. var CurrentDirectory : String; { Get current dir }
  457. begin
  458.   { If updated, do refresh }
  459.   if ScrollBox1.IconsNeedRefreshing then
  460.   begin
  461.     Scrollbox1.ClearTheFIPs;
  462.     ScrollBox1.IconsNeedRefreshing := false;
  463.     GetDir( 0 , CurrentDirectory );
  464.     { Force trailing backslash }
  465.     CurrentDirectory := ScrollBox1.TheFWB.ForceTrailingBackSlash(
  466.      CurrentDirectory );
  467.     { Set the label to the new directory }
  468.     Label1.Caption := UpperCase( CurrentDirectory );
  469.     { Do the update }
  470.     ScrollBox1.GetIconsForEntireDirectory( CurrentDirectory );
  471.   end;
  472. end;
  473.  
  474. { Delphi wrote this; use it to reset the current view Icons/List }
  475. procedure TCCFileMgrForm.BitBtn8Click(Sender: TObject);
  476. var TheOldString : String; { Use to get current directory }
  477. begin
  478.   { Reset currentview }
  479.   if CurrentView = 1 then CurrentView := 2 else
  480.    CurrentView := 1;
  481.   { either show the windows boxes or the scrollbox }
  482.   case CurrentView of
  483.     1 : begin
  484.           { Make the listboxes invisible by changing align and width }
  485.           FileListBox1.Visible := false;
  486.           FileListBox1.Align := alNone;
  487.           FileListBox1.Width := 0;
  488.           DirectoryListBox1.Visible := false;
  489.           DirectoryListBox1.align := alNone;
  490.           DirectoryListBox1.Width := 0;
  491.           { Keep them from getting mouse clicks }
  492.           FileListBox1.Enabled := false;
  493.           DirectoryListBox1.Enabled := false;
  494.           { Have the scrollbox get mouse and be seen  by resetting align/wid}
  495.           Scrollbox1.align := alClient;
  496.           Scrollbox1.width := Panel1.Width - 32;
  497.           ScrollBox1.Enabled := true;
  498.           { Tell the scrollbox to repaint itself just in case }
  499.           ScrollBox1.Update;
  500.         end;
  501.     2 : begin
  502.           { Make the listboxes visible by resetting align and width}
  503.           FileListBox1.Visible := true;
  504.           DirectoryListBox1.Visible := true;
  505.           DirectoryListBox1.width := 145;
  506.           DirectoryListBox1.align := alLeft;
  507.           FileListBox1.align := alClient;
  508.           FileListBox1.Width := Panel1.Width - 32 - DirectoryListBox1.Width;
  509.           { Have them getting mouse clicks }
  510.           FileListBox1.Enabled := true;
  511.           DirectoryListBox1.Enabled := true;
  512.           { Have the scrollbox not get mouse and not be seen via align/width}
  513.           ScrollBox1.Enabled := false;
  514.           ScrollBox1.Visible := false;
  515.           ScrollBox1.align := alNone;
  516.           ScrollBox1.Width := 0;
  517.         end;
  518.   end;
  519.   Invalidate;
  520. end;
  521.  
  522. { Delphi wrote this; use it to do a file search display }
  523. procedure TCCFileMgrForm.BitBtn9Click(Sender: TObject);
  524. var CurrentDirectory : String; { Holds current directory }
  525. begin
  526.   { Set up and run the search dialog }
  527.   OpenDialog2.FileName := '*.*';
  528.   { if not cancelled do the search }
  529.   if OpenDialog2.Execute then
  530.   begin
  531.     { Get current directory }
  532.     GetDir( 0 , CurrentDirectory );
  533.     { Force trailing backslash }
  534.     CurrentDirectory :=
  535.      ScrollBox1.TheFWB.ForceTrailingBackSlash( CurrentDirectory );
  536.     { display recursive search results }
  537.     GlobalAbortFlag := false;
  538.     Scrollbox1.DisplayRecursiveSearchResults(
  539.      CurrentDirectory + OpenDialog2.Filename );
  540.     Label1.Caption := 'Search Results for ' + CurrentDirectory +
  541.      OpenDialog2.FileName;
  542.   end;
  543. end;
  544.  
  545. { Delphi wrote this; use it to set a file's properties }
  546. procedure TCCFileMgrForm.BitBtn6Click(Sender: TObject);
  547. var ThePosition  : Integer;       { Loop counter   }
  548.     CurrentName ,                 { Holds work name}
  549.     TheOldString : String;        { Holds Dir      }
  550.     finished     : Boolean;       { Loop control   }
  551.     WorkingDir   : String;        { Holds mod wd   }
  552. begin
  553.   { Get current directory for later }
  554.   GetDir( 0 , TheOldString );
  555.   ThePosition := 1;
  556.   { Check for need to add trailing \ }
  557.   Workingdir := TheOldString;
  558.   WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( WorkingDIr );
  559.   { Call generic file getting routine based on current view}
  560.   case CurrentView of
  561.     1 : CurrentName := ScrollBox1.GetNextSelection( WorkingDir ,
  562.          ThePosition );
  563.     2 : CurrentName := FileListBox1.GetNextSelection( WorkingDir ,
  564.          ThePosition );
  565.   end;
  566.   { If nothing selected then abort (gets ..!) }
  567.   if CurrentName = '' then
  568.   begin
  569.     MessageDlg( 'No File Selected!' , mtError , [mbOK] , 0 );
  570.     exit;
  571.   end
  572.   else
  573.   begin
  574.     { Otherwise set up the properties form and show it }
  575.     CCFMPropsForm.WorkingFileName := CurrentName;
  576.     CCFMPropsForm.ThePosition := ThePosition;
  577.     CCFMPropsForm.BitBtn4.Enabled := true;
  578.     CCFMPropsForm.Initialize;
  579.     CCFMPropsForm.ShowModal;
  580.   end;
  581.   if CurrentView = 1 then { Reset icon display if in view }
  582.    ScrollBox1.Update else FileListBox1.Update; { Otherwise update the FLB }
  583. end;
  584.  
  585. { Delphi wrote this; use it to drag and drop files for copying }
  586. procedure TCCFileMgrForm.BitBtn1DragDrop(Sender, Source: TObject; X,
  587.   Y: Integer);
  588. var CurrentName ,                 { Holds work name}
  589.     WorkingDir ,
  590.     TheOldString : String;        { Holds Dir      }
  591.     TargetDir    : String;        { target of op   }
  592.     TheResult    : Integer;       { Modal res hold }
  593.     Counter_1    : Integer;
  594. begin
  595.   { Make sure source is indeed a FileIconPanel }
  596.   if Source is TIconFileListbox then
  597.   begin
  598.     with Source as TIconFileListBox do
  599.     begin
  600.      { Get current directory and save it for later }
  601.      GetDir( 0 , TheOldString );
  602.      WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( TheOldString );
  603.      { Display the Windows-based directory input form }
  604.      TheResult := DestDDForm.ShowModal;
  605.      { If not cancelled do the copy }
  606.      if TheResult = mrOK then
  607.      begin
  608.        for Counter_1 := 1 to Items.Count do
  609.        begin
  610.          if Selected[ Counter_1 - 1 ] then
  611.          begin
  612.             CurrentName := WorkingDIr + Items[ Counter_1 - 1 ];
  613.             { Get the target directory with \ OK }
  614.             TargetDir := DestDDForm.GetTargetDirectory;
  615.             { If a directory signal and do recursive operation }
  616.             if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  617.             begin
  618.               if MessageDlg( 'Copy Directory ' + CurrentName + ' to ' + TargetDir
  619.                +'?', mtConfirmation , mbYesNoCancel , 0 ) = mryes then
  620.               begin
  621.                 ScrollBox1.TheFWB.RecursivelyCopyDirectory( CurrentName ,
  622.                  TargetDir );
  623.               end;
  624.             end
  625.             else
  626.             begin
  627.               { Do the copy }
  628.               Scrollbox1.TheFWB.CopyTheFile( CurrentName , TargetDir );
  629.             end;
  630.             { Reset to the original directory }
  631.             ChDir( TheOldString );
  632.           end;
  633.         end;
  634.       end;
  635.     end;
  636.     FileListBox1.Update;
  637.     exit;
  638.   end;
  639.   if TheIOManager.WasSHIFTPressed then
  640.   begin
  641.     BitBtn1Click( Source );
  642.     exit;
  643.   end;
  644.   with Source as TFileIconPanel do
  645.   begin
  646.     { Get current directory and save it for later }
  647.     GetDir( 0 , TheOldString );
  648.     { Display the Windows-based directory input form }
  649.     TheResult := DestDDForm.ShowModal;
  650.     { If not cancelled do the copy }
  651.     if TheResult = mrOK then
  652.     begin
  653.       CurrentName := FTheName;
  654.       { Get the target directory with \ OK }
  655.       TargetDir := DestDDForm.GetTargetDirectory;
  656.       { If a directory signal and do recursive operation }
  657.       if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  658.       begin
  659.         if MessageDlg( 'Copy Directory ' + CurrentName + ' to ' + TargetDir
  660.          +'?', mtConfirmation , mbYesNoCancel , 0 ) = mryes then
  661.         begin
  662.           ScrollBox1.TheFWB.RecursivelyCopyDirectory( CurrentName ,
  663.            TargetDir );
  664.         end;
  665.       end
  666.       else
  667.       begin
  668.         { Do the copy }
  669.         Scrollbox1.TheFWB.CopyTheFile( CurrentName , TargetDir );
  670.       end;
  671.       { Reset to the original directory }
  672.       ChDir( TheOldString );
  673.     end;
  674.   end;
  675. end;
  676.  
  677. { Delphi wrote this; use it to generically OK DnD from FIPs }
  678. procedure TCCFileMgrForm.BitBtn1DragOver(Sender, Source: TObject; X,
  679.   Y: Integer; State: TDragState; var Accept: Boolean);
  680. begin
  681.   { Only accept from FileIconPanel components }
  682.   if ( Source is TFileIconPanel ) or
  683.      ( Source is TIconFileListBox ) then Accept := true else Accept := false;
  684. end;
  685.  
  686. { Delphi wrote this; use it to accept Drag and Drop moving }
  687. procedure TCCFileMgrForm.BitBtn2DragDrop(Sender, Source: TObject; X,
  688.   Y: Integer);
  689. var CurrentName ,                 { Holds work name}
  690.     WorkingDir ,
  691.     TheOldString : String;        { Holds Dir      }
  692.     TargetDir    : String;        { target of op   }
  693.     TheResult       : Integer;    { Modal res hold }
  694.     Counter_1   : Integer;
  695. begin
  696.   { Make sure source is indeed a FileIconPanel }
  697.   if Source is TIconFileListbox then
  698.   begin
  699.     with Source as TIconFileListBox do
  700.     begin
  701.       { Get current directory and save it for later }
  702.       GetDir( 0 , TheOldString );
  703.       WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( TheOldString );
  704.       { Display the Windows-based directory input form }
  705.       TheResult := DestDDForm.ShowModal;
  706.       for Counter_1 := 1 to Items.Count do
  707.       begin
  708.         if Selected[ Counter_1 - 1 ] then
  709.         begin
  710.           { If not cancelled do the copy }
  711.           if TheResult = mrOK then
  712.           begin
  713.             CurrentName := WorkingDir + Items[ Counter_1 - 1 ];
  714.             { Get the target directory with \ OK }
  715.             TargetDir := DestDDForm.GetTargetDirectory;
  716.             { If a directory signal and do recursive operation }
  717.             if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  718.             begin
  719.               if MessageDlg( 'Move Directory ' + CurrentName + ' to ' + TargetDir
  720.                +'?', mtConfirmation , mbYesNoCancel , 0 ) = mryes then
  721.               begin
  722.                 ScrollBox1.TheFWB.RecursivelyMoveDirectory( CurrentName ,
  723.                  TargetDir );
  724.               end;
  725.             end
  726.             else
  727.             begin
  728.               { Do the copy }
  729.               Scrollbox1.TheFWB.MoveTheFile( CurrentName , TargetDir );
  730.             end;
  731.             { Reset to the original directory }
  732.             ChDir( TheOldString );
  733.           end;
  734.         end;
  735.       end;
  736.     end;
  737.     FileListBox1.Update;
  738.     exit;
  739.   end;
  740.   if TheIOManager.WasSHIFTPressed then
  741.   begin
  742.     BitBtn2Click( Source );
  743.     exit;
  744.   end;
  745.   with Source as TFileIconPanel do
  746.   begin
  747.     { Get current directory and save it for later }
  748.     GetDir( 0 , TheOldString );
  749.     { Display the Windows-based directory input form }
  750.     TheResult := DestDDForm.ShowModal;
  751.     { If not cancelled do the copy }
  752.     if TheResult = mrOK then
  753.     begin
  754.       { Get the target directory with \ OK }
  755.       TargetDir := DestDDForm.GetTargetDirectory;
  756.       { If Copyfile returns false an error occurred }
  757.       CurrentName := FTheName;
  758.       { If a directory signal and do recursion }
  759.       if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  760.       begin
  761.         if MessageDlg( 'Move Directory ' + CurrentName + ' to ' + TargetDir +
  762.          '?' , mtConfirmation , mbYesNoCancel , 0 ) = mrYes then
  763.           ScrollBox1.TheFWB.RecursivelyMoveDirectory( CurrentName ,
  764.            TargetDir );
  765.       end
  766.       else
  767.       begin  { Do the move }
  768.         Scrollbox1.TheFWB.MoveTheFile( CurrentName , TargetDir );
  769.         ChDir( TheOldString );
  770.       end;
  771.       { Refresh display }
  772.       ScrollBox1.Update;
  773.     end;
  774.   end;
  775. end;
  776.  
  777. { Delphi wrote this; use it to do drag and drop deletes }
  778. procedure TCCFileMgrForm.BitBtn3DragDrop(Sender, Source: TObject; X,
  779.   Y: Integer);
  780. var WorkingDir ,
  781.     CurrentName : String;  { Holds work name}
  782.     Counter_1   : Integer;
  783. begin
  784.   { Make sure source is indeed a FileIconPanel }
  785.   if Source is TIconFileListbox then
  786.   begin
  787.     with Source as TIconFileListBox do
  788.     begin
  789.       GetDir( 0 , WorkingDir );
  790.       WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( WorkingDir );
  791.       for Counter_1 := 1 to Items.Count do
  792.       begin
  793.         if Selected[ Counter_1 - 1 ] then
  794.         begin
  795.           CurrentName := WorkingDir + Items[ Counter_1 - 1 ];
  796.           { If a directory signal and do recursive operation }
  797.           if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  798.           begin
  799.             if MessageDlg( 'Delete Directory ' + CurrentName +'?',
  800.              mtConfirmation , mbYesNoCancel , 0 ) = mryes then
  801.             begin
  802.               ScrollBox1.TheFWB.RecursivelyDeleteDirectory( CurrentName );
  803.               Scrollbox1.TheFWB.RemoveDirectory( CurrentName );
  804.             end;
  805.           end
  806.           else
  807.           begin
  808.             if MessageDlg( 'Delete file ' + CurrentName + '?', mtConfirmation ,
  809.              mbYesNoCancel , 0 ) = mrYes then
  810.             begin
  811.               Scrollbox1.TheFWB.DeleteTheFile( CurrentName );
  812.             end;
  813.           end;
  814.         end;
  815.       end;
  816.     end;
  817.     FileListBox1.Update;
  818.     exit;
  819.   end;
  820.   if TheIOManager.WasSHIFTPressed then
  821.   begin
  822.     BitBtn3Click( Source );
  823.     exit;
  824.   end;
  825.   with Source as TFileIconPanel do
  826.   begin
  827.     CurrentName := FTheName;
  828.     { If its a directory signal and do recursive delete }
  829.     if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  830.     begin
  831.       if MessageDlg( 'Delete Directory ' + CurrentName + '?' , mtConfirmation ,
  832.        mbYesNoCancel , 0 ) = mrYes then
  833.       begin
  834.         Scrollbox1.TheFWB.RecursivelyDeleteDirectory( CurrentName );
  835.         Scrollbox1.TheFWB.RemoveDirectory( CurrentName );
  836.       end;
  837.     end
  838.     else
  839.     begin
  840.       { Otherwise get confirmation message and if OKed delete file }
  841.       if MessageDlg( 'Delete file ' + CurrentName + '?', mtConfirmation ,
  842.        mbYesNoCancel , 0 ) = mrYes then
  843.       begin
  844.         Scrollbox1.TheFWB.DeleteTheFile( CurrentName );
  845.       end;
  846.     end;
  847.     { Refresh Display }
  848.     Scrollbox1.Update;
  849.   end;
  850. end;
  851.  
  852. { Delphi wrote this; use it to do drag and drop renames }
  853. procedure TCCFileMgrForm.BitBtn4DragDrop(Sender, Source: TObject; X,
  854.   Y: Integer);
  855. var WorkingDir ,
  856.     CurrentName : String;  { Holds work name}
  857.     Counter_1   : Integer;
  858. begin
  859.   { Make sure source is indeed a FileIconPanel }
  860.   if Source is TIconFileListbox then
  861.   begin
  862.     with Source as TIconFileListBox do
  863.     begin
  864.       GetDir( 0 , WorkingDir );
  865.       WorkingDir := ScrollBox1.TheFWB.ForceTrailingBackSlash( WorkingDir );
  866.       for Counter_1 := 1 to Items.Count do
  867.       begin
  868.         if Selected[ Counter_1 - 1 ] then
  869.         begin
  870.           CurrentName := WorkingDir + Items[ Counter_1 - 1 ];
  871.           { Otherwise set up the opendialog with filename and caption }
  872.           OpenDialog2.Filename := ExtractFilename( CurrentName );
  873.           { Use this to prevent error from changing directories }
  874.           OpenDialog2.Options := [ofNoChangeDir];
  875.           OpenDialog2.Title := 'Rename File';
  876.           { If not cancelled then do rename or signal error }
  877.           if OpenDialog2.Execute then
  878.           begin
  879.             Scrollbox1.TheFWB.RenameTheFile( CurrentName , OpenDialog2.Filename );
  880.           end;
  881.         end;
  882.       end;
  883.     end;
  884.     FileListBox1.Update;
  885.     exit;
  886.   end;
  887.   if TheIOManager.WasSHIFTPressed then
  888.   begin
  889.     BitBtn4Click( Source );
  890.     exit;
  891.   end;
  892.   with Source as TFileIconPanel do
  893.   begin
  894.     CurrentName := FTheName;
  895.     { If a directory signal error }
  896.     { Otherwise set up the opendialog with filename and caption }
  897.     OpenDialog2.Filename := ExtractFilename( CurrentName );
  898.     { Use this to prevent error from changing directories }
  899.     OpenDialog2.Options := [ofNoChangeDir];
  900.     OpenDialog2.Title := 'Rename File';
  901.     { If not cancelled then do rename or signal error }
  902.     if OpenDialog2.Execute then
  903.     begin
  904.       Scrollbox1.TheFWB.RenameTheFile( CurrentName , OpenDialog1.Filename );
  905.     end;
  906.     { Refresh the display }
  907.     ScrollBox1.Update;
  908.   end;
  909. end;
  910.  
  911. procedure TCCFileMgrForm.BitBtn10Click(Sender: TObject);
  912. var TheCCFMForm : TCCFileMgrForm;
  913. begin
  914.   TheCCFMForm := TCCFileMgrForm.Create( Application );
  915.   TheCCFMForm.Show;
  916. end;
  917.  
  918. procedure TCCFileMgrForm.FormDestroy(Sender: TObject);
  919. begin
  920.   { Release the IO Manager }
  921.   if assigned( TheIOManager) then
  922.   begin
  923.     TheIOManager.Free;
  924.     TheIOManager := nil;
  925.   end;
  926.   if Assigned( TheMouseManager ) then
  927.   begin
  928.     TheMouseManager.Free;
  929.     TheMouseManager := nil;
  930.   end;
  931. end;
  932.  
  933. procedure TCCFileMgrForm.FormKeyDown(Sender: TObject; var Key: Word;
  934.   Shift: TShiftState);
  935. var S_lock , N_Lock , C_lock : Boolean;
  936. begin
  937.   case Key of
  938.     VK_Capital : begin
  939.                    TheIOManager.ReadLocks( C_lock , N_Lock , S_Lock );
  940.                    C_Lock := not C_Lock;
  941.                    TheIOManager.SetLocks( C_Lock , N_Lock , S_Lock );
  942.                    Label2.Visible := C_Lock;
  943.                  end;
  944.     VK_End : begin
  945.                 ScrollBox1.VertScrollbar.Position :=
  946.                  ScrollBox1.VertScrollbar.Range;
  947.                 ScrollBox1.HorzScrollbar.Position :=
  948.                  ScrollBox1.HorzScrollBar.Range;
  949.              end;
  950.     VK_Home : begin
  951.                 ScrollBox1.VertScrollbar.Position := 0;
  952.                 ScrollBox1.HorzScrollbar.Position := 0;
  953.               end;
  954.     VK_Left : begin
  955.                 TheMouseManager.InitializeNormal;
  956.                 TheIOManager.WhichState := Shift;
  957.                 if TheIOManager.WasSHIFTPressed then
  958.                  TheMouseManager.MoveSmallJumpLeft else
  959.                   if TheIOManager.WasCTRLPressed then
  960.                    TheMouseManager.MoveLargeJumpLeft else
  961.                     TheMouseManager.MoveSinglePixelLeft;
  962.               end;
  963.     VK_Up : begin
  964.                 TheMouseManager.InitializeNormal;
  965.                 TheIOManager.WhichState := Shift;
  966.                 if TheIOManager.WasSHIFTPressed then
  967.                  TheMouseManager.MoveSmallJumpUP else
  968.                   if TheIOManager.WasCTRLPressed then
  969.                    TheMouseManager.MoveLargeJumpUp else
  970.                     TheMouseManager.MoveSinglePixelUp;
  971.               end;
  972.     VK_Right : begin
  973.                 TheMouseManager.InitializeNormal;
  974.                 TheIOManager.WhichState := Shift;
  975.                 if TheIOManager.WasSHIFTPressed then
  976.                  TheMouseManager.MoveSmallJumpRight else
  977.                   if TheIOManager.WasCTRLPressed then
  978.                    TheMouseManager.MoveLargeJumpRight else
  979.                     TheMouseManager.MoveSinglePixelRight;
  980.               end;
  981.     VK_Down : begin
  982.                 TheMouseManager.InitializeNormal;
  983.                 TheIOManager.WhichState := Shift;
  984.                 if TheIOManager.WasSHIFTPressed then
  985.                  TheMouseManager.MoveSmallJumpDown else
  986.                   if TheIOManager.WasCTRLPressed then
  987.                    TheMouseManager.MoveLargeJumpDown else
  988.                     TheMouseManager.MoveSinglePixelDown;
  989.               end;
  990.     VK_F1 : TheIOManager.OnF1Pressed( Sender , Key , Shift );
  991.     VK_F2 : TheIOManager.OnF2Pressed( Sender , Key , Shift );
  992.     VK_F3 : TheIOManager.OnF3Pressed( Sender , Key , Shift );
  993.     VK_F4 : TheIOManager.OnF4Pressed( Sender , Key , Shift );
  994.     VK_F5 : TheIOManager.OnF5Pressed( Sender , Key , Shift );
  995.     VK_F6 : TheIOManager.OnF6Pressed( Sender , Key , Shift );
  996.     VK_F7 : TheIOManager.OnF7Pressed( Sender , Key , Shift );
  997.     VK_F8 : TheIOManager.OnF8Pressed( Sender , Key , Shift );
  998.     VK_F9 : TheIOManager.OnF9Pressed( Sender , Key , Shift );
  999.     VK_F10 : TheIOManager.OnF10Pressed( Sender , Key , Shift );
  1000.     VK_F11 : TheIOManager.OnF11Pressed( Sender , Key , Shift );
  1001.     VK_F12 : TheIOManager.OnF12Pressed( Sender , Key , Shift );
  1002.     VK_Numlock : Begin
  1003.                    TheIOManager.ReadLocks( C_lock , N_Lock , S_Lock );
  1004.                    N_Lock := not N_Lock;
  1005.                    TheIOManager.SetLocks( C_Lock , N_Lock , S_Lock );
  1006.                    Label3.Visible := N_Lock;
  1007.                  end;
  1008.     VK_Scroll : Begin
  1009.                    TheIOManager.ReadLocks( C_lock , N_Lock , S_Lock );
  1010.                    S_Lock := not S_Lock;
  1011.                    TheIOManager.SetLocks( C_Lock , N_Lock , S_Lock );
  1012.                    Label4.Visible := S_Lock;
  1013.                 end;
  1014.   end;
  1015. end;
  1016.  
  1017. procedure TCCFileMgrForm.BitBtn9KeyDown(Sender: TObject; var Key: Word;
  1018.   Shift: TShiftState);
  1019. begin
  1020.   case Key of
  1021.     VK_CANCEL : begin
  1022.                   if MessageDlg( 'Control Break Pressed! Abort Search?',
  1023.                    mtConfirmation,mbYesNoCancel,0) = mrYes
  1024.                     then GlobalAbortFlag := true;
  1025.                 end;
  1026.   end;
  1027. end;
  1028.  
  1029. procedure TCCFileMgrForm.Label2Click(Sender: TObject);
  1030. var C_Lock , N_Lock , S_Lock : Boolean;
  1031. begin
  1032.   TheIOManager.ReadLocks( C_lock , N_Lock , S_Lock );
  1033.   C_Lock := not C_Lock;
  1034.   TheIOManager.SetLocks( C_Lock , N_Lock , S_Lock );
  1035.   Label2.Visible := C_Lock;
  1036. end;
  1037.  
  1038. procedure TCCFileMgrForm.Label3Click(Sender: TObject);
  1039. var C_Lock , N_Lock , S_Lock : Boolean;
  1040. begin
  1041.   TheIOManager.ReadLocks( C_lock , N_Lock , S_Lock );
  1042.   N_Lock := not N_Lock;
  1043.   TheIOManager.SetLocks( C_Lock , N_Lock , S_Lock );
  1044.   Label3.Visible := N_Lock;
  1045. end;
  1046.  
  1047. procedure TCCFileMgrForm.Label4Click(Sender: TObject);
  1048. var C_Lock , N_Lock , S_Lock : Boolean;
  1049. begin
  1050.   TheIOManager.ReadLocks( C_lock , N_Lock , S_Lock );
  1051.   S_Lock := not S_Lock;
  1052.   TheIOManager.SetLocks( C_Lock , N_Lock , S_Lock );
  1053.   Label4.Visible := S_Lock;
  1054. end;
  1055.  
  1056. procedure TCCFileMgrForm.Panel2MouseMove(Sender: TObject;
  1057.   Shift: TShiftState; X, Y: Integer);
  1058. var ThePoint, TheOtherPoint : TPoint;
  1059. begin
  1060.   if IconDragging then
  1061.   begin
  1062.     ThePoint.X := X + Panel2.Left;
  1063.     ThePoint.Y := Y + Panel2.Top;
  1064.     TheOtherPoint := ClientToScreen( ThePoint );
  1065.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1066.     exit;
  1067.   end;
  1068.   if BitmapDragging then
  1069.   begin
  1070.     ThePoint.X := X + Panel2.Left;
  1071.     ThePoint.Y := Y + Panel2.Top;
  1072.     TheOtherPoint := ClientToScreen( ThePoint );
  1073.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1074.     exit;
  1075.   end;
  1076. end;
  1077.  
  1078. procedure TCCFileMgrForm.Panel1MouseMove(Sender: TObject;
  1079.   Shift: TShiftState; X, Y: Integer);
  1080. var ThePoint, TheOtherPoint : TPoint;
  1081. begin
  1082.   if IconDragging then
  1083.   begin
  1084.     ThePoint.X := X + Panel1.Left;
  1085.     ThePoint.Y := Y + Panel1.Top;
  1086.     TheOtherPoint := ClientToScreen( ThePoint );
  1087.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1088.     exit;
  1089.   end;
  1090.   if BitmapDragging then
  1091.   begin
  1092.     ThePoint.X := X + Panel1.Left;
  1093.     ThePoint.Y := Y + Panel1.Top;
  1094.     TheOtherPoint := ClientToScreen( ThePoint );
  1095.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1096.     exit;
  1097.   end;
  1098. end;
  1099.  
  1100. procedure TCCFileMgrForm.Panel4MouseMove(Sender: TObject;
  1101.   Shift: TShiftState; X, Y: Integer);
  1102. var ThePoint, TheOtherPoint : TPoint;
  1103. begin
  1104.   if IconDragging then
  1105.   begin
  1106.     ThePoint.X := X + Panel4.Left;
  1107.     ThePoint.Y := Y + Panel4.Top;
  1108.     TheOtherPoint := ClientToScreen( ThePoint );
  1109.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1110.     exit;
  1111.   end;
  1112.   if BitmapDragging then
  1113.   begin
  1114.     ThePoint.X := X + Panel4.Left;
  1115.     ThePoint.Y := Y + Panel4.Top;
  1116.     TheOtherPoint := ClientToScreen( ThePoint );
  1117.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1118.     exit;
  1119.   end;
  1120. end;
  1121.  
  1122. procedure TCCFileMgrForm.Panel3MouseMove(Sender: TObject;
  1123.   Shift: TShiftState; X, Y: Integer);
  1124. var ThePoint, TheOtherPoint : TPoint;
  1125. begin
  1126.   if IconDragging then
  1127.   begin
  1128.     ThePoint.X := X + Panel3.Left;
  1129.     ThePoint.Y := Y + Panel3.Top;
  1130.     TheOtherPoint := ClientToScreen( ThePoint );
  1131.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1132.     exit;
  1133.   end;
  1134.   if BitmapDragging then
  1135.   begin
  1136.     ThePoint.X := X + Panel3.Left;
  1137.     ThePoint.Y := Y + Panel3.Top;
  1138.     TheOtherPoint := ClientToScreen( ThePoint );
  1139.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1140.     exit;
  1141.   end;
  1142. end;
  1143.  
  1144. procedure TCCFileMgrForm.BitBtn1MouseMove(Sender: TObject;
  1145.   Shift: TShiftState; X, Y: Integer);
  1146. var ThePoint, TheOtherPoint : TPoint;
  1147. begin
  1148.   if IconDragging then
  1149.   begin
  1150.     ThePoint.X := X + Panel2.Left + BitBtn1.Left;
  1151.     ThePoint.Y := Y + Panel2.Top + BitBtn1.Top;
  1152.     TheOtherPoint := ClientToScreen( ThePoint );
  1153.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1154.     exit;
  1155.   end;
  1156.   if BitmapDragging then
  1157.   begin
  1158.     ThePoint.X := X + Panel2.Left + BitBtn1.Left;
  1159.     ThePoint.Y := Y + Panel2.Top + BitBtn1.Top;
  1160.     TheOtherPoint := ClientToScreen( ThePoint );
  1161.     TheMouseManager.MovebitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1162.     exit;
  1163.   end;
  1164. end;
  1165.  
  1166. procedure TCCFileMgrForm.BitBtn2MouseMove(Sender: TObject;
  1167.   Shift: TShiftState; X, Y: Integer);
  1168. var ThePoint, TheOtherPoint : TPoint;
  1169. begin
  1170.   if IconDragging then
  1171.   begin
  1172.     ThePoint.X := X + Panel2.Left + BitBtn2.Left;
  1173.     ThePoint.Y := Y + Panel2.Top + BitBtn2.Top;
  1174.     TheOtherPoint := ClientToScreen( ThePoint );
  1175.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1176.     exit;
  1177.   end;
  1178.   if BitmapDragging then
  1179.   begin
  1180.     ThePoint.X := X + Panel2.Left + BitBtn2.Left;
  1181.     ThePoint.Y := Y + Panel2.Top + BitBtn2.Top;
  1182.     TheOtherPoint := ClientToScreen( ThePoint );
  1183.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1184.     exit;
  1185.   end;
  1186. end;
  1187.  
  1188. procedure TCCFileMgrForm.BitBtn3MouseMove(Sender: TObject;
  1189.   Shift: TShiftState; X, Y: Integer);
  1190. var ThePoint, TheOtherPoint : TPoint;
  1191. begin
  1192.   if IconDragging then
  1193.   begin
  1194.     ThePoint.X := X + Panel2.Left + BitBtn3.Left;
  1195.     ThePoint.Y := Y + Panel2.Top + BitBtn3.Top;
  1196.     TheOtherPoint := ClientToScreen( ThePoint );
  1197.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1198.     exit;
  1199.   end;
  1200.   if BitmapDragging then
  1201.   begin
  1202.     ThePoint.X := X + Panel2.Left + BitBtn3.Left;
  1203.     ThePoint.Y := Y + Panel2.Top + BitBtn3.Top;
  1204.     TheOtherPoint := ClientToScreen( ThePoint );
  1205.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1206.     exit;
  1207.   end;
  1208. end;
  1209.  
  1210. procedure TCCFileMgrForm.BitBtn4MouseMove(Sender: TObject;
  1211.   Shift: TShiftState; X, Y: Integer);
  1212. var ThePoint, TheOtherPoint : TPoint;
  1213. begin
  1214.   if IconDragging then
  1215.   begin
  1216.     ThePoint.X := X + Panel2.Left + BitBtn4.Left;
  1217.     ThePoint.Y := Y + Panel2.Top + BitBtn4.Top;
  1218.     TheOtherPoint := ClientToScreen( ThePoint );
  1219.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1220.     exit;
  1221.   end;
  1222.   if BitmapDragging then
  1223.   begin
  1224.     ThePoint.X := X + Panel2.Left + BitBtn4.Left;
  1225.     ThePoint.Y := Y + Panel2.Top + BitBtn4.Top;
  1226.     TheOtherPoint := ClientToScreen( ThePoint );
  1227.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1228.     exit;
  1229.   end;
  1230. end;
  1231.  
  1232. procedure TCCFileMgrForm.BitBtn5MouseMove(Sender: TObject;
  1233.   Shift: TShiftState; X, Y: Integer);
  1234. var ThePoint, TheOtherPoint : TPoint;
  1235. begin
  1236.   if IconDragging then
  1237.   begin
  1238.     ThePoint.X := X + Panel2.Left + BitBtn5.Left;
  1239.     ThePoint.Y := Y + Panel2.Top + BitBtn5.Top;
  1240.     TheOtherPoint := ClientToScreen( ThePoint );
  1241.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1242.     exit;
  1243.   end;
  1244.   if BitmapDragging then
  1245.   begin
  1246.     ThePoint.X := X + Panel2.Left + BitBtn5.Left;
  1247.     ThePoint.Y := Y + Panel2.Top + BitBtn5.Top;
  1248.     TheOtherPoint := ClientToScreen( ThePoint );
  1249.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1250.     exit;
  1251.   end;
  1252. end;
  1253.  
  1254. procedure TCCFileMgrForm.BitBtn8MouseMove(Sender: TObject;
  1255.   Shift: TShiftState; X, Y: Integer);
  1256. var ThePoint, TheOtherPoint : TPoint;
  1257. begin
  1258.   if IconDragging then
  1259.   begin
  1260.     ThePoint.X := X + Panel2.Left + BitBtn8.Left;
  1261.     ThePoint.Y := Y + Panel2.Top + BitBtn8.Top;
  1262.     TheOtherPoint := ClientToScreen( ThePoint );
  1263.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1264.     exit;
  1265.   end;
  1266.   if BitmapDragging then
  1267.   begin
  1268.     ThePoint.X := X + Panel2.Left + BitBtn8.Left;
  1269.     ThePoint.Y := Y + Panel2.Top + BitBtn8.Top;
  1270.     TheOtherPoint := ClientToScreen( ThePoint );
  1271.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1272.     exit;
  1273.   end;
  1274. end;
  1275.  
  1276. procedure TCCFileMgrForm.BitBtn9MouseMove(Sender: TObject;
  1277.   Shift: TShiftState; X, Y: Integer);
  1278. var ThePoint, TheOtherPoint : TPoint;
  1279. begin
  1280.   if IconDragging then
  1281.   begin
  1282.     ThePoint.X := X + Panel2.Left + BitBtn9.Left;
  1283.     ThePoint.Y := Y + Panel2.Top + BitBtn9.Top;
  1284.     TheOtherPoint := ClientToScreen( ThePoint );
  1285.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1286.     exit;
  1287.   end;
  1288.   if BitmapDragging then
  1289.   begin
  1290.     ThePoint.X := X + Panel2.Left + BitBtn9.Left;
  1291.     ThePoint.Y := Y + Panel2.Top + BitBtn9.Top;
  1292.     TheOtherPoint := ClientToScreen( ThePoint );
  1293.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1294.     exit;
  1295.   end;
  1296. end;
  1297.  
  1298. procedure TCCFileMgrForm.BitBtn6MouseMove(Sender: TObject;
  1299.   Shift: TShiftState; X, Y: Integer);
  1300. var ThePoint, TheOtherPoint : TPoint;
  1301. begin
  1302.   if IconDragging then
  1303.   begin
  1304.     ThePoint.X := X + Panel2.Left + BitBtn6.Left;
  1305.     ThePoint.Y := Y + Panel2.Top + BitBtn6.Top;
  1306.     TheOtherPoint := ClientToScreen( ThePoint );
  1307.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1308.     exit;
  1309.   end;
  1310.   if BitmapDragging then
  1311.   begin
  1312.     ThePoint.X := X + Panel2.Left + BitBtn6.Left;
  1313.     ThePoint.Y := Y + Panel2.Top + BitBtn6.Top;
  1314.     TheOtherPoint := ClientToScreen( ThePoint );
  1315.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1316.     exit;
  1317.   end;
  1318. end;
  1319.  
  1320. procedure TCCFileMgrForm.BitBtn7MouseMove(Sender: TObject;
  1321.   Shift: TShiftState; X, Y: Integer);
  1322. var ThePoint, TheOtherPoint : TPoint;
  1323. begin
  1324.   if IconDragging then
  1325.   begin
  1326.     ThePoint.X := X + Panel2.Left + BitBtn7.Left;
  1327.     ThePoint.Y := Y + Panel2.Top + BitBtn7.Top;
  1328.     TheOtherPoint := ClientToScreen( ThePoint );
  1329.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1330.     exit;
  1331.   end;
  1332.   if BitmapDragging then
  1333.   begin
  1334.     ThePoint.X := X + Panel2.Left + BitBtn7.Left;
  1335.     ThePoint.Y := Y + Panel2.Top + BitBtn7.Top;
  1336.     TheOtherPoint := ClientToScreen( ThePoint );
  1337.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1338.     exit;
  1339.   end;
  1340. end;
  1341.  
  1342. procedure TCCFileMgrForm.BitBtn10MouseMove(Sender: TObject;
  1343.   Shift: TShiftState; X, Y: Integer);
  1344. var ThePoint, TheOtherPoint : TPoint;
  1345. begin
  1346.   if IconDragging then
  1347.   begin
  1348.     ThePoint.X := X + Panel2.Left + BitBtn10.Left;
  1349.     ThePoint.Y := Y + Panel2.Top + BitBtn10.Top;
  1350.     TheOtherPoint := ClientToScreen( ThePoint );
  1351.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1352.     exit;
  1353.   end;
  1354.   if BitmapDragging then
  1355.   begin
  1356.     ThePoint.X := X + Panel2.Left + BitBtn10.Left;
  1357.     ThePoint.Y := Y + Panel2.Top + BitBtn10.Top;
  1358.     TheOtherPoint := ClientToScreen( ThePoint );
  1359.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1360.     exit;
  1361.   end;
  1362. end;
  1363.  
  1364. procedure TCCFileMgrForm.Panel5MouseMove(Sender: TObject;
  1365.   Shift: TShiftState; X, Y: Integer);
  1366. var ThePoint, TheOtherPoint : TPoint;
  1367. begin
  1368.   if IconDragging then
  1369.   begin
  1370.     ThePoint.X := X + Panel4.Left + Panel5.Left;
  1371.     ThePoint.Y := Y + Panel4.Top + Panel5.Top;
  1372.     TheOtherPoint := ClientToScreen( ThePoint );
  1373.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1374.     exit;
  1375.   end;
  1376.   if BitmapDragging then
  1377.   begin
  1378.     ThePoint.X := X + Panel4.Left + Panel5.Left;
  1379.     ThePoint.Y := Y + Panel4.Top + Panel5.Top;
  1380.     TheOtherPoint := ClientToScreen( ThePoint );
  1381.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1382.     exit;
  1383.   end;
  1384. end;
  1385.  
  1386. procedure TCCFileMgrForm.Panel6MouseMove(Sender: TObject;
  1387.   Shift: TShiftState; X, Y: Integer);
  1388. var ThePoint, TheOtherPoint : TPoint;
  1389. begin
  1390.   if IconDragging then
  1391.   begin
  1392.     ThePoint.X := X + Panel4.Left + Panel6.Left;
  1393.     ThePoint.Y := Y + Panel4.Top + Panel6.Top;
  1394.     TheOtherPoint := ClientToScreen( ThePoint );
  1395.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1396.     exit;
  1397.   end;
  1398.   if BitmapDragging then
  1399.   begin
  1400.     ThePoint.X := X + Panel4.Left + Panel6.Left;
  1401.     ThePoint.Y := Y + Panel4.Top + Panel6.Top;
  1402.     TheOtherPoint := ClientToScreen( ThePoint );
  1403.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1404.     exit;
  1405.   end;
  1406. end;
  1407.  
  1408. procedure TCCFileMgrForm.Panel7MouseMove(Sender: TObject;
  1409.   Shift: TShiftState; X, Y: Integer);
  1410. var ThePoint, TheOtherPoint : TPoint;
  1411. begin
  1412.   if IconDragging then
  1413.   begin
  1414.     ThePoint.X := X + Panel4.Left + Panel7.Left;
  1415.     ThePoint.Y := Y + Panel4.Top + Panel7.Top;
  1416.     TheOtherPoint := ClientToScreen( ThePoint );
  1417.     TheMouseManager.MoveIconCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1418.     exit;
  1419.   end;
  1420.   if BitmapDragging then
  1421.   begin
  1422.     ThePoint.X := X + Panel4.Left + Panel7.Left;
  1423.     ThePoint.Y := Y + Panel4.Top + Panel7.Top;
  1424.     TheOtherPoint := ClientToScreen( ThePoint );
  1425.     TheMouseManager.MoveBitmapCursor( TheOtherPoint.X , TheOtherPoint.Y );
  1426.     exit;
  1427.   end;
  1428. end;
  1429.  
  1430. procedure TCCFileMgrForm.Panel1MouseUp(Sender: TObject;
  1431.   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  1432. begin
  1433.   if ( IconDragging or BitmapDragging ) then
  1434.   begin
  1435.     if IconDragging then TheMouseManager.EndIconCursor( X , Y );
  1436.     if BitmapDragging then TheMouseManager.EndBitmapCursor( X , Y );
  1437.     IconDragging := false;
  1438.     BitmapDragging := false;
  1439.     Invalidate;
  1440.   end;
  1441. end;
  1442.  
  1443. procedure TCCFileMgrForm.BitBtn1MouseUp(Sender: TObject;
  1444.   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  1445. var CurrentName ,                 { Holds work name}
  1446.     WorkingDir ,
  1447.     TheOldString : String;        { Holds Dir      }
  1448.     TargetDir    : String;        { target of op   }
  1449.     TheResult    : Integer;       { Modal res hold }
  1450.     Counter_1    : Integer;
  1451. begin
  1452.   If ( IconDragging  or BitmapDragging )then
  1453.   begin
  1454.     if IconDragging then TheMouseManager.EndIconCursor( X , Y );
  1455.     if BitmapDragging then TheMouseManager.EndBitmapCursor( X , Y );
  1456.     IconDragging := false;
  1457.     BitmapDragging := false;
  1458.     with GlobalSource as TFileIconPanel do
  1459.     begin
  1460.       { Get current directory and save it for later }
  1461.       GetDir( 0 , TheOldString );
  1462.       { Display the Windows-based directory input form }
  1463.       TheResult := DestDDForm.ShowModal;
  1464.       { If not cancelled do the copy }
  1465.       if TheResult = mrOK then
  1466.       begin
  1467.         CurrentName := FTheName;
  1468.         { Get the target directory with \ OK }
  1469.         TargetDir := DestDDForm.GetTargetDirectory;
  1470.         { If a directory signal and do recursive operation }
  1471.         if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  1472.         begin
  1473.           if MessageDlg( 'Copy Directory ' + CurrentName + ' to ' + TargetDir
  1474.            +'?', mtConfirmation , mbYesNoCancel , 0 ) = mryes then
  1475.           begin
  1476.             ScrollBox1.TheFWB.RecursivelyCopyDirectory( CurrentName ,
  1477.              TargetDir );
  1478.           end;
  1479.         end
  1480.         else
  1481.         begin
  1482.           { Do the copy }
  1483.           Scrollbox1.TheFWB.CopyTheFile( CurrentName , TargetDir );
  1484.         end;
  1485.         { Reset to the original directory }
  1486.         ChDir( TheOldString );
  1487.       end
  1488.       else Invalidate;
  1489.     end;
  1490.   end;
  1491. end;
  1492.  
  1493. procedure TCCFileMgrForm.BitBtn2MouseUp(Sender: TObject;
  1494.   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  1495. var CurrentName ,                 { Holds work name}
  1496.     WorkingDir ,
  1497.     TheOldString : String;        { Holds Dir      }
  1498.     TargetDir    : String;        { target of op   }
  1499.     TheResult       : Integer;    { Modal res hold }
  1500.     Counter_1   : Integer;
  1501. begin
  1502.   If ( IconDragging  or BitmapDragging )then
  1503.   begin
  1504.     if IconDragging then TheMouseManager.EndIconCursor( X , Y );
  1505.     if BitmapDragging then TheMouseManager.EndBitmapCursor( X , Y );
  1506.     IconDragging := false;
  1507.     BitmapDragging := false;
  1508.     with GlobalSource as TFileIconPanel do
  1509.     begin
  1510.       { Get current directory and save it for later }
  1511.       GetDir( 0 , TheOldString );
  1512.       { Display the Windows-based directory input form }
  1513.       TheResult := DestDDForm.ShowModal;
  1514.       { If not cancelled do the copy }
  1515.       if TheResult = mrOK then
  1516.       begin
  1517.         { Get the target directory with \ OK }
  1518.         TargetDir := DestDDForm.GetTargetDirectory;
  1519.         { If Copyfile returns false an error occurred }
  1520.         CurrentName := FTheName;
  1521.         { If a directory signal and do recursion }
  1522.         if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  1523.         begin
  1524.           if MessageDlg( 'Move Directory ' + CurrentName + ' to ' + TargetDir +
  1525.            '?' , mtConfirmation , mbYesNoCancel , 0 ) = mrYes then
  1526.             ScrollBox1.TheFWB.RecursivelyMoveDirectory( CurrentName ,
  1527.              TargetDir );
  1528.         end
  1529.         else
  1530.         begin  { Do the move }
  1531.           Scrollbox1.TheFWB.MoveTheFile( CurrentName , TargetDir );
  1532.           ChDir( TheOldString );
  1533.         end;
  1534.         { Refresh display }
  1535.         ScrollBox1.Update;
  1536.       end
  1537.       else Invalidate;
  1538.     end;
  1539.   end;
  1540. end;
  1541.  
  1542. procedure TCCFileMgrForm.BitBtn3MouseUp(Sender: TObject;
  1543.   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  1544. var WorkingDir ,
  1545.     CurrentName : String;  { Holds work name}
  1546.     Counter_1   : Integer;
  1547. begin
  1548.   If ( IconDragging  or BitmapDragging )then
  1549.   begin
  1550.     if IconDragging then TheMouseManager.EndIconCursor( X , Y );
  1551.     if BitmapDragging then TheMouseManager.EndBitmapCursor( X , Y );
  1552.     IconDragging := false;
  1553.     BitmapDragging := false;
  1554.     with GLobalSource as TFileIconPanel do
  1555.     begin
  1556.       CurrentName := FTheName;
  1557.       { If its a directory signal and do recursive delete }
  1558.       if (( FileGetAttr( CurrentName ) and faDirectory ) = faDirectory ) then
  1559.       begin
  1560.         if MessageDlg( 'Delete Directory ' + CurrentName + '?' , mtConfirmation ,
  1561.          mbYesNoCancel , 0 ) = mrYes then
  1562.         begin
  1563.           Scrollbox1.TheFWB.RecursivelyDeleteDirectory( CurrentName );
  1564.           Scrollbox1.TheFWB.RemoveDirectory( CurrentName );
  1565.         end
  1566.         else Invalidate;
  1567.       end
  1568.       else
  1569.       begin
  1570.         { Otherwise get confirmation message and if OKed delete file }
  1571.         if MessageDlg( 'Delete file ' + CurrentName + '?', mtConfirmation ,
  1572.          mbYesNoCancel , 0 ) = mrYes then
  1573.         begin
  1574.           Scrollbox1.TheFWB.DeleteTheFile( CurrentName );
  1575.         end
  1576.         else Invalidate;
  1577.       end;
  1578.       { Refresh Display }
  1579.       Scrollbox1.Update;
  1580.     end;
  1581.   end;
  1582. end;
  1583.  
  1584. procedure TCCFileMgrForm.BitBtn4MouseUp(Sender: TObject;
  1585.   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  1586. var WorkingDir ,
  1587.     CurrentName : String;  { Holds work name}
  1588.     Counter_1   : Integer;
  1589. begin
  1590.   If ( IconDragging  or BitmapDragging )then
  1591.   begin
  1592.     if IconDragging then TheMouseManager.EndIconCursor( X , Y );
  1593.     if BitmapDragging then TheMouseManager.EndBitmapCursor( X , Y );
  1594.     IconDragging := false;
  1595.     BitmapDragging := false;
  1596.     with GlobalSource as TFileIconPanel do
  1597.     begin
  1598.       CurrentName := FTheName;
  1599.       { If a directory signal error }
  1600.       { Otherwise set up the opendialog with filename and caption }
  1601.       OpenDialog2.Filename := ExtractFilename( CurrentName );
  1602.       { Use this to prevent error from changing directories }
  1603.       OpenDialog2.Options := [ofNoChangeDir];
  1604.       OpenDialog2.Title := 'Rename File';
  1605.       { If not cancelled then do rename or signal error }
  1606.       if OpenDialog2.Execute then
  1607.       begin
  1608.         Scrollbox1.TheFWB.RenameTheFile( CurrentName , OpenDialog2.Filename );
  1609.       end
  1610.       else Invalidate;
  1611.       { Refresh the display }
  1612.       ScrollBox1.Update;
  1613.     end;
  1614.   end;
  1615. end;
  1616.  
  1617. procedure TCCFileMgrForm.BitBtn11Click(Sender: TObject);
  1618. begin
  1619.   CCPrintForm.ShowModal;
  1620. end;
  1621.  
  1622. procedure TCCFileMgrForm.Shape1MouseUp(Sender: TObject;
  1623.   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  1624. begin
  1625.   ColorDialog1.Color := GlobalTransparentColor;
  1626.   if ColorDialog1.Execute then
  1627.   begin
  1628.     Shape1.Brush.Color := ColorDialog1.Color;
  1629.     GlobalTransparentColor := Shape1.Brush.Color;
  1630.     InvalidateRect( Self.Handle, nil , true );
  1631.   end;
  1632. end;
  1633.  
  1634. end.
  1635.