home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1995 May / pcw-0595.bin / demos / databeck / wsounds / setup.dir / wswsrc.exe / SHOWRDLG.PAS < prev    next >
Pascal/Delphi Source File  |  1992-12-02  |  2KB  |  70 lines

  1. Unit ShowRDlg;
  2.  
  3. INTERFACE
  4. uses WinTypes, WinProcs, WinDos, WObjects, Strings, MMSystem,
  5.      DataObj, WaveIO;
  6.  
  7. const
  8.   dn_ShowRDlg = 'SHOWRDLG';
  9.  
  10.   id_SDir  = 1100;
  11.   id_File  = 1101;
  12.   id_Start = 1102;
  13.   id_VName = 1103;
  14.   id_FilN  = 1104;
  15.  
  16.  
  17. type
  18.   PShowRDlg = ^TShowRDlg;
  19.   TShowRDlg = object(TDialog)
  20.     CurrCollect : PWaveCollection;
  21.     CurrPath : DirStr;
  22.     State : Integer;
  23.     constructor Init(AParent: PWindowsObject;AName: PChar; ACollect : PWaveCollection; APName : DirStr; AState : Integer);
  24.     procedure SetupWindow; virtual;
  25.     Procedure HandleStartScan(VAR Msg : TMessage);virtual id_First + id_Start;
  26.   end;
  27.  
  28. implementation
  29.  
  30. constructor TShowRDlg.Init(AParent: PWindowsObject;
  31.   AName: PChar; ACollect : PWaveCollection; APName : DirStr; AState : Integer);
  32. begin
  33.   TDialog.Init(AParent, AName);
  34.   CurrCollect := ACollect;
  35.   CurrPath := APName;
  36.   State := AState;
  37. end;
  38.  
  39. procedure TShowRDlg.SetupWindow;
  40. VAR
  41.    ACount : Word;
  42.    Out    : Array [0..6] of char;
  43.    Msg : TMessage;
  44. begin
  45.   TDialog.SetupWindow;
  46. {
  47.   SetDlgItemText(HWindow, id_SDir, CurrPath);
  48.   SetDlgItemText(HWindow, id_File, '*.WAV');
  49. }
  50.   TWindowsObject.Show(sw_Show);
  51.   HandleStartScan(Msg);
  52. end;
  53.  
  54. Procedure TShowRDlg.HandleStartScan(VAR Msg : TMessage);
  55. BEGIN
  56.    SetDlgItemText(HWindow, id_VName, 'Directory   :');
  57.    SetDlgItemText(HWindow, id_FilN, 'File  :');
  58.    Case State of
  59.    0 : BEGIN
  60.         WD_ReadOneDir(HWindow, CurrPath,0,CurrCollect);
  61.         END;
  62.    1 : BEGIN
  63.         WD_ReadRecDir(HWindow, CurrPath,0,CurrCollect);
  64.         END;
  65.    END;
  66.    OK(Msg);
  67.    end;
  68. BEGIN
  69.    END.
  70.