// ScheduleBar.cpp : implementation file//#include "stdafx.h"#include "webdatamining.h"#include "ScheduleBar.h"#ifdef _DEBUG#undef THIS_FILEstatic char THIS_FILE[]=__FILE__;#define new DEBUG_NEW#endif/////////////////////////////////////////////////////////////////////////////// CScheduleBarconst int nBorderSize = 1;CScheduleBar::CScheduleBar(){}CScheduleBar::~CScheduleBar(){}BEGIN_MESSAGE_MAP(CScheduleBar, CDockablePane)//{{AFX_MSG_MAP(CScheduleBar)ON_WM_CREATE()ON_WM_PAINT()ON_WM_SIZE()ON_WM_CONTEXTMENU()//}}AFX_MSG_MAPON_WM_SETFOCUS()END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CScheduleBar message handlersint CScheduleBar::OnCreate(LPCREATESTRUCT lpCreateStruct){if (CDockablePane::OnCreate(lpCreateStruct) == -1)return -1;CRect rectDummy;rectDummy.SetRectEmpty ();// Create tree windows.// TODO: create your own tab windows here:const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES |TVS_LINESATROOT | TVS_HASBUTTONS;if (!m_wndTree.Create (dwViewStyle, rectDummy, this, 1)){TRACE0("Failed to create workspace view\n");return -1; // fail to create}// Setup trees content:m_wndTree.SetImageList(IDB_TREEIMGLIST,16,4,RGB(255,255,255));m_wndTree.InitUpdate(TRUE);theApp.SetScheduleTree(&m_wndTree);return 0;}void CScheduleBar::OnPaint(){CPaintDC dc(this); // device context for paintingCRect rectTree;m_wndTree.GetWindowRect (rectTree);ScreenToClient (rectTree);rectTree.InflateRect (nBorderSize, nBorderSize);dc.Draw3dRect (rectTree, ::GetSysColor (COLOR_3DSHADOW),::GetSysColor (COLOR_3DSHADOW));}void CScheduleBar::OnSize(UINT nType, int cx, int cy){CDockablePane::OnSize(nType, cx, cy);// Tab control should cover a whole client area:m_wndTree.SetWindowPos (NULL, nBorderSize, nBorderSize,cx - 2 * nBorderSize, cy - 2 * nBorderSize,SWP_NOACTIVATE | SWP_NOZORDER);}void CScheduleBar::OnContextMenu(CWnd* pWnd, CPoint point){// TODO: Add your message handler code hereCTreeCtrl* pWndTree = (CTreeCtrl*) &m_wndTree;ASSERT_VALID (pWndTree);if (pWnd != pWndTree){CDockablePane::OnContextMenu(pWnd, point);return;}if (point != CPoint(-1, -1)){// ѡѵ:CPoint ptTree = point;pWndTree->ScreenToClient(&ptTree);UINT flags = 0;HTREEITEM hTreeItem = pWndTree->HitTest(ptTree, &flags);if (hTreeItem != NULL){pWndTree->SelectItem(hTreeItem);}}pWndTree->SetFocus();theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_TOOLBAR, point.x, point.y, this, TRUE);}void CScheduleBar::OnSetFocus(CWnd* pOldWnd){CDockablePane::OnSetFocus(pOldWnd);// TODO: Add your message handler code herem_wndTree.SetFocus();}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。