Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - [SOLVED]ControlGallery Ribbon init shown small
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED]ControlGallery Ribbon init shown small

 Post Reply Post Reply
Author
Message
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED]ControlGallery Ribbon init shown small
    Posted: 10 January 2017 at 9:44am
As you can see in the animated GIF, the gallery is shown as a small icon.
But when i change the tabs it is as it should be:




what can i do to force the "big" size?

pPopup = (CXTPControlPopup*)pGroup->Add(xtpControlSplitButtonPopupID_SELECT_VIEW); pPopup->SetCaption(GetRibbonItemText(ID_SELECT_VIEW, pRibbonHelperMenu)); CXTPControlGallery* pControlGallery = (CXTPControlGallery*)pPopup->GetCommandBar()->GetControls()->Add(new CXTPControlGallery(), ID_GALLERY_VIEWTYPES); pControlGallery->ShowScrollBar(FALSE); pControlGallery->SetStyle(xtpButtonIconAndCaption); pControlGallery->SetItemsMargin(XTP_DPI_X(2), XTP_DPI_Y(2), XTP_DPI_X(2), XTP_DPI_Y(2)); CXTPControlGalleryItems* pGalViewItems = CXTPControlGalleryItems::CreateItems(GetCommandBars(), ID_GALLERY_VIEWTYPES); pGalViewItems->SetItemSize(CSize(0, 38)); // XTP_DPI is done internally pGalViewItems->ClipItems(FALSE); pGalViewItems->GetImageManager()->SetIcons(IDB_PNG_VIEWTYPES, 0, 0, CSize(32, 32)); pGalViewItems->AddItem(GetRibbonItemText(ID_MDIVIEW_TOGGLE_CRDVIEW, pRibbonHelperMenu), EUIViewPresentationType::Card, 0); pGalViewItems->AddItem(GetRibbonItemText(ID_MDIVIEW_TOGGLE_BRWVIEW, pRibbonHelperMenu), EUIViewPresentationType::Browse, 1);
...


Back to Top
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2017 at 11:29am
I use XTP 17.3!
Any idea or option?

Please help me Codejock Team  :-)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 645
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2017 at 2:48am
I have no idea if this helps or what it does, but it seems to be very popular to add this line of code:
pPopup->SetFlags(xtpFlagManualUpdate);
pPopup->SetStyle(xtpButtonIconAndCaptionBelow);

-cpede
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
Jonas R. View Drop Down
Newbie
Newbie


Joined: 01 February 2017
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jonas R. Quote  Post ReplyReply Direct Link To This Post Posted: 01 February 2017 at 7:00am
Hi Codejock Team,

we are still facing this issue. :/
Any information on how to tackle it would be really appreciated. Thanks!
Back to Top
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (1) Thanks(1)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Posted: 29 March 2017 at 4:55am
I found a solution!

1. It is important to reset the Ribbon (Config)
2. this option helped me to solve the Problem:
 pGroup->AllowReduce(xtpRibbonGroupReductionDisabled);

:-)
Back to Top
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2017 at 3:17am
Unfortunately it does not work in every situation.
It looks like the serialization of ribbons has problems with DPI-Awareness?
Back to Top
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2017 at 3:37am
is there a relation with

http://forum.codejock.com/forum_posts.asp?TID=23212&KW=DPI&title=solved-ribbon-loadcommandbars-bug

?

because  CXTPControlGallery::DoPropExchange also uses
PX_DPI_Rect
Back to Top
BeeJay View Drop Down
Groupie
Groupie
Avatar

Joined: 12 March 2013
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote BeeJay Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2017 at 3:56am
any news on this?
Back to Top
BeeJay View Drop Down
Groupie
Groupie
Avatar

Joined: 12 March 2013
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote BeeJay Quote  Post ReplyReply Direct Link To This Post Posted: 02 February 2018 at 2:05am
any news on this?!? Problem ist still there :( It was promised to be addressed in 18.1 - but nothing happens at all!! :(
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 04 February 2018 at 2:57pm
Hello,

Can somebody give source code, which reproduce this issue. I can't reproduce it with codesample from first post. It will be ideal if this can be inserted in our RibbonSample or other sample. 

Regards,
 Oleksandr Lebed
Back to Top
BeeJay View Drop Down
Groupie
Groupie
Avatar

Joined: 12 March 2013
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote BeeJay Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2018 at 2:00am
Hi Oleksandr,

sorry our application is far too huge and complex to pass it on. If you provide us the right places where to add TRACEs in the XTP source to narrow it down, we will happy to do this to help! Please refer to issue #35615 for further contact.

@forum: we will let you know as soon as we know how to fix it
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2018 at 9:16am
BeeJay, other customers also can help and interested in solution.

So in MFC RibbonSample I have added code similar to first post
CMainFrame::CreateRibbonBar()BOOL CMainFrame::CreateRibbonBar()
{
.....
    
    CXTPRibbonTab* pTabHome = pRibbonBar->AddTab(ID_TAB_HOME);
    pTabHome->SetCustomizeCaption(_T("(Home)"));

    
    CXTPRibbonGroup* pGroup1 = pTabHome->AddGroup(ID_GROUP_CLIPBOARD);
    
    CXTPControlPopup* pPopup = (CXTPControlPopup*)pGroup1->Add(xtpControlSplitButtonPopup, ID_EDIT_PASTE);
    pPopup->SetCaption(_T("bla bla"));
        
    CXTPControlGallery* pControlGallery1 = (CXTPControlGallery*)pPopup->GetCommandBar()->GetControls()->Add(new CXTPControlGallery(), ID_GALLERY_STYLES);
    pControlGallery1->ShowScrollBar(FALSE);
    pControlGallery1->SetStyle(xtpButtonIconAndCaption);
    pControlGallery1->SetItemsMargin(XTP_DPI_X(2), XTP_DPI_Y(2), XTP_DPI_X(2), XTP_DPI_Y(2));

.....

//excluded adding groups ID_GROUP_PARAGRAPH and ID_GROUP_STYLES

Try to change this to reproduce your issues.
Do I correctly understood that problem on GIF with icon in GroupPopup in  tab "Start" >  group "Anzeigen" ?

Regards,
 Oleksandr Lebed
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 260
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 11 November 2021 at 6:01am
Hello,

During investigation of the bug I found maybe RobbonSample has same behaior in certain conditions.

In sample we have couple buttons "Signature line", "Date & Time" and "Insert object", they all in "INSERT" tab. During initialization for every button was set style pControlButton->SetStyleEx(xtpButtonIconAndCaption);.


This buttons works as expected. But if I to add next functions calls for save and load ribbon state:
LoadCommandBars(_PROFILE_NAME);
SaveCommandBars(_PROFILE_NAME);
- buttons has wrong style after LoadCommandBars function call.


To fix this bug I've changed DoPropExchange as below.


May be this fix will to resolve your problem.
Can you please to respond me, if this fix resolve your problem.

FYI: For test you can to remove registry key
HKEY_CURRENT_USER\SOFTWARE\Codejock Software Sample Applications\Codejock Ribbon Sample

Regards,
Artem Gontarenko
Back to Top
BeeJay View Drop Down
Groupie
Groupie
Avatar

Joined: 12 March 2013
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote BeeJay Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2021 at 6:04am
Hi Artem,

after almost 5 years hoping to get a solution, we finally found a workaround/whatever for our specific context 1 year ago by ourselves. Do not ask me, what it was. :-) 

Being that, I cannot verify anymore, if your fix would solve it, too. Sorry.

Thank you nevertheless.

BJ
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.141 seconds.