home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / wksinst / rwcdemo.pak / RWCDLG.H < prev    next >
C/C++ Source or Header  |  1991-09-09  |  1KB  |  54 lines

  1. // (C) Copyright 1991 by Borland International
  2.  
  3. #define fsPathName 80
  4. #define fsExtension 3
  5. #define fsFileSpec fsPathName+fsExtension
  6.  
  7. class TDialog
  8. {
  9. public:
  10.     HWND hWindow;
  11.     FARPROC dialogFunc;
  12.     char far *name;
  13.  
  14.     TDialog(int DlgName);
  15.     ~TDialog();
  16.     virtual void setupDialog() {};
  17.     virtual void retrieveInfo() {};
  18.     virtual int doCommands(WORD wParam, LONG lParam);
  19.     virtual int canClose() {return 1;};
  20. };
  21.  
  22.  
  23. class TFileNew : public TDialog
  24. {
  25. public:
  26.   int *fileType;
  27.   TFileNew(int *aFileType) : TDialog(dlg_FileNew) { fileType = aFileType;};
  28.   int canClose();
  29.   void setupDialog();
  30. };
  31.  
  32. class TFileOpen : public TDialog
  33. {
  34. public:
  35.     char *filePath;
  36.     char pathName[fsPathName + 1];
  37.     char extension[fsExtension + 1];
  38.     char fileSpec[fsFileSpec + 1];
  39.     int *fileType;
  40.  
  41.     TFileOpen(int *aType, char *aFilePath);
  42.     ~TFileOpen() {free(filePath);};
  43.     int canClose();
  44.     int hasWildCards(char *aFilePath) { return strchr(aFilePath, '*') || strchr(aFilePath, '?');};
  45.     char *getExtension(char *aFilePath);
  46.     char *getFileName(char *aFilePath);
  47.     char *getFileFirst(char *aFilePath);
  48.     void setupDialog();
  49.     int doCommands(WORD wParam, LONG lParam);
  50.     void selectFileName();
  51.     void updateFileName();
  52.     void updateButtons();
  53.     int updateListBoxes();
  54. };