home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
FILECTRL.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
15KB
|
421 lines
//----------------------------------------------------------------------------
// FileCtrl.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
// From: FileCtrl.pas
//----------------------------------------------------------------------------
#ifndef FileCtrlHPP
#define FileCtrlHPP
//----------------------------------------------------------------------------
#include <Buttons.hpp>
#include <StdCtrls.hpp>
#include <Menus.hpp>
#include <Forms.hpp>
#include <Graphics.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Windows.hpp>
#include <System.hpp>
#pragma warn -par
#pragma warn -hid
#pragma warn -inl
namespace Filectrl
{
//-- type declarations -------------------------------------------------------
enum TFileAttr { ftReadOnly, ftHidden, ftSystem, ftVolumeID, ftDirectory, ftArchive, ftNormal };
typedef Set<TFileAttr, ftReadOnly, ftNormal> TFileType;
enum TDriveType { dtUnknown, dtNoDrive, dtFloppy, dtFixed, dtNetwork, dtCDROM, dtRAM };
class __declspec(delphiclass) TFileListBox;
class __declspec(delphiclass) TDirectoryListBox;
class __declspec(delphiclass) TDriveComboBox;
enum TTextCase { tcLowerCase, tcUpperCase };
class __declspec(pascalimplementation) TDriveComboBox : public Stdctrls::TCustomComboBox
{
typedef Stdctrls::TCustomComboBox inherited;
private:
TDirectoryListBox* FDirList;
char FDrive;
TTextCase FTextCase;
void __fastcall SetDirListBox(TDirectoryListBox* Value);
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
void __fastcall SetDrive(char NewDrive);
void __fastcall SetTextCase(TTextCase NewTextCase);
void __fastcall ReadBitmaps(void);
void __fastcall ResetItemHeight(void);
protected:
Graphics::TBitmap* FloppyBMP;
Graphics::TBitmap* FixedBMP;
Graphics::TBitmap* NetworkBMP;
Graphics::TBitmap* CDROMBMP;
Graphics::TBitmap* RAMBMP;
Classes::TNotifyEvent FOnChange;
virtual void __fastcall CreateWnd(void);
virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
);
virtual void __fastcall Click(void);
virtual void __fastcall BuildList(void);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
);
HIDESBASE virtual void __fastcall Change(void);
public:
__fastcall virtual TDriveComboBox(Classes::TComponent* AOwner);
__fastcall virtual ~TDriveComboBox(void);
__property Text ;
__property char Drive = {read=FDrive, write=SetDrive, nodefault};
__published:
__property Color ;
__property Ctl3D ;
__property TDirectoryListBox* DirList = {read=FDirList, write=SetDirListBox, nodefault};
__property DragMode ;
__property DragCursor ;
__property Enabled ;
__property Font ;
__property ImeMode ;
__property ImeName ;
__property ParentColor ;
__property ParentCtl3D ;
__property ParentFont ;
__property ParentShowHint ;
__property PopupMenu ;
__property ShowHint ;
__property TabOrder ;
__property TabStop ;
__property TTextCase TextCase = {read=FTextCase, write=SetTextCase, default=0};
__property Visible ;
__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
__property OnClick ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnDropDown ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnStartDrag ;
public:
/* TWinControl.CreateParented */ __fastcall TDriveComboBox(HWND ParentWindow) : Stdctrls::TCustomComboBox(
ParentWindow) { }
};
class __declspec(delphiclass) TFolderBitmap;
class __declspec(pascalimplementation) TFolderBitmap : public Graphics::TBitmap
{
typedef Graphics::TBitmap inherited;
public:
__fastcall TFolderBitmap(void);
public:
/* TBitmap.Destroy */ __fastcall virtual ~TFolderBitmap(void) { }
};
class __declspec(pascalimplementation) TDirectoryListBox : public Stdctrls::TCustomListBox
{
typedef Stdctrls::TCustomListBox inherited;
private:
TFileListBox* FFileList;
TDriveComboBox* FDriveCombo;
Stdctrls::TLabel* FDirLabel;
bool FInSetDir;
bool FPreserveCase;
bool FCaseSensitive;
char __fastcall GetDrive(void);
void __fastcall SetFileListBox(TFileListBox* Value);
void __fastcall SetDirLabel(Stdctrls::TLabel* Value);
void __fastcall SetDirLabelCaption(void);
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
void __fastcall SetDrive(char Value);
void __fastcall DriveChange(char NewDrive);
void __fastcall SetDir(const System::AnsiString NewDirectory);
virtual void __fastcall SetDirectory(const System::AnsiString NewDirectory);
void __fastcall ResetItemHeight(void);
protected:
TFolderBitmap* ClosedBMP;
TFolderBitmap* OpenedBMP;
TFolderBitmap* CurrentBMP;
System::AnsiString FDirectory;
Classes::TNotifyEvent FOnChange;
virtual void __fastcall Change(void);
virtual void __fastcall DblClick(void);
virtual void __fastcall ReadBitmaps(void);
virtual void __fastcall CreateWnd(void);
virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
);
int __fastcall ReadDirectoryNames(const System::AnsiString ParentDirectory, Classes::TStringList* DirectoryList
);
virtual void __fastcall BuildList(void);
virtual void __fastcall KeyPress(char &Key);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
);
public:
__fastcall virtual TDirectoryListBox(Classes::TComponent* AOwner);
__fastcall virtual ~TDirectoryListBox(void);
System::AnsiString __fastcall DisplayCase(const System::AnsiString S);
int __fastcall FileCompareText(const System::AnsiString A, const System::AnsiString B);
System::AnsiString __fastcall GetItemPath(int Index);
void __fastcall OpenCurrent(void);
HIDESBASE void __fastcall Update(void);
__property char Drive = {read=GetDrive, write=SetDrive, nodefault};
__property System::AnsiString Directory = {read=FDirectory, write=SetDirectory, nodefault};
__property bool PreserveCase = {read=FPreserveCase, nodefault};
__property bool CaseSensitive = {read=FCaseSensitive, nodefault};
__published:
__property Align ;
__property Color ;
__property Columns ;
__property Ctl3D ;
__property Stdctrls::TLabel* DirLabel = {read=FDirLabel, write=SetDirLabel, nodefault};
__property DragCursor ;
__property DragMode ;
__property Enabled ;
__property TFileListBox* FileList = {read=FFileList, write=SetFileListBox, nodefault};
__property Font ;
__property ImeMode ;
__property ImeName ;
__property IntegralHeight ;
__property ItemHeight ;
__property ParentColor ;
__property ParentCtl3D ;
__property ParentFont ;
__property ParentShowHint ;
__property PopupMenu ;
__property ShowHint ;
__property TabOrder ;
__property TabStop ;
__property Visible ;
__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
__property OnClick ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
__property OnStartDrag ;
public:
/* TWinControl.CreateParented */ __fastcall TDirectoryListBox(HWND ParentWindow) : Stdctrls::TCustomListBox(
ParentWindow) { }
};
class __declspec(delphiclass) TFilterComboBox;
class __declspec(pascalimplementation) TFilterComboBox : public Stdctrls::TCustomComboBox
{
typedef Stdctrls::TCustomComboBox inherited;
private:
System::AnsiString FFilter;
TFileListBox* FFileList;
Classes::TStringList* MaskList;
bool __fastcall IsFilterStored(void);
System::AnsiString __fastcall GetMask(void);
void __fastcall SetFilter(const System::AnsiString NewFilter);
void __fastcall SetFileListBox(TFileListBox* Value);
protected:
Classes::TNotifyEvent FOnChange;
virtual void __fastcall CreateWnd(void);
virtual void __fastcall Click(void);
void __fastcall BuildList(void);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
);
HIDESBASE virtual void __fastcall Change(void);
public:
__fastcall virtual TFilterComboBox(Classes::TComponent* AOwner);
__fastcall virtual ~TFilterComboBox(void);
__property System::AnsiString Mask = {read=GetMask, nodefault};
__property Text ;
__published:
__property Color ;
__property Ctl3D ;
__property DragMode ;
__property DragCursor ;
__property Enabled ;
__property TFileListBox* FileList = {read=FFileList, write=SetFileListBox, nodefault};
__property System::AnsiString Filter = {read=FFilter, write=SetFilter, stored=IsFilterStored, nodefault
};
__property Font ;
__property ImeMode ;
__property ImeName ;
__property ParentColor ;
__property ParentCtl3D ;
__property ParentFont ;
__property ParentShowHint ;
__property PopupMenu ;
__property ShowHint ;
__property TabOrder ;
__property TabStop ;
__property Visible ;
__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
__property OnClick ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnDropDown ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnStartDrag ;
public:
/* TWinControl.CreateParented */ __fastcall TFilterComboBox(HWND ParentWindow) : Stdctrls::TCustomComboBox(
ParentWindow) { }
};
class __declspec(pascalimplementation) TFileListBox : public Stdctrls::TCustomListBox
{
typedef Stdctrls::TCustomListBox inherited;
private:
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
char __fastcall GetDrive(void);
System::AnsiString __fastcall GetFileName(void);
bool __fastcall IsMaskStored(void);
void __fastcall SetDrive(char Value);
void __fastcall SetFileEdit(Stdctrls::TEdit* Value);
void __fastcall SetDirectory(const System::AnsiString NewDirectory);
void __fastcall SetFileType(TFileType NewFileType);
void __fastcall SetMask(const System::AnsiString NewMask);
void __fastcall SetFileName(const System::AnsiString NewFile);
void __fastcall SetShowGlyphs(bool Value);
void __fastcall ResetItemHeight(void);
protected:
System::AnsiString FDirectory;
System::AnsiString FMask;
TFileType FFileType;
Stdctrls::TEdit* FFileEdit;
TDirectoryListBox* FDirList;
TFilterComboBox* FFilterCombo;
Graphics::TBitmap* ExeBMP;
Graphics::TBitmap* DirBMP;
Graphics::TBitmap* UnknownBMP;
Classes::TNotifyEvent FOnChange;
int FLastSel;
bool FShowGlyphs;
virtual void __fastcall CreateWnd(void);
virtual void __fastcall ReadBitmaps(void);
virtual void __fastcall Click(void);
virtual void __fastcall Change(void);
virtual void __fastcall ReadFileNames(void);
virtual void __fastcall DrawItem(int Index, const Windows::TRect &Rect, Stdctrls::TOwnerDrawState State
);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
);
virtual System::AnsiString __fastcall GetFilePath(void);
public:
__fastcall virtual TFileListBox(Classes::TComponent* AOwner);
__fastcall virtual ~TFileListBox(void);
HIDESBASE void __fastcall Update(void);
virtual void __fastcall ApplyFilePath(const System::AnsiString EditText);
__property char Drive = {read=GetDrive, write=SetDrive, nodefault};
__property System::AnsiString Directory = {read=FDirectory, write=ApplyFilePath, nodefault};
__property System::AnsiString FileName = {read=GetFilePath, write=ApplyFilePath, nodefault};
__published:
__property Align ;
__property Color ;
__property Ctl3D ;
__property DragCursor ;
__property DragMode ;
__property Enabled ;
__property ExtendedSelect ;
__property Stdctrls::TEdit* FileEdit = {read=FFileEdit, write=SetFileEdit, nodefault};
__property TFileType FileType = {read=FFileType, write=SetFileType, default=64};
__property Font ;
__property ImeMode ;
__property ImeName ;
__property IntegralHeight ;
__property ItemHeight ;
__property System::AnsiString Mask = {read=FMask, write=SetMask, stored=IsMaskStored, nodefault};
__property MultiSelect ;
__property ParentColor ;
__property ParentCtl3D ;
__property ParentFont ;
__property ParentShowHint ;
__property PopupMenu ;
__property bool ShowGlyphs = {read=FShowGlyphs, write=SetShowGlyphs, default=0};
__property ShowHint ;
__property TabOrder ;
__property TabStop ;
__property Visible ;
__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
__property OnClick ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
__property OnStartDrag ;
public:
/* TWinControl.CreateParented */ __fastcall TFileListBox(HWND ParentWindow) : Stdctrls::TCustomListBox(
ParentWindow) { }
};
enum TSelectDirOpt { sdAllowCreate, sdPerformCreate, sdPrompt };
typedef Set<TSelectDirOpt, sdAllowCreate, sdPrompt> TSelectDirOpts;
//-- var, const, procedure ---------------------------------------------------
#define WNTYPE_DRIVE (Byte)(1)
extern System::AnsiString __fastcall MinimizeName(const System::AnsiString Filename, Graphics::TCanvas*
Canvas, int MaxLen);
extern void __fastcall ProcessPath(const System::AnsiString EditText, char &Drive, System::AnsiString &
DirPart, System::AnsiString &FilePart);
extern bool __fastcall SelectDirectory( System::AnsiString &Directory, TSelectDirOpts Options, long
HelpCtx);
extern bool __fastcall DirectoryExists(const System::AnsiString Name);
extern void __fastcall ForceDirectories( System::AnsiString Dir);
//-- template instantiations -------------------------------------------------
template class TSelectDirOpts ;
template class TFileType ;
} /* namespace Filectrl */
#pragma warn .par
#pragma warn .hid
#pragma warn .inl
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Filectrl;
#endif
//-- end unit ----------------------------------------------------------------
#endif // FileCtrl