Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - [solved] Caption Direction
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] Caption Direction

 Post Reply Post Reply
Author
Message
MGebler View Drop Down
Groupie
Groupie


Joined: 18 May 2006
Location: Germany
Status: Offline
Points: 64
Post Options Post Options   Thanks (1) Thanks(1)   Quote MGebler Quote  Post ReplyReply Direct Link To This Post Topic: [solved] Caption Direction
    Posted: 30 July 2017 at 4:29am
Vertical orientated captions of a docking pane are displayed wrong, if the Office2013 theme is used.
The caption string and the buttons are still horizontal orientated and therefore clipped by the caption rectangle.



This bug still exists in the Office2016 theme of the beta version 18.
You can reproduce this problem with the 'pane' example of your sample programs.

With best regards
 Marcus
Back to Top
MGebler View Drop Down
Groupie
Groupie


Joined: 18 May 2006
Location: Germany
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote MGebler Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2017 at 9:34am
Hello again. I found a solution. Could you please verify the following source code patch.

void CXTPDockingPaneOffice2013Theme::DrawCaption(CDC *pDC, CXTPDockingPaneTabbedContainer *pPane, CRect rc)
{
#ifdef PATCHED_VERSION
  BOOL bVertical = pPane->IsCaptionVertical();

  int nTitleHeight = m_nTitleHeight;
  CRect rcCaption(rc);

  if (bVertical)
  {
    rcCaption.DeflateRect(0, 0, rc.Width() - nTitleHeight - XTP_DPI_X(5), 0);
  }
  else
  {
    rcCaption.DeflateRect(0, 0, 0, rc.Height() - nTitleHeight - XTP_DPI_Y(5));
  }

  DrawTitleBar(pDC, pPane, rcCaption, bVertical );

#else
  // Caption
  CRect rcCaption(rc);
  rcCaption.bottom = rcCaption.top + m_nTitleHeight;

  DrawTitleBar(pDC, pPane, rcCaption, FALSE);
#endif
}

I am not quite sure about the correction terms XTP_DPI_Y(5) and XTP_DPI_X(5).

With best regards
 Marcus

Back to Top
astoyan View Drop Down
Admin Group
Admin Group
Avatar

Joined: 24 August 2013
Status: Offline
Points: 284
Post Options Post Options   Thanks (0) Thanks(0)   Quote astoyan Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2017 at 10:40pm
Hello Marcus,

We're not are not able to reproduce this issue neither in 17.3 no in 18.0. Can you please provide more detailed information about your environment, compiler and configuration?

Regards,
  Alexander
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: 07 August 2017 at 6:49am
Hello Marcus,

I think problem in hardcoded horizontal caption in CXTPDockingPaneOffice2013Theme::DrawCaption and other places 
DrawTitleBar(pDC, pPane, rcCaption, FALSE);

try only
DrawTitleBar(pDC, pPane, rcCaption, pPane->IsCaptionVertical());

Regards,
 Oleksandr Lebed
Back to Top
MGebler View Drop Down
Groupie
Groupie


Joined: 18 May 2006
Location: Germany
Status: Offline
Points: 64
Post Options Post Options   Thanks (1) Thanks(1)   Quote MGebler Quote  Post ReplyReply Direct Link To This Post Posted: 08 August 2017 at 7:43am
Hello Oleksandr

I have just tried version 18.0.1 and applied your patch. But the result is still wrong.
You have to recalculate the cation rectangle!

You can simply reproduce this effect:

1. Start the pane sample program
2. Select a office 2013 or 2016 theme
3. Select the menu entry 'Docking Pane | Captions | Vertical'

With best regards
 Marcus



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: 09 August 2017 at 10:05am
Hello Marcus,

Your changes are accepted.

The same fix in CXTPDockingPaneVisualStudio2012Theme which also affects on VS2015 theme.

Regards,
 Oleksandr Lebed
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.