⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 controlpos.h

📁 企业之间的竞争主要体现在三个方面:产品市场的竞争、资金市场的竞争和人才市场的竞争。在网络经济的环境下
💻 H
字号:
//------------------------------------------------------------------------------
// ControlPos.h
// 
//	CControlPos 
//	Position controls on a form's resize 
// 
//		Copyright (c) 2000 Paul Wendt
// 
//		VERSION#	DATE			NAME	DESCRIPTION OF CHANGE
//		--------	----------	----	---------------------
//		1.01  	07/11/2000	PRW	Original creation.
// 
#ifndef CONTROLPOS_H_
#define CONTROLPOS_H_

//----------------------------------------------
// these #define's specify HOW the control
// will move. they can be combined with the
// bitwise or operator
//
#define CP_MOVE_H					1
#define CP_MOVE_V					2
#define CP_RESIZE_H					4
#define CP_RESIZE_V					8

class CControlPos
{
private:
	// internal structure used to hold all information about a CWnd* control
	typedef struct tagCONTROLDATA
	{
		HWND  hControl;		// HWND's never change; some MFC functions return tYgorary CWnd *'s
		DWORD dwStyle;		// check the #define's above
	} CONTROLDATA, *LPCONTROLDATA;
	

public:
	CControlPos(CWnd* pParent = NULL);
	virtual ~CControlPos();

public:
	void SetParent(CWnd* pParent);

	BOOL AddControl(CWnd* pControl, const DWORD& dwStyle = CP_MOVE_H);
	BOOL AddControl(const UINT& unID, const DWORD& dwStyle = CP_MOVE_H);
	BOOL RemoveControl(CWnd* pControl);
	BOOL RemoveControl(const UINT& unID);
	void ResetControls(void);
	virtual void MoveControls(void);

	//---------------------------------------------------
	// most of the time, you don't want to move controls
	// if the user reduces window size [controls can
	// overlap and cause "issues"]
	// negative moves won't move controls when the parent
	// window is getting smaller than its original size
	//
	void SetNegativeMoves(const BOOL& fNegativeMoves = TRUE);
	BOOL GetNegativeMoves(void) const;

protected:
	virtual void UpdateParentSize(void);

private:
	CWnd*  m_pParent;		
	int    m_nOldParentWidth;			
	int    m_nOldParentHeight;
	int    m_nOriginalParentWidth;
	int    m_nOriginalParentHeight;
	BOOL   m_fNegativeMoves;

	CObArray m_awndControls;
};


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -