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

  1. //---------------------------------------------------------------------------
  2. // Borland C++Builder
  3. // Copyright (c) 1987, 1997 Borland International Inc.  All Rights Reserved.
  4. //---------------------------------------------------------------------------
  5. #ifndef diroutlnH
  6. #define diroutlnH
  7. //---------------------------------------------------------------------------
  8. #include <vcl\sysutils.hpp>
  9. #include <vcl\controls.hpp>
  10. #include <vcl\classes.hpp>
  11. #include <vcl\forms.hpp>
  12. #include <vcl\Outline.hpp>
  13. #include <vcl\Grids.hpp>
  14. //---------------------------------------------------------------------------
  15.  
  16. namespace Diroutln {
  17. enum TTextCase { tcLowerCase, tcUpperCase, tcAsIs };
  18.  
  19. class TDirectoryOutline : public TCustomOutline
  20. {
  21. private:
  22.     typedef AnsiString (__fastcall *TCaseFunction)(const AnsiString AString);
  23.     static int __fastcall DriveToInt(char);
  24.     static char __fastcall IntToDrive(int);
  25.     long __fastcall GetChildNamed(const AnsiString& Name, long Item);
  26.     
  27.     static const InvalidIndex = -1;
  28.     static const RootIndex = 1;
  29.     static void* APointer;
  30.  
  31.     char FDrive;
  32.     TFileName FDirectory;
  33.     TNotifyEvent FOnChange;
  34.     TTextCase FTextCase;
  35.     TCaseFunction FCaseFunction;
  36.     
  37.     
  38. protected:
  39.     void __fastcall SetDrive(char NewDrive);
  40.     void __fastcall SetDirectory(TFileName NewDirectory);
  41.     void __fastcall SetTextCase(TTextCase NewTextCase);
  42.     void __fastcall AssignCaseProc();
  43.     void __fastcall WalkTree(const AnsiString& Dest);
  44.     
  45.     virtual void __fastcall BuildOneLevel(long RootItem);
  46.     virtual void __fastcall BuildTree();
  47.     virtual void __fastcall BuildSubTree(long RootItem);
  48.     virtual void __fastcall Change();
  49.  
  50.     // virtual overrides from base
  51.     virtual void __fastcall Click();
  52.     virtual void __fastcall CreateWnd();
  53.     virtual void __fastcall Expand(long Index);
  54.     virtual void __fastcall Loaded();
  55.  
  56.     // helper statics
  57.     static AnsiString CurDir();
  58.     
  59.  
  60. public:
  61.     virtual __fastcall TDirectoryOutline(TComponent* Owner);
  62.  
  63.     AnsiString __fastcall ForceCase(const AnsiString& AString);
  64.  
  65.     __property char Drive = { read = FDrive, write = SetDrive };
  66.     __property TFileName Directory =
  67.             { read = FDirectory, write = SetDirectory };
  68.  
  69.     // from base class
  70.     __property Lines = { stored = false };
  71.  
  72. __published:
  73.     // new properties
  74.     __property TNotifyEvent OnChange = { read = FOnChange, write = FOnChange };
  75.     __property TTextCase TextCase = { read = FTextCase, write = SetTextCase };
  76.  
  77.     // properties from base classes
  78.     __property Align;
  79.     __property BorderStyle;
  80.     __property Color;
  81.     __property Ctl3D;
  82.     __property DragCursor;
  83.     __property DragMode;
  84.     __property Enabled;
  85.     __property Font;
  86.     __property ItemHeight;
  87.     __property OnClick;
  88.     __property OnCollapse;
  89.     __property OnDblClick;
  90.     __property OnDragDrop;
  91.     __property OnDragOver;
  92.     __property OnDrawItem;
  93.     __property OnEndDrag;
  94.     __property OnEnter;
  95.     __property OnExit;
  96.     __property OnExpand;
  97.     __property OnKeyDown;
  98.     __property OnKeyPress;
  99.     __property OnKeyUp;
  100.     __property OnMouseDown;
  101.     __property OnMouseMove;
  102.     __property OnMouseUp;
  103.     __property Options;
  104.     __property ParentColor;
  105.     __property ParentCtl3D;
  106.     __property ParentFont;
  107.     __property ParentShowHint;
  108.     __property PictureClosed;
  109.     __property PictureLeaf;
  110.     __property PictureOpen;
  111.     __property PopupMenu;
  112.     __property ScrollBars;
  113.     __property Style;
  114.     __property ShowHint;
  115.     __property TabOrder;
  116.     __property TabStop;
  117.     __property Visible;
  118. };
  119. } //end namespace
  120. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  121. using namespace Diroutln;
  122. #endif
  123. //---------------------------------------------------------------------------
  124. #endif
  125.