Exemplo n.º 1
0
BOOL CEditFrameDialog::CreateRibbonBar ()
{
	CreateDocumentColors ();

	return CFrameDialog::CreateRibbonBar ();
}
Exemplo n.º 2
0
void CMainFrame::Add_Category3()
{
	CreateDocumentColors();

	CMFCRibbonCategory* pCategory = m_wndRibbonBar.AddCategory(_T("&Color Buttons"), IDB_RIBBON_CATEGORY3_SMALL, IDB_RIBBON_CATEGORY3_LARGE);

	CMFCRibbonPanel* pPanel1 = pCategory->AddPanel(_T("Large"));

	CMFCRibbonColorButton* pBtn1 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_1, _T("Simple"), TRUE, 0, 0);
	pBtn1->SetAlwaysLargeImage();
	pBtn1->SetDefaultCommand(FALSE);
	pPanel1->Add(pBtn1);

	CMFCRibbonColorButton* pBtn2 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_2, _T("Simple with Options"), TRUE, 1, 1);
	pBtn2->SetAlwaysLargeImage();
	pBtn2->SetDefaultCommand(FALSE);
	pBtn2->EnableAutomaticButton(_T("&Automatic"), RGB(0, 0, 0));
	pBtn2->EnableOtherButton(_T("&More Colors..."), _T("More Colors"));
	pPanel1->Add(pBtn2);

	CMFCRibbonColorButton* pBtn3 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_3, _T("Custom"), TRUE, 2, 2);
	pBtn3->SetAlwaysLargeImage();
	pBtn3->SetDefaultCommand(FALSE);
	pBtn3->EnableAutomaticButton(_T("&Automatic"), RGB(0, 0, 0));
	pBtn3->EnableOtherButton(_T("&More Colors..."), _T("More Colors"));
	pBtn3->SetColumns(10);
	pBtn3->SetColorBoxSize(CSize(17, 17));
	pBtn3->AddColorsGroup(_T("Theme Colors"), m_lstMainColors);
	pBtn3->AddColorsGroup(_T(""), m_lstAdditionalColors, TRUE);
	pBtn3->AddColorsGroup(_T("Standard Colors"), m_lstStandardColors);
	pPanel1->Add(pBtn3);

	CMFCRibbonPanel* pPanel2 = pCategory->AddPanel(_T("Small"));

	CMFCRibbonColorButton* pBtn4 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_4, _T("Simple"), TRUE, 3, -1);
	pBtn4->SetDefaultCommand(FALSE);
	pPanel2->Add(pBtn4);

	CMFCRibbonColorButton* pBtn5 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_5, _T("Simple with Options"), TRUE, 4, -1);
	pBtn5->SetDefaultCommand(FALSE);
	pBtn5->EnableAutomaticButton(_T("&Automatic"), RGB(0, 0, 0));
	pBtn5->EnableOtherButton(_T("&More Colors..."), _T("More Colors"));
	pPanel2->Add(pBtn5);

	CMFCRibbonColorButton* pBtn6 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_6, _T("Custom"), TRUE, 5, -1);
	pBtn6->SetDefaultCommand(FALSE);
	pBtn6->EnableAutomaticButton(_T("&Automatic"), RGB(0, 0, 0));
	pBtn6->EnableOtherButton(_T("&More Colors..."), _T("More Colors"));
	pBtn6->SetColumns(10);
	pBtn6->SetColorBoxSize(CSize(17, 17));
	pBtn6->AddColorsGroup(_T("Theme Colors"), m_lstMainColors);
	pBtn6->AddColorsGroup(_T(""), m_lstAdditionalColors, TRUE);
	pBtn6->AddColorsGroup(_T("Standard Colors"), m_lstStandardColors);
	pPanel2->Add(pBtn6);

	CMFCRibbonPanel* pPanel3 = pCategory->AddPanel(_T("Small with Indicator"));

	CMFCRibbonColorButton* pBtn7 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_7, _T("Simple"), 6);
	pBtn7->SetColor(RGB(255, 0, 0));
	pPanel3->Add(pBtn7);

	CMFCRibbonColorButton* pBtn8 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_8, _T("Simple with Options"), 7);
	pBtn8->SetColor(RGB(0, 0, 255));
	pBtn8->EnableAutomaticButton(_T("&Automatic"), RGB(0, 0, 0));
	pBtn8->EnableOtherButton(_T("&More Colors..."), _T("More Colors"));
	pPanel3->Add(pBtn8);

	CMFCRibbonColorButton* pBtn9 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_9, _T("Custom"), 8);
	pBtn9->EnableAutomaticButton(_T("&Automatic"), RGB(0, 0, 0));
	pBtn9->EnableOtherButton(_T("&More Colors..."), _T("More Colors"));
	pBtn9->SetColumns(10);
	pBtn9->SetColorBoxSize(CSize(17, 17));
	pBtn9->AddColorsGroup(_T("Theme Colors"), m_lstMainColors);
	pBtn9->AddColorsGroup(_T(""), m_lstAdditionalColors, TRUE);
	pBtn9->AddColorsGroup(_T("Standard Colors"), m_lstStandardColors);
	pPanel3->Add(pBtn9);

	CMFCRibbonPanel* pPanel4 = pCategory->AddPanel(_T("Embedded"));

	CMFCRibbonColorButton* pBtn10 = new CMFCRibbonColorButton(ID_RIBBON_CBTN_10, _T("Embedded"), TRUE, 1, 1);
	pBtn10->EnableOtherButton(_T("&More Colors..."), _T("More Shading Colors"));
	pBtn10->SetColor(RGB(240, 240, 240));
	pBtn10->SetColumns(10);
	pBtn10->AddColorsGroup(_T("Theme Colors"), m_lstMainColors);
	pBtn10->AddColorsGroup(_T(""), m_lstAdditionalColors, TRUE);
	pBtn10->AddColorsGroup(_T("Standard Colors"), m_lstStandardColors);
	pBtn10->SetColorBoxSize(CSize(17, 17));
	pBtn10->SetButtonMode(FALSE);
	pBtn10->EnableAutomaticButton(_T("&No Color"), (COLORREF)-1, TRUE, NULL, FALSE /* Bottom */);
	pPanel4->Add(pBtn10);

	pPanel1->SetData(ID_RIBBON_SOURCE_CODE_3_1);
	pPanel2->SetData(ID_RIBBON_SOURCE_CODE_3_2);
	pPanel3->SetData(ID_RIBBON_SOURCE_CODE_3_3);
	pPanel4->SetData(ID_RIBBON_SOURCE_CODE_3_4);
}
Exemplo n.º 3
0
CMyRibbonBar::CMyRibbonBar()
{
	CreateDocumentColors();
	chartControl.setRibbonBar(this);

}
Exemplo n.º 4
0
void CMainFrame::InitHomeCategory()
{
	CreateDocumentColors();

	CMFCRibbonCategory* pCategory = m_wndRibbonBar.AddCategory(_T("&Home"), IDB_RIBBON_HOMESMALL, IDB_RIBBON_HOMELARGE);

	// Create "Clipboard" panel:
	CMFCRibbonPanel* pPanelClipboard = pCategory->AddPanel(_T("Clipboard\nzc"), m_PanelImages.ExtractIcon(0));

	CMFCRibbonButton* pBtnPaste = new CMFCRibbonButton(ID_EDIT_PASTE, _T("Paste\nv"), 0, 0);
	pPanelClipboard->Add(pBtnPaste);

	pPanelClipboard->Add(new CMFCRibbonButton(ID_EDIT_CUT, _T("Cut\nx"), 1));
	pPanelClipboard->Add(new CMFCRibbonButton(ID_EDIT_COPY, _T("Copy\nc"), 2));
	pPanelClipboard->Add(new CMFCRibbonButton(ID_EDIT_CLEAR, _T("Delete\nt"), 3));

	// Create "Operations" panel
	CMFCRibbonPanel* pPanelOperations = pCategory->AddPanel(_T("Operations\nzo"), m_PanelImages.ExtractIcon(1));

	// <Snippet3>
	// Create the "Paper Color" button
	CMFCRibbonColorButton* pBtnPaperColor = new CMFCRibbonColorButton(ID_VIEW_PAPERCOLOR, _T("Paper Color\ng"), TRUE, 13, 1);
	pBtnPaperColor->SetAlwaysLargeImage();
	pBtnPaperColor->EnableAutomaticButton(_T("&Automatic"), RGB(255, 255, 255));
	pBtnPaperColor->EnableOtherButton(_T("&More Colors..."), _T("More Colors"));
	pBtnPaperColor->SetColumns(10);
	pBtnPaperColor->SetColorBoxSize(CSize(17, 17));
	// CList<COLORREF,COLORREF> m_lstMainColors
	pBtnPaperColor->AddColorsGroup(_T("Theme Colors"), m_lstMainColors, TRUE);
	// CList<COLORREF,COLORREF> m_lstAdditionalColors
	pBtnPaperColor->AddColorsGroup(_T(""), m_lstAdditionalColors, FALSE);
	// CList<COLORREF,COLORREF> m_lstStandardColors
	pBtnPaperColor->AddColorsGroup(_T("Standard Colors"), m_lstStandardColors, TRUE);
	CList<COLORREF,COLORREF> lstColors;
	lstColors.AddTail(RGB(255,0,0));
	lstColors.AddTail(RGB(0,255,0));
	lstColors.AddTail(RGB(0,0,255));
	pBtnPaperColor->SetDocumentColors( _T("Document Colors"), lstColors );
    // </Snippet3>

	pPanelOperations->Add(pBtnPaperColor);

	pPanelOperations->Add(new CMFCRibbonButton(ID_EDIT_SELECT_ALL, _T("Select All\na"), 4));
	pPanelOperations->Add(new CMFCRibbonButton(ID_OLE_INSERT_NEW, _T("New Object...\no"), 5));
	pPanelOperations->Add(new CMFCRibbonButton(ID_OLE_EDIT_LINKS, _T("Links...\ni"), 6));

	// Create "Draw" panel
	CMFCRibbonPanel* pPanelDraw = pCategory->AddPanel(_T("Draw\nzd"), m_PanelImages.ExtractIcon(2));

	pPanelDraw->Add(new CMFCRibbonButton(ID_DRAW_SELECT, _T("Select\ns"), 7));
	pPanelDraw->Add(new CMFCRibbonButton(ID_DRAW_LINE, _T("Line\nl"), 8));
	pPanelDraw->Add(new CMFCRibbonButton(ID_DRAW_RECT, _T("Rectangle\nr"), 9));
	pPanelDraw->Add(new CMFCRibbonButton(ID_DRAW_ROUNDRECT, _T("Round Rectangle\nn"), 10));
	pPanelDraw->Add(new CMFCRibbonButton(ID_DRAW_ELLIPSE, _T("Ellipse\ne"), 11));
	pPanelDraw->Add(new CMFCRibbonButton(ID_DRAW_POLYGON, _T("Polygon\ny"), 12));

	// Create "Arrange" panel
	CMFCRibbonPanel* pPanelArrange = pCategory->AddPanel(_T("Arrange\nzj"), m_PanelImages.ExtractIcon(3));

	pPanelArrange->Add(new CMFCRibbonButton(ID_OBJECT_MOVETOFRONT, _T("Move to Front\nmf"), 15, 3));
	pPanelArrange->Add(new CMFCRibbonButton(ID_OBJECT_MOVEFORWARD, _T("Move Forward\nmw"), 17, 5));
	pPanelArrange->Add(new CMFCRibbonButton(ID_OBJECT_MOVEBACK, _T("Move Backward\nmd"), 18, 6));
	pPanelArrange->Add(new CMFCRibbonButton(ID_OBJECT_MOVETOBACK, _T("Move to Back\nmb"), 16, 4));

	// Add not-in-ribbon commands
	CMFCRibbonButton* pUndo = new CMFCRibbonButton(ID_EDIT_UNDO, _T("Undo"), 20);
	pCategory->AddHidden(pUndo);
}