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

Ribbon Control alignment

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon Control alignment
    Posted: 22 March 2011 at 10:30am
Hi;

What I got is this:



But I want this:



How?
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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: 22 March 2011 at 10:36am
I accomplished this by using a xtpControlLabel as the first control, instead of using the label on the xtpControlEdit, or whatever control you are using.
 
-cpede
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2011 at 10:40am
Hi;

I do this allready! First I load the toolbar ressource, then I create two xtpControlLabel controls:

    pGroup=TabReports->AddGroup(ID_GROUP_REPORT_DATETIME);
    CXTPControl* pControl = pGroup->Add(xtpControlLabel, ID_REPORT_DATE_FROM_CAPTION, 0, 0);
    pControl->SetID(0);
    pControl->SetStyle(xtpButtonCaption);

    pControl = pGroup->Add(xtpControlLabel, ID_REPORT_DATE_TO_CAPTION, 0, 2);
    pControl->SetID(0);
    pControl->SetStyle(xtpButtonCaption);


In OnCreateControl I create my two custom controls to enter timestamps:

    // Create the timestamp control
    if (lpCreateControl->nID == ID_REPORT_DATETIME_FROM)
    {
        FromTime_.AllowEmptyTimestamp(true);
        FromTime_.SetShowSeconds(false);
        FromTime_.SetButtonGap(0);
        if (!FromTime_.Create(0, WS_TABSTOP | WS_CHILD | TSCS_HASCALENDARBUTTON | TSCS_AUTOSIZE,
                              CRect(0,0,160,22), this, ID_REPORT_DATETIME_FROM ))
            return FALSE;

        CSize size(FromTime_.GetBestFit());
        FromTime_.SetWindowPos(0, 0, 0, size.cx, size.cy, SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);
        FromTime_.ClearSelection();

        CXTPControlCustom* pControl = CXTPControlCustom::CreateControlCustom(&FromTime_);
        pControl->SetBorders(0, 3, 0, 3);
        // Set the xtpFlagManualUpdate flag.
        // Without this flag you must call the Enable member of
        // CCmdUI in the ON_UPDATE_COMMAND_UI handler.
        pControl->SetFlags(xtpFlagManualUpdate);

        lpCreateControl->pControl = pControl;
        return TRUE;
    }


Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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: 22 March 2011 at 10:55am
Why do you create two captions? And move the second caption after the second index?
 
I would just create one label, and the the two custom controls.
 
-cpede
Product: Xtreme ToolkitPro (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2011 at 11:05am
Hi;

Just after posting my initial question I had to change the layout due to customers wishes I recognized later. The new layout should be this:



Any ideas how to achieve this kind of layout?

Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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.172 seconds.