Print Page | Close Window

[SOLVED]ControlGallery Ribbon init shown small

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=23238
Printed Date: 21 November 2024 at 11:42am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED]ControlGallery Ribbon init shown small
Posted By: Alex H.
Subject: [SOLVED]ControlGallery Ribbon init shown small
Date 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);
...





Replies:
Posted By: Alex H.
Date Posted: 17 January 2017 at 11:29am
I use XTP 17.3!
Any idea or option?

Please help me Codejock Team  :-)


Posted By: cpede
Date 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 (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: Jonas R.
Date 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!


Posted By: Alex H.
Date 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);

:-)


Posted By: Alex H.
Date 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?


Posted By: Alex H.
Date 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" rel="nofollow - http://forum.codejock.com/forum_posts.asp?TID=23212&KW=DPI&title=solved-ribbon-loadcommandbars-bug

?

because  CXTPControlGallery::DoPropExchange also uses
PX_DPI_Rect


Posted By: BeeJay
Date Posted: 31 May 2017 at 3:56am
any news on this?


Posted By: BeeJay
Date 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!! :(


Posted By: olebed
Date 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


Posted By: BeeJay
Date 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


Posted By: olebed
Date 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


Posted By: agontarenko
Date 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


Posted By: BeeJay
Date 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



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