PaintToolbar.cpp
资源名称:GDIUSE.rar [点击查看]
上传用户:jinlangri
上传日期:2022-07-17
资源大小:10774k
文件大小:1k
源码类别:
GDI/图象编程
开发平台:
Visual C++
- // PaintToolbar.cpp : implementation file
- //
- #include "stdafx.h"
- #include "draw.h"
- #include "PaintToolbar.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CPaintToolbar
- CPaintToolbar::CPaintToolbar()
- {
- }
- CPaintToolbar::~CPaintToolbar()
- {
- }
- BEGIN_MESSAGE_MAP(CPaintToolbar, CToolBar)
- //{{AFX_MSG_MAP(CPaintToolbar)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CPaintToolbar message handlers
- void CPaintToolbar::SetColumns(UINT nColumns)
- {
- m_nColumns = nColumns;
- int nCount = GetToolBarCtrl().GetButtonCount();
- for(int i = 0; i < nCount; i++)
- {
- UINT nStyle = GetButtonStyle(i);
- BOOL bWrap = (((i + 1) % nColumns) == 0);
- if(bWrap)
- nStyle |= TBBS_WRAPPED;
- else
- nStyle &= ~TBBS_WRAPPED;
- SetButtonStyle(i, nStyle);
- }
- Invalidate();
- GetParentFrame()->RecalcLayout();
- }
- #ifdef _DEBUG
- void CPaintToolbar::AssertValid() const
- {
- CWnd::AssertValid();
- }
- void CPaintToolbar::Dump(CDumpContext& dc) const
- {
- CWnd::Dump(dc);
- }
- #endif //_DEBUG