tabcontainer.h
来自「用bcg库编写的java IDE 源码」· C头文件 代码 · 共 113 行
H
113 行
#if !defined(AFX_TABCONTAINER_H__B1835CB8_81E4_44D9_A114_9515CB7F1C0B__INCLUDED_)
#define AFX_TABCONTAINER_H__B1835CB8_81E4_44D9_A114_9515CB7F1C0B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TabContainer.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTabContainer window
#include "GuiToolButton.h"
#include "bcgcontrolbar.h"
class BCGCONTROLBARDLLEXPORT CTabContainer : public CWnd
{
struct __Component
{
CPoint m_ptOrigin;
CPoint m_ptTerminal;
CRect m_rcRect;
CWnd* m_pwndComponent;
bool m_bResizable;
int m_iImage;
__Component()
{
}
~__Component()
{
delete m_pwndComponent;
}
__Component(CPoint ptOrg,CPoint ptTermOffSet,CWnd* pwndComp)
{
m_bResizable = true;
m_ptOrigin = ptOrg;
m_ptTerminal = ptTermOffSet;
m_pwndComponent = pwndComp;
}
__Component(CRect rcRect,CWnd* pwndComp)
{
m_bResizable = false;
m_pwndComponent = pwndComp;
m_rcRect = rcRect;
}
void updateCoords(int cx,int cy)
{
if(m_bResizable)
{
int nCx = cx-m_ptTerminal.x;
int nCy = cy-m_ptTerminal.y;
CRect rcRect(m_ptOrigin,CPoint(nCx,nCy));
m_pwndComponent->MoveWindow(rcRect);
}
}
bool resize(){return m_bResizable;}
};
// Construction
public:
CTabContainer();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTabContainer)
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
CWnd* addComponent(CRuntimeClass* m_rtcwnd,UINT nID,DWORD dwStyle,
CPoint ptOrigin,CPoint ptTerminal);
CWnd* addComponent(CRuntimeClass* m_rtcwnd,UINT nID,DWORD dwStyle,
CRect rcRect);
void addComponent(CWnd* pwndComp,CRect rcRect);
void addComponent(CWnd* pwndComp,CPoint ptOrg,CPoint ptTerm);
void addButton(int iImage,_CGuiToolButton* pwndComp,CString m_szCaption=_T(""),
CString m_ToolTip=_T(""));
void SetImageList(UINT nBitmapID, int cx, int nGrow, COLORREF crMask);
virtual ~CTabContainer();
DECLARE_MESSAGE_MAP()
// Generated message map functions
protected:
//{{AFX_MSG(CTabContainer)
afx_msg void OnPaint();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
//}}AFX_MSG
CArray<__Component*,__Component*> m_ptrComponents;
CImageList m_imgList;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TABCONTAINER_H__B1835CB8_81E4_44D9_A114_9515CB7F1C0B__INCLUDED_)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?