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

Checkbox in ribbon

 Post Reply Post Reply
Author
Message
pavold View Drop Down
Newbie
Newbie


Joined: 14 May 2007
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote pavold Quote  Post ReplyReply Direct Link To This Post Topic: Checkbox in ribbon
    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.
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: 05 November 2007 at 1:04am
Hello,
 
Show code you tried.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
pavold View Drop Down
Newbie
Newbie


Joined: 14 May 2007
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote pavold Quote  Post ReplyReply Direct Link To This Post 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.
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: 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
Back to Top
pavold View Drop Down
Newbie
Newbie


Joined: 14 May 2007
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote pavold Quote  Post ReplyReply Direct Link To This Post 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
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: 05 November 2007 at 5:36am
Thanks for let us know.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.203 seconds.