home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / fli106c / examples / dds.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-25  |  5.7 KB  |  250 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. #include "piece.h"
  11.  
  12. //-------------------------------------------------------------------------
  13. //
  14. // Event codes for menu items
  15. //
  16. //-------------------------------------------------------------------------
  17.  
  18. const winOpen=5000;
  19. const winNew=5001;
  20. const winSave=5002;
  21. const winSaveAs=5003;
  22. const winChDir=5004;
  23. const winGenCPP=5005;
  24. const winDOSShell=5006;
  25. const winExit=5007;
  26. const winControlPanel=5008;
  27. const winAbout=5009;
  28.  
  29. const winCallMenu=5010;
  30.  
  31. // LAYOUT menu
  32.  
  33. const layoutSpecs=5050;
  34. const layoutEditMode=5051;
  35. const layoutMove=5052;
  36. const layoutSize=5053;
  37. const layoutZoom=5054;
  38. const layoutTest=5055;
  39.  
  40. // DRAW menu
  41.  
  42. const drawBox=5100;
  43. const drawFillBox=5101;
  44. const drawHLine=5102;
  45. const drawVLine=5103;
  46. const drawCharBox=5104;
  47. const drawShadow=5105;
  48. const drawErase=5106;
  49. const drawTrans=5107;
  50. const drawPlop=5108;
  51. const drawColor=5109;
  52.  
  53. // ELEMENT menu
  54.  
  55. const entryMenu=5195; // to provide help for sub menu
  56. const radioMenu=5196; // to provide help for sub menu
  57. const elementChar=5200;
  58. const elementInt=5201;
  59. const elementLong=5202;
  60. const elementFloat=5203;
  61. const elementDouble=5204;
  62. const elementBcd=5205;
  63. const elementVRadio=5206;
  64. const elementHRadio=5207;
  65. const elementPick=5208;
  66. const elementCheck=5209;
  67. const elementPush=5210;
  68. const elementHeading=5211;
  69. const elementScrollChar=5212;
  70. const elementPickStruct=5213;
  71. const elementPickArray=5214;
  72. const elementPickGeneric=5215;
  73.  
  74. // MANIPULATE menu
  75.  
  76. const manipBack=5300;
  77. const manipForward=5301;
  78. const manipReArrange=5302;
  79. const manipGroupings=5303;
  80. const manipSize=5304;
  81. const manipMove=5305;
  82. const manipMoveText=5306;
  83. const manipCopy=5307;
  84. const manipCopyText=5308;
  85. const manipDeletePiece=5309;
  86. const manipTextColor=5310;
  87. const manipObjectColor=5311;
  88. const manipTestDialog=5312;
  89. const manipToStart=5313;
  90. const manipToEnd=5314;
  91. const manipEarlier=5315;
  92. const manipLater=5316;
  93.  
  94. //-------------------------------------------------------------------------
  95. //
  96. // Event codes for dialogs
  97. //
  98. //-------------------------------------------------------------------------
  99.  
  100. // Events for control panel
  101.  
  102. const panelAcceptButton=10000;
  103. const panelColorButton=10014;
  104. const panelVideoButton=10015;
  105. const videoChange=10016;
  106. const videoCancel=10017;
  107. const colorChange=10018;
  108. const colorCancel=10019;
  109.  
  110. // Events for ChDir dialog
  111.  
  112. const ChDirCancelButton=10100;
  113. const ChDirRevertButton=10101;
  114. const ChDirOkayButton=10102;
  115.  
  116. //-------------------------------------------------------------------------
  117. //
  118. // ZPositioning status variable and "About.." box global variable
  119. //
  120. //-------------------------------------------------------------------------
  121.  
  122. extern InfoBox *Welcome;
  123. extern int ZPositioning;
  124.  
  125. //-------------------------------------------------------------------------
  126. //
  127. // Main dialog window - derived class
  128. //
  129. //-------------------------------------------------------------------------
  130.  
  131. class DialogWindow : public WindowElement
  132. {
  133. public:
  134.  
  135.   char FileName[100];
  136.  
  137. private:
  138.  
  139.   int CurrentColor;                 // Current drawing color
  140.  
  141.   int CursorX, CursorY;             // Current cursor location
  142.  
  143.   int Insert;                       // Status of insert mode toggle
  144.  
  145.   char (*Interior)[400];            // Text storage for interior of window
  146.  
  147.   PieceHandler **Pieces;            // Storage for defined objects/elements
  148.   int NumberPieces;                 // Total number of defined pieces
  149.  
  150.   int PreviousWidth;                // Storage for previous dimensions of
  151.   int PreviousHeight;               // an altered object
  152.  
  153.   char DerivedClass[50];            // The name of the derived class
  154.  
  155.   int PlopCharacter();
  156.   int GetMaskElement();
  157.   int MoveObject(int=0,int=0);
  158.  
  159.   void ChangeColor();
  160.     void Generate(char *GenTo);
  161.     void PlaceObject(int);
  162.     void PlaceElement(int);
  163.     void VirtualizedInterior();
  164.     void MoveText();
  165.     void ColorObject();
  166.     void ColorText();
  167.     void CopyObject();
  168.     void CopyText();
  169.     void DeleteObject();
  170.     void SizeObject(int=0);
  171.     void PushBack();
  172.     void BringFront();
  173.     void ManipToStart();
  174.   void ManipToEnd();
  175.   void ManipEarlier();
  176.   void ManipLater();
  177.     void Groupings();
  178.     void LayOut();
  179.   void PlacePrompter(PieceHandler &);
  180.   void EditElement(PieceHandler &);
  181.   void TestDialog();
  182.   void SaveFile(char *);
  183.  
  184. public:
  185.  
  186.   void LoadFile(char *LoadIt);
  187.  
  188.     void ShowInterior();
  189.   void ShowWindow();
  190.   void Cursor();
  191.  
  192.   int EventHandler(int Event);
  193.  
  194.   DialogWindow(char *LoadIt=0);
  195.     ~DialogWindow();
  196. };
  197.  
  198. //-------------------------------------------------------------------------
  199. //
  200. // Event handler/dispatcher definition for FusionWindow and this program
  201. //
  202. //-------------------------------------------------------------------------
  203.  
  204. class DesignerWindow : public FusionWindow
  205. {
  206.   int ControlPanel();
  207.   void ChDir();
  208.  
  209.   int EventHandler(int Event);
  210. };
  211.  
  212. //-------------------------------------------------------------------------
  213. //
  214. // Elements for the colorization dialog
  215. //
  216. //-------------------------------------------------------------------------
  217.  
  218. struct CurrentColor
  219. {
  220.   static int *TheColor;
  221. };
  222.  
  223. class ForeGround : public DialogElement, public CurrentColor
  224. {
  225. private:
  226.  
  227.   int TestX, TestY;
  228.  
  229. public:
  230.  
  231.   ForeGround(int X,int Y,int TestX,int TestY);
  232.   void Show();
  233.   void HighLight();
  234.   int EventHandler(int Event);
  235. };
  236.  
  237. class BackGround : public DialogElement, public CurrentColor
  238. {
  239. private:
  240.  
  241.   int TestX, TestY;
  242.  
  243. public:
  244.  
  245.   BackGround(int X,int Y,int TestX,int TestY);
  246.     void Show();
  247.   void HighLight();
  248.     int EventHandler(int Event);
  249. };
  250.