home *** CD-ROM | disk | FTP | other *** search
/ POINT Software Programming / PPROG1.ISO / c / fli106c / examples / chgdir.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-25  |  3.0 KB  |  142 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.01
  4. // Copyright (C) 1990, 1991
  5. // Software Dimensions
  6. //
  7. // Dialog Development System
  8. //
  9. //
  10. // To use this dialog in your own program, here is all you have to do:
  11. //
  12. //   1. Include CHGDIR.H in your module
  13. //   2. Place the following code where you want to bring up the dialog:
  14. //         ChDirDialog &ChDir=*new ChDirDialog();
  15. //         ChDir.UseDialog();
  16. //         delete &ChDir;
  17. //   3. That is it!!
  18. //
  19.  
  20. #include "elements.h"
  21. #include <dir.h>
  22.  
  23. //-------------------------------------------------------------------------
  24. //
  25. // PathStorage element that stores path information
  26. //
  27. //-------------------------------------------------------------------------
  28.  
  29. #define MaxEntries 100
  30.  
  31. class PathStorage
  32. {
  33. public:
  34.  
  35.   char *Revert;
  36.   char *Path;
  37.   ffblk *DirEntries;
  38.   char (*Drives)[2];
  39.   int Count;
  40.   int DriveCount;
  41.   int CurrentDisk;
  42.   int SaveDisk;
  43.  
  44.   PathStorage();
  45.   ~PathStorage();
  46.  
  47.   void Refresh();
  48. };
  49.  
  50. //-------------------------------------------------------------------------
  51. //
  52. // ChDirDialog class that controls the entire dialog
  53. //
  54. //-------------------------------------------------------------------------
  55.  
  56. class ChDirDialog : public DialogClass
  57. {
  58. public:
  59.  
  60.   PathStorage *Path;
  61.  
  62.   ChDirDialog();
  63.   ~ChDirDialog();
  64.  
  65.   int EventHandler(int Event);
  66. };
  67.  
  68. //-------------------------------------------------------------------------
  69. //
  70. // ChDirPath class that handles the dir path
  71. //
  72. //-------------------------------------------------------------------------
  73.  
  74. class ChDirPath : public DiaChar
  75. {
  76. public:
  77.  
  78.   PathStorage &Path;
  79.   char *ComparePathStorage;
  80.  
  81.   ChDirPath(int X,int Y,PathStorage &_Path);
  82.   ~ChDirPath();
  83.  
  84.   int EventHandler(int Event);
  85. };
  86.  
  87. //-------------------------------------------------------------------------
  88. //
  89. // ChDirList class that lists the available directories
  90. //
  91. //-------------------------------------------------------------------------
  92.  
  93. class ChDirList : public DiaStructPickList
  94. {
  95. public:
  96.  
  97.   PathStorage &Path;
  98.   static int CurrentItem;
  99.  
  100.   ChDirList(int X,int Y,PathStorage &_Path);
  101.  
  102.   int EventHandler(int Event);
  103.   void Show();
  104. };
  105.  
  106. //-------------------------------------------------------------------------
  107. //
  108. // DirList class that lists all of the available drives
  109. //
  110. //-------------------------------------------------------------------------
  111.  
  112. class DirList : public DiaStructPickList
  113. {
  114. public:
  115.  
  116.   PathStorage &Path;
  117.  
  118.   DirList(int X,int Y,PathStorage &_Path);
  119.  
  120.   int EventHandler(int Event);
  121. };
  122.  
  123. //-------------------------------------------------------------------------
  124. //
  125. // Prompt class indiciates current location
  126. //
  127. //-------------------------------------------------------------------------
  128.  
  129. class Prompt : public DialogElement
  130. {
  131. public:
  132.  
  133.   PathStorage &Path;
  134.  
  135.   Prompt(PathStorage &_Path);
  136.  
  137.   void Show();
  138.   void HighLight();
  139.   int Available();
  140.   int EventHandler(int Event);
  141. };
  142.