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

📄 wbtoolbar.cpp

📁 电子白板程序
💻 CPP
字号:
// WBToolBar.cpp : implementation file
//

#include "stdafx.h"
#include "WB.h"
#include "WBToolBar.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CWBToolBar

CWBToolBar::CWBToolBar()
{
}

CWBToolBar::~CWBToolBar()
{
}


BEGIN_MESSAGE_MAP(CWBToolBar, CToolBar)
	//{{AFX_MSG_MAP(CWBToolBar)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CWBToolBar message handlers

BOOL CWBToolBar::Create( CFrameWnd * pFrame )
{
	if( CToolBar::CreateEx( pFrame , TBSTYLE_FLAT | TBSTYLE_TOOLTIPS , WS_CHILD | WS_VISIBLE | CBRS_ALIGN_BOTTOM ) && this->LoadToolBar( IDR_WB_TOOLBAR ) )
	{
		this->GetToolBarCtrl().CheckButton( ID_DRAW_LINE , TRUE );
		
		CRect rect;
		
		int nIndex = this->GetToolBarCtrl().CommandToIndex( ID_LINETYPE );
		
		this->SetButtonInfo( nIndex, ID_LINETYPE , TBBS_SEPARATOR, 100 );
		
		this->GetToolBarCtrl().GetItemRect( nIndex , &rect );
		
		rect.top = 1; rect.bottom = rect.top + 500;

		this->m_linetype_combo.SetMode( CColourPickerCB::LINE );
		
		this->m_linetype_combo.Create( WS_CHILD | WS_VISIBLE | WS_VSCROLL, rect, this , ID_LINETYPE );

		nIndex = this->GetToolBarCtrl().CommandToIndex( ID_COLOR );
		
		this->SetButtonInfo( nIndex, ID_COLOR , TBBS_SEPARATOR, 100 );
		
		this->GetToolBarCtrl().GetItemRect( nIndex , &rect );
		
		rect.top = 1; rect.bottom = rect.top + 500;

		this->m_color_combo.SetMode( CColourPickerCB::COLOR );
		
		this->m_color_combo.Create( WS_CHILD | WS_VISIBLE | WS_VSCROLL, rect, this , ID_COLOR );

		nIndex = this->GetToolBarCtrl().CommandToIndex( ID_STATIC );
		
		this->SetButtonInfo( nIndex, ID_STATIC , TBBS_SEPARATOR, 150 );
		
		this->GetToolBarCtrl().GetItemRect( nIndex , &rect );

		rect.top = 2;

		this->m_static.Create( "" , WS_CHILD | WS_VISIBLE | SS_CENTER | SS_CENTERIMAGE | SS_SUNKEN , rect , this );

		return TRUE;
	}
	return FALSE;
}

⌨️ 快捷键说明

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