?? controlpos.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 + -