Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

parentinfo.h

Go to the documentation of this file.
00001 // ParentInfo.h: interface for the CParentInfo class. 00002 // 00004 00005 #if !defined(AFX_PARENTINFO_H__CBCB8816_7899_11D1_96A4_00C04FB177B1__INCLUDED_) 00006 #define AFX_PARENTINFO_H__CBCB8816_7899_11D1_96A4_00C04FB177B1__INCLUDED_ 00007 00008 #if _MSC_VER >= 1000 00009 #pragma once 00010 #endif // _MSC_VER >= 1000 00011 #include "edge.h" 00012 00013 typedef struct tagDIMENSION 00014 { 00015 int Width; 00016 int Height; 00017 } DIMENSION, * PDIMENSION; 00018 00019 00020 #define PROPERTY(type, Name) void Set##Name( type v) { m_##Name=v; } type Get##Name() const {return m_##Name; } 00021 00022 class CParentInfo 00023 { 00024 public: 00025 void DeterminBorders( CControlList * pControlList); 00026 void Annotate( HDC hdc ); 00027 CEdge ** GetHorizontalEdges(); 00028 CEdge ** GetVerticalEdges(); 00029 void Resize(int width, int height); 00030 CParentInfo(); 00031 virtual ~CParentInfo(); 00032 void Init(HWND h); 00033 00034 LONG GetWidth() const { return m_Size.right-m_Size.left; } 00035 LONG GetHeight() const { return m_Size.bottom-m_Size.top; } 00036 00037 LONG GetLeft() const { return m_Size.left; } 00038 LONG GetTop() const { return m_Size.top; } 00039 LONG GetRight() const { return m_Size.right; } 00040 LONG GetBottom() const { return m_Size.bottom; } 00041 00042 void DeterminSize(); 00043 HWND GetWindow() const { return m_hWnd;} 00044 00045 PROPERTY(LONG, RightBorder); 00046 PROPERTY(LONG, LeftBorder); 00047 PROPERTY(LONG, TopBorder); 00048 PROPERTY(LONG, BottomBorder); 00049 00050 CEdge * AddEdge(int Position, int Axis, BOOL Flexible=false, int Offset=0); 00051 CEdge * AddEdge(CGuide * pGuide, int Offset=0); 00052 void ConstructBorders(); 00053 CEdge & FindCloseEdge(CEdge & Fixed, int Offset); 00054 00055 CEdge * GetLeftEdge() { return m_pLeftEdge; } 00056 CEdge * GetRightEdge() { return m_pRightEdge; } 00057 CEdge * GetTopEdge() { return m_pTopEdge; } 00058 CEdge * GetBottomEdge() { return m_pBottomEdge; } 00059 00060 int GetNumHoriz() const { return m_Edges.GetNumHoriz(); } 00061 int GetNumVert() const { return m_Edges.GetNumVert(); } 00062 00063 PROPERTY( DIMENSION, MinimumSize ); 00064 00065 private: 00066 DIMENSION m_MinimumSize; 00067 RECT m_Size; 00068 HWND m_hWnd; 00069 00070 LONG m_RightBorder; 00071 LONG m_LeftBorder; 00072 LONG m_TopBorder; 00073 LONG m_BottomBorder; 00074 00075 // 00076 // This is a list of the edges 00077 // 00078 CEdgeCache m_Edges; 00079 00080 // 00081 // These are the edges of the parent itself. 00082 // 00083 CEdge * m_pLeftEdge; 00084 CEdge * m_pRightEdge; 00085 CEdge * m_pTopEdge; 00086 CEdge * m_pBottomEdge; 00087 }; 00088 00089 #endif // !defined(AFX_PARENTINFO_H__CBCB8816_7899_11D1_96A4_00C04FB177B1__INCLUDED_)

Generated on Sat May 15 19:41:08 2004 for test by doxygen 1.3.7