<?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 : [SOLVED] BUG: Strange edit control behaviour?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : [SOLVED] BUG: Strange edit control behaviour?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 06:49:53 +0000</pubDate>
  <lastBuildDate>Wed, 07 Jan 2009 09:25:49 +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=12975</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[[SOLVED] BUG: Strange edit control behaviour? : Hi;I tried it and now it works...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44239&amp;title=solved-bug-strange-edit-control-behaviour#44239</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 07 January 2009 at 9:25am<br /><br />Hi;<br>I tried it and now it works as expected!<br>But I'm still insitent that a customizable edit control would be a requirement for the report control. <img src="http://forum.codejock.com/smileys/smiley2.gif" border="0" align="absmiddle"><br><br>Thanks for you help! <img src="http://forum.codejock.com/smileys/smiley32.gif" border="0" align="absmiddle"><br>]]>
   </description>
   <pubDate>Wed, 07 Jan 2009 09:25:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44239&amp;title=solved-bug-strange-edit-control-behaviour#44239</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? : Hey, finally I make a control...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44096&amp;title=solved-bug-strange-edit-control-behaviour#44096</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 04 January 2009 at 11:15pm<br /><br />Hey, finally I make a control which recover previous selection if OnEditChanging not commit. Please try it and keep me updated<DIV>&nbsp;</DIV><DIV><FONT color=#0000ff size=2><P>void</FONT><FONT size=2> CXTPReportInplaceEdit::OnEnChange()</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_bSetWindowText || !pControl || !pItem)</P><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2>;</P><P>CString strValue, strValNew;</P><P>GetWindowText(strValue);</P><P>strValNew = strValue;</P></FONT><FONT color=#008000 size=2><P>//recover previous selection by diff between old and new text - compare from the start and from the end</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> kO = strValue.GetLength();</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> kP = m_strText_prev.GetLength();</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> K = min(kO, kP);</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> kOld(0);</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> kOldEnd(kP);</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_strText_prev != strValue)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> j = 0; j &lt; K; j++)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_strText_prev&#091;j&#093; != strValue&#091;j&#093;)</P><P>{</P><P>kOld = j;</P><P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P><P>}</P><P>}</P><P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> j = 1; j &lt;= K; j++)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_strText_prev&#091;kP - j&#093; != strValue&#091;kO - j&#093;)</P><P>{</P><P>kOldEnd = kP + 1 - j;</P><P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P><P>}</P><P>}</P><P>}</P><P>BOOL bCommit = pItem-&gt;OnEditChanging((XTP_REPORTRECORDITEM_ARGS*)</FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>, strValNew);</P></FONT><FONT color=#008000 size=2><P>//Test cases for Forum discussion (Topic: BUG: Strange edit control behaviour? - 19 December 2008)</P><P>//test case for key entry rejected by OnEditChanging handler</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//int iRep1 = strValNew.Replace("#", "@");</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//int iRep2 = strValNew.Replace("?", "");</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//if (iRep1 &gt; 0 || iRep2 &gt; 0)</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//{</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// bCommit = FALSE;</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// strValNew = strValue;</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//}</P><P>//test case for paste operation rejected by OnEditChanging handler</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//if (strValNew.Find("666666") &gt; - 1)</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//{</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// bCommit = FALSE;</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// strValNew = strValue;</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//}</P><P>//test case for Forum discussion</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (!bCommit || strValNew != strValue)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> nSelStart = 0, nSelEnd = 0;</P><P>GetSel(nSelStart, nSelEnd);</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> kN = strValNew.GetLength();</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> kk = min(kO, kN);</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (strValNew != strValue) </FONT><FONT color=#008000 size=2>//it means that bCommit is TRUE</P></FONT><FONT size=2><P>{</P><P>SetWindowText(strValNew);</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> k(kk - 1);</P><P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> j = 0; j &lt; kk; j++)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (strValNew&#091;j&#093; != strValue&#091;j&#093;)</P><P>{</P><P>k = j;</P><P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P><P>}</P><P>}</P><P>SetSel(k, k);</P><P>}</P><P></FONT><FONT color=#0000ff size=2>else</FONT><FONT size=2> </FONT><FONT color=#008000 size=2>//it means that bCommit is FALSE - need rollback</P></FONT><FONT size=2><P>{</P><P>SetWindowText(m_strText_prev);</P></FONT><FONT size=2><P>SetSel(kOld, kOldEnd);</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (nSelStart == kO &amp;&amp; nSelEnd == kO &amp;&amp; kP &lt; kO)</P><P>SetSel(nSelStart, nSelEnd);</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (nSelStart == 1 &amp;&amp; nSelEnd == 1 &amp;&amp; kP &lt; kO)</P><P>SetSel(0, 0);</P><P>}</P></FONT><FONT size=2><P>}</P><P></FONT><FONT color=#0000ff size=2>else</P></FONT><FONT size=2><P>{</P><P>m_strText_prev = strValue; </P><P></FONT><FONT color=#008000 size=2>//Normal (default) cursor positioning</P></FONT><FONT size=2><P>}</P><P>}</P></FONT></DIV>]]>
   </description>
   <pubDate>Sun, 04 Jan 2009 23:15:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44096&amp;title=solved-bug-strange-edit-control-behaviour#44096</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? : &amp;gt;&amp;gt;the whole selection is...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44086&amp;title=solved-bug-strange-edit-control-behaviour#44086</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 02 January 2009 at 6:18pm<br /><br />&gt;&gt;the whole selection is cleared and the cursor is moved to the beginning of the text<DIV>btw - this is a standard reaction - e.g. C# System.Windows.Forms.MaskedTextBox()</DIV><DIV>if you select previous (validated) value and paste smth wrong - all selection clear and value set to default (initial - e.g. empty or prompt)</DIV>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 18:18:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44086&amp;title=solved-bug-strange-edit-control-behaviour#44086</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? :   mdoubson wrote:Well - let&amp;#039;s...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44082&amp;title=solved-bug-strange-edit-control-behaviour#44082</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 02 January 2009 at 1:59pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by mdoubson" alt="Originally posted by mdoubson" style="vertical-align: text-bottom;" /> <strong>mdoubson wrote:</strong><br /><br /><p>Well - let's extend the concept to cover your copy operation</p><div><font color="#0000ff" size="2">Now we have different reactions for test case. Suppose your validation reject the string modification when string has <font color="#008000">"666666" pattern. It means that for key by key entry validation will allow to input "66666" and will stop on next "6" BUT if user&nbsp;PASTE "666666" as one Ctrl+V operation - all operation will rejected. This is that updated case covered. Try and give me your feedback</font></font></div><div><font color="#0000ff" size="2"></font>&nbsp;</div><div><font color="#0000ff" size="2">void</font><font size="2"> CXTPReportInplaceEdit::OnEnChange()</font></div><div><p><font size="2">{</font></p><p><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (m_bSetWindowText || !pControl || !pItem)</font></p><p><font size="2"></font><font color="#0000ff" size="2">return</font><font size="2">;</font></p><p><font size="2">CString strValue, strValNew;</font></p><p><font size="2">GetWindowText(strValue);</font></p><p><font size="2">strValNew = strValue;</font></p><p><font size="2"></font><font color="#0000ff" size="2">int</font><font size="2"> kOld(0);</font></p><p><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (m_strText_prev != strValue)</font></p><p><font size="2">{</font></p><p><font size="2"></font><font color="#0000ff" size="2">for</font><font size="2"> (</font><font color="#0000ff" size="2">int</font><font size="2"> j = 0; j &lt; min(strValue.GetLength(), m_strText_prev.GetLength()); j++)</font></p><p><font size="2">{</font></p><p><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (m_strText_prev&#091;j&#093; != strValue&#091;j&#093;)</font></p><p><font size="2">{</font></p><p><font size="2">kOld = j;</font></p><p><font size="2"></font><font color="#0000ff" size="2">break</font><font size="2">;</font></p><p><font size="2">}</font></p><p><font size="2">}</font></p><p><font size="2">}</font></p><p><font size="2">BOOL bCommit = pItem-&gt;OnEditChanging((XTP_REPORTRECORDITEM_ARGS*)</font><font color="#0000ff" size="2">this</font><font size="2">, strValNew);</font></p><font size="2"></font><font color="#008000" size="2"><p>//Test cases for Forum discussion (Topic: BUG: Strange edit control behaviour? - 19 December 2008)</p><p>//test case for key entry rejected by OnEditChanging handler</p></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">//int iRep1 = strValNew.Replace("#", "@");</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">//int iRep2 = strValNew.Replace("?", "");</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">//if (iRep1 &gt; 0 || iRep2 &gt; 0)</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">//{</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">// bCommit = FALSE;</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">// strValNew = strValue;</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">//}</font></p><p><font color="#008000" size="2">//test case for paste operation rejected by OnEditChanging handler</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">//if (strValNew.Find("666666") &gt; - 1)</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">//{</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">// bCommit = FALSE;</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">// strValNew = strValue;</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#008000" size="2">//}</font></p><p><font color="#008000" size="2">//test case for Forum discussion</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (!bCommit || strValNew != strValue)</font></p><p><font size="2">{</font></p><p><font size="2"></font><font color="#0000ff" size="2">int</font><font size="2"> nSelStart = 0, nSelEnd = 0;</font></p><p><font size="2">GetSel(nSelStart, nSelEnd);</font></p><font size="2"></font><font color="#008000" size="2"><p>//test case for Forum discussion</p></font><font size="2"></font><p><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (strValNew != strValue) </font><font color="#008000" size="2">//it means that bCommit is TRUE</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2">{</font></p><p><font size="2">SetWindowText(strValNew);</font></p><p><font size="2"></font><font color="#0000ff" size="2">int</font><font size="2"> k(0);</font></p><p><font size="2"></font><font color="#0000ff" size="2">for</font><font size="2"> (</font><font color="#0000ff" size="2">int</font><font size="2"> j = 0; j &lt; min(strValue.GetLength(), strValNew.GetLength()); j++)</font></p><p><font size="2">{</font></p><p><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (strValNew&#091;j&#093; != strValue&#091;j&#093;)</font></p><p><font size="2">{</font></p><p><font size="2">k = j;</font></p><p><font size="2"></font><font color="#0000ff" size="2">break</font><font size="2">;</font></p><p><font size="2">}</font></p><p><font size="2">}</font></p><p><font size="2">SetSel(k, k);</font></p><p><font size="2">}</font></p><p><font size="2"></font><font color="#0000ff" size="2">else</font><font size="2"> </font><font color="#008000" size="2">//it means that bCommit is FALSE - need rollback</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2">{</font></p><p><font size="2">SetWindowText(m_strText_prev);</font></p><p><font size="2"></font><font color="#008000" size="2">//SetSel(nSelStart -1, nSelEnd - 1);</font></p><font color="#008000" size="2"></font><font size="2"></font><p><font size="2">SetSel(kOld, kOld);</font></p><p><font size="2"></font><font color="#008000" size="2">//Cursor position before 1st OnEditChanging - handler - modified symbol</font></p><font color="#008000" size="2"></font><font size="2"><p>}</p></font><font color="#008000" size="2"><p>//test case for Forum discussion</p><p>//MD - old code &lt;&lt;</p><p>// SetWindowText(bCommit ? strValNew : m_strText_prev);</p><p>// SetSel(nSelStart, nSelEnd);</p><p>//MD - old code &gt;&gt;</p></font><font size="2"></font><p><font size="2">}</font></p><p><font size="2"></font><font color="#0000ff" size="2">else</font></p><font color="#0000ff" size="2"></font><font size="2"></font><p><font size="2">{</font></p><p><font size="2">m_strText_prev = strValue;</font></p><p><font size="2"></font><font color="#008000" size="2">//Normal (default) cursor positioning</font></p><font color="#008000" size="2"></font><font size="2"><p>}</p><p>}</p></font></div></td></tr></table>Ok, I'll try it.<br>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 13:59:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44082&amp;title=solved-bug-strange-edit-control-behaviour#44082</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? :   mdoubson wrote:btw - why you...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44080&amp;title=solved-bug-strange-edit-control-behaviour#44080</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 02 January 2009 at 12:50pm<br /><br /><table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Originally posted by mdoubson" alt="Originally posted by mdoubson" style="vertical-align: text-bottom;" /> <strong>mdoubson wrote:</strong><br /><br />btw - why you don't complain about non-supported Ctrl+A action?<div><font color="#0000ff" size="2">You can modify <font color="#000000">OnChar function adding in the end&nbsp;few lines:</font></font></div><div><font size="2"></font>&nbsp;</div><div><font color="#0000ff" size="2">void</font><font size="2"> CXTPReportInplaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)</font></div><div><p><font size="2">{</font></p><font size="2"></font><font color="#008000" size="2"></font><p><font color="#008000" size="2">...........................................</font><font size="2"></font></p><font size="2"></font><font size="2"></font><p><font size="2"></font><font color="#0000ff" size="2">if</font><font size="2"> (nChar == 1 &amp;&amp; nFlags == 30) </font><font color="#008000" size="2">//Ctrl+A case</font></p><font color="#008000" size="2"></font><font size="2"><p>{</p><p>SetSel(0, -1);</p><p>}</p></font><font size="2"><p>CEdit::OnChar(nChar, nRepCnt, nFlags);</p><p>}</p></font></div></td></tr></table><br>Hi;<br>As I told in one of my previous posts, our company guidelines do not allow to change regular toolkit code, to avoid additional work and possible 'hidden' failures when new toolkit releases are available. We're using the toolkit since version 2.x and in the past we had to fix several bugs that came from modifying the core toolkit source.<br>Today I dig into the CXTPReportRecordItem class to eventually find another solution for our editing issue, but until now with no success<br>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 12:50:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44080&amp;title=solved-bug-strange-edit-control-behaviour#44080</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? : btw - why you don&amp;#039;t complain...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44079&amp;title=solved-bug-strange-edit-control-behaviour#44079</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 02 January 2009 at 12:24pm<br /><br />btw - why you don't complain about non-supported Ctrl+A action?<DIV><FONT color=#0000ff size=2>You can modify <FONT color=#000000>OnChar function adding in the end&nbsp;few lines:</FONT></FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2>void</FONT><FONT size=2> CXTPReportInplaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)</DIV><DIV><P>{</P></FONT><FONT color=#008000 size=2><P>...........................................</FONT><FONT size=2></P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (nChar == 1 &amp;&amp; nFlags == 30) </FONT><FONT color=#008000 size=2>//Ctrl+A case</P></FONT><FONT size=2><P>{</P><P>SetSel(0, -1);</P><P>}</P></FONT><FONT size=2><P>CEdit::OnChar(nChar, nRepCnt, nFlags);</P><P>}</P></FONT></DIV>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 12:24:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44079&amp;title=solved-bug-strange-edit-control-behaviour#44079</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? : Well - let&amp;#039;s extend the concept...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44077&amp;title=solved-bug-strange-edit-control-behaviour#44077</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 02 January 2009 at 11:37am<br /><br /><P>Well - let's extend the concept to cover your copy operation</P><DIV><FONT color=#0000ff size=2>Now we have different reactions for test case. Suppose your validation reject the string modification when string has <FONT color=#008000>"666666" pattern. It means that for key by key entry validation will allow to input "66666" and will stop on next "6" BUT if user&nbsp;PASTE "666666" as one Ctrl+V operation - all operation will rejected. This is that updated case covered. Try and give me your feedback</FONT></FONT></DIV><DIV><FONT color=#0000ff size=2></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2>void</FONT><FONT size=2> CXTPReportInplaceEdit::OnEnChange()</DIV><DIV><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_bSetWindowText || !pControl || !pItem)</P><P></FONT><FONT color=#0000ff size=2>return</FONT><FONT size=2>;</P><P>CString strValue, strValNew;</P><P>GetWindowText(strValue);</P><P>strValNew = strValue;</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> kOld(0);</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_strText_prev != strValue)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> j = 0; j &lt; min(strValue.GetLength(), m_strText_prev.GetLength()); j++)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (m_strText_prev&#091;j&#093; != strValue&#091;j&#093;)</P><P>{</P><P>kOld = j;</P><P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P><P>}</P><P>}</P><P>}</P><P>BOOL bCommit = pItem-&gt;OnEditChanging((XTP_REPORTRECORDITEM_ARGS*)</FONT><FONT color=#0000ff size=2>this</FONT><FONT size=2>, strValNew);</P></FONT><FONT color=#008000 size=2><P>//Test cases for Forum discussion (Topic: BUG: Strange edit control behaviour? - 19 December 2008)</P><P>//test case for key entry rejected by OnEditChanging handler</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//int iRep1 = strValNew.Replace("#", "@");</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//int iRep2 = strValNew.Replace("?", "");</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//if (iRep1 &gt; 0 || iRep2 &gt; 0)</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//{</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// bCommit = FALSE;</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// strValNew = strValue;</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//}</P><P>//test case for paste operation rejected by OnEditChanging handler</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//if (strValNew.Find("666666") &gt; - 1)</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//{</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// bCommit = FALSE;</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>// strValNew = strValue;</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2>//}</P><P>//test case for Forum discussion</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (!bCommit || strValNew != strValue)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> nSelStart = 0, nSelEnd = 0;</P><P>GetSel(nSelStart, nSelEnd);</P></FONT><FONT color=#008000 size=2><P>//test case for Forum discussion</P></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (strValNew != strValue) </FONT><FONT color=#008000 size=2>//it means that bCommit is TRUE</P></FONT><FONT size=2><P>{</P><P>SetWindowText(strValNew);</P><P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> k(0);</P><P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> j = 0; j &lt; min(strValue.GetLength(), strValNew.GetLength()); j++)</P><P>{</P><P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (strValNew&#091;j&#093; != strValue&#091;j&#093;)</P><P>{</P><P>k = j;</P><P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P><P>}</P><P>}</P><P>SetSel(k, k);</P><P>}</P><P></FONT><FONT color=#0000ff size=2>else</FONT><FONT size=2> </FONT><FONT color=#008000 size=2>//it means that bCommit is FALSE - need rollback</P></FONT><FONT size=2><P>{</P><P>SetWindowText(m_strText_prev);</P><P></FONT><FONT color=#008000 size=2>//SetSel(nSelStart -1, nSelEnd - 1); </P></FONT><FONT size=2><P>SetSel(kOld, kOld);</P><P></FONT><FONT color=#008000 size=2>//Cursor position before 1st OnEditChanging - handler - modified symbol</P></FONT><FONT size=2><P>}</P></FONT><FONT color=#008000 size=2><P>//test case for Forum discussion</P><P>//MD - old code &lt;&lt;</P><P>// SetWindowText(bCommit ? strValNew : m_strText_prev);</P><P>// SetSel(nSelStart, nSelEnd);</P><P>//MD - old code &gt;&gt;</P></FONT><FONT size=2><P>}</P><P></FONT><FONT color=#0000ff size=2>else</P></FONT><FONT size=2><P>{</P><P>m_strText_prev = strValue; </P><P></FONT><FONT color=#008000 size=2>//Normal (default) cursor positioning</P></FONT><FONT size=2><P>}</P><P>}</P></FONT></DIV>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 11:37:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44077&amp;title=solved-bug-strange-edit-control-behaviour#44077</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? : Hi;I tried your solution and it...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44076&amp;title=solved-bug-strange-edit-control-behaviour#44076</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 02 January 2009 at 8:44am<br /><br />Hi;<br>I tried your solution and it partially works.<br>Two issues are not solved:<br><br>1. The user selects the whole text in the edit control and presses a key that is not accepted by the regex pattern. Then in your solution, the whole selection is cleared and the cursor is moved to the beginning of the text. This is also true for partially selected text. Other edit controls have a different behaviour: in this case, the edit control selection is kept the same.<br>(This was my first problem when implementing this 'custom' edit task).<br>2. <table width="99%"><tr><td class="BBquote"><img src="forum_images/quote_box.png" title="Quote" alt="Quote" style="vertical-align: text-bottom;" /> You wrote:<table width="99%"><tr><td><pre class="BBcode"><font color="#0000ff" size="2">if</font><font size="2"> (strValNew != strValue)</font><br>{<br>&nbsp;&nbsp; SetWindowText(strValNew);<font color="#0000ff" size="2"><br>&nbsp;&nbsp; int</font> k(0);<font color="#0000ff" size="2"><br>&nbsp;&nbsp; for</font><font size="2"> (</font><font color="#0000ff" size="2">int</font><font size="2"> j = 0; j &lt; <strong>strValue.GetLength()</strong>; j++){<br></font><font color="#0000ff" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</font><font size="2"> (<strong>strValNew&#091;j&#093;</strong> != strValue&#091;j&#093;)</font><font size="2"></pre></td></tr></table></font></td></tr></table><br>What if strValNew is shorter than strValue? Wouldn't this lead to access violations?<br><br>BTW: You didn't answer my question about custom edit controls in future releases... <img src="http://1.2.3.11/bmi/forum.codejock.com/smileys/smiley19.gif" border="0" align="absmiddle"><br>]]>
   </description>
   <pubDate>Fri, 02 Jan 2009 08:44:05 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44076&amp;title=solved-bug-strange-edit-control-behaviour#44076</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? : Ok!Do you have plans to enable...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44007&amp;title=solved-bug-strange-edit-control-behaviour#44007</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=109">mgampi</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 29 December 2008 at 5:28pm<br /><br />Ok!<br>Do you have plans to enable custom inplace edit controls too?<br>We will need several mask edit control types in report controls of our software.<img src="http://forum.codejock.com/smileys/smiley20.gif" border="0" align="absmiddle"> <br>]]>
   </description>
   <pubDate>Mon, 29 Dec 2008 17:28:31 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44007&amp;title=solved-bug-strange-edit-control-behaviour#44007</guid>
  </item> 
  <item>
   <title><![CDATA[[SOLVED] BUG: Strange edit control behaviour? : Sure I will change the toolkit...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44006&amp;title=solved-bug-strange-edit-control-behaviour#44006</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4721">mdoubson</a><br /><strong>Subject:</strong> 12975<br /><strong>Posted:</strong> 29 December 2008 at 5:19pm<br /><br />Sure I will change the toolkit code. Try to test also the case you do smart validation and change smth inside your derived code -&nbsp;check how logical will be&nbsp;the resulted cursor position]]>
   </description>
   <pubDate>Mon, 29 Dec 2008 17:19:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12975&amp;PID=44006&amp;title=solved-bug-strange-edit-control-behaviour#44006</guid>
  </item> 
 </channel>
</rss>