home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / fli106c / examples / cons.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-25  |  3.2 KB  |  151 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.02
  4. // Copyright (C) 1990, 1991
  5. // Software Dimensions
  6. //
  7. // Dialog Development System
  8. //
  9.  
  10. #include "fli.h"
  11. #include "piece.h"
  12.  
  13. //-------------------------------------------------------------------------
  14. //
  15. // Destruction of all declared and allocated pointers
  16. //
  17. //-------------------------------------------------------------------------
  18.  
  19. PieceHandler::~PieceHandler()
  20. {
  21.   if (Mask)
  22.     delete Mask;
  23.  
  24.   if (Variable)
  25.     delete Variable;
  26.  
  27.   if (Prompter)
  28.     delete Prompter;
  29.  
  30.   if (HotKey)
  31.     delete HotKey;
  32.  
  33.   if (Text)
  34.     delete Text;
  35.  
  36.   if (Constant)
  37.     delete Constant;
  38.  
  39.   if (Help)
  40.     delete Help;
  41.  
  42.   if (DerivedClass)
  43.     delete DerivedClass;
  44.  
  45.   if (Elements)
  46.   {
  47.     for (int i=0;i<10;i++)
  48.       delete Elements[i];
  49.     delete Elements;
  50.   }
  51. }
  52.  
  53. //-------------------------------------------------------------------------
  54. //
  55. // Sizing function for objects (not elements).  It is declared as
  56. // a null function to eliminate overhead with elements -- since they
  57. // do not need the function to operate.
  58. //
  59. //-------------------------------------------------------------------------
  60.  
  61. void PieceHandler::Size(int X,int Y)
  62. {
  63.   // Empty function to conserve space
  64. }
  65.  
  66. //-------------------------------------------------------------------------
  67. //
  68. // Define the constructors for the objects
  69. //
  70. //-------------------------------------------------------------------------
  71.  
  72. #undef Fig
  73.  
  74. #define Fig(A) \
  75. A::A(BlazeClass *_Blaze_,int X,int Y,int Width,int Height,int Color) : \
  76.   PieceHandler(_Blaze_) \
  77.   { \
  78.     LayOut=A; \
  79.     PieceHandler::X=X; \
  80.     PieceHandler::Y=Y; \
  81.     PieceHandler::Width=Width; \
  82.     PieceHandler::Height=Height; \
  83.     PieceHandler::Color=Color; \
  84.     Mask=0; \
  85.     Elements=0; \
  86.     Variable=0; \
  87.     Prompter=0; \
  88.     GroupCode=0; \
  89.     HelpId=0; \
  90.     ToBeDerived=0; \
  91.     PromptX=0; \
  92.     PromptY=0; \
  93.     Text=0; \
  94.     Constant=0; \
  95.     HotKey=0; \
  96.     Help=0; \
  97.     DerivedClass=0; \
  98.     MaskCharacter=0; \
  99.     MaskWidth=0; \
  100.     ScrollWidth=0; \
  101.     Focus_Reset=0; \
  102.   } \
  103. A::A(PieceHandler &Object) \
  104.   { \
  105.     LayOut=A; \
  106.     X=Object.X; \
  107.     Y=Object.Y; \
  108.     Width=Object.Width; \
  109.     Height=Object.Height; \
  110.     Color=Object.Color; \
  111.     Mask=Object.Mask; \
  112.     Elements=Object.Elements; \
  113.     Blaze=Object.Blaze; \
  114.     Variable=Object.Variable; \
  115.     Prompter=Object.Prompter; \
  116.     GroupCode=Object.GroupCode; \
  117.     HelpId=Object.HelpId; \
  118.     ToBeDerived=Object.ToBeDerived; \
  119.     PromptX=Object.PromptX; \
  120.     PromptY=Object.PromptY; \
  121.     Text=Object.Text; \
  122.     Constant=Object.Constant; \
  123.     HotKey=Object.HotKey; \
  124.     Help=Object.Help; \
  125.     DerivedClass=Object.DerivedClass; \
  126.     MaskCharacter=Object.MaskCharacter; \
  127.     MaskWidth=Object.MaskWidth; \
  128.     ScrollWidth=Object.ScrollWidth; \
  129.     Focus_Reset=Object.Focus_Reset; \
  130.   } \
  131.  
  132. Fig(Box);
  133. Fig(FilledBox);
  134. Fig(HorizontalLine);
  135. Fig(VerticalLine);
  136. Fig(Shadow);
  137. Fig(EraseArea);
  138. Fig(ColorizeArea);
  139. Fig(Character);
  140. Fig(Integer);
  141. Fig(Long);
  142. Fig(Float);
  143. Fig(Double);
  144. Fig(Bcd);
  145. Fig(VRadio);
  146. Fig(HRadio);
  147. Fig(Check);
  148. Fig(Push);
  149. Fig(GroupHeading);
  150. Fig(PickGeneric);
  151.