Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Grouping Controls on a Ribbon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Grouping Controls on a Ribbon

 Post Reply Post Reply
Author
Message
Danlar View Drop Down
Groupie
Groupie
Avatar

Joined: 27 February 2008
Location: United States
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Danlar Quote  Post ReplyReply Direct Link To This Post Topic: Grouping Controls on a Ribbon
    Posted: 05 May 2008 at 3:58pm
Hello,

I recently discovered the SetControlsGrouping function on CXTPRibbonGroup. For any unfamiliar readers, this function provides two alternative ways to "group" various controls within a single CXTPRibbonGroup. Here is an example from the RibbonSample of two different groups: The one and on the left has ControlsGrouping set to False, and the one on the right has it set to True.



I noticed a ribbon group in Microsoft Excel 2007 that appears to be combining both of these styles within a single CXTPRibbonGroup. Is it possible with CodeJock to make a ribbon group appear like this one from excel? Note that the right half of this Ribbon Group is denoted with a separator, whereas the left half uses ControlsGrouping. I couldn't find a way to use separators when ControlsGrouping is True.



Here is a mock-up of what we would most like our ribbon group to look like; is this possible? Notice how the far left control appears to be "ungrouped," and we have a separator in there, yet some controls are still "grouped" together (below the left combobox and in the top-right corner).



Thanks,
Dan Fike
Back to Top
cpehonk View Drop Down
Groupie
Groupie


Joined: 27 April 2008
Location: Germany
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpehonk Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2008 at 12:56am
Hi Dan,
 
did you already try to use "BeginGroup( TRUE)" on the first added control of the "sub-group" ? Didn't try this myself but it might work for you.
 
It works perfectly for inserting separators so far ...
 
Greetings,
Chris
Back to Top
Danlar View Drop Down
Groupie
Groupie
Avatar

Joined: 27 February 2008
Location: United States
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Danlar Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2008 at 10:44am
Consider the following group:



This group was constructed with the following code:

CXTPRibbonTab* tab = pRibbonBar->AddTab(_T("TestTab"));

CXTPRibbonGroup* group = tab->AddGroup(_T("TestGroup"));

group->Add(xtpControlButton, ID_EDIT_PASTE)->SetBeginGroup(TRUE);
     
group->Add(xtpControlButton, ID_EDIT_PASTE)->SetBeginGroup(TRUE);
group->Add(xtpControlButton, ID_EDIT_PASTE);
     
group->Add(xtpControlButton, ID_EDIT_PASTE)->SetBeginGroup(TRUE);
     
group->Add(xtpControlButton, ID_EDIT_PASTE)->SetBeginGroup(TRUE);
group->Add(xtpControlButton, ID_EDIT_PASTE);
     
group->Add(xtpControlButton, ID_EDIT_PASTE)->SetBeginGroup(TRUE);
group->Add(xtpControlButton, ID_EDIT_PASTE);

group->SetControlsGrouping(FALSE);


Now, if I change that very last line of code to read as group->SetControlsGrouping(TRUE), the group will look like this instead:



The CXTPControl::SetBeginGroup function has different results if you change the argument to CXTPRibbonGroup::SetControlsGrouping. You don't get separators anymore. I'm trying to find a way to blend both results in a single group, the way Microsoft Excel 2007 appears to be doing it in the screenshot of my previous post.

Furthermore, I added calls to CXTPControl::SetStyle to the last two controls in the above code, using xtpButtonIconAndCaption and xtpButtonIconAndCaptionBelow as arguments, and this was the result.



That seems a bit odd.

It doesn't seem that CodeJock is capable of making a ribbon group that looks like the Excel image or the desired mock-up in my original post. I'm just looking to confirm this before I move on.

-Dan
Back to Top
cpehonk View Drop Down
Groupie
Groupie


Joined: 27 April 2008
Location: Germany
Status: Offline
Points: 22
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpehonk Quote  Post ReplyReply Direct Link To This Post Posted: 06 May 2008 at 12:51pm
Understood and agreed ...
 
Maybe this is a job for Oleg again ...
 
Greetings,
Chris
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.031 seconds.