<?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 : Font combobox shows square boxes</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Font combobox shows square boxes]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 30 Apr 2026 21:08:12 +0000</pubDate>
  <lastBuildDate>Wed, 26 Oct 2005 11:03:19 +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=3095</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[Font combobox shows square boxes : But not all of them that show...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3095&amp;PID=9249&amp;title=font-combobox-shows-square-boxes#9249</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1567">BethZ</a><br /><strong>Subject:</strong> 3095<br /><strong>Posted:</strong> 26 October 2005 at 11:03am<br /><br /><P>But not all of them that show square boxes are special symbol fonts, such as "Estrangelo Edessa", "Gautami", "Latha", "Mangal", "MV Boli", "Raavi", "Shruti", and "Tunga", and they&nbsp;are not&nbsp;shown as square boxes in Microsoft Word, but&nbsp;they are shown square boxes in the sample progam "Custom Themes" if you&nbsp;pick any of these fonts using "CustomDraw" toolbar button on the bottom of the window.</P><P>Only two classes are needed to implement this font combobox, and they are <strong>CControlComboBoxCustomDraw</strong> and <strong>CControlComboBoxCustomDrawList</strong>. The code&nbsp;is as following. Is there anything missing in this code ?</P><P> //////////////////////////////////////////////////////////// //////////////<BR>// <strong>CControlComboBoxCustomDraw<BR></strong> /*********************************************************** ******/<BR>/* <strong>The header file for CControlComboBoxCustomDraw</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; */<BR> /*********************************************************** *******/<BR>class CControlComboBoxCustomDraw: public CXTPControlFontComboBox<BR>{<BR>&nbsp;DECLARE_XTP_CONTROL(CControlComboBoxCustomDraw)<BR>public:</P><P>&nbsp;CControlComboBoxCustomDraw()<BR>&nbsp;{<BR>&nbsp;&nbsp;if (m_pCommandBar)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;m_pCommandBar-&gt;InternalRelease();<BR>&nbsp;&nbsp;}</P><P>&nbsp;&nbsp;m_pCommandBar = new CControlComboBoxCustomDrawList();<BR> &nbsp;&nbsp;((CControlComboBoxCustomDrawList*)m_pCommandBar) -&gt;CreateListBox();</P><P> &nbsp;&nbsp;((CControlComboBoxCustomDrawList*)m_pCommandBar) -&gt;EnumFontFamiliesEx(1);</P><P>&nbsp;}<BR>};</P><P> /*********************************************************** **********/<BR>/* <strong>The .cpp file for CControlComboBoxCustomDraw</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; */<BR> /*********************************************************** **********/<BR>IMPLEMENT_XTP_CONTROL(CControlComboBoxCustomDraw, CXTPControlFontComboBox)</P><P>&nbsp;</P><P> //////////////////////////////////////////////////////////// //////////////<BR>// <strong>CControlComboBoxCustomDrawList</strong><BR> /*********************************************************** **********/<BR>/* <strong>The header file for CControlComboBoxCustomDrawList</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  */<BR> /*********************************************************** **********/<BR>class CControlComboBoxCustomDrawList : public CXTPControlFontComboBoxList<BR>{<BR> &nbsp;DECLARE_XTP_COMMANDBAR(CControlComboBoxCustomDrawList) ;<BR>&nbsp;DECLARE_MESSAGE_MAP()<BR>public:</P><P>&nbsp;void DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct );</P><P>&nbsp;virtual void CreateListBox()<BR>&nbsp;{<BR>&nbsp;&nbsp;CWnd* pParentWnd = CMainFrame::m_pInstance;</P><P>&nbsp;&nbsp;CreateEx(WS_EX_STATICEDGE|WS_EX_TOOLWINDOW, _T("LISTBOX"), _T(""),<BR> &nbsp;&nbsp;&nbsp;WS_CHILD|WS_VSCROLL|WS_BORDER|WS_CLIPCHILD REN|LBS_SORT|LBS_OWNERDRAWFIXED|LBS_HASSTRINGS|LBS_NOTIFY, <BR>&nbsp;&nbsp;&nbsp;CRect(0,0,0,0), pParentWnd,&nbsp; 0);</P><P>&nbsp;&nbsp;SetWindowLong(m_hWnd, GWL_HWNDPARENT, 0 );<BR>&nbsp;&nbsp;ModifyStyle(WS_CHILD, WS_POPUP);<BR>&nbsp;#ifdef _WIN64<BR>&nbsp;&nbsp;SetWindowLongPtr(m_hWnd, GWL_HWNDPARENT, (LONG_PTR)(pParentWnd-&gt;m_hWnd));<BR>&nbsp;#else<BR>&nbsp;&nbsp;SetWindowLong(m_hWnd, GWL_HWNDPARENT, (LONG)(LONG_PTR)(pParentWnd-&gt;m_hWnd));<BR>&nbsp;#endif<BR>&nbsp;}</P><P>&nbsp;friend class CControlComboBoxCustomDraw;<BR>};</P><P> /*********************************************************** **********/<BR>/* <strong>The .cpp file for CControlComboBoxCustomDrawList</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  */<BR> /*********************************************************** **********/<BR>IMPLEMENT_XTP_COMMANDBAR(CControlComboBoxCustomDrawList, CXTPControlFontComboBoxList)</P><P>BEGIN_MESSAGE_MAP(CControlComboBoxCustomDrawList, CXTPControlFontComboBoxList)<BR>&nbsp;ON_WM_DRAWITEM_REFLECT()<BR>END_MESSAGE_MAP()</P><P><BR>void CControlComboBoxCustomDrawList::DrawItem ( LPDRAWITEMSTRUCT lpDrawItemStruct )<BR>{<BR>&nbsp;CString strText;<BR> &nbsp;((CListBox*)this)-&gt;GetText(lpDrawItemStruct-&gt;ite mID, strText);</P><P>&nbsp;CRect rc(&amp;lpDrawItemStruct-&gt;rcItem);</P><P>&nbsp;ASSERT(lpDrawItemStruct-&gt;CtlType == ODT_LISTBOX);<BR>&nbsp;LPCTSTR lpszText = (LPCTSTR) strText;<BR>&nbsp;ASSERT(lpszText != NULL);<BR>&nbsp;CDC dc;</P><P>&nbsp;dc.Attach(lpDrawItemStruct-&gt;hDC);</P><P>&nbsp;// Save these value to restore them when done drawing.<BR>&nbsp;COLORREF crOldTextColor = dc.GetTextColor();<BR>&nbsp;COLORREF crOldBkColor = dc.GetBkColor();</P><P>&nbsp;COLORREF cltBkColor = crOldBkColor;</P><P>&nbsp;// If this item is selected, set the background color<BR>&nbsp;// and the text color to appropriate values. Also, erase<BR>&nbsp;// rect by filling it with the background color.<BR>&nbsp;if ((lpDrawItemStruct-&gt;itemAction | ODA_SELECT) &amp;&amp;<BR>&nbsp;&nbsp;(lpDrawItemStruct-&gt;itemState &amp; ODS_SELECTED))<BR>&nbsp;{<BR>&nbsp;&nbsp;cltBkColor = XTPPaintManager()-&gt;GetXtremeColor(XPCOLOR_HIGHLIGHT);</P><P> &nbsp;&nbsp;dc.SetTextColor(XTPPaintManager()-&gt;GetXtremeC olor(XPCOLOR_HIGHLIGHT_TEXT));<BR>&nbsp;&nbsp;dc.FillSolidRect(rc, cltBkColor);</P><P>&nbsp;&nbsp;dc.Draw3dRect(rc,  XTPPaintManager()-&gt;GetXtremeColor(XPCOLOR_HIGHLIGHT_BORDE R),  XTPPaintManager()-&gt;GetXtremeColor(XPCOLOR_HIGHLIGHT_BORDE R));<BR>&nbsp;}<BR>&nbsp;else<BR>&nbsp;&nbsp;dc.FillSolidRect(rc, crOldBkColor);</P><P>&nbsp;CFont fnt;<BR>&nbsp;fnt.CreatePointFont(100, strText);</P><P>&nbsp;CFont* pOldFont = (CFont*)dc.SelectObject(&amp;fnt);</P><P>&nbsp;dc.SetBkMode(TRANSPARENT);<BR>&nbsp;rc.left += 3;<BR>&nbsp;dc.DrawText(strText, rc, DT_SINGLELINE|DT_VCENTER);</P><P>&nbsp;dc.SelectObject(pOldFont);</P><P>&nbsp;// Reset the background color and the text color back to their<BR>&nbsp;// original values.<BR>&nbsp;dc.SetTextColor(crOldTextColor);<BR>&nbsp;dc.SetBkColor(crOldBkColor);</P><P>&nbsp;dc.Detach();<BR>}</P><P>&nbsp;</P><P>Thanks, Beth</P>]]>
   </description>
   <pubDate>Wed, 26 Oct 2005 11:03:19 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3095&amp;PID=9249&amp;title=font-combobox-shows-square-boxes#9249</guid>
  </item> 
  <item>
   <title><![CDATA[Font combobox shows square boxes : that&amp;#039;s just the special symbol...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3095&amp;PID=9245&amp;title=font-combobox-shows-square-boxes#9245</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1011">Barto</a><br /><strong>Subject:</strong> 3095<br /><strong>Posted:</strong> 26 October 2005 at 6:50am<br /><br /><P>that's just the special symbol fonts, that only have symbols, but no letters.</P><P>What I have seen in other applications ist that you draw the name of the font in the standard system font and draw a sample of the font right to it... I think there may even be a way to determine if a font is a symbol font or a "real" font</P>]]>
   </description>
   <pubDate>Wed, 26 Oct 2005 06:50:28 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3095&amp;PID=9245&amp;title=font-combobox-shows-square-boxes#9245</guid>
  </item> 
  <item>
   <title><![CDATA[Font combobox shows square boxes : I built a font combobox in the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=3095&amp;PID=9234&amp;title=font-combobox-shows-square-boxes#9234</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1567">BethZ</a><br /><strong>Subject:</strong> 3095<br /><strong>Posted:</strong> 25 October 2005 at 4:27pm<br /><br /><P>I built a font combobox in the toolbar by following the Custom Themes sample and certain fonts cannot be displayed properly and they are shown as square boxes just like those in the sample program. Does anybody know the solution for this ? I am using Xtreme Command Bars Pro v9.70.&nbsp;</P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <IMG src="uploads/BethZ/2005-10-25_162729_FontCombobox.JPG" border="0"></P><P>Thanks, Beth&nbsp;</P><span style="font-size:10px"><br /><br />Edited by BethZ</span>]]>
   </description>
   <pubDate>Tue, 25 Oct 2005 16:27:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=3095&amp;PID=9234&amp;title=font-combobox-shows-square-boxes#9234</guid>
  </item> 
 </channel>
</rss>