Print Page | Close Window

[solved] Caption Direction

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=23399
Printed Date: 26 April 2024 at 10:13pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] Caption Direction
Posted By: MGebler
Subject: [solved] Caption Direction
Date 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



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



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


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


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





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



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