Ejemplo n.º 1
0
BOOL CMainFrame::InitRibbonBars(CXTPCommandBars* pCommandBars)
{
    m_cmdbars = pCommandBars;

    m_cmdbars->GetCommandBarsOptions()->ShowKeyboardCues(xtpKeyboardCuesShowWindowsDefault);
    m_cmdbars->GetCommandBarsOptions()->bToolBarAccelTips = TRUE;
    m_cmdbars->GetCommandBarsOptions()->bShowKeyboardTips = TRUE;
    m_cmdbars->GetShortcutManager()->SetAccelerators(m_id);

    if (InitRibbonTheme() && !CreateRibbonBar())
    {
        TRACE0("Failed to create ribbon\n");
    }

    if (!CreateStatusBar())
        return FALSE;

    CXTPToolTipContext* pToolTipContext = m_cmdbars->GetToolTipContext();
    pToolTipContext->SetStyle((XTPToolTipStyle)(xtpToolTipLuna + 1));
    pToolTipContext->ShowTitleAndDescription();
    pToolTipContext->SetMargin(CRect(2, 2, 2, 2));
    pToolTipContext->SetMaxTipWidth(180);

    m_enableCustomize = m_frameNode->GetBool(L"enableCustomize", !HasRibbonBar());
    LoadCommandBars();

    CreateDockingPanes();

    return TRUE;
}
Ejemplo n.º 2
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CBCGPFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	CBCGPToolbarComboBoxButton::SetFlatMode ();
	CBCGPToolBar::EnableQuickCustomization ();

	//--------------------------------
	// Création du rubban
	//--------------------------------
	if (!CreateRibbonBar())
	{
		TRACE0("Failed to create ribbon bar\n");
		return -1;      // fail to create
	}
	
	//--------------------------------
	// Création des barres ancrables
	//--------------------------------
	if (!CreateDockingBars())
	{
		TRACE0("Failed to create docking bars\n");
		return -1;      // fail to create
	}

	
	//--------------------------------
	// Création de la barre de status
	//--------------------------------
	if (!m_wndStatusBar.Create(this))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	
	CBCGPToolBar::SetMenuSizes (CSize (22, 22), CSize (16, 16));
	CBCGPToolBar::AddToolBarForImageCollection (IDR_TOOLBAR_IMAGES
												, IDB_TOOLBAR_IMAGES_16		// Hot
												, IDB_TOOLBAR_IMAGES_16		// Cold
												, IDB_TOOLBAR_IMAGES_16		// Menu
												, IDB_TOOLBAR_IMAGES_D16	// Disable
												, IDB_TOOLBAR_IMAGES_D16);	// Menu Disable

	// Ancrage
	m_wndPropertiesBar.EnableDocking(CBRS_ALIGN_ANY);

	EnableDocking(CBRS_ALIGN_ANY);
	EnableAutoHideBars(CBRS_ALIGN_ANY);

	DockControlBar(&m_wndPropertiesBar);

	return 0;
}
Ejemplo n.º 3
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWndEx::OnCreate(lpCreateStruct) == -1)
		return -1;

	OnAppLook (m_nAppLook);

	if (!CreateRibbonBar ())
	{
		TRACE0("Failed to create ribbon bar\n");
		return -1;      // fail to create
	}

//	m_wndRibbonBar.SaveToXMLFile(_T("E:\\Users\\patbr\\Documents\\Visual Studio 10\\Samples\\C++\\MFC\\Visual C++ 2008 Feature Pack\\RibbonGadgets\\res\\RibbonGadgets.mfcribbon-ms"));

	if (!m_wndStatusBar.Create(this))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	m_wndStatusBar.AddElement (new CMFCRibbonStatusBarPane (ID_STATUSBAR_PANE1, _T("Pane 1"), TRUE), _T("Pane 1"));
	m_wndStatusBar.AddExtendedElement (new CMFCRibbonStatusBarPane (ID_STATUSBAR_PANE2, _T("Pane 2"), TRUE), _T("Pane 2"));

	if (!m_wndOutput.Create (_T("Source Code"), this, CRect (0, 0, 150, 150),
		TRUE /* Has gripper */, ID_VIEW_OUTPUT,
		WS_CHILD | WS_VISIBLE | CBRS_BOTTOM | CBRS_FLOAT_MULTI,
		AFX_CBRS_REGULAR_TABS, AFX_CBRS_RESIZE | AFX_CBRS_AUTOHIDE))
	{
		TRACE0("Failed to create output bar\n");
		return -1;      // fail to create
	}

	EnableDocking(CBRS_ALIGN_ANY);
	EnableAutoHidePanes(CBRS_ALIGN_ANY);
	DockPane(&m_wndOutput);

	OnChangeRibbonCategory (0, 0);
	return 0;
}
Ejemplo n.º 4
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CMDIFrameWndEx::OnCreate(lpCreateStruct) == -1)
		return -1;

	OnAppLook(m_nAppLook);

	if (!CreateRibbonBar())
	{
		TRACE0("Failed to create ribbon bar\n");
		return -1;      // fail to create
	}

	if (!CreateStatusBar())
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	// Enable windows manager:
	EnableWindowsDialog(ID_WINDOW_MANAGER, _T("&Windows..."), TRUE);

	return 0;
}