<?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 : CXTPSyntaxEditCtrl selection highlight</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Syntax Edit : CXTPSyntaxEditCtrl selection highlight]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 23 May 2026 02:57:20 +0000</pubDate>
  <lastBuildDate>Sat, 29 Aug 2009 12:26:30 +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=15058</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[CXTPSyntaxEditCtrl selection highlight : Done - for MFC and for ActiveX...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52558&amp;title=cxtpsyntaxeditctrl-selection-highlight#52558</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 29 August 2009 at 12:26pm<br /><br />Done - for MFC and for ActiveX <DIV>e.g. in VB sample use</DIV><DIV>&nbsp;</DIV><DIV>With SyntaxEdit1<BR>&nbsp; .SyntaxSet "&#091;Schemes&#093;" &amp; vbCrLf &amp; "VBS" &amp; vbCrLf &amp; "&#091;Themes&#093;" &amp; vbCrLf &amp; "Default" &amp; vbCrLf &amp; "Alternative" &amp; vbCrLf<BR>&nbsp; .SyntaxScheme = sScheme2<BR>&nbsp; .DataManager.FileExt = ".vbs"<BR>&nbsp; .EnableEditAccelerators = True<BR>&nbsp; .Text = sText<BR>&nbsp; .ActivateOnFocus = True<BR>End With<BR></DIV><DIV><img src="http://forum.codejock.com/uploads/20090829_124157_ScreenShot7.jpg" border="0"></DIV>]]>
   </description>
   <pubDate>Sat, 29 Aug 2009 12:26:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52558&amp;title=cxtpsyntaxeditctrl-selection-highlight#52558</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight : Sounds good! Thanks! ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52557&amp;title=cxtpsyntaxeditctrl-selection-highlight#52557</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2426">robin_l</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 29 August 2009 at 12:12pm<br /><br />Sounds good! Thanks!]]>
   </description>
   <pubDate>Sat, 29 Aug 2009 12:12:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52557&amp;title=cxtpsyntaxeditctrl-selection-highlight#52557</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight : We can add special flag CXTPSy...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52556&amp;title=cxtpsyntaxeditctrl-selection-highlight#52556</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 29 August 2009 at 12:09pm<br /><br />We can add special flag <FONT size=2>CXTPSyntaxEditCtrl::m_bActivateOnFocus - so no need to subclassing - just set TRUE (let's default be FALSE as now - no activation)</FONT> and expose the flag to ActiveX]]>
   </description>
   <pubDate>Sat, 29 Aug 2009 12:09:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52556&amp;title=cxtpsyntaxeditctrl-selection-highlight#52556</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight : I have done now... by subclassing...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52555&amp;title=cxtpsyntaxeditctrl-selection-highlight#52555</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2426">robin_l</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 29 August 2009 at 12:04pm<br /><br />I have done now... by subclassing <FONT size=2>CXTPSyntaxEditCtrl so that WM_SETFOCUS calls SetActive(TRUE) and WM_KILLFOCUS calls SetActive(FALSE). I think it would be useful for other people if this was the default behaviour though.</FONT>]]>
   </description>
   <pubDate>Sat, 29 Aug 2009 12:04:24 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52555&amp;title=cxtpsyntaxeditctrl-selection-highlight#52555</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight : Essentially this is proper behaviour...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52554&amp;title=cxtpsyntaxeditctrl-selection-highlight#52554</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 29 August 2009 at 11:53am<br /><br />Essentially this is proper behaviour - app should care about such things - control should not dictate it. ]]>
   </description>
   <pubDate>Sat, 29 Aug 2009 11:53:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52554&amp;title=cxtpsyntaxeditctrl-selection-highlight#52554</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight : It doesn&amp;#039;t do so here. For...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52553&amp;title=cxtpsyntaxeditctrl-selection-highlight#52553</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2426">robin_l</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 29 August 2009 at 11:37am<br /><br />It doesn't do so here. For example, run your "SyntaxEdit On Dialog" sample. This never shows anything but the non-active selection color (on my system at least):<DIV>&nbsp;</DIV><DIV><img src="https://forum.codejock.com/uploads/20090829_112539_syntaxdialog.png" border="0"></DIV><DIV>&nbsp;</DIV><DIV>If the syntax editor is used in a View, then everything is OK. For example, using the SyntaxEdit.MDITextEditor&nbsp;sample from the toolkit:</DIV><DIV>&nbsp;</DIV><DIV><img src="https://forum.codejock.com/uploads/20090829_113029_syntaxview.png" border="0"></DIV><DIV>&nbsp;</DIV><DIV>This shows the "correct" selection color (and the dull blue color when the application loses focus). It looks as if when&nbsp;the control is used in a dialog then it never receives the WM_ACTIVATE messages, so <FONT size=2>CXTPSyntaxEditCtrl::OnActivate </FONT>is never called (though OnMouseActivate is).</DIV><DIV>&nbsp;</DIV><DIV>The View version calls SetActive via a different route, via <FONT size=2>CXTPSyntaxEditView::OnActivateView, which does get called.</FONT></DIV>]]>
   </description>
   <pubDate>Sat, 29 Aug 2009 11:37:36 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52553&amp;title=cxtpsyntaxeditctrl-selection-highlight#52553</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight : I am not sure that you are right...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52552&amp;title=cxtpsyntaxeditctrl-selection-highlight#52552</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 29 August 2009 at 9:51am<br /><br /><P>I am not sure that you are right - if you put breakpoint inside the CXTPSyntaxEditPaintManager code </P><DIV><FONT color=#0000ff>if</FONT><FONT size=2> (!pEditCtrl-&gt;IsActive()) {... </FONT></DIV><DIV><FONT size=2>you will see that it will break. Also flag pEditCtrl-&gt;m_bFocused exist and accessable from CXTPSyntaxEditPaintManager.</FONT></DIV>]]>
   </description>
   <pubDate>Sat, 29 Aug 2009 09:51:39 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52552&amp;title=cxtpsyntaxeditctrl-selection-highlight#52552</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight : OK... now I&amp;#039;m beginning to...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52550&amp;title=cxtpsyntaxeditctrl-selection-highlight#52550</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2426">robin_l</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 29 August 2009 at 9:10am<br /><br />OK... now I'm beginning to understand! I assumed that as the highlighting was not indicating the focused (active) condition that the code didn't do this. Wrong... it does. What the problem is, however, is that the active state is never being set for a CXTPSyntaxEditCtrl so the selection state is ALWAYS the inactive highlight color. This isn't just a problem of my application--you were good enough to create a small sample app that used the CXTPSyntaxEditCtrl&nbsp;in a dialog--this also shows the same behaviour.<DIV>&nbsp;</DIV><DIV>The active state is set via the&nbsp;OnActivate function call, but this seems never to happen. I can't detect any WM_ACTIVATE messages going to the control--I'm not even sure that dialog controls receive these. This means that the controls are never in the "active" state.</DIV><DIV>&nbsp;</DIV><DIV>What DOES work, however, is to add message handlers for WM_SETFOCUS and WM_KILLFOCUS, and from these call SetActive(TRUE) and SetActive(FALSE). Perhaps you should add these for the CXTPSyntaxEditCtrl&nbsp;so that the syntax highlighting will work as designed?</DIV>]]>
   </description>
   <pubDate>Sat, 29 Aug 2009 09:10:32 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52550&amp;title=cxtpsyntaxeditctrl-selection-highlight#52550</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight :  AFX_INLINE COLORREF CXTPSynt...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52546&amp;title=cxtpsyntaxeditctrl-selection-highlight#52546</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 28 August 2009 at 9:55pm<br /><br /><FONT size=2><P>AFX_INLINE COLORREF CXTPSyntaxEditPaintManager::GetHiliteTextColor() </FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2>{ </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> m_clrValues.crHiliteText; }</P><P>AFX_INLINE COLORREF CXTPSyntaxEditPaintManager::GetHiliteBackColor() </FONT><FONT color=#0000ff size=2>const </FONT><FONT size=2>{ </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> m_clrValues.crHiliteBack; }</P><P>AFX_INLINE COLORREF CXTPSyntaxEditPaintManager::GetInactiveHiliteTextColor() </FONT><FONT color=#0000ff size=2>const </FONT><FONT size=2>{ </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> m_clrValues.crInactiveHiliteText; }</P><P>AFX_INLINE COLORREF CXTPSyntaxEditPaintManager::GetInactiveHiliteBackColor() </FONT><FONT color=#0000ff size=2>const </FONT><FONT size=2>{ </FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2> m_clrValues.crInactiveHiliteBack; }</P></FONT>]]>
   </description>
   <pubDate>Fri, 28 Aug 2009 21:55:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52546&amp;title=cxtpsyntaxeditctrl-selection-highlight#52546</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPSyntaxEditCtrl selection highlight : Right - this is not difficult....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52529&amp;title=cxtpsyntaxeditctrl-selection-highlight#52529</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 15058<br /><strong>Posted:</strong> 28 August 2009 at 10:56am<br /><br />Right - this is not difficult. <DIV>See next post - we already have&nbsp;active and not active color combination.</DIV><DIV>Used in <FONT size=2><FONT size=2>CXTPSyntaxEditPaintManager::DrawLineTextEx</FONT></FONT></DIV><DIV><FONT size=2>with defaults:</FONT></DIV><FONT size=2><P>m_clrValues.crHiliteText.SetStandardValue(::GetSysColor(COLOR_HIGHLIGHTTEXT));</P><P>m_clrValues.crHiliteBack.SetStandardValue(::GetSysColor(COLOR_HIGHLIGHT));</P><P>m_clrValues.crInactiveHiliteText.SetStandardValue(::GetSysColor(COLOR_INACTIVECAPTIONTEXT));</P><P>m_clrValues.crInactiveHiliteBack.SetStandardValue(::GetSysColor(COLOR_INACTIVECAPTION));</P><DIV></DIV><P>And function to switch:</P><DIV><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (!pEditCtrl-&gt;IsActive()) {</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (crHiliteBack == m_clrValues.crHiliteBack.GetStandardColor())</P><P>crHiliteBack = m_clrValues.crInactiveHiliteBack;</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (crHiliteText == m_clrValues.crHiliteText.GetStandardColor())</P><P>crHiliteText = m_clrValues.crInactiveHiliteText; }</P><DIV></DIV>So find why it does not covered your expectation - please debug your mutli-controls case with attention to this switch</FONT></FONT></DIV>]]>
   </description>
   <pubDate>Fri, 28 Aug 2009 10:56:24 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=15058&amp;PID=52529&amp;title=cxtpsyntaxeditctrl-selection-highlight#52529</guid>
  </item> 
 </channel>
</rss>