You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.0 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Turbo Vision - Version 2.0
  3. *
  4. * Copyright (c) 1994 by Borland International
  5. * All Rights Reserved.
  6. *
  7. Modified by Robert H�hne to be used for RHIDE.
  8. *
  9. *
  10. */
  11. #if defined( Uses_TDirListBox ) && !defined( __TDirListBox )
  12. #define __TDirListBox
  13. class TRect;
  14. class TScrollBar;
  15. struct TEvent;
  16. class TDirCollection;
  17. #include <limits.h>
  18. class TDirListBox : public TListBox
  19. {
  20. public:
  21. TDirListBox( const TRect& bounds, TScrollBar *aScrollBar );
  22. ~TDirListBox();
  23. virtual void getText( char *, ccIndex, short );
  24. virtual void handleEvent( TEvent& );
  25. virtual Boolean isSelected( ccIndex );
  26. void newDirectory( const char * );
  27. virtual void setState( ushort aState, Boolean enable );
  28. TDirCollection *list();
  29. static char pathDir[];
  30. static char firstDir[];
  31. static char middleDir[];
  32. static char lastDir[];
  33. static char graphics[];
  34. static char opathDir[];
  35. static char ofirstDir[];
  36. static char omiddleDir[];
  37. static char olastDir[];
  38. static char ographics[];
  39. private:
  40. void showDrives( TDirCollection * );
  41. void showDirs( TDirCollection * );
  42. char dir[PATH_MAX];
  43. ushort cur;
  44. #if !defined( NO_STREAM )
  45. virtual const char *streamableName() const
  46. { return name; }
  47. protected:
  48. TDirListBox( StreamableInit ): TListBox( streamableInit ) {}
  49. public:
  50. static const char * const name;
  51. static TStreamable *build();
  52. #endif // NO_STREAM
  53. };
  54. #if !defined( NO_STREAM )
  55. inline ipstream& operator >> ( ipstream& is, TDirListBox& cl )
  56. { return is >> (TStreamable&)cl; }
  57. inline ipstream& operator >> ( ipstream& is, TDirListBox*& cl )
  58. { return is >> (void *&)cl; }
  59. inline opstream& operator << ( opstream& os, TDirListBox& cl )
  60. { return os << (TStreamable&)cl; }
  61. inline opstream& operator << ( opstream& os, TDirListBox* cl )
  62. { return os << (TStreamable *)cl; }
  63. #endif // NO_STREAM
  64. inline TDirCollection *TDirListBox::list()
  65. {
  66. return (TDirCollection *)TListBox::list();
  67. }
  68. #endif // Uses_TDirListBox