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.

98 lines
2.7 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. Modified by Salvador Eduardo Tropea to add more functionality.
  9. *
  10. *
  11. */
  12. #if defined( Uses_TFileDialog ) && !defined( __TFileDialog )
  13. #define __TFileDialog
  14. const ushort
  15. fdOKButton = 0x0001, // Put an OK button in the dialog
  16. fdOpenButton = 0x0002, // Put an Open button in the dialog
  17. fdReplaceButton = 0x0004, // Put a Replace button in the dialog
  18. fdClearButton = 0x0008, // Put a Clear button in the dialog
  19. fdHelpButton = 0x0010, // Put a Help button in the dialog
  20. fdSelectButton = 0x0020, // Put a Select button in the dialog
  21. fdDoneButton = 0x0040, // Say Done isntead of "Cancel"
  22. fdAddButton = 0x0080, // Put an Add button in the dialog
  23. fdNoLoadDir = 0x0100; // Do not load the current directory
  24. // contents into the dialog at Init.
  25. // This means you intend to change the
  26. // WildCard by using SetData or store
  27. // the dialog on a stream.
  28. struct TEvent;
  29. class TFileInputLine;
  30. class TFileList;
  31. class TFileDialog : public TDialog
  32. {
  33. public:
  34. TFileDialog( const char *aWildCard, const char *aTitle,
  35. const char *inputName, ushort aOptions, uchar histId );
  36. ~TFileDialog();
  37. virtual void getData( void *rec );
  38. void getFileName( char *s );
  39. virtual void handleEvent( TEvent& event );
  40. virtual void setData( void *rec );
  41. virtual Boolean valid( ushort command );
  42. virtual void shutDown();
  43. virtual void sizeLimits(TPoint& min, TPoint& max);
  44. TFileInputLine *fileName;
  45. TFileList *fileList;
  46. char wildCard[PATH_MAX];
  47. const char *directory;
  48. private:
  49. void readDirectory();
  50. Boolean checkDirectory( const char * );
  51. protected:
  52. void setUpCurDir(); // SET
  53. #if !defined( NO_STREAM )
  54. virtual const char *streamableName() const
  55. { return name; }
  56. protected:
  57. TFileDialog( StreamableInit ) : TWindowInit( &TFileDialog::initFrame ),
  58. TDialog ( streamableInit ) {}
  59. virtual void write( opstream& );
  60. virtual void *read( ipstream& );
  61. public:
  62. static const char * const name;
  63. static TStreamable *build();
  64. #endif // NO_STREAM
  65. };
  66. #if !defined( NO_STREAM )
  67. inline ipstream& operator >> ( ipstream& is, TFileDialog& cl )
  68. { return is >> (TStreamable&)cl; }
  69. inline ipstream& operator >> ( ipstream& is, TFileDialog*& cl )
  70. { return is >> (void *&)cl; }
  71. inline opstream& operator << ( opstream& os, TFileDialog& cl )
  72. { return os << (TStreamable&)cl; }
  73. inline opstream& operator << ( opstream& os, TFileDialog* cl )
  74. { return os << (TStreamable *)cl; }
  75. #endif // NO_STREAM
  76. #endif // Uses_TFileDialog