NGen

GUI Bases.h V0.1

May 16th, 2011
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.88 KB | None | 0 0
  1. #ifndef ORE_GUI_BASES_H
  2. #define ORE_GUI_BASES_H
  3.  
  4. #include "treeimpl.h"
  5.  
  6. namespace ore
  7. {
  8.     namespace gui
  9.     {
  10.         ////////////////////////////////////////////
  11.         //  Basic "Object" Bases (Rect objects, elliptical objects, etc.)
  12.         ////////////////////////////////////////////
  13.         class CInternalBase_PositionalObject
  14.         {
  15.         public:
  16.             float myX, myY;
  17.  
  18.             CInternalBase_PositionalObject () {}
  19.             CInternalBase_PositionalObject (float xIn, float yIn)
  20.                 : myX (xIn), myY (yIn)
  21.             {
  22.             }
  23.  
  24.             virtual ~CInternalBase_PositionalObject () {}
  25.  
  26.             void Set_Position (float xIn, float yIn)
  27.             {
  28.                 myX = xIn;
  29.                 myY = yIn;
  30.             }
  31.         };
  32.  
  33.         class CInternalBase_PositionalPolygon
  34.         {
  35.         public:
  36.             float myOriginX, myOriginY;
  37.             CInternalBase_PositionalPolygon () {}
  38.             CInternalBase_PositionalPolygon (float originXIn, float originYIn)
  39.             {
  40.             }
  41.  
  42.             virtual ~CInternalBase_PositionalPolygon () {}
  43.  
  44.             void Set_Origin (float originXIn, float originYIn)
  45.             {
  46.                 myOriginX = originXIn;
  47.                 myOriginY = originYIn;
  48.             }
  49.         };
  50.  
  51.         class CInternalBase_Rect
  52.             :   public CInternalBase_PositionalObject,  //  x, y
  53.                 public CInternalBase_PositionalPolygon  //  origin
  54.         {
  55.         public:
  56.             float myWidth, myHeight;
  57.             CInternalBase_Rect () {}
  58.             CInternalBase_Rect (float xIn, float yIn, float widthIn, float heightIn, float originXIn = 0.0f, float originYIn = 0.0f)
  59.                 :   CInternalBase_PositionalObject (xIn, yIn),
  60.                     CInternalBase_PositionalPolygon (originXIn, originYIn),
  61.                     myWidth (widthIn), myHeight (heightIn)
  62.             {
  63.             }
  64.  
  65.             virtual ~CInternalBase_Rect () {}
  66.  
  67.             void Set_Size (float widthIn, float heightIn)
  68.             {
  69.                 myWidth = widthIn;
  70.                 myHeight = heightIn;
  71.             }
  72.         };
  73.  
  74.  
  75.  
  76.         ////////////////////////////////////////////
  77.         //  GUI Element Templates
  78.         ////////////////////////////////////////////
  79.  
  80.         class CBase_InactiveElement;
  81.         class CBase_InteractiveElement;
  82.         class CBase_ViewingArea;
  83.  
  84.         /*
  85.             Use: Output Boxes, Animated Graphics, etc.
  86.  
  87.             Maintains:
  88.                 Rendering and Processing
  89.         */
  90.  
  91.         class CBase_InactiveElement
  92.             : public ie::CBasicSequentialTreeNode
  93.         {
  94.         public:
  95.             void Process_AttachProcessing (CBase_ViewingArea * ptrViewingAreaIn);
  96.             void Process_AttachRendering (CBase_ViewingArea * ptrViewingAreaIn);
  97.         };
  98.  
  99.         /*
  100.             Use: Buttons, Text Boxes, etc.
  101.  
  102.             Maintains:
  103.                 Event Handling
  104.         */
  105.         class CBase_InteractiveElement
  106.             : public CBase_InactiveElement  //  For rendering/processing
  107.         {
  108.         public:
  109.             virtual void Event_DefaultHandler ();
  110.         };
  111.  
  112.  
  113.         /*
  114.             Use: Tabs, Windows, Toolbars, Menus, etc.
  115.  
  116.             Maintains:
  117.                 Children Management
  118.         */
  119.         class CBase_ViewingArea
  120.             : public CBase_InteractiveElement, public ie::CBasicSequentialTreeSplit
  121.         {
  122.         public:
  123.             virtual void Request_AppropriateDimensioning (float * ptrXOut, float * ptrYOut, float * ptrWidthOut, float * ptrHeightOut);
  124.            
  125.             virtual void Children_Add ();
  126.         };
  127.     }
  128. }
  129.  
  130. #endif
Advertisement
Add Comment
Please, Sign In to add comment