home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / FILECTRL.HPP < prev    next >
C/C++ Source or Header  |  1997-02-14  |  15KB  |  421 lines

  1. //----------------------------------------------------------------------------
  2. // FileCtrl.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: FileCtrl.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef FileCtrlHPP
  6. #define FileCtrlHPP
  7. //----------------------------------------------------------------------------
  8. #include <Buttons.hpp>
  9. #include <StdCtrls.hpp>
  10. #include <Menus.hpp>
  11. #include <Forms.hpp>
  12. #include <Graphics.hpp>
  13. #include <Controls.hpp>
  14. #include <Classes.hpp>
  15. #include <SysUtils.hpp>
  16. #include <Messages.hpp>
  17. #include <Windows.hpp>
  18. #include <System.hpp>
  19. #pragma warn -par
  20. #pragma warn -hid 
  21. #pragma warn -inl
  22.  
  23. namespace Filectrl
  24. {
  25. //-- type declarations -------------------------------------------------------
  26. enum TFileAttr { ftReadOnly, ftHidden, ftSystem, ftVolumeID, ftDirectory, ftArchive, ftNormal };
  27.  
  28. typedef Set<TFileAttr, ftReadOnly, ftNormal>  TFileType;
  29.  
  30. enum TDriveType { dtUnknown, dtNoDrive, dtFloppy, dtFixed, dtNetwork, dtCDROM, dtRAM };
  31.  
  32. class __declspec(delphiclass) TFileListBox;
  33. class __declspec(delphiclass) TDirectoryListBox;
  34. class __declspec(delphiclass) TDriveComboBox;
  35. enum TTextCase { tcLowerCase, tcUpperCase };
  36.  
  37. class __declspec(pascalimplementation) TDriveComboBox : public Stdctrls::TCustomComboBox
  38. {
  39.     typedef Stdctrls::TCustomComboBox inherited;
  40.     
  41. private:
  42.     TDirectoryListBox* FDirList;
  43.     char FDrive;
  44.     TTextCase FTextCase;
  45.     void __fastcall SetDirListBox(TDirectoryListBox* Value);
  46.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  47.     void __fastcall SetDrive(char NewDrive);
  48.     void __fastcall SetTextCase(TTextCase NewTextCase);
  49.     void __fastcall ReadBitmaps(void);
  50.     void __fastcall ResetItemHeight(void);
  51.     
  52. protected:
  53.     Graphics::TBitmap* FloppyBMP;
  54.     Graphics::TBitmap* FixedBMP;
  55.     Graphics::TBitmap* NetworkBMP;
  56.     Graphics::TBitmap* CDROMBMP;
  57.     Graphics::TBitmap* RAMBMP;
  58.     Classes::TNotifyEvent FOnChange;
  59.     virtual void __fastcall CreateWnd(void);
  60.     virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
  61.         );
  62.     virtual void __fastcall Click(void);
  63.     virtual void __fastcall BuildList(void);
  64.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  65.         );
  66.     HIDESBASE virtual void __fastcall Change(void);
  67.     
  68. public:
  69.     __fastcall virtual TDriveComboBox(Classes::TComponent* AOwner);
  70.     __fastcall virtual ~TDriveComboBox(void);
  71.     __property Text ;
  72.     __property char Drive = {read=FDrive, write=SetDrive, nodefault};
  73.     
  74. __published:
  75.     __property Color ;
  76.     __property Ctl3D ;
  77.     __property TDirectoryListBox* DirList = {read=FDirList, write=SetDirListBox, nodefault};
  78.     __property DragMode ;
  79.     __property DragCursor ;
  80.     __property Enabled ;
  81.     __property Font ;
  82.     __property ImeMode ;
  83.     __property ImeName ;
  84.     __property ParentColor ;
  85.     __property ParentCtl3D ;
  86.     __property ParentFont ;
  87.     __property ParentShowHint ;
  88.     __property PopupMenu ;
  89.     __property ShowHint ;
  90.     __property TabOrder ;
  91.     __property TabStop ;
  92.     __property TTextCase TextCase = {read=FTextCase, write=SetTextCase, default=0};
  93.     __property Visible ;
  94.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  95.     __property OnClick ;
  96.     __property OnDblClick ;
  97.     __property OnDragDrop ;
  98.     __property OnDragOver ;
  99.     __property OnDropDown ;
  100.     __property OnEndDrag ;
  101.     __property OnEnter ;
  102.     __property OnExit ;
  103.     __property OnKeyDown ;
  104.     __property OnKeyPress ;
  105.     __property OnKeyUp ;
  106.     __property OnStartDrag ;
  107. public:
  108.     /* TWinControl.CreateParented */ __fastcall TDriveComboBox(HWND ParentWindow) : Stdctrls::TCustomComboBox(
  109.         ParentWindow) { }
  110.     
  111. };
  112.  
  113. class __declspec(delphiclass) TFolderBitmap;
  114. class __declspec(pascalimplementation) TFolderBitmap : public Graphics::TBitmap
  115. {
  116.     typedef Graphics::TBitmap inherited;
  117.     
  118. public:
  119.     __fastcall TFolderBitmap(void);
  120. public:
  121.     /* TBitmap.Destroy */ __fastcall virtual ~TFolderBitmap(void) { }
  122.     
  123. };
  124.  
  125. class __declspec(pascalimplementation) TDirectoryListBox : public Stdctrls::TCustomListBox
  126. {
  127.     typedef Stdctrls::TCustomListBox inherited;
  128.     
  129. private:
  130.     TFileListBox* FFileList;
  131.     TDriveComboBox* FDriveCombo;
  132.     Stdctrls::TLabel* FDirLabel;
  133.     bool FInSetDir;
  134.     bool FPreserveCase;
  135.     bool FCaseSensitive;
  136.     char __fastcall GetDrive(void);
  137.     void __fastcall SetFileListBox(TFileListBox* Value);
  138.     void __fastcall SetDirLabel(Stdctrls::TLabel* Value);
  139.     void __fastcall SetDirLabelCaption(void);
  140.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  141.     void __fastcall SetDrive(char Value);
  142.     void __fastcall DriveChange(char NewDrive);
  143.     void __fastcall SetDir(const System::AnsiString NewDirectory);
  144.     virtual void __fastcall SetDirectory(const System::AnsiString NewDirectory);
  145.     void __fastcall ResetItemHeight(void);
  146.     
  147. protected:
  148.     TFolderBitmap* ClosedBMP;
  149.     TFolderBitmap* OpenedBMP;
  150.     TFolderBitmap* CurrentBMP;
  151.     System::AnsiString FDirectory;
  152.     Classes::TNotifyEvent FOnChange;
  153.     virtual void __fastcall Change(void);
  154.     virtual void __fastcall DblClick(void);
  155.     virtual void __fastcall ReadBitmaps(void);
  156.     virtual void __fastcall CreateWnd(void);
  157.     virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
  158.         );
  159.     int __fastcall ReadDirectoryNames(const System::AnsiString ParentDirectory, Classes::TStringList* DirectoryList
  160.         );
  161.     virtual void __fastcall BuildList(void);
  162.     virtual void __fastcall KeyPress(char &Key);
  163.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  164.         );
  165.     
  166. public:
  167.     __fastcall virtual TDirectoryListBox(Classes::TComponent* AOwner);
  168.     __fastcall virtual ~TDirectoryListBox(void);
  169.     System::AnsiString __fastcall DisplayCase(const System::AnsiString S);
  170.     int __fastcall FileCompareText(const System::AnsiString A, const System::AnsiString B);
  171.     System::AnsiString __fastcall GetItemPath(int Index);
  172.     void __fastcall OpenCurrent(void);
  173.     HIDESBASE void __fastcall Update(void);
  174.     __property char Drive = {read=GetDrive, write=SetDrive, nodefault};
  175.     __property System::AnsiString Directory = {read=FDirectory, write=SetDirectory, nodefault};
  176.     __property bool PreserveCase = {read=FPreserveCase, nodefault};
  177.     __property bool CaseSensitive = {read=FCaseSensitive, nodefault};
  178.     
  179. __published:
  180.     __property Align ;
  181.     __property Color ;
  182.     __property Columns ;
  183.     __property Ctl3D ;
  184.     __property Stdctrls::TLabel* DirLabel = {read=FDirLabel, write=SetDirLabel, nodefault};
  185.     __property DragCursor ;
  186.     __property DragMode ;
  187.     __property Enabled ;
  188.     __property TFileListBox* FileList = {read=FFileList, write=SetFileListBox, nodefault};
  189.     __property Font ;
  190.     __property ImeMode ;
  191.     __property ImeName ;
  192.     __property IntegralHeight ;
  193.     __property ItemHeight ;
  194.     __property ParentColor ;
  195.     __property ParentCtl3D ;
  196.     __property ParentFont ;
  197.     __property ParentShowHint ;
  198.     __property PopupMenu ;
  199.     __property ShowHint ;
  200.     __property TabOrder ;
  201.     __property TabStop ;
  202.     __property Visible ;
  203.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  204.     __property OnClick ;
  205.     __property OnDblClick ;
  206.     __property OnDragDrop ;
  207.     __property OnDragOver ;
  208.     __property OnEndDrag ;
  209.     __property OnEnter ;
  210.     __property OnExit ;
  211.     __property OnKeyDown ;
  212.     __property OnKeyPress ;
  213.     __property OnKeyUp ;
  214.     __property OnMouseDown ;
  215.     __property OnMouseMove ;
  216.     __property OnMouseUp ;
  217.     __property OnStartDrag ;
  218. public:
  219.     /* TWinControl.CreateParented */ __fastcall TDirectoryListBox(HWND ParentWindow) : Stdctrls::TCustomListBox(
  220.         ParentWindow) { }
  221.     
  222. };
  223.  
  224. class __declspec(delphiclass) TFilterComboBox;
  225. class __declspec(pascalimplementation) TFilterComboBox : public Stdctrls::TCustomComboBox
  226. {
  227.     typedef Stdctrls::TCustomComboBox inherited;
  228.     
  229. private:
  230.     System::AnsiString FFilter;
  231.     TFileListBox* FFileList;
  232.     Classes::TStringList* MaskList;
  233.     bool __fastcall IsFilterStored(void);
  234.     System::AnsiString __fastcall GetMask(void);
  235.     void __fastcall SetFilter(const System::AnsiString NewFilter);
  236.     void __fastcall SetFileListBox(TFileListBox* Value);
  237.     
  238. protected:
  239.     Classes::TNotifyEvent FOnChange;
  240.     virtual void __fastcall CreateWnd(void);
  241.     virtual void __fastcall Click(void);
  242.     void __fastcall BuildList(void);
  243.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  244.         );
  245.     HIDESBASE virtual void __fastcall Change(void);
  246.     
  247. public:
  248.     __fastcall virtual TFilterComboBox(Classes::TComponent* AOwner);
  249.     __fastcall virtual ~TFilterComboBox(void);
  250.     __property System::AnsiString Mask = {read=GetMask, nodefault};
  251.     __property Text ;
  252.     
  253. __published:
  254.     __property Color ;
  255.     __property Ctl3D ;
  256.     __property DragMode ;
  257.     __property DragCursor ;
  258.     __property Enabled ;
  259.     __property TFileListBox* FileList = {read=FFileList, write=SetFileListBox, nodefault};
  260.     __property System::AnsiString Filter = {read=FFilter, write=SetFilter, stored=IsFilterStored, nodefault
  261.         };
  262.     __property Font ;
  263.     __property ImeMode ;
  264.     __property ImeName ;
  265.     __property ParentColor ;
  266.     __property ParentCtl3D ;
  267.     __property ParentFont ;
  268.     __property ParentShowHint ;
  269.     __property PopupMenu ;
  270.     __property ShowHint ;
  271.     __property TabOrder ;
  272.     __property TabStop ;
  273.     __property Visible ;
  274.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  275.     __property OnClick ;
  276.     __property OnDblClick ;
  277.     __property OnDragDrop ;
  278.     __property OnDragOver ;
  279.     __property OnDropDown ;
  280.     __property OnEndDrag ;
  281.     __property OnEnter ;
  282.     __property OnExit ;
  283.     __property OnKeyDown ;
  284.     __property OnKeyPress ;
  285.     __property OnKeyUp ;
  286.     __property OnStartDrag ;
  287. public:
  288.     /* TWinControl.CreateParented */ __fastcall TFilterComboBox(HWND ParentWindow) : Stdctrls::TCustomComboBox(
  289.         ParentWindow) { }
  290.     
  291. };
  292.  
  293. class __declspec(pascalimplementation) TFileListBox : public Stdctrls::TCustomListBox
  294. {
  295.     typedef Stdctrls::TCustomListBox inherited;
  296.     
  297. private:
  298.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  299.     char __fastcall GetDrive(void);
  300.     System::AnsiString __fastcall GetFileName(void);
  301.     bool __fastcall IsMaskStored(void);
  302.     void __fastcall SetDrive(char Value);
  303.     void __fastcall SetFileEdit(Stdctrls::TEdit* Value);
  304.     void __fastcall SetDirectory(const System::AnsiString NewDirectory);
  305.     void __fastcall SetFileType(TFileType NewFileType);
  306.     void __fastcall SetMask(const System::AnsiString NewMask);
  307.     void __fastcall SetFileName(const System::AnsiString NewFile);
  308.     void __fastcall SetShowGlyphs(bool Value);
  309.     void __fastcall ResetItemHeight(void);
  310.     
  311. protected:
  312.     System::AnsiString FDirectory;
  313.     System::AnsiString FMask;
  314.     TFileType FFileType;
  315.     Stdctrls::TEdit* FFileEdit;
  316.     TDirectoryListBox* FDirList;
  317.     TFilterComboBox* FFilterCombo;
  318.     Graphics::TBitmap* ExeBMP;
  319.     Graphics::TBitmap* DirBMP;
  320.     Graphics::TBitmap* UnknownBMP;
  321.     Classes::TNotifyEvent FOnChange;
  322.     int FLastSel;
  323.     bool FShowGlyphs;
  324.     virtual void __fastcall CreateWnd(void);
  325.     virtual void __fastcall ReadBitmaps(void);
  326.     virtual void __fastcall Click(void);
  327.     virtual void __fastcall Change(void);
  328.     virtual void __fastcall ReadFileNames(void);
  329.     virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
  330.         );
  331.     virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  332.         );
  333.     virtual System::AnsiString __fastcall GetFilePath(void);
  334.     
  335. public:
  336.     __fastcall virtual TFileListBox(Classes::TComponent* AOwner);
  337.     __fastcall virtual ~TFileListBox(void);
  338.     HIDESBASE void __fastcall Update(void);
  339.     virtual void __fastcall ApplyFilePath(const System::AnsiString EditText);
  340.     __property char Drive = {read=GetDrive, write=SetDrive, nodefault};
  341.     __property System::AnsiString Directory = {read=FDirectory, write=ApplyFilePath, nodefault};
  342.     __property System::AnsiString FileName = {read=GetFilePath, write=ApplyFilePath, nodefault};
  343.     
  344. __published:
  345.     __property Align ;
  346.     __property Color ;
  347.     __property Ctl3D ;
  348.     __property DragCursor ;
  349.     __property DragMode ;
  350.     __property Enabled ;
  351.     __property ExtendedSelect ;
  352.     __property Stdctrls::TEdit* FileEdit = {read=FFileEdit, write=SetFileEdit, nodefault};
  353.     __property TFileType FileType = {read=FFileType, write=SetFileType, default=64};
  354.     __property Font ;
  355.     __property ImeMode ;
  356.     __property ImeName ;
  357.     __property IntegralHeight ;
  358.     __property ItemHeight ;
  359.     __property System::AnsiString Mask = {read=FMask, write=SetMask, stored=IsMaskStored, nodefault};
  360.     __property MultiSelect ;
  361.     __property ParentColor ;
  362.     __property ParentCtl3D ;
  363.     __property ParentFont ;
  364.     __property ParentShowHint ;
  365.     __property PopupMenu ;
  366.     __property bool ShowGlyphs = {read=FShowGlyphs, write=SetShowGlyphs, default=0};
  367.     __property ShowHint ;
  368.     __property TabOrder ;
  369.     __property TabStop ;
  370.     __property Visible ;
  371.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  372.     __property OnClick ;
  373.     __property OnDblClick ;
  374.     __property OnDragDrop ;
  375.     __property OnDragOver ;
  376.     __property OnEndDrag ;
  377.     __property OnEnter ;
  378.     __property OnExit ;
  379.     __property OnKeyDown ;
  380.     __property OnKeyPress ;
  381.     __property OnKeyUp ;
  382.     __property OnMouseDown ;
  383.     __property OnMouseMove ;
  384.     __property OnMouseUp ;
  385.     __property OnStartDrag ;
  386. public:
  387.     /* TWinControl.CreateParented */ __fastcall TFileListBox(HWND ParentWindow) : Stdctrls::TCustomListBox(
  388.         ParentWindow) { }
  389.     
  390. };
  391.  
  392. enum TSelectDirOpt { sdAllowCreate, sdPerformCreate, sdPrompt };
  393.  
  394. typedef Set<TSelectDirOpt, sdAllowCreate, sdPrompt>  TSelectDirOpts;
  395.  
  396. //-- var, const, procedure ---------------------------------------------------
  397. #define WNTYPE_DRIVE (Byte)(1)
  398. extern System::AnsiString __fastcall MinimizeName(const System::AnsiString Filename, Graphics::TCanvas* 
  399.     Canvas, int MaxLen);
  400. extern void __fastcall ProcessPath(const System::AnsiString EditText, char &Drive,  System::AnsiString &
  401.     DirPart,  System::AnsiString &FilePart);
  402. extern bool __fastcall SelectDirectory( System::AnsiString &Directory, TSelectDirOpts Options, long 
  403.     HelpCtx);
  404. extern bool __fastcall DirectoryExists(const System::AnsiString Name);
  405. extern void __fastcall ForceDirectories( System::AnsiString Dir);
  406. //-- template instantiations -------------------------------------------------
  407. template class TSelectDirOpts ;
  408. template class TFileType ;
  409.  
  410. }    /* namespace Filectrl */
  411.  
  412. #pragma warn .par
  413. #pragma warn .hid 
  414. #pragma warn .inl
  415.  
  416. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  417. using namespace Filectrl;
  418. #endif
  419. //-- end unit ----------------------------------------------------------------
  420. #endif    // FileCtrl
  421.