<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Enable Visual Studio 2015 theme to CXTPTabCtrl</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : Enable Visual Studio 2015 theme to CXTPTabCtrl]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 12 May 2026 23:13:23 +0000</pubDate>
  <lastBuildDate>Mon, 04 Apr 2016 09:02:09 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=22986</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Enable Visual Studio 2015 theme to CXTPTabCtrl :  I just added Visual Studio 2015...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=22986&amp;PID=74635&amp;title=enable-visual-studio-2015-theme-to-cxtptabctrl#74635</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1863">JoseAngel</a><br /><strong>Subject:</strong> 22986<br /><strong>Posted:</strong> 04 April 2016 at 9:02am<br /><br /><div>I just added Visual Studio 2015 theming support to CXTPTabCtrl.</div><div><br></div><div>To do it, add this lines to VisualStudio2015Blue.ini:</div><div><br></div><div><font face="Courier New, Courier, mono">&#091;TabCtrl&#093;<br>BackSelected = 255 255 255<br>Back = 91 113 153<br>Border = 142 155 188<br>TextSelected = 0 0 0<br>Text = 255 255 255</font></div><div><br></div><div>Add this lines to VisualStudio2015Dark.ini</div><div><br></div><div><font face="Courier New, Courier, mono">&#091;TabCtrl&#093;<br>BackSelected = 37 37 38<br>Back = 45 45 48<br>Border = 63 63 70<br>TextSelected = 51 153 255<br>Text = 241 241 241</font></div><div><br></div><div>and add this lines to VisualStudio2015Light.ini</div><div><br></div><div><font face="Courier New, Courier, mono">&#091;TabCtrl&#093;<br>BackSelected = 245 245 245<br>Back = 238 238 242<br>Border = 204 206 219<br>TextSelected = 51 153 255<br>Text = 0 0 0</font></div><div><br></div><div>and compile the VisualStudio2015 solution.</div><div><br></div><div>Then, add the next lines to XTPTabBase.cpp in method BOOL CXTPTabBase::SetTheme(XTPControlTheme eTheme):</div><div><br></div><div><font face="Courier New, Courier, mono">&nbsp;case xtpControlThemeVisualStudio2015:<br>&nbsp;&nbsp;m_pTheme = new CXTPTabCtrlThemeVisualStudio2015;<br>&nbsp;&nbsp;break;</font></div><div><br></div><div>Add this lines in XTPTabBaseTheme.h, after declaration of CXTPTTabBaseTheme:</div><div><br></div><div><font face="Courier New, Courier, mono">class _XTP_EXT_CLASS CXTPTabCtrlThemeVisualStudio2015 : public CXTPTabBaseTheme<br>{<br>private:<br>&nbsp;CXTPPaintManagerColor back;<br>&nbsp;CXTPPaintManagerColor backSelected;<br>&nbsp;CXTPPaintManagerColor text;<br>&nbsp;CXTPPaintManagerColor textSelected;<br>&nbsp;CXTPPaintManagerColor border;<br>public:<br>&nbsp;CXTPTabCtrlThemeVisualStudio2015();</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">protected:<br>&nbsp;virtual void RefreshMetrics(CTabCtrl* pTab);<br>&nbsp;virtual void DrawBorders(CDC* pDC, const CRect&amp; rcClient);<br>&nbsp;virtual void DrawTabCtrl(CDC* pDC, CXTPTabBase* pTabCtrl);<br>&nbsp;virtual void FillTabFace(CDC* pDC, CTabCtrl* pTabCtrl, CRect rcItem, BOOL bSelected);<br>&nbsp;virtual void DrawTabText(CDC* pDC, CTabCtrl* pTabCtrl, CRect&amp; rcItem, int iItem, BOOL bSelected, BOOL bBoldFont);<br>};</font></div><div><br></div><div>and finally add this lines to XTPTabBaseTheme.cpp:</div><div><br></div><div><b></b><i></i><u></u><sub></sub><sup></sup><strike></strike><font face="Courier New, Courier, mono">CXTPTabCtrlThemeVisualStudio2015::CXTPTabCtrlThemeVisualStudio2015()<br>{<br>&nbsp;m_bUseWinThemes = FALSE;<br>&nbsp;m_bSystemDrawing = FALSE;<br>}</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">void CXTPTabCtrlThemeVisualStudio2015::RefreshMetrics(CTabCtrl* pTab)<br>{<br>&nbsp;__super::RefreshMetrics(pTab);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;backSelected = XTPIniColor(_T("TabCtrl"), _T("BackSelected"), RGB(253, 253, 253));<br>&nbsp;back = XTPIniColor(_T("TabCtrl"), _T("Back"), RGB(253, 253, 253));<br>&nbsp;border = XTPIniColor(_T("TabCtrl"), _T("Border"), RGB(253, 253, 253));<br>&nbsp;textSelected = XTPIniColor(_T("TabCtrl"), _T("TextSelected"), RGB(253, 253, 253));<br>&nbsp;text = XTPIniColor(_T("TabCtrl"), _T("Text"), RGB(253, 253, 253));<br>}</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">void CXTPTabCtrlThemeVisualStudio2015::DrawTabCtrl(CDC* pDC, CXTPTabBase* pTabCtrlBase)<br>{<br>&nbsp;CTabCtrl* pTabCtrl = pTabCtrlBase-&gt;GetTabCtrlImpl();</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;CXTPClientRect rcClient(pTabCtrl);<br>&nbsp;pDC-&gt;FillSolidRect(rcClient, back);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;DrawBorders(pDC, rcClient);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;if (pTabCtrl-&gt;GetItemCount() != 0)<br>&nbsp;{<br>&nbsp;&nbsp;for (int iItem = 0; iItem &lt; pTabCtrl-&gt;GetItemCount(); ++iItem)<br>&nbsp;&nbsp;&nbsp;DrawTab(pDC, pTabCtrlBase, iItem);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;DrawTab(pDC, pTabCtrlBase, pTabCtrl-&gt;GetCurSel());</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;ShowButtons(pTabCtrlBase);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;if (pTabCtrlBase-&gt;m_bXPBorder)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;CRect rcChild;<br>&nbsp;&nbsp;&nbsp;pTabCtrlBase-&gt;GetChildRect(rcChild);<br>&nbsp;&nbsp;&nbsp;rcChild.InflateRect(1, 1);<br>&nbsp;&nbsp;&nbsp;DrawBorder(pDC, rcChild);<br>&nbsp;&nbsp;}<br>&nbsp;}<br>&nbsp;else<br>&nbsp;{<br>&nbsp;&nbsp;ShowButtons(pTabCtrlBase);<br>&nbsp;}<br>}</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">void CXTPTabCtrlThemeVisualStudio2015::DrawBorders(CDC* pDC, const CRect&amp; rcClient)<br>{<br>&nbsp;CRect rcBorder = rcClient;</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;if (m_bUseWinThemes &amp;&amp; m_themeTab-&gt;IsAppThemeReady())<br>&nbsp;{<br>&nbsp;}<br>&nbsp;else<br>&nbsp;{<br>&nbsp;&nbsp;VerticalLine(pDC, rcBorder.left, rcBorder.top, rcBorder.Height(), border);<br>&nbsp;&nbsp;VerticalLine(pDC, rcBorder.right - XTP_DPI_X(1), rcBorder.top, rcBorder.Height(), border);<br>&nbsp;&nbsp;HorizontalLine(pDC, rcBorder.left, rcBorder.top, rcBorder.Width(), border);<br>&nbsp;&nbsp;HorizontalLine(pDC, rcBorder.left, rcBorder.bottom - XTP_DPI_Y(1), rcBorder.Width(), border);<br>&nbsp;}<br>}</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">void CXTPTabCtrlThemeVisualStudio2015::FillTabFace(CDC* pDC, CTabCtrl* pTabCtrl, CRect rcItem, BOOL bSelected)<br>{<br>&nbsp;DWORD dwStyle = GetTabStyle(pTabCtrl);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;if (IsRight(dwStyle))<br>&nbsp;{<br>&nbsp;&nbsp;if (bSelected)<br>&nbsp;&nbsp;&nbsp;pDC-&gt;FillSolidRect(&amp;rcItem, backSelected);<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;pDC-&gt;FillSolidRect(&amp;rcItem, back);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;HorizontalLine(pDC, rcItem.left, rcItem.top, rcItem.Width(), border);<br>&nbsp;&nbsp;VerticalLine(pDC, rcItem.right, rcItem.top, rcItem.Height(), border);<br>&nbsp;&nbsp;HorizontalLine(pDC, rcItem.left, rcItem.bottom, rcItem.Width(), border);<br>&nbsp;}<br>&nbsp;else if (IsLeft(dwStyle))<br>&nbsp;{<br>&nbsp;&nbsp;if (bSelected)<br>&nbsp;&nbsp;&nbsp;pDC-&gt;FillSolidRect(&amp;rcItem, backSelected);<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;pDC-&gt;FillSolidRect(&amp;rcItem, back);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;HorizontalLine(pDC, rcItem.left, rcItem.top, rcItem.Width(), border);<br>&nbsp;&nbsp;VerticalLine(pDC, rcItem.left, rcItem.top, rcItem.Height(), border);<br>&nbsp;&nbsp;HorizontalLine(pDC, rcItem.left, rcItem.bottom, rcItem.Width(), border);<br>&nbsp;}<br>&nbsp;else if (IsBottom(dwStyle))<br>&nbsp;{<br>&nbsp;&nbsp;if (bSelected)<br>&nbsp;&nbsp;&nbsp;pDC-&gt;FillSolidRect(&amp;rcItem, backSelected);<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;pDC-&gt;FillSolidRect(&amp;rcItem, back);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;VerticalLine(pDC, rcItem.left, rcItem.top, rcItem.Height(), border);<br>&nbsp;&nbsp;HorizontalLine(pDC, rcItem.left, rcItem.bottom, rcItem.Width(), border);<br>&nbsp;&nbsp;VerticalLine(pDC, rcItem.right, rcItem.top, rcItem.Height(), border);<br>&nbsp;}<br>&nbsp;else<br>&nbsp;{<br>&nbsp;&nbsp;if (bSelected)<br>&nbsp;&nbsp;&nbsp;pDC-&gt;FillSolidRect(&amp;rcItem, backSelected);<br>&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;pDC-&gt;FillSolidRect(&amp;rcItem, back);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;VerticalLine(pDC, rcItem.left - XTP_DPI_X(2), rcItem.top - XTP_DPI_Y(2), rcItem.Height(), border);<br>&nbsp;&nbsp;HorizontalLine(pDC, rcItem.left, rcItem.top - XTP_DPI_Y(2), rcItem.Width(), border);<br>&nbsp;&nbsp;VerticalLine(pDC, rcItem.right - XTP_DPI_X(2), rcItem.top - XTP_DPI_Y(2), rcItem.Height(), border);<br>&nbsp;}<br>}</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">void CXTPTabCtrlThemeVisualStudio2015::DrawTabText(CDC* pDC, CTabCtrl* pTabCtrl, CRect&amp; rcItem, int iItem, BOOL bSelected, BOOL bBoldFont)<br>{<br>&nbsp;TCHAR szLabel&#091;256&#093;;<br>&nbsp;szLabel&#091;0&#093; = 0;</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;TC_ITEM tci;<br>&nbsp;tci.mask = TCIF_TEXT;<br>&nbsp;tci.pszText = szLabel;<br>&nbsp;tci.cchTextMax = _countof(szLabel);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;if (pTabCtrl-&gt;GetItem(iItem, &amp;tci))<br>&nbsp;{<br>&nbsp;&nbsp;int nLen = (int)_tcslen(szLabel);<br>&nbsp;&nbsp;if (nLen &gt; 0)<br>&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;pDC-&gt;SetBkMode(TRANSPARENT);<br>&nbsp;&nbsp;&nbsp;pDC-&gt;SetTextColor(bSelected ? textSelected : text);</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp;// Set the font for the tab label.<br>&nbsp;&nbsp;&nbsp;DWORD dwStyle = GetTabStyle(pTabCtrl);<br>&nbsp;&nbsp;&nbsp;CXTPFontDC font(pDC, (bBoldFont &amp;&amp; bSelected) ? (IsHorz(dwStyle) ? &amp;XTPAuxData().fontBold : &amp;XTPAuxData().fontVertBold) : (IsHorz(dwStyle) ? &amp;XTPAuxData().font : &amp;XTPAuxData().fontVert));</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp;// Draw the tab label.<br>&nbsp;&nbsp;&nbsp;if (IsHorz(dwStyle))<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;DrawText(szLabel, nLen, rcItem, DT_SINGLELINE | DT_VCENTER | DT_CENTER | DT_END_ELLIPSIS);<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;CSize sz = pDC-&gt;GetTextExtent(szLabel, nLen);<br>&nbsp;&nbsp;&nbsp;&nbsp;rcItem.left = rcItem.right - (rcItem.Width() - sz.cy + XTP_DPI_Y(1)) / 2;<br>&nbsp;&nbsp;&nbsp;&nbsp;rcItem.top = rcItem.top + (rcItem.Height() - sz.cx + XTP_DPI_X(1)) / 2;</font></div><div><font face="Courier New, Courier, mono"><br></font></div><div><font face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp;&nbsp;pDC-&gt;DrawText(szLabel, nLen, &amp;rcItem, DT_SINGLELINE | DT_NOCLIP);<br>&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;}<br>&nbsp;}<br>}</font></div><div><font face="Courier New"></font><br></div><div>Then, you'll have something like this:</div><div><br></div><div><img src="uploads/1863/Nuevo_proyecto.PNG" height="647" width="589" border="0" /><br></div><div><br></div>]]>
   </description>
   <pubDate>Mon, 04 Apr 2016 09:02:09 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=22986&amp;PID=74635&amp;title=enable-visual-studio-2015-theme-to-cxtptabctrl#74635</guid>
  </item> 
 </channel>
</rss>