home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / Chip_2002-05_cd1.bin / chplus / cpp / 5 / Komponety.exe / cdiroutl.h < prev    next >
C/C++ Source or Header  |  1998-02-09  |  4KB  |  126 lines

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