myDialogBar的动态大小
来源:互联网 发布:女程序员容易老吗 编辑:程序博客网 时间:2024/05/21 04:16
/* Compile options needed: Default
*/
// ResizableDlgBar.h : header file
//
class CResizableDlgBar : public CDialogBar
{
// Construction
public:
BOOL Create( CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle,
UINT nID, BOOL = TRUE);
BOOL Create( CWnd* pParentWnd, LPCTSTR lpszTemplateName,
UINT nStyle, UINT nID, BOOL = TRUE);
// Attributes
public:
CSize m_sizeDocked;
CSize m_sizeFloating;
BOOL m_bChangeDockedSize; // Indicates whether to keep
// a default size for docking
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CResizableDlgBar)
//}}AFX_VIRTUAL
virtual CSize CalcDynamicLayout( int nLength, DWORD dwMode );
// Implementation
public:
// Generated message map functions
protected:
//{{AFX_MSG(CResizableDlgBar)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////
// ResizableDlgBar.cpp : implementation file
//
#include "stdafx.h"
#include "ResizableDlgBar.h"
////////////////////////////////////////////////////////////////////
// CResizableDlgBar Construction/Destruction
BOOL CResizableDlgBar::Create( CWnd* pParentWnd, UINT nIDTemplate,
UINT nStyle, UINT nID, BOOL bChange)
{
if(!CDialogBar::Create(pParentWnd,nIDTemplate,nStyle,nID))
return FALSE;
m_bChangeDockedSize = bChange;
m_sizeFloating = m_sizeDocked = m_sizeDefault;
return TRUE;
}
BOOL CResizableDlgBar::Create( CWnd* pParentWnd,
LPCTSTR lpszTemplateName, UINT nStyle,
UINT nID, BOOL bChange)
{
if (!CDialogBar::Create( pParentWnd, lpszTemplateName,
nStyle, nID))
return FALSE;
m_bChangeDockedSize = bChange;
m_sizeFloating = m_sizeDocked = m_sizeDefault;
return TRUE;
}
////////////////////////////////////////////////////////////////////
// Overloaded functions
CSize CResizableDlgBar::CalcDynamicLayout(int nLength, DWORD dwMode)
{
// Return default if it is being docked or floated
if ((dwMode & LM_VERTDOCK) || (dwMode & LM_HORZDOCK))
{
if (dwMode & LM_STRETCH) // if not docked stretch to fit
return CSize((dwMode & LM_HORZ) ? 32767 : m_sizeDocked.cx,
(dwMode & LM_HORZ) ? m_sizeDocked.cy : 32767);
else
return m_sizeDocked;
}
if (dwMode & LM_MRUWIDTH)
return m_sizeFloating;
// In all other cases, accept the dynamic length
if (dwMode & LM_LENGTHY)
return CSize(m_sizeFloating.cx, (m_bChangeDockedSize) ?
m_sizeFloating.cy = m_sizeDocked.cy = nLength :
m_sizeFloating.cy = nLength);
else
return CSize((m_bChangeDockedSize) ?
m_sizeFloating.cx = m_sizeDocked.cx = nLength :
m_sizeFloating.cx = nLength, m_sizeFloating.cy);
}
BEGIN_MESSAGE_MAP(CResizableDlgBar, CDialogBar)
//{{AFX_MSG_MAP(CResizableDlgBar)
// NOTE - the ClassWizard will add and remove mapping macros
here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////
// CResizableDlgBar message handlers
/////////////////////////////////////////////////////////////////////
- myDialogBar的动态大小
- 确定动态数组的大小!
- 动态改变ImageView的大小
- 动态更改View的大小
- 动态设置控件的大小
- 根据itemView的大小计算ListView动态大小
- 动态改变showModalDialog窗体的大小
- 动态改变模态窗口的大小
- 动态获得当前显示器的大小
- c# 动态改变控件大小的方法
- 动态改变对话框中控件的大小
- c# 动态改变panel大小的问题
- ncurses 设置动态大小的域
- 动态调整android控件(View)的大小
- 动态调整iframe页面的大小
- Android 动态改变控件的大小
- 动态设置表格列的大小
- 如何动态改变框架的大小[转]
- 每周一总结(4)
- 今天是2010-12-05,天气好冷
- What's Object-Oriented
- 什么是业务平台
- float在内存中的存放方式
- myDialogBar的动态大小
- Linux CPU 信息查看
- MySQL笔记(覆盖索引)
- a
- 嵌入式Linux之我行——s3c2440的IO静态映射的分析
- 设置Gvim的启动位置与窗口大小,代码折叠及配色等
- 百度笔试题5.1
- RMAN备份(九)
- Android Camera Framework Stream(一)