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

persctl.h

Go to the documentation of this file.
00001 // 00002 // CResizeControl 00003 // 00004 // FelixA 00005 // 00006 // Resize controls 00007 00008 #ifndef __PERSISTCONTROL 00009 #define __PERSISTCONTROL 00010 00011 class CRegUiData; 00012 00013 #include "parentinfo.h" 00014 #include "edge.h" 00015 00016 00017 // 00018 // Generic version of the PersistenControls 00019 // 00020 #define PROPERTY(type, Name) void Set##Name( type v) { m_##Name=v; } type Get##Name() const {return m_##Name; } 00021 00022 class CResizeControlGeneric 00023 { 00024 public: 00025 int Attatchment( CGuide * pGuide); 00026 virtual ~CResizeControlGeneric(); 00027 CResizeControlGeneric(HWND hC, CParentInfo & pi, CResizeControl * pUs); 00028 void SetControl(HWND h) { m_hC=h; } 00029 HWND GetControl() const { return m_hC; } 00030 00031 // 00032 // Attatches itself to each guide. 00033 // 00034 BOOL SetControlAssociations(); 00035 00036 // 00037 // Everything is in dialog units, as that's how we get laid out. 00038 // 00039 RECT GetLocation() { return m_Location; } 00040 00041 // these are obvious ones, like I'm on the edge - 00042 virtual BOOL DeterminLeftAttatchments(); 00043 virtual BOOL DeterminRightAttatchments(); 00044 virtual BOOL DeterminTopAttatchments(); 00045 virtual BOOL DeterminBottomAttatchments(); 00046 00047 virtual BOOL Resize(WORD width, WORD height); 00048 00049 LONG GetRightGap() const { return m_Parent.GetRight() - m_Location.right; } 00050 LONG GetTopGap() const { return m_Location.top; } 00051 LONG GetLeftGap() const { return m_Location.left; } 00052 LONG GetBottomGap() const { // return m_Parent.GetBottom() - m_Location.bottom;// 00053 return m_Parent.GetHeight() - m_Location.bottom; } 00054 00055 LONG GetWidth() const { return m_PreferredSize.Width; } // { return m_Location.right - m_Location.left; } 00056 LONG GetHeight() const { return m_PreferredSize.Height; } // m_Location.bottom - m_Location.top; } 00057 00058 BOOL IsGrowsHigh() const { return m_GrowsHigh; } 00059 BOOL IsGrowsWide() const { return m_GrowsWide; } 00060 00061 CEdge * GetRightEdge() { return m_pRightEdge; } 00062 00063 PROPERTY( int, X ); 00064 PROPERTY( int, Y ); 00065 PROPERTY( int, TempWidth ); 00066 PROPERTY( int, TempHeight ); 00067 DIMENSION GetPreferredSize(); 00068 PROPERTY( LPTSTR, ClassName); 00069 00070 private: 00071 int m_X; 00072 int m_Y; 00073 int m_TempWidth; 00074 int m_TempHeight; 00075 DIMENSION m_PreferredSize; 00076 00077 HWND m_hC; 00078 RECT m_Location; 00079 CEdge * m_pLeftEdge; 00080 CEdge * m_pRightEdge; 00081 CEdge * m_pTopEdge; 00082 CEdge * m_pBottomEdge; 00083 00084 protected: 00085 int m_RightSlop; // ammount we can be off finding the right edge. 00086 void DeterminLocation(); // works out where we are on the dialog, and its width / height 00087 BOOL m_GrowsWide; 00088 BOOL m_GrowsHigh; 00089 CParentInfo & m_Parent; 00090 CResizeControl * m_pUs; // what we should hand out. 00091 LPTSTR m_ClassName; 00092 }; 00093 00094 00095 // 00096 // How the user see's it. 00097 // 00098 #define WRAP( returnType, method ) returnType method() { if(m_pC) return m_pC->##method(); return (returnType)0; } 00099 00100 class CResizeControl 00101 { 00102 public: 00103 ~CResizeControl(){}; 00104 CResizeControl(HWND hC,CParentInfo & pi); 00105 BOOL Valid() const { if(m_pC) return true; return false; } 00106 CResizeControlGeneric * m_pC; 00107 00108 // these are obvious ones, like I'm on the edge - 00109 WRAP (BOOL, DeterminLeftAttatchments ) 00110 WRAP (BOOL, DeterminRightAttatchments ) 00111 WRAP (BOOL, DeterminTopAttatchments ) 00112 WRAP (BOOL, DeterminBottomAttatchments ) 00113 00114 CEdge * GetRightEdge() { if(m_pC) return m_pC->GetRightEdge(); return NULL; } 00115 00116 BOOL Resize(WORD width, WORD height) { if(m_pC) return m_pC->Resize(width, height); return FALSE; } 00117 WRAP(LONG, GetRightGap ); 00118 WRAP(LONG, GetLeftGap ); 00119 WRAP(LONG, GetTopGap ); 00120 WRAP(LONG, GetBottomGap ); 00121 00122 WRAP(LONG, GetWidth ); 00123 WRAP(LONG, GetHeight ); 00124 00125 WRAP(BOOL, IsGrowsWide ); 00126 WRAP(BOOL, IsGrowsHigh ); 00127 00128 WRAP(HWND, GetControl ); 00129 WRAP(BOOL, SetControlAssociations ); 00130 00131 WRAP( int, GetX ); 00132 WRAP( int, GetY ); 00133 WRAP( int, GetTempWidth ); 00134 WRAP( int, GetTempHeight ); 00135 WRAP( LPTSTR, GetClassName ); 00136 00137 void SetX(int i ) { m_pC->SetX(i); } 00138 void SetY(int i ) { m_pC->SetY(i); } 00139 void SetWidth(int i ) { m_pC->SetTempWidth(i); } 00140 void SetHeight(int i ) { m_pC->SetTempHeight(i); } 00141 00142 DIMENSION GetPreferredSize() { return m_pC->GetPreferredSize(); } 00143 int Attatchment(CGuide *pGuide) { return m_pC->Attatchment(pGuide); } 00144 RECT GetLocation() { return m_pC->GetLocation(); } 00145 00146 CConstraint m_Cons; 00147 }; 00148 00149 00150 #endif

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