Print Page | Close Window

ribbon images

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=17987
Printed Date: 02 December 2024 at 11:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ribbon images
Posted By: dalai
Subject: ribbon images
Date Posted: 02 March 2011 at 12:17pm
trying to figure out how ribbon images are assigned to ribbon controls in codejock samples RibbonMDISample & RibbonControls. trying to reproduce this in my own project with any progress??< id="gwProxy" ="">< ="jsCall;" id="jsProxy" ="">



Replies:
Posted By: dalai
Date Posted: 02 March 2011 at 6:15pm
I've used the ribbon code from RibbonMDISample in my project which creates the correct ribbon tab,group and buttons but no icons and no icons on the systembutton menu.

How can I use codejock to:

1) define large & small images for each group (category) e.g. IDB_WRITELARGE & IDB_WRITESMALL ?

2) define Image Index and Large Image Index for each control within the group ?

this is not coded in the samples so I cannot determine how this is being achieved.

Visual Studio 2010 wizard creates a sample ribbon that has the following properties:

Bar Control, Images = IDB_BUTTONS
 home category (group), large images = IDB_WRITELARGE, small images = IDB_WRITESMALL
  Paste Button, ID = ID_EDIT_PASTE, Image Index = 0, Large Image Index = 0 (use image 0 on IDB_WRITELARGE)
  Cut Button, ID = ID_EDIT_CUT, Image Index = 1, Large Image Index = -1 (use image 1 on IDB_WRITESMALL)
  Copy Button, ID = ID_EDIT_COPY, Image Index = 2, Large Image Index = -1 (use image 2 on IDB_WRITESMALL)
  Select All Button, ID = ID_EDIT_SELECT_ALL, Image Index = 3, Large Image Index = -1 (use image 3 on IDB_WRITESMALL)
  Window Manager Button, ID = ID_WINDOW_MANAGER, Image Index = 8, Large Image Index = 3 (use image 3 on IDB_WRITELARGE and Quick Access image 8 on IDB_WRITESMALL)

no idea how this is being achieved with codejock samples (also refers to image files that don't exist) ???  


Posted By: dalai
Date Posted: 03 March 2011 at 3:14am
Visual Studio has a logical solution where each tab group or category has a large and small image definition. Each control in the group has a large and small index into the image.

Unless I'm missing something I just don't understand how this is organised in codejock code? and no documentation on it either????


Posted By: dalai
Date Posted: 03 March 2011 at 6:50am
uploads/6562/Ribbon.zip - uploads/6562/Ribbon.zip < id="gwProxy" ="">< ="jsCall;" id="jsProxy" ="">

Ref. RibbonProcedure.png. In RibbonControls sample, how is the system menu + images generated from ID_MENU_FILE TOOLBAR and ID_MENU_FILE image?

Ref. RibbonProcedure2.png. In RibbonMDISample, how are the file group images generated using ID_LARGEICONS TOOLBAR and ID_LARGEICONS image.

Ref. RibbonProcedure2.png. Why wasn't ID_SMALLICONS TOOLBAR used since no reference to in ->AddGroup(ID_GROUP_FILE).

totally confused???
< id="gwProxy" ="">< ="jsCall;" id="jsProxy" ="">


Posted By: dalai
Date Posted: 03 March 2011 at 1:34pm
also in RibbonControls sample), how does the following code gets the correct icon from IDR_MAINFRAME with out any index value

CXTPControl* pControlAbout = pRibbonBar->GetControls()->Add(xtpControlButton, ID_APP_ABOUT);
pControlAbout->SetFlags(xtpFlagRightAlign);
pCommandBars->GetImageManager()->SetIcons(IDR_MAINFRAME);

and again without any reference to an image file and index, how are the correct icons chosen here:

pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_FILE_NEW);
pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_FILE_OPEN)->SetHideFlag(xtpHideCustomize, TRUE);
pRibbonBar->GetQuickAccessControls()->Add(xtpControlButton, ID_FILE_SAVE);


< id="gwProxy" ="">< ="jsCall;" id="jsProxy" ="">


Posted By: Oleg
Date Posted: 04 March 2011 at 6:35am
Hi,

Add Toolbar resource and specify Ids for ID_LARGEICONS.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: dalai
Date Posted: 07 March 2011 at 9:05am
sorry Oleg I don't understand.< id="gwProxy" ="">< ="jsCall;" id="jsProxy" ="">


Posted By: dalai
Date Posted: 07 March 2011 at 9:14am
in the RibbonControls sample, it adds:

CXTPControl* pControlAbout = pRibbonBar->GetControls()->Add(xtpControlButton, ID_APP_ABOUT);

and sets image strip:

pCommandBars->GetImageManager()->SetIcons(IDR_MAINFRAME);

and ID_APP_ABOUT is the 10th image on image strip and 10th item in toolbar resource:

IDR_MAINFRAME TOOLBAR 16, 16
BEGIN
    BUTTON      ID_FILE_NEW
    BUTTON      ID_FILE_OPEN
    BUTTON      ID_FILE_SAVE
    BUTTON      ID_EDIT_CUT
    BUTTON      ID_EDIT_COPY
    BUTTON      ID_EDIT_PASTE
    SEPARATOR
    BUTTON      ID_EDIT_UNDO
    BUTTON      ID_EDIT_REDO
    SEPARATOR
    BUTTON      ID_FILE_PRINT
    SEPARATOR
    BUTTON      ID_APP_ABOUT
END
< id="gwProxy" ="">< ="jsCall;" id="jsProxy" ="">



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net