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

📄 mainfrm.cpp

📁 这是书上的代码
💻 CPP
📖 第 1 页 / 共 3 页
字号:
	return TRUE; 
}

BOOL CMainFrame::CreateDeviceRectToolBar()
{
	if (!m_wndDeviceRectToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndDeviceRectToolBar.LoadToolBar(IDR_RECTDEVICETOOLBAR))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
	m_wndDeviceRectToolBar.SetWindowText(_T("矩形"));
	ShowControlBar( &m_wndDeviceRectToolBar, FALSE, FALSE );
	m_wndDeviceRectToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	FloatControlBar(&m_wndDeviceRectToolBar, CPoint(500,300));
//	DockControlBar(&m_wndArcToolBar,AFX_IDW_DOCKBAR_RIGHT);	
	return TRUE; 
}

BOOL CMainFrame::CreateDevicePolygonToolBar()
{
	if (!m_wndDevicePolygonToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndDevicePolygonToolBar.LoadToolBar(IDR_POLYGONDEVICETOOLBAR))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
	m_wndDevicePolygonToolBar.SetWindowText(_T("多边形"));
	ShowControlBar( &m_wndDevicePolygonToolBar, FALSE, FALSE );
	m_wndDevicePolygonToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	FloatControlBar(&m_wndDevicePolygonToolBar, CPoint(500,300));
//	DockControlBar(&m_wndArcToolBar,AFX_IDW_DOCKBAR_RIGHT);	
	return TRUE;
}

BOOL CMainFrame::CreateDeviceRoundrectToolBar()
{
	if (!m_wndDeviceRoundrectToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndDeviceRoundrectToolBar.LoadToolBar(IDR_ROUNDRECTDEVICETOOLBAR))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
	m_wndDeviceRoundrectToolBar.SetWindowText(_T("圆角矩形"));
	ShowControlBar( &m_wndDeviceRoundrectToolBar, FALSE, FALSE );
	m_wndDeviceRoundrectToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	FloatControlBar(&m_wndDeviceRoundrectToolBar, CPoint(500,300));
//	DockControlBar(&m_wndArcToolBar,AFX_IDW_DOCKBAR_RIGHT);	
	return TRUE;
}

BOOL CMainFrame::CreateDeviceChordToolBar()
{
	if (!m_wndDeviceChordToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndDeviceChordToolBar.LoadToolBar(IDR_CHORDDEVICETOOLBAR))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
	m_wndDeviceChordToolBar.SetWindowText(_T("弦"));
	ShowControlBar( &m_wndDeviceChordToolBar, FALSE, FALSE );
	m_wndDeviceChordToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	FloatControlBar(&m_wndDeviceChordToolBar, CPoint(500,300));
//	DockControlBar(&m_wndArcToolBar,AFX_IDW_DOCKBAR_RIGHT);	
	return TRUE;  
}

BOOL CMainFrame::CreateDevicePieToolBar()
{
	if (!m_wndDevicePieToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndDevicePieToolBar.LoadToolBar(IDR_PIEDEVICETOOLBAR))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
	m_wndDevicePieToolBar.SetWindowText(_T("扇形"));
	ShowControlBar( &m_wndDevicePieToolBar, FALSE, FALSE );
	m_wndDevicePieToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	FloatControlBar(&m_wndDevicePieToolBar, CPoint(500,300));
//	DockControlBar(&m_wndArcToolBar,AFX_IDW_DOCKBAR_RIGHT);	
	return TRUE; 
}



void CMainFrame::OnViewBuildingdrawtoolbarArc() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingArcToolBar,(m_wndBuildingArcToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarArc(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingArcToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewBuildingdrawtoolbarBeeline() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingLineToolBar,(m_wndBuildingLineToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarBeeline(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingLineToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewBuildingdrawtoolbarChord() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingChordToolBar,(m_wndBuildingChordToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarChord(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingChordToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewBuildingdrawtoolbarEllipse() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingEllipseToolBar,(m_wndBuildingEllipseToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarEllipse(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingEllipseToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewBuildingdrawtoolbarLazys() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingLazysToolBar,(m_wndBuildingLazysToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarLazys(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingLazysToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewBuildingdrawtoolbarPie() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingPieToolBar,(m_wndBuildingPieToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarPie(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingPieToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewBuildingdrawtoolbarPolygon() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingPolygonToolBar,(m_wndBuildingPolygonToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarPolygon(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingPolygonToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewBuildingdrawtoolbarRect() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingRectToolBar,(m_wndBuildingRectToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarRect(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingRectToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewBuildingdrawtoolbarRoundrect() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndBuildingRoundrectToolBar,(m_wndBuildingRoundrectToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewBuildingdrawtoolbarRoundrect(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndBuildingRoundrectToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarArc() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDeviceArcToolBar,(m_wndDeviceArcToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarArc(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDeviceArcToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarBeeline() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDeviceLineToolBar,(m_wndDeviceLineToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarBeeline(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDeviceLineToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarChord() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDeviceChordToolBar,(m_wndDeviceChordToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarChord(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDeviceChordToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarEllipse() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDeviceEllipseToolBar,(m_wndDeviceEllipseToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarEllipse(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDeviceEllipseToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarLazys() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDeviceLazysToolBar,(m_wndDeviceLazysToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarLazys(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDeviceLazysToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarPie() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDevicePieToolBar,(m_wndDevicePieToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarPie(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDevicePieToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarPolygon() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDevicePolygonToolBar,(m_wndDevicePolygonToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarPolygon(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDevicePolygonToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarRect() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDeviceRectToolBar,(m_wndDeviceRectToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarRect(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDeviceRectToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDevicedrawtoolbarRoundrect() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDeviceRoundrectToolBar,(m_wndDeviceRoundrectToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDevicedrawtoolbarRoundrect(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDeviceRoundrectToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewDrawtool() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndDrawToolBar,(m_wndDrawToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewDrawtool(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndDrawToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewPathdrawtoolbarArc() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndPathLineToolBar,(m_wndPathLineToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewPathdrawtoolbarArc(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndPathLineToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewPathdrawtoolbarBeeline() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndPathLineToolBar,(m_wndPathLineToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewPathdrawtoolbarBeeline(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndPathLineToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewPathdrawtoolbarLazys() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndPathLazysToolBar,(m_wndPathLazysToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewPathdrawtoolbarLazys(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndPathLazysToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewPathdrawtoolbarScp() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndPathScpToolBar,(m_wndPathScpToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewPathdrawtoolbarScp(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndPathScpToolBar.GetStyle() & WS_VISIBLE) != 0);
}

void CMainFrame::OnViewPathdrawtoolbarSide() 
{
	// TODO: Add your command handler code here
	ShowControlBar( &m_wndPathSideToolBar,(m_wndPathSideToolBar.GetStyle() & WS_VISIBLE) == 0, FALSE );
}

void CMainFrame::OnUpdateViewPathdrawtoolbarSide(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->SetCheck((m_wndPathSideToolBar.GetStyle() & WS_VISIBLE) != 0);
}

⌨️ 快捷键说明

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