<?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 : CXTPControlComboBox width</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTPControlComboBox width]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 15:15:22 +0000</pubDate>
  <lastBuildDate>Thu, 10 Jul 2008 06:45:34 +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=11364</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[CXTPControlComboBox width : Will be nice to support Markup...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38112&amp;title=cxtpcontrolcombobox-width#38112</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 11364<br /><strong>Posted:</strong> 10 July 2008 at 6:45am<br /><br />Will be nice to support Markup into ListBox<br><br>&nbsp; Jimmy<br><br>]]>
   </description>
   <pubDate>Thu, 10 Jul 2008 06:45:34 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38112&amp;title=cxtpcontrolcombobox-width#38112</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPControlComboBox width :  Here&amp;#039;s a more accurate...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38074&amp;title=cxtpcontrolcombobox-width#38074</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3717">Smucker</a><br /><strong>Subject:</strong> 11364<br /><strong>Posted:</strong> 09 July 2008 at 3:41pm<br /><br /><font face="Courier New, Courier, mono" size="2">Here's a more accurate version that handles the font size and borders/scroll width correctly. New code/changed code in green:<br><br>&nbsp; int cwidth = 0;<br><font color="#006633">&nbsp; CFont cfont;<br></font></font><font face="Courier New, Courier, mono" size="2"><font color="#003399"><font color="#006633">&nbsp; CDC *pdc = pcombo-&gt;GetListBoxCtrl()-&gt;GetDC();<br>&nbsp; CFont *pfont = pcombo-&gt;GetListBoxCtrl()-&gt;GetFont();<br>&nbsp; if (!pfont) {<br>&nbsp;&nbsp;&nbsp; cfont.CreateStockObject(DEFAULT_GUI_FONT);<br>&nbsp;&nbsp;&nbsp; pfont = &amp;cfont;<br>&nbsp; }<br>&nbsp; pdc-&gt;SaveDC();<br>&nbsp; pdc-&gt;SelectObject(pfont);</font><br></font>&nbsp; pcombo-&gt;ResetContent();<br>&nbsp; for (<b><i><font face="Arial, Helvetica, sans-serif">each CString strval you add</font></i></b>)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; pcombo-&gt;AddString(strval);<br>&nbsp; &nbsp; int w = pdc-&gt;GetTextExtent(strval).cx;<br>&nbsp;&nbsp;&nbsp; if (w &gt; cwidth)<br>&nbsp; &nbsp; &nbsp; cwidth = w;<br>&nbsp; }<br><font color="#006600">&nbsp; CXTNonClientMetrics ncm;<br>&nbsp; cwidth += ncm.iBorderWidth * 2 + ncm.iScrollWidth;<br>&nbsp; pdc-&gt;RestoreDC(-1);<br></font>&nbsp; pcombo-&gt;GetListBoxCtrl()-&gt;ReleaseDC(pdc);<br></font><font face="Courier New, Courier, mono" size="2">&nbsp; pcombo-&gt;SetDropDownWidth(max(pcombo-&gt;<font color="#009900">GetRect().Width()</font>, cwidth));<br><br></font>]]>
   </description>
   <pubDate>Wed, 09 Jul 2008 15:41:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38074&amp;title=cxtpcontrolcombobox-width#38074</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPControlComboBox width : Thanks Smucker! I plugged in the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38073&amp;title=cxtpcontrolcombobox-width#38073</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3713">Bala</a><br /><strong>Subject:</strong> 11364<br /><strong>Posted:</strong> 09 July 2008 at 3:01pm<br /><br />Thanks Smucker! I plugged in the logic and works great in german,french,chinese,english...etc<DIV>I had to substitute <FONT face="Courier New" size=2>GetEditCtrl with <FONT size=2>GetListBoxCtrl - since our ctrl is of type list box</FONT></FONT></DIV><DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV><DIV><FONT face="Courier New" size=2>May be for next release&nbsp;- codejock could support this property - 'autowidth' and do this math - instead of every customer setting the width.</FONT></DIV><DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV><DIV><FONT face="Courier New" size=2>Regards,</FONT></DIV><DIV><FONT face="Courier New" size=2>Bala</FONT></DIV>]]>
   </description>
   <pubDate>Wed, 09 Jul 2008 15:01:50 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38073&amp;title=cxtpcontrolcombobox-width#38073</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPControlComboBox width :    Here&amp;#039;s the basic code...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38070&amp;title=cxtpcontrolcombobox-width#38070</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3717">Smucker</a><br /><strong>Subject:</strong> 11364<br /><strong>Posted:</strong> 09 July 2008 at 2:16pm<br /><br />Here's the basic code I use:<br><font size="2" face="Courier New, Courier, mono"><br>&nbsp; int cwidth = 0;<br></font><font size="2" face="Courier New, Courier, mono">&nbsp; pcombo-&gt;ResetContent();<br>&nbsp; CDC *pdc = pcombo-&gt;GetEditCtrl()-&gt;GetDC();<br>&nbsp; for (<b><i><font face="Arial, Helvetica, sans-serif">each CString strval you add</font></i></b>)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; pcombo-&gt;AddString(strval);<br>&nbsp; &nbsp; int w = pdc-&gt;GetTextExtent(strval).cx;<br>&nbsp;&nbsp;&nbsp; if (w &gt; cwidth)<br>&nbsp; &nbsp; &nbsp; cwidth = w;<br>&nbsp; }<br>&nbsp; pcombo-&gt;GetEditCtrl()-&gt;ReleaseDC(pdc);<br></font><font size="2" face="Courier New, Courier, mono">&nbsp; pcombo-&gt;SetDropDownWidth(max(pcombo-&gt;GetWidth(), cwidth)); // **<br><br></font><br>** - you may want to constrain cwidth to a reasonable range.<br><br>]]>
   </description>
   <pubDate>Wed, 09 Jul 2008 14:16:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38070&amp;title=cxtpcontrolcombobox-width#38070</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPControlComboBox width : Thanks for your response.looks...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38061&amp;title=cxtpcontrolcombobox-width#38061</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3713">Bala</a><br /><strong>Subject:</strong> 11364<br /><strong>Posted:</strong> 09 July 2008 at 12:35pm<br /><br />Thanks for your response.looks like you have hard coded value of 180.<DIV>&nbsp;</DIV><DIV>we are also calling SetWidth</DIV><DIV>&nbsp;</DIV><DIV>But I would like to know what value to set..</DIV><DIV>&nbsp;</DIV><DIV>for ex:- we have a string called "Samrt priority" in english ...and it may be different in chinese.....so how do we come up with the width.</DIV><DIV>&nbsp;</DIV><DIV>One way is to get the string length and multiply by average font width.</DIV><DIV>&nbsp;</DIV><DIV>I am trying to see - if codejock has a special flag called "autowidth" on the combo box.&nbsp;&nbsp;&nbsp; ---ie'; combo box width adjusts based on the string added and font. - instead of users having to specify it...</DIV><DIV>&nbsp;</DIV><DIV>Regards,</DIV><DIV>Bala</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 09 Jul 2008 12:35:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38061&amp;title=cxtpcontrolcombobox-width#38061</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPControlComboBox width :  Hi,int CExResizeDialog::OnCr...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38056&amp;title=cxtpcontrolcombobox-width#38056</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=233">jimmy</a><br /><strong>Subject:</strong> 11364<br /><strong>Posted:</strong> 09 July 2008 at 11:11am<br /><br />Hi,<br><br>int CExResizeDialog::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)<br>{<br>&nbsp;&nbsp;&nbsp; if (lpCreateControl-&gt;bToolBar)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPToolBar* pToolBar = DYNAMIC_DOWNCAST(CXTPToolBar, lpCreateControl-&gt;pCommandBar);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!pToolBar)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return FALSE;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (lpCreateControl-&gt;nID == ID_GUI_ONLINECURRENT &amp;&amp; pToolBar-&gt;GetBarID() == IDR_GUI_ONLINESETTINGS)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPControlComboBox* pComboState = (CXTPControlComboBox*)CXTPControlComboBox::CreateObject();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pComboState-&gt;SetCaption(_T("Online"));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pComboState-&gt;SetWidth(180);<br><font color="#339900">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pComboState-&gt;SetDropDownWidth(220);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pComboState-&gt;SetDropDownItemCount(30);<br></font>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; lpCreateControl-&gt;pControl = pComboState;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return TRUE;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return FALSE;<br>}<br><br>&nbsp; Jimmy<br><br>]]>
   </description>
   <pubDate>Wed, 09 Jul 2008 11:11:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38056&amp;title=cxtpcontrolcombobox-width#38056</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPControlComboBox width : Hi,  We are using CXTPControlComboBox...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38054&amp;title=cxtpcontrolcombobox-width#38054</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3713">Bala</a><br /><strong>Subject:</strong> 11364<br /><strong>Posted:</strong> 09 July 2008 at 11:09am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>We are using <FONT size=2>CXTPControlComboBox object and setting up a standard width based on the string size that we are adding.</FONT></DIV><DIV><FONT size=2>But on multi byte langauges ( japanese/chinese) our math of setting width doesnot hold up....a few chars are trucated in the display.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Here is how our display looks like...</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: SimSun; mso-bidi-font-family: SimSun; mso-ansi-: EN-US; mso-fareast-: ZH-CN; mso-bidi-: AR-SA"><?:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shape id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600">&nbsp;<img src="https://forum.codejock.com/uploads/20080709_110655_sample.jpg" border="0"></v:shape></SPAN></DIV><DIV><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: SimSun; mso-bidi-font-family: SimSun; mso-ansi-: EN-US; mso-fareast-: ZH-CN; mso-bidi-: AR-SA"><v:shape stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"></v:shape></SPAN>&nbsp;</DIV><DIV><SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-fareast-font-family: SimSun; mso-bidi-font-family: SimSun; mso-ansi-: EN-US; mso-fareast-: ZH-CN; mso-bidi-: AR-SA"><v:shape stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"></v:stroke><v:ulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:ulas><v:path o:c&#111;nnect="rect" gradientshapeok="t" o:extrusi&#111;nok="f"></v:path><?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:lock aspectratio="t" v:ext="edit"><DIV><FONT size=2>Is there an auto width property on the <FONT size=2>CXTPControlComboBox? or should we be getting the font width and number of chars do the math and come up with the width??</FONT></FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Regards,</FONT></DIV><DIV><FONT size=2>Bala</FONT></DIV></o:lock></v:shape></SPAN></DIV>]]>
   </description>
   <pubDate>Wed, 09 Jul 2008 11:09:22 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11364&amp;PID=38054&amp;title=cxtpcontrolcombobox-width#38054</guid>
  </item> 
 </channel>
</rss>