Print Page | Close Window

Checkbox in ribbon

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=8655
Printed Date: 06 October 2024 at 12:15pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Checkbox in ribbon
Posted By: pavold
Subject: Checkbox in ribbon
Date Posted: 04 November 2007 at 6:19pm
Hi,

I have a problem with checkbox control in the RibbonBar.
When placing controls in a group, checkbox is always positioned at the top of the column. Even if one is followed by the another checkbox, the second checkbox is also positioned in the new column.

I have tried to force wrap by setting xtpFlagWrapRow flag, but it didn't help either.

Is there any way to circumvent this? I'm using toolkitpro version 11.1.3

Best Regards,
Pavol.



Replies:
Posted By: Oleg
Date Posted: 05 November 2007 at 1:04am
Hello,
 
Show code you tried.


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


Posted By: pavold
Date Posted: 05 November 2007 at 2:23am
Hi,

Here is the code for the problematic checkboxes:

CXTPRibbonGroup* pGroup=AddGroup(ID_OBJECT_LINES_GROUP);
pGroup->SetControlsCentering(TRUE);

.....

{
    CXTPControl* pControl=
        pGroup->Add(xtpControlCheckBox, ID_CONNECT_LINES_3D);
    pControl->SetTag(VIEWID(NView::ELEMID_CONNECT_LINES, 0));
    pControl->SetBeginGroup(TRUE);
}

{
    CXTPControl* pControl=
        pGroup->Add(xtpControlCheckBox, ID_CONNECT_LINES_WIDTH_BY_OBJECT);
    pControl->SetTag(VIEWID(NView::ELEMID_CONNECT_LINES, 0));
}

And here is the screenshot:



Regards,
Pavol.


Posted By: Oleg
Date Posted: 05 November 2007 at 4:27am
Hello,
Sorry, again can't reproduce.
 
I tried add this code to our sample:
 
 CXTPRibbonGroup* pGroupShowHide = pTabView->AddGroup(ID_GROUP_SHOWHIDE);
 pGroupShowHide->SetControlsCentering(TRUE);
 pGroupShowHide->Add(xtpControlComboBox, ID_EDIT_PASTE)->SetStyle(xtpButtonIconAndCaption);;
 pGroupShowHide->Add(xtpControlComboBox, ID_EDIT_PASTE)->SetStyle(xtpButtonIconAndCaption);;
 pGroupShowHide->Add(xtpControlPopup, ID_EDIT_PASTE)->SetStyle(xtpButtonIconAndCaption);
 pControl = pGroupShowHide->Add(xtpControlCheckBox, ID_VIEW_RULER);
 pControl->SetBeginGroup(TRUE);
 pControl->SetCaption("3D Lines");
 pControl = pGroupShowHide->Add(xtpControlCheckBox, ID_VIEW_GRIDLINES);
 pControl->SetCaption("Width By Object");
 
and see it right. May be something was fixed in newer versions. Can you download 11.2.1 to check ?


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


Posted By: pavold
Date Posted: 05 November 2007 at 4:59am
I tried to insert your code into our application and play around to see what causes the problem.

Finally I have found the problem. In our code, the second checkbox is associated with a resource, that have an icon. In the case of checkbox it is used only for tooltip. Yet, the framework probably applied default button style (xtpButtonIconAndCaptionBelow) when it was positioning the checkxbox.

Using pControl->SetStype(xtpButtonIconAndCaption) have fixed the problem.

Best Regards,
Pavol


Posted By: Oleg
Date Posted: 05 November 2007 at 5:36am
Thanks for let us know.

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



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