Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - ribbon images
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ribbon images

 Post Reply Post Reply
Author
Message
dalai View Drop Down
Groupie
Groupie


Joined: 07 January 2011
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote dalai Quote  Post ReplyReply Direct Link To This Post Topic: ribbon images
    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" ="">
Back to Top
dalai View Drop Down
Groupie
Groupie


Joined: 07 January 2011
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote dalai Quote  Post ReplyReply Direct Link To This Post 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) ???  
Back to Top
dalai View Drop Down
Groupie
Groupie


Joined: 07 January 2011
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote dalai Quote  Post ReplyReply Direct Link To This Post 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????
Back to Top
dalai View Drop Down
Groupie
Groupie


Joined: 07 January 2011
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote dalai Quote  Post ReplyReply Direct Link To This Post Posted: 03 March 2011 at 6:50am
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" ="">
Back to Top
dalai View Drop Down
Groupie
Groupie


Joined: 07 January 2011
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote dalai Quote  Post ReplyReply Direct Link To This Post 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" ="">
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 04 March 2011 at 6:35am
Hi,

Add Toolbar resource and specify Ids for ID_LARGEICONS.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
dalai View Drop Down
Groupie
Groupie


Joined: 07 January 2011
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote dalai Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2011 at 9:05am
sorry Oleg I don't understand.< id="gwProxy" ="">< ="jsCall;" id="jsProxy" ="">
Back to Top
dalai View Drop Down
Groupie
Groupie


Joined: 07 January 2011
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote dalai Quote  Post ReplyReply Direct Link To This Post 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" ="">
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.133 seconds.