コード例 #1
0
ファイル: MainFrm.cpp プロジェクト: geforce42376/easyprofiler
BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, int nInitialWidth)
{
	CWindowDC dc(NULL);

	bar.SetMode2003();

	BOOL bNameValid;
	CString strTemp;
	bNameValid = strTemp.LoadString(IDS_SHORTCUTS);
	ASSERT(bNameValid);
	if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS_CHILD | WS_VISIBLE | CBRS_LEFT))
	{
		return FALSE; // fail to create
	}

	CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)bar.GetUnderlyingWindow();

	if (pOutlookBar == NULL)
	{
		ASSERT(FALSE);
		return FALSE;
	}

	pOutlookBar->EnableInPlaceEdit(TRUE);

	static UINT uiPageID = 1;

	DWORD dwPaneStyle = AFX_DEFAULT_TOOLBAR_STYLE | CBRS_FLOAT_MULTI;

	// can float, can autohide, can resize, CAN NOT CLOSE
	DWORD dwStyle = AFX_CBRS_FLOAT | AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE;

	CRect rectDummy(0, 0, 0, 0);

	m_TreeBar.Create(NULL,NULL,WS_VISIBLE|WS_CHILD,rectDummy,&bar,1200);
	bNameValid = strTemp.LoadString(IDS_FOLDERS);
	ASSERT(bNameValid);
	pOutlookBar->AddControl(&m_TreeBar, _T("Test data"), 0, TRUE, dwStyle);

	m_selectionPane.Create(NULL,NULL,WS_VISIBLE|WS_CHILD,rectDummy, &bar, 1201);
	pOutlookBar->AddControl(&m_selectionPane, _T("Compare target"), 1, TRUE, dwStyle);



	bar.SetPaneStyle(bar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	pOutlookBar->SetImageList(theApp.m_bHiColorIcons ? IDB_PAGES_HC : IDB_PAGES, 24);
	pOutlookBar->SetToolbarImageList(theApp.m_bHiColorIcons ? IDB_PAGES_SMALL_HC : IDB_PAGES_SMALL, 16);
	pOutlookBar->RecalcLayout();

	BOOL bAnimation = theApp.GetInt(_T("OutlookAnimation"), TRUE);
	CMFCOutlookBarTabCtrl::EnableAnimation(bAnimation);

	bar.SetButtonsFont(&afxGlobalData.fontBold);

	return TRUE;
}
コード例 #2
0
BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, CMFCShellTreeCtrl& tree, CCalendarBar& calendar, int nInitialWidth)
{
    bar.SetMode2003();

    BOOL bNameValid;
    CString strTemp;
    bNameValid = strTemp.LoadString(IDS_SHORTCUTS);
    ASSERT(bNameValid);
    if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS_CHILD | WS_VISIBLE | CBRS_LEFT))
    {
        return FALSE; // 만들지 못했습니다.
    }

    CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)bar.GetUnderlyingWindow();

    if (pOutlookBar == NULL)
    {
        ASSERT(FALSE);
        return FALSE;
    }

    pOutlookBar->EnableInPlaceEdit(TRUE);

    static UINT uiPageID = 1;

    // 움직이거나, 자동으로 숨기거나, 크기를 조정할 수 있지만 닫을 수는 없습니다.
    DWORD dwStyle = AFX_CBRS_FLOAT | AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE;

    CRect rectDummy(0, 0, 0, 0);
    const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

    tree.Create(dwTreeStyle, rectDummy, &bar, 1200);
    bNameValid = strTemp.LoadString(IDS_FOLDERS);
    ASSERT(bNameValid);
    pOutlookBar->AddControl(&tree, strTemp, 2, TRUE, dwStyle);

    calendar.Create(rectDummy, &bar, 1201);
    bNameValid = strTemp.LoadString(IDS_CALENDAR);
    ASSERT(bNameValid);
    pOutlookBar->AddControl(&calendar, strTemp, 3, TRUE, dwStyle);

    bar.SetPaneStyle(bar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

    pOutlookBar->SetImageList(theApp.m_bHiColorIcons ? IDB_PAGES_HC : IDB_PAGES, 24);
    pOutlookBar->SetToolbarImageList(theApp.m_bHiColorIcons ? IDB_PAGES_SMALL_HC : IDB_PAGES_SMALL, 16);
    pOutlookBar->RecalcLayout();

    BOOL bAnimation = theApp.GetInt(_T("OutlookAnimation"), TRUE);
    CMFCOutlookBarTabCtrl::EnableAnimation(bAnimation);

    bar.SetButtonsFont(&afxGlobalData.fontBold);

    return TRUE;
}
コード例 #3
0
ファイル: MainFrm.cpp プロジェクト: kooiot/rdc
BOOL CMainFrame::CreateOutlookBar(CMFCOutlookBar& bar, UINT uiID, int nInitialWidth)
{
	bar.SetMode2003();

	BOOL bNameValid;
	CString strTemp;
	bNameValid = strTemp.LoadString(IDS_SHORTCUTS);
	ASSERT(bNameValid);
	if (!bar.Create(strTemp, this, CRect(0, 0, nInitialWidth, 32000), uiID, WS_CHILD | WS_VISIBLE | CBRS_LEFT))
	{
		return FALSE; // 未能创建
	}

	CMFCOutlookBarTabCtrl* pOutlookBar = (CMFCOutlookBarTabCtrl*)bar.GetUnderlyingWindow();

	if (pOutlookBar == NULL)
	{
		ASSERT(FALSE);
		return FALSE;
	}

	pOutlookBar->EnableInPlaceEdit(TRUE);

	static UINT uiPageID = 1;

	// 可浮动,可自动隐藏,可调整大小,但不能关闭
	DWORD dwStyle = AFX_CBRS_AUTOHIDE | AFX_CBRS_RESIZE;

	CRect rectDummy(0, 0, 0, 0);
	const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;
	m_wndOnlineTree.Create(dwTreeStyle, rectDummy, &bar, 1200);
	m_wndOfflineTree.Create(dwTreeStyle, rectDummy, &bar, 1200);
	m_wndOutdateTree.Create(dwTreeStyle, rectDummy, &bar, 1200);

	CImageList* pImageList = new CImageList();
	
	pImageList->Create(24, 24, ILC_COLOR32 | ILC_MASK, 0, 3);
	CBitmap bmp;
	bmp.LoadBitmap(IDB_DEVICES);
	pImageList->Add(&bmp, RGB(255, 0, 255));
	m_wndOnlineTree.SetImageList(pImageList, TVSIL_NORMAL);
	m_wndOfflineTree.SetImageList(pImageList, TVSIL_NORMAL);
	m_wndOutdateTree.SetImageList(pImageList, TVSIL_NORMAL);

	bNameValid = strTemp.LoadString(IDS_ONLINE_DEVICES);
	ASSERT(bNameValid);
	m_treeOnlineRoot = m_wndOnlineTree.InsertItem(strTemp, 0, 0);
	pOutlookBar->AddControl(&m_wndOnlineTree, strTemp, 2, TRUE, dwStyle);

	m_wndOnlineTree.Expand(m_treeOnlineRoot, TVE_EXPAND);
	auto h = m_wndOnlineTree.InsertItem(strTemp, 0, 0, m_treeOnlineRoot);
	m_wndOnlineTree.InsertItem(strTemp, 0, 0, h);


	bNameValid = strTemp.LoadString(IDS_OFFLINE_DEVICES);
	ASSERT(bNameValid);
	m_treeOfflineRoot = m_wndOfflineTree.InsertItem(strTemp, 0, 0);
	pOutlookBar->AddControl(&m_wndOfflineTree, strTemp, 2, TRUE, dwStyle);

	bNameValid = strTemp.LoadString(IDS_OUTDATE_DEVICES);
	ASSERT(bNameValid);
	m_treeOutdateRoot = m_wndOutdateTree.InsertItem(strTemp, 0, 0);
	pOutlookBar->AddControl(&m_wndOutdateTree, strTemp, 2, TRUE, dwStyle);
	

	bar.SetPaneStyle(bar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	pOutlookBar->SetImageList(theApp.m_bHiColorIcons ? IDB_PAGES_HC : IDB_PAGES, 24);
	pOutlookBar->SetToolbarImageList(theApp.m_bHiColorIcons ? IDB_PAGES_SMALL_HC : IDB_PAGES_SMALL, 16);
	pOutlookBar->RecalcLayout();

	BOOL bAnimation = theApp.GetInt(_T("OutlookAnimation"), TRUE);
	CMFCOutlookBarTabCtrl::EnableAnimation(bAnimation);

	bar.SetButtonsFont(&afxGlobalData.fontBold);

	return TRUE;
}