http://zhangjunhd.blog.51cto.com/113473/128174
class CHYLayout;
void Layout(int nWidth, int nHeight);
class CHYLayoutHorizontal;
class CHYLayoutVertical;
class CHYLayoutGrid;
class CHYLayoutBorder;
class CHYLayoutManager;
void Init(HWND hWnd, CHYLayout* pCHYLayout);
void Release();
void Layout();
void Layout(int nWidth, int nHeight);
HWND m_hWnd;
CHYLayout* m_pCHYLayout;
==================================================================================
// HYLayout.h
#pragma once
#include "../HYComm/STLContainerTemplate.h"
class CHYLayout;
class CHYLayoutObject
{
public:
CHYLayoutObject(HWND hWnd);
CHYLayoutObject(CHYLayout* pCHYLayout);
~CHYLayoutObject();
void Layout(int nX, int nY, int nWidth, int nHeight);
private:
HWND m_hWnd;
CHYLayout* m_pCHYLayout;
};
HYPCONTAINER_VECTOR(CHYLayoutObject);
s
/////////////////////////////////////////////////////////////////////////////////////////
class CHYLayout
{
public:
CHYLayout();
~CHYLayout();
virtual void Layout(int nX, int nY, int nWidth, int nHeight);
protected:
CHYLayoutObjectVector m_hyLayoutObjectVector;
};
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
class CHYLayoutHorizontal : public CHYLayout
{
public:
CHYLayoutHorizontal();
~CHYLayoutHorizontal();
virtual void Layout(int nX, int nY, int nWidth, int nHeight);
};
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
class CHYLayoutVertical : public CHYLayout
{
public:
CHYLayoutVertical();
~CHYLayoutVertical();
virtual void Layout(int nX, int nY, int nWidth, int nHeight);
};
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
class CHYLayoutGrid : public CHYLayout
{
public:
CHYLayoutGrid();
~CHYLayoutGrid();
virtual void Layout(int nX, int nY, int nWidth, int nHeight);
};
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
class CHYLayoutBorder : public CHYLayout
{
public:
CHYLayoutBorder();
~CHYLayoutBorder();
virtual void Layout(int nX, int nY, int nWidth, int nHeight);
};
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
class CHYLayoutManager
{
public:
CHYLayoutManager();
~CHYLayoutManager();
void Init(HWND hWnd, CHYLayout* pCHYLayout);
void Release();
void Layout();
private:
HWND m_hWnd;
CHYLayout* m_pCHYLayout;
}

148

被折叠的 条评论
为什么被折叠?



