<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Uwe&#039;s Delphi blog</title>
	<atom:link href="http://www.bitcommander.de/blog/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bitcommander.de/blog</link>
	<description>Thoughts on Delphi and Version Control</description>
	<lastBuildDate>Sun, 13 May 2012 21:52:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Modal Search Dialog Expert Beta 2 (D2010 and fixes)</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/05/13/modal-search-2/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/05/13/modal-search-2/#comments</comments>
		<pubDate>Sun, 13 May 2012 21:52:16 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[IDE]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=2156</guid>
		<description><![CDATA[I have fixed some bugs in the Modal Search Dialog Expert, added support for D2010 and here is now Beta 2. For more information about the Modal Search Dialog Expert check my first Modal Search blog post. This is the &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/05/13/modal-search-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have fixed some bugs in the Modal Search Dialog Expert, added support for D2010 and here is now <a href="http://www.bitcommander.de/files/20120513ED91E160/ModalSearchDialogExpertBeta2.exe">Beta 2</a>.</p>
<p>For more information about the Modal Search Dialog Expert check my <a href="http://www.bitcommander.de/blog/index.php/2012/05/09/modal-search-1/">first Modal Search blog post</a>.</p>
<p>This is the list of the changes:</p>
<ul>
<li>Added D2010 support</li>
<li>Fixed RegEx focus bug (search did not consider the option &#8220;BRIEF regular expressions&#8221; and treated it always to be True)</li>
<li>Last search text is now shown in Find dialog, when &#8220;Find text at cursor&#8221; is disabled</li>
<li>Fixed Repeat Search &#8220;Not found&#8221; behavior for the case when &#8220;Show all search matches&#8221; is enabled</li>
<li>Match count is now localized and updated when repeating a search</li>
</ul>
<p>The IDEs default &#8220;Not found&#8221; behavior since D2010 is a bit ill especially with &#8220;Show all search matches&#8221; enabled, because the IDE knows if there is any search result in the file. With steps this should be more understandable:</p>
<ul>
<li>start the IDE</li>
<li>check if the editor option &#8220;Show all search matches&#8221; is enabled and if not, enable it and restart the IDE</li>
<li>check if the editor option &#8220;Auto search wrap around&#8221; is enabled and if yes, disable it</li>
<li>create a new console app</li>
<li>place cursor into the middle of the source</li>
<li>search for &#8220;foo&#8221;</li>
<li>-> message &#8220;Search string &#8216;foo&#8217; not found&#8221; is shown</li>
<li>press F3</li>
<li>-> wrap around message &#8220;Restart search from the beginning of the file?&#8221; is shown</li>
<li>press Yes button</li>
<li>-> cursor is now on top of the file and message &#8220;Search string &#8216;foo&#8217; not found&#8221; is shown</li>
</ul>
<p>If &#8220;Auto search wrap around&#8221; is enabled then the behavior is a bit different</p>
<ul>
<li>start the IDE</li>
<li>check if the editor option &#8220;Show all search matches&#8221; is enabled and if not, enable it and restart the IDE</li>
<li>check if the editor option &#8220;Auto search wrap around&#8221; is enabled and if not, enable it</li>
<li>create a new console app</li>
<li>place cursor into the middle of the source</li>
<li>search for &#8220;foo&#8221;</li>
<li>-> message &#8220;Search string &#8216;foo&#8217; not found&#8221; is shown two times and cursor is now on top of the file</li>
<li>place cursor into the middle of the source</li>
<li>press F3</li>
<li>-> message &#8220;Search string &#8216;foo&#8217; not found&#8221; is shown once and cursor is now on top of the file</li>
</ul>
<p>In this Beta I have fixed the Repeat Search behavior for the case when &#8220;Show all search matches&#8221; is enabled. The behavior with and without &#8220;Auto search wrap around&#8221; after pressing F3 is now</p>
<ul>
<li>-> message &#8220;Search string &#8216;foo&#8217; not found&#8221; is shown once</li>
</ul>
<p>I make use of the fact that with &#8220;Show all search matches&#8221; the IDE knows if there are matches anywhere in the file. If the match count is zero then I show myself the &#8220;Search string &#8216;foo&#8217; not found&#8221; message and tell the IDE the search was successful. That prevents the unnecessary wrap around message &#8220;Restart search from the beginning/end of the file?&#8221; and the cursor does not jump to the top of the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/05/13/modal-search-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Modal Search is back from vacation!</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/05/09/modal-search-1/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/05/09/modal-search-1/#comments</comments>
		<pubDate>Tue, 08 May 2012 23:47:10 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[IDE]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=2108</guid>
		<description><![CDATA[I do not like the quality of the IDEs modeless search feature and you might remember my blog post &#8220;Scotts Valley get that search right!&#8221; from last October. There I have quoted more or less my co-worker with that &#8220;Every &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/05/09/modal-search-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I do not like the quality of the IDEs modeless search feature and you might remember my blog post <a href="http://www.bitcommander.de/blog/index.php/2011/10/01/search/">&#8220;Scotts Valley get that search right!&#8221;</a> from last October. There I have quoted more or less my co-worker with that <em>&#8220;Every text editor can do that better. Why did they changed that?&#8221;</em> and at that time he did not use Delphi XE2 daily. That changed in January and sometime ago he said something like <em>&#8220;Are there two edits in the search panel in Replace mode?&#8221;</em>. He knows that in Replace mode there is still a modal dialog and that is inconsistent.</p>
<p>I had a short look at some development tools and this is a short and incomplete development tools lists with the information if the search and replace features are modal or modeless.</p>
<table border="0">
<colgroup>
<col width="0">
<col width="150">
<col width="0">
<col width="0">
  </colgroup>
<tr>
<th>Tool</th>
<th>Version</th>
<th>Search</th>
<th>Replace</th>
</tr>
<tr>
<td>Delphi</td>
<td>till D2009</td>
<td>Modal</td>
<td>Modal</td>
</tr>
<tr>
<td>Delphi</td>
<td>since D2010</td>
<td>Modeless</td>
<td>Modal</td>
</tr>
<tr>
<td>Eclipse</td>
<td>Helious</td>
<td>Modal</td>
<td>Modal</td>
</tr>
<tr>
<td>SharpDevelop</td>
<td>3.2</td>
<td>Modal</td>
<td>Modal</td>
</tr>
<tr>
<td>Visual Studio</td>
<td>2008</td>
<td>Modal</td>
<td>Modal</td>
</tr>
<tr>
<td>Visual Studio</td>
<td>2011</td>
<td>Modeless</td>
<td>Modeless</td>
</tr>
</table>
<p>Well you see there is no other tool than Delphi in that incomplete list with that Search/Replace in inconsistency. Another problem with the modeless search is that not all search options are visible even if that gets better with higher resolutions. The following screenshot shows the search panel for the &#8220;Default&#8221; IDE desktop layout with different resolutions and for the US and the DE version. I hope you do see that not all search options are visible in any case. If not all are visible one has to click with the mouse cursor on the chevron to get access to the &#8220;invisible&#8221; options. Is it possible to show the chevrons popup menu using keys? I do not think so.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/SearchPanelControllerComparsion.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/SearchPanelControllerComparsion-1024x554.png" alt="" title="Search Panel Controller Comparsion" width="640" height="346" class="alignnone size-large wp-image-2127" /></a><br />
<em>Search Panel comparison (click for full size)</em></p>
<p>While I am at the search panel &#8211; Did the search panel add any new features to the IDE apart from the fact that the search dialog is now a modeless panel? Yes it did, but who really cares about them?</p>
<p>The new implicit and explicitly added functionality is:</p>
<ul>
<li>implicit: one can still see the text to find and the options after executing the search<br />-> no one cares about this</li>
<li>explicit: there are buttons to search forward, to search backward and to restart</li>
<li>explicit: the match count is shown and if the search has been restarted</li>
</ul>
<p>About two weeks ago I have had a look into the IDEs search basics, it was very easy to replace the search panel with a dialog and to perform a simple search and I decided to look deeper into it. After testing, some issues and improvements the modal search is now back with my new expert so far called Modal Search Dialog Expert. It does not 100 percent behave as Delphi 2009 and earlier, because the meaning of the F3 key has been changed. In D2009 and earlier F3 did always search into the direction you did select in the search dialog, but since D2010 F3 does always search forward and SHIFT+F3 has been added for backward search. Now the direction group box is disabled in the modal search dialog, but I had enabled it in early versions of the modal search dialog and did run into the problem that searching stopped working. The reason was that I had used SHIFT+F3, that toggled the direction (the modal search dialog does use the IDEs internal search options) and there was just nothing above the cursor to find. When the search panel starts a search with enter then the direction is always set to forward and thatswhy I have never seen the problem there. The modal search dialog looks now like this:<br />
<a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/ModalSearchDialog.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/ModalSearchDialog.png" alt="" title="Modal Search Dialog" width="384" height="259" class="alignnone size-full wp-image-2139" /></a><br />
<em>Modal Search dialog</em></p>
<p>When you do run a localized IDE then this dialog is almost completely localized (only the caption is not localized in the FR and JA locale) &#8211; I just read the captions from the DFM resource of the replace dialog. As said above the search panel did add the feature that the match count is shown and since the panel is not longer visible anymore I did add the match count to the right hand side of the editors &#8220;statusbar&#8221; as you can see on the following screenshot:<br />
<a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/EditorStatusbarWithMatchCount.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/EditorStatusbarWithMatchCount.png" alt="" title="Editor Statusbar With Match Count" width="402" height="48" class="alignnone size-full wp-image-2141" /></a><br />
<em>Editor &#8220;Statusbar&#8221; with match count</em></p>
<p>Note I have used the x resolution 1280 for that screenshot and that means there is usually much more space between the sub editor views and the match count. Right now the match count is not localized, but I guess you do understand what it is trying to tell you. The match count needs a little bit more work, because it remains visible when you switch to another file and so on.</p>
<p>Unless the editor option &#8220;Auto search wrap around&#8221; is enabled the IDE shows a dialog when you hit (SHIFT+) F3 on the last or first match. That is a regular dialog, but looks like an old message box:<br />
<a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/DefaultWrapAroundDialog.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/DefaultWrapAroundDialog.png" alt="" title="Default Wrap Around Dialog" width="384" height="126" class="alignnone size-full wp-image-2142" /></a><br />
<em>The IDEs default wrap around dialog</em></p>
<p>For Windows 6.x I have replaced this with a Task dialog and this looks like this:<br />
<a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/WrapAroundTaskDialog.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/WrapAroundTaskDialog.png" alt="" title="Wrap Around Task Dialog" width="379" height="131" class="alignnone size-full wp-image-2143" /></a><br />
<em>Using TTaskDialog for the wrap around message</em></p>
<p>This looks much better to me on newer OS. Maybe Embarcadero thought the Task dialog would limit them, requires too much testing or this is a left hand vs. right hand problem, because TTaskDialog has no confirmation icon as you can see in the following screenshot:<br />
<a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/TTaskDialogMainIcon.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/05/TTaskDialogMainIcon.png" alt="" title="TTaskDialog MainIcon" width="369" height="235" class="alignnone size-full wp-image-2144" /></a><br />
<em>Object Inspector showing possible values for TTaskDialog.MainIcon</em></p>
<p>The missing confirmation icon is not related to my filter and maybe the missing icon limited the developer and he decided to create an own dialog, but who knows. I know that my co-worker reworked some of our message helper functions to use TTaskDialog, I know that confirmation works there and the solution is just 99.</p>
<p>There is one unintended feature in my expert and that is that it does fix unintentionally without any changes at least the search bug <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=95578">QC 95578</a>.</p>
<p>Setup:</p>
<ul>
<li>Download the setup for XE and XE2 from <a href="http://www.bitcommander.de/files/201205086CF70589/ModalSearchDialogExpertBeta1.exe">here</a></li>
<li>Follow the instructions in the setup</li>
<li>Start the IDE</li>
</ul>
<p>I hope the expert helps to improve your search experience!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/05/09/modal-search-1/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>The better Insight for Delphi Compiler QA people</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/03/17/editor-drawing/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/03/17/editor-drawing/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 14:33:12 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[IDE]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=2015</guid>
		<description><![CDATA[I have not found a better subject for this post, but however I do a lot Delphi compiler QA and especially in the Delphi 2010 field test I have created a large number of test cases out of thousands of &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/03/17/editor-drawing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have not found a better subject for this post, but however I do a lot Delphi compiler QA and especially in the Delphi 2010 field test I have created a large number of test cases out of thousands of lines of code. When reducing, reducing and reducing the amount of unrelated code the compiler errors help me to find the code that can be removed. That means for example that I do remove some methods in a class definition, invoke compile and the compiler in connection with the editor lead me to the first method implementation that needs to be removed too. The compiler generates also errors for the other methods, but in order to find out what to remove too I need to click onto the messages in the message pane or press compile again. That simply takes too long, do not tell me about Error Fail<-<-<-<-Insight and I wish I would have implemented already about three years ago what you see on the following screenshots.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/03/CompilerMessagesInEditorV2.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/03/CompilerMessagesInEditorV2.png" alt="" title="Compiler Messages In Editor V2" width="457" height="700" class="alignnone size-full wp-image-2019" /></a><br />
<em>Code Editor highlighting hints in blue and warnings in yellow</em></p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/03/CompilerErrorsInEditor.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/03/CompilerErrorsInEditor.png" alt="" title="Compiler Errors In Editor" width="448" height="703" class="alignnone size-full wp-image-2020" /></a><br />
<em>Code Editor highlighting errors in red<br />(there is no contrast control especially for [F1] and [F2] yet)</em></p>
<p>I am doing this right now as a personal favor and prerequisite for further Live Blame improvements. The Delphi compiler quality got much better in the last years, also a lot users do provide simplified test cases and so I have to simplify big &#8220;test cases&#8221; currently not that often. However everytime I have done I wished to have that editor enhancement, but writing the enhancement takes much more time than simplifing a test case does nor can you estimate how long it will take to write the enhancement or if it will be successful at all. Simplifying a bigger test case may take between 15 minutes up to one hour, but so far I guess I have invested six hours into that project. I do not have statistic on the durations for the test case creations and it is anyway better for me not to know how many thousands of hours I have invested into Delphi (QA).</p>
<p>Right now this editor enhancement is pre alpha and not available for download, but to make this sure &#8211; this is not supposed to become an Error Insight replacement &#8211; it is not supposed to do anything else than showing the compiler messages of the last compile attempt in the editor. However the current Error Insight is a hopeless case (in german I would say &#8220;hier ist Hopfen und Malz verloren&#8221;) and I hope it is getting better with the future Delphi Compiler written in Delphi. <a href="http://blog.barrkel.com/">Barry Kelly</a> indicated that in the <a href="http://www.youtube.com/watch?v=R8goMTsEhUU">&#8220;Delphi Birthday Webinar Replay with David I and Special Guests&#8221;</a> at about 01:03:45 that the future Delphi Compiler is written in Delphi and it may power Error Insight. <a href="http://blogs.embarcadero.com/abauer/">Allen Bauer</a> indicated in the same webinar at 00:29:26 that he is too implementing stuff in Delphi for the Delphi compiler. BTW, I do know that &#8220;new&#8221; or &#8220;future&#8221; Delphi Compiler is confusing for some users, because for example there is already something new in the XE2 release &#8211; the compiler backend for the Win64 target is something completely new. It is written by <a href="https://twitter.com/#!/yooichitagawa">Tagawa-San (Yooichi Tagawa)</a>, but I do not know if this is already written in Delphi nor have I tried to find that out. The frontend of the Win32, Win64 and OSX32 compilers and the backend of the Win32 and OSX32 compilers are &#8220;just&#8221; maintained and enhanced versions of the native Delphi compiler that exists since years (since Delphi 2?).</p>
<p>I guess you have seen on the screenshots the icons on the left hand side of the compiler messages. Due all former work for the compiler message drawing and the screenshot (test case) for <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=81121">QC 81121</a> in my blog post <a href="http://www.bitcommander.de/blog/index.php/2010/10/18/qc-requests/">Some QC requests need your votes</a> back in October 2010 it took me less than ten minutes to implement a initial version of a solution for another QC report. This report is <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=74097">QC 74097: Prefix compiler messages with a glyph</a> by <a href="http://melander.dk/">Anders Melander</a>. Well the border of the icons does not yet look nice and I have already added the icon to an imagelist with 32-bit color depth. <img src='http://www.bitcommander.de/blog/wp/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /><br />
Another feature request to consider, but to be implemented into a separate window, is <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=67540">QC 67540: Support separate columns for compiler messages (file, line, msg type, message, etc.)</a> by Erik Berry (the <a href="http://www.gexperts.org/">GExperts</a> maintainer).</p>
<p>Last but not least &#8211; no that was not a post about creating compiler test cases and at this time such a post is not on the horizon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/03/17/editor-drawing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How not to write SQL or using DECODE and f(index)</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/03/16/sql-decode/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/03/16/sql-decode/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 12:37:41 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=1967</guid>
		<description><![CDATA[I do write SQL statements and PL/SQL at work and the first also when I work on the JEDI VCS server, but I am not an expert in that area compared to my knowlegde in Delphi for example. Given someone &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/03/16/sql-decode/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I do write SQL statements and PL/SQL at work and the first also when I work on the JEDI VCS server, but I am not an expert in that area compared to my knowlegde in Delphi for example. Given someone of a company developing professional database tools writes SQL statements &#8211; do you expect these statements to make use of all the database possibilities to achieve the best goal? I do not expect that. This is just because no one is an expert right from the start, almost every company tries to save money and employs also people without expert knowledge, everyone has bad days or &#8220;in the available time was no more quality possible&#8221;.</p>
<p>Even if I am not an expert maybe the following solution for a fictive requirement does help you some day.</p>
<p><strong>Fictive requirement</strong></p>
<p><em>We do store the amount of downloads of all our tools, updates, 3rd party vendor tools and user contributions in a database. For all the 3rd party stuff, user contributions and our own free stuff we want to show the amount of downloads to the user to indicate the popularity. The downloads are shown in lists in a web interface and for our own tools and updates we do not want to show the amount of downloads as this might be useful information for our competition.</em></p>
<p>This is fictive and so I do not want to speculate about the &#8220;Why&#8221; and I even do not think that these numbers are accurate &#8211; someone might download something multiple times (yes one could make sure it is only counted once), but someone else downloads it and shares it with his friends and how does this affect the numbers?</p>
<p><strong>Solution</strong></p>
<p>Before looking at solutions it is necessary to show the existing, but fictive data structure and some sample data. FREE = 1 indicates a download where the number can be shown. The data structure is kept very simple &#8211; in reality it could be more than one table due normalization. I am using Firebird for the example.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> DOWNLOAD
<span style="color: #66cc66;">&#40;</span>
    ID             <span style="color: #993333; font-weight: bold;">INTEGER</span><span style="color: #66cc66;">,</span>
    NAME           <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
    FREE           <span style="color: #993333; font-weight: bold;">INTEGER</span>
      <span style="color: #993333; font-weight: bold;">CONSTRAINT</span> CKC_DOWNLOAD_FREE 
      <span style="color: #993333; font-weight: bold;">CHECK</span> <span style="color: #66cc66;">&#40;</span>FREE <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
    DOWNLOADAMOUNT <span style="color: #993333; font-weight: bold;">INTEGER</span><span style="color: #66cc66;">,</span>
    <span style="color: #993333; font-weight: bold;">CONSTRAINT</span> PK_DOWNLOAD <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#40;</span>ID<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> DOWNLOAD<span style="color: #66cc66;">&#40;</span>ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> FREE<span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Product A'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">500</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> DOWNLOAD<span style="color: #66cc66;">&#40;</span>ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> FREE<span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Trial B'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1500</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> DOWNLOAD<span style="color: #66cc66;">&#40;</span>ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> FREE<span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'3rd Foo'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">3000</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> DOWNLOAD<span style="color: #66cc66;">&#40;</span>ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> FREE<span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Hotfix C'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2000</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> DOWNLOAD<span style="color: #66cc66;">&#40;</span>ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> FREE<span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">VALUES</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'3rd Bar'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>With the following simple query one gets the following plain result</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> DOWNLOADAMOUNT <span style="color: #993333; font-weight: bold;">AS</span> DL <span style="color: #993333; font-weight: bold;">FROM</span> DOWNLOAD</pre></div></div>

<pre>ID | Name      | DL
---------------------
 1 | Product A |  500
 2 | Trial B   | 1500
 3 | 3rd Foo   | 3000
 4 | Hotfix C  | 2000
 5 | 3rd Bar   |  100</pre>
<p>In order to hide the download amount in the output for the web you could just do output &#8220;-&#8221; as amount when FREE is not 1. As Delphi snippet this could look like this</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">if</span> qrDOWNLOADFREE<span style="color: #000066;">.</span><span style="color: #006600;">AsInteger</span> <span style="color: #000066;">=</span> <span style="color: #0000ff;">1</span> <span style="color: #000000; font-weight: bold;">then</span>
    Text <span style="color: #000066;">:</span><span style="color: #000066;">=</span> qrDOWNLOADDOWNLOADAMOUNT<span style="color: #000066;">.</span><span style="color: #006600;">AsString</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    Text <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #ff0000;">'-'</span><span style="color: #000066;">;</span></pre></div></div>

<p>Well that requires to retrieve the FREE column from the database. Unless you need FREE for something else you could let the database do part of the work and let the database return either an &#8220;invalid&#8221; amount like -1 for downloads that are not free or the state NULL. For NULL the SQL statement does look like this (-1 is similar &#8211; just replace NULL by -1)</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> DECODE<span style="color: #66cc66;">&#40;</span>FREE<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> DL 
<span style="color: #993333; font-weight: bold;">FROM</span> DOWNLOAD</pre></div></div>

<p>and the Delphi snippet like this</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">not</span> qrDOWNLOADDOWNLOADAMOUNT<span style="color: #000066;">.</span><span style="color: #006600;">IsNull</span> <span style="color: #000000; font-weight: bold;">then</span>
    Text <span style="color: #000066;">:</span><span style="color: #000066;">=</span> qrDOWNLOADDOWNLOADAMOUNT<span style="color: #000066;">.</span><span style="color: #006600;">AsString</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    Text <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #ff0000;">'-'</span><span style="color: #000066;">;</span></pre></div></div>

<p><strong>Both solutions do fulfill the requirement. Do they not?</strong></p>
<p>Yes, they do.</p>
<p>However it is worth another look. Given the user has the possibility to sort the list in the web interface by the column of their choice &#8211; What do you think happens when the user can sort by the download amount column? The output would look like this if you would just order by DOWNLOADAMOUNT</p>
<pre>ID | Name      | DL
---------------------
 5 | 3rd Bar   |  100
 1 | Product A |    -
 2 | Trial B   | 1500
 4 | Hotfix C  |    -
 3 | 3rd Foo   | 3000</pre>
<p>The requirement was</p>
<p>&#8220;<em>&#8230;for our own tools and updates we do not want to show the amount of downloads as this might be useful information for our competition.</em>&#8221;</p>
<p>Well the actual amount is not shown, but the user does know that he sorted by the download amount and can conclude that &#8220;Product A&#8221; has been downloaded between 100 and 1500 times and &#8220;Hotfix C&#8221; between 1500 and 3000 times. The more downloads are available with similar popularity the smaller the ranges for the values get and the more precise the information for the competition is. The competition can assume from that numbers that you have not sold &#8220;Product A&#8221; 100000 times. I guess this renders the attempt to hide the number as waste of time and also as something that causes the users asking themselves unnecessary questions. Furthermore this may cause a little bit bad impression as there seems to be something to hide whatever it costs.</p>
<p>What could one do to &#8220;hide&#8221; the number completely?</p>
<p>The answer is using DECODE also in the ORDER clause or SELECT from SELECT. The statements would look like this and is at the end something a framework could do automatically</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> DECODE<span style="color: #66cc66;">&#40;</span>FREE<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> DL 
<span style="color: #993333; font-weight: bold;">FROM</span> DOWNLOAD
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> DECODE<span style="color: #66cc66;">&#40;</span>FREE<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span>
<span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> ID<span style="color: #66cc66;">,</span> NAME<span style="color: #66cc66;">,</span> DECODE<span style="color: #66cc66;">&#40;</span>FREE<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> DL 
<span style="color: #993333; font-weight: bold;">FROM</span> DOWNLOAD
<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> DL</pre></div></div>

<p>The result looks like this</p>
<pre>ID | Name      | DL
---------------------
 1 | Product A |    -
 4 | Hotfix C  |    -
 5 | 3rd Bar   |  100
 2 | Trial B   | 1500
 3 | 3rd Foo   | 3000</pre>
<p>Given sorting using DECODE causes an unacceptable slowdown (I do not think it does), then you could add a function based index for that virtual download amount field. Function based indexes are a very neat thing, because they can speed up things without the redundancy that an additional field would create. For the download amount the statement for the function based index would look like this</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">INDEX</span> IDX_DOWNLOAD_DL <span style="color: #993333; font-weight: bold;">ON</span> DOWNLOAD
COMPUTED <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #66cc66;">&#40;</span>DECODE<span style="color: #66cc66;">&#40;</span>FREE<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> DOWNLOADAMOUNT<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>So that was my little &#8220;lesson&#8221; about DECODE and function based indexes. No, I do not plan regular posts on SQL and database related stuff. My domains are Delphi and Version Control and you can so quickly find the answers with your prefered search engine that I would just waste time that I do not have. This issue just caused me a big headache that I had to blog about it. I guess some readers do know or find out what caused me the headache.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/03/16/sql-decode/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Version Insight Plus Beta 8 (Find in [modified] Files)</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/03/13/verins-plus-8/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/03/13/verins-plus-8/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 20:07:56 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[DelphiSVN]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=1929</guid>
		<description><![CDATA[I have fixed some minor issues, added some minor improvements, added &#8220;Find in Files&#8221; support as a new Plus feature and here is finally Version Insight Plus Beta 8. This setup is for XE and XE2. This is the list &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/03/13/verins-plus-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have fixed some minor issues, added some minor improvements, added &#8220;Find in Files&#8221; support as a new Plus feature and here is finally Version Insight Plus <a href="http://www.bitcommander.de/files/201203137F9F1951/VerInsPlusBeta8.exe">Beta 8</a>. This setup is for XE and XE2.</p>
<p>This is the list of the changes:</p>
<ul>
<li>[Svn] Added Blame Diff options</li>
<li>Commit: Tweak: Perform state flush after Revert, Add and Resolve</li>
<li>Improvement: File states: States can now be cleared on Close All</li>
<li>Menu: Added Revert on file level</li>
<li>[Svn] Commit View: Fixed error &#8220;Target changelist name must not be empty&#8221; when pressing ESCAPE or entering nothing in the &#8220;Create Changelist&#8221; dialog</li>
<li>Commit View: improved Files listview performance for a lot files</li>
<li>Commit View: Tweak: when a selected item is checked/unchecked then check/uncheck all other selected items as in TortoiseSVN</li>
<li>Added new Plus feature &#8220;Find in Files&#8221; support</li>
</ul>
<p><strong>&#8220;Find in Files&#8221; support</strong></p>
<p>Back in late November last year I was looking for something in the files which I was currently working on. While doing so I thought it would be good if I could perform the search with the IDEs &#8220;Find in Files&#8221; feature instead of using Total Commander. I have looked into that topic and it did not take me that long to find out how &#8220;Find in Files&#8221; works in general, but implementing the feature was a bit more complicated.</p>
<p>What the feature is all about is that Version Insight can provide the &#8220;Find in Files&#8221; feature with a list of files that should be used as &#8220;Where&#8221; for the search. So far the &#8220;Where&#8221; in the IDEs &#8220;Find in Files&#8221; dialog has four entries and with Version Insight Plus it has now the two additional entries &#8220;Search modified files in project&#8221; and &#8220;Search modified files in project group&#8221; as you can see in the following screenshot.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/03/FindInFilesDlg.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/03/FindInFilesDlg.png" alt="" title="Find In Files Dlg" width="433" height="240" class="alignnone size-full wp-image-1935" /></a><br />
<em>&#8220;Find In Files&#8221; dialog with the two additional entries &#8220;Search modified files&#8230;&#8221;</em></p>
<p>When selecting one of these two new entries then the file list of the current project or project group is passed to the installed version control systems that support the new IOTAProVersionControlSearchFileFind interface. The version control system managing these files is supposed to return all the files of that list where the file state is either modified, added or just normal, but the file is opened in the Code Editor and is modified. The file states are right now taken from the file state cache and with the improvements in that area in this Beta this is especially for Git and Mercurial much faster than retrieving the file states again. (In the early days of that feature I retrieved the file state for every search and for bigger projects that took longer than the actual search did.)</p>
<p>Apart from showing &#8220;Searching: Getting files[...]&#8221; in the &#8220;Searching&#8221; tool window on the bottom of the right hand side before the actual search starts and the icon for the search result tab there are no other differences to the &#8220;Search all files in project[ group]&#8221; &#8220;Where&#8221; entries. That means the search itself is done by the existing &#8220;Find in Files&#8221; implementation and so do not blame me for the bugs in it. A known issue is for example that searching for non-ASCII characters (e.g. german umlauts) does not find something unless the file is already open in the Code Editor or uses UTF-8 encoding. There are at least six QC reports for this and the master report is <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=88114">QC 88114</a>.</p>
<p>The mentioned icon for the search result tab, which you can see as well in the following screenshot, is only used when using the two new &#8220;Where&#8221; entries. For all other four &#8220;Where&#8221; entries there will not be an icon and so you know directly if the search was performed with or without the help of Version Insight.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/03/PlusSearchResult.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/03/PlusSearchResult.png" alt="" title="Plus Search Result" width="329" height="117" class="alignnone size-full wp-image-1941" /></a><br />
<em>&#8220;Find in Files&#8221; search result tab for a search performed with the help of Version Insight</em></p>
<p><strong>&#8220;Close All&#8221; and the file states</strong></p>
<p>This time I have looked into monitoring meta data in these directories like .git and .hg to detect file states changes due actions in other version control clients, but unfortunately that did not worked out. ReadDirectoryChangesW is not supposed to detect each and every change to a file and so I have decided to implement an alternative. When you enable &#8220;Clear files states after Close All&#8221; in the Environment Options for a version control system then all cached file states are cleared when you call &#8220;Close All&#8221;. Note &#8220;Close All&#8221; is also implicitly performed by actions like opening a project or creating a new one and the option is disabled by default to preserve the current behavior. When enabling this option then you can refresh the file states in the IDE after an external action like Commit by calling &#8220;Close All&#8221; and re-open the project (group) afterwards. I hope this helps too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/03/13/verins-plus-8/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Platforms Expert for XE2 Beta 2</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/02/03/platformsexpert-2/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/02/03/platformsexpert-2/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 00:08:40 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[Open Tools API]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=1901</guid>
		<description><![CDATA[Back in October last year I have released Project Manager Platform Utils for XE2. Meanwhile Blaise Thorn and I made some minor fixes and improvements, decided to rename the expert and here is now Platforms Expert Beta 2. This download &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/02/03/platformsexpert-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Back in October last year I have released <a href="http://www.bitcommander.de/blog/index.php/2011/10/02/pjman-platf-utils/">Project Manager Platform Utils for XE2</a>. Meanwhile Blaise Thorn and I made some minor fixes and improvements, decided to rename the expert and here is now <a href="http://www.bitcommander.de/files/201202030FFF30B7/PlatformsExpertBeta2.exe">Platforms Expert Beta 2</a>. This download contains now a setup.</p>
<p>This is the list of the changes:</p>
<ul>
<li>Fixed: occasional exception when closing a project</li>
<li>Fixed: project rename (name did contain configuration and platform)</li>
<li>Fixed: missing command for &#8220;Target Platforms&#8221; in localized IDE versions</li>
<li>Added: Compile commands</li>
<li>Added: The platform names can now be customised via a registry key</li>
</ul>
<p>Here is again the full list of the features of the Platforms Expert including screenshots:</p>
<ul>
<li>Platforms are now sorted in the IDE</li>
<li>Added bitness to OSX32 target display name<br />
(&#8220;32-bit OS X&#8221; [EN] is more future-proof than just &#8220;OS X&#8221;)</li>
<li>Show active configuration and platform for project nodes in the Project Manager</li>
</ul>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/ProjectManagerNodes.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/ProjectManagerNodes.png" alt="" title="Project Manager Nodes" width="520" height="270" class="alignnone size-full wp-image-1902" /></a></p>
<ul>
<li>Show active configuration for &#8220;Set active configuration(s)&#8221; toolbutton dropdown menu<br />
(when all projects have the same active configuration)</li>
</ul>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/BuildConfigsDropDownNew.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/BuildConfigsDropDownNew.png" alt="" title="Build Configs Drop Down New" width="294" height="142" class="alignnone size-full wp-image-1906" /></a></p>
<ul>
<li>Show active platform for &#8220;Set active platform(s)&#8221; toolbutton dropdown menu<br />
(when all projects have the same active platform)</li>
</ul>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/PlatformsDropDownNew.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/PlatformsDropDownNew.png" alt="" title="Platforms Drop Down New" width="330" height="162" class="alignnone size-full wp-image-1907" /></a></p>
<ul>
<li>Added &#8220;Build All For&#8221; and &#8220;Compile All For&#8221; to Project Manager popup menu of project group node<br />
(like the default &#8220;Build All&#8221; command only visible when there is more than one project)</li>
<li>Added &#8220;Build All For All Platforms&#8221; and &#8220;Compile All For All Platforms&#8221; to Project Manager popup menu of project group node<br />
(like the default &#8220;Build All&#8221; command only visible when there is more than one project)</li>
</ul>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/BuildCompileAllGroupCommand.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/BuildCompileAllGroupCommand.png" alt="" title="Build Compile All Group Command" width="384" height="286" class="alignnone size-full wp-image-1909" /></a></p>
<ul>
<li>Added &#8220;Build&#8221; and &#8220;Compile&#8221; command to Project Manager popup menu of the target platforms</li>
</ul>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/BuildCompileTargetNodeCommand.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/BuildCompileTargetNodeCommand.png" alt="" title="Build Compile Target Node Command" width="346" height="317" class="alignnone size-full wp-image-1911" /></a></p>
<ul>
<li>Added &#8220;Build All&#8221; and &#8220;Compile All&#8221; command to Project Manager popup menu of the target platforms root node</li>
</ul>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/BuildCompileAllPlatformsNodeCommand.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/BuildCompileAllPlatformsNodeCommand.png" alt="" title="Build Compile All Platforms Node Command" width="286" height="163" class="alignnone size-full wp-image-1913" /></a></p>
<ul>
<li>Added &#8220;Add&#8230;&#8221; command to Project Manager popup menu of folder nodes (QC 81304)</li>
</ul>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/AddFolderNodeCommand.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/AddFolderNodeCommand.png" alt="" title="Add Folder Node Command" width="266" height="236" class="alignnone size-full wp-image-1915" /></a></p>
<ul>
<li>Custom platform names</li>
</ul>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/CustomPlatformNames.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/02/CustomPlatformNames.png" alt="" title="Custom Platform Names" width="223" height="136" class="alignnone size-full wp-image-1917" /></a></p>
<p>The reg file snippet for these names looks like this:</p>
<pre>[HKEY_CURRENT_USER\Software\Embarcadero\BDS\9.0\PlatformsExpert]
"Rename.Win64"="Windows/x64"
"Rename.Win32"="Windows/x86"</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/02/03/platformsexpert-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handling some XE2 issues Part #1</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/01/29/xe2-issues-1/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/01/29/xe2-issues-1/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 18:49:59 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[QC]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=1800</guid>
		<description><![CDATA[I am using XE2 since it is available to me, but the stuff I am doing at home is different from the stuff at work and also different from the stuff my co-worker is doing. We have switched to XE2 &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/01/29/xe2-issues-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am using XE2 since it is available to me, but the stuff I am doing at home is different from the stuff at work and also different from the stuff my co-worker is doing. We have switched to XE2 almost two weeks ago and thatswhy we discover some more XE2 issues now. Here are some of the issues we discovered and I try to provide some information that may help you to help yourselfs when you are affected by the same issue. If this information is not enough for you &#8211; I am sorry, but I cannot and will not provide &#8220;works for everyone&#8221; solutions here. I am glad that we solved the issues for us. There might me more posts about XE2 issues and so I have added the &#8220;Part #1&#8243; to the subject. This time the topics are:</p>
<ul>
<li><a href="#issue1">TDBNavigator glyphs</a></li>
<li><a href="#issue2">TRect scope issue (Delphi lib recompiling issues)</a></li>
<li><a href="#issue3">&#8220;Package Foo.bpl can&#8217;t be installed because it was created with a different version of Delphi or CBuilder.&#8221;</a></li>
<li><a href="#issue4">F12 performance</a></li>
<li><a href="#issue5">Excel automation</a></li>
<li><a href="#issue6">Open File At Cursor</a></li>
<li><a href="#issue7">TDBGrid cell painting</a></li>
</ul>
<p>and apart from the last issue these issues are new in XE2. There are not that much QC reports mentioned in this post, but Embarcadero knows already about most of the mentioned issues.</p>
<p><a name="issue1"></a><strong>TDBNavigator glyphs</strong></p>
<p>The TDBNavigator got new glyphs in the XE2 release and the following screenshot shows the difference between XE and XE2.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorXEDesignTime.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorXEDesignTime.png" alt="" title="DBNavigator XE DesignTime" width="546" height="174" class="alignnone size-full wp-image-1808" /></a><br />
<em>Delphi XE TDBNavigator at designtime without a TDataSource assigned</em></p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorXE2DesignTime.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorXE2DesignTime.png" alt="" title="DBNavigator XE2 DesignTime" width="546" height="174" class="alignnone size-full wp-image-1809" /></a><br />
<em>Delphi XE2 TDBNavigator at designtime without a TDataSource assigned</em></p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXERunTimeBrowseMode.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXERunTimeBrowseMode.png" alt="" title="DBNavigator Flat XE RunTime BrowseMode" width="530" height="146" class="alignnone size-full wp-image-1812" /></a><br />
<em>Delphi XE flat TDBNavigator at runtime in browse mode</em></p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXERunTimeEditMode.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXERunTimeEditMode.png" alt="" title="DBNavigator Flat XE RunTime EditMode" width="530" height="146" class="alignnone size-full wp-image-1814" /></a><br />
<em>Delphi XE flat TDBNavigator at runtime in edit mode</em></p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXE2RunTimeBrowseMode.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXE2RunTimeBrowseMode.png" alt="" title="DBNavigator Flat XE2 RunTime BrowseMode" width="530" height="146" class="alignnone size-full wp-image-1813" /></a><br />
<em>Delphi XE2 flat TDBNavigator at runtime in browse mode</em></p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXE2RunTimeEditMode.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXE2RunTimeEditMode.png" alt="" title="DBNavigator Flat XE2 RunTime EditMode" width="530" height="146" class="alignnone size-full wp-image-1815" /></a><br />
<em>Delphi XE2 flat TDBNavigator at runtime in edit mode</em></p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXE2RunTimeBrowseModeWinClassicNonDefaultColors.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/DBNavigatorFlatXE2RunTimeBrowseModeWinClassicNonDefaultColors.png" alt="" title="DBNavigator Flat XE2 RunTime BrowseMode WinClassicNonDefaultColors" width="530" height="146" class="alignnone size-full wp-image-1816" /></a><br />
<em>Delphi XE2 flat TDBNavigator at runtime in browse mode with non default colors</em></p>
<p>The opinions of the team members that used the XE2 build of our application were different regarding this new glyphs:</p>
<p><em>Well these icons does not look bad, but which meaning do have the colors?</em></p>
<p>I see blue, aqua, a mixture between red and orange, green and red. My co-worker started with the following guess</p>
<p><em>blue are harmless actions, red are harmful action</em> </p>
<p>well but is adding a new record something bad or posting a record necessarily something good. Hey Embarcadero please explain!</p>
<p><em>It is hard to see the difference between the enabled and disabled Post button!</em></p>
<p>I have to add here that this team member is affected by partial red-green color blindness. (in german it is &#8220;Rot-Grün-Sehschwäche&#8221;)</p>
<p><em>The shadow looks ugly with non default colors. Haven&#8217;t they still fixed alpha transparency issue.</em></p>
<p>This is from co-worker, he does have non default colors and we have had looked into an alpha transparency issue with TSpeedButton sometime ago with 2010 or XE. I think due to other more important stuff I have never looked if there is already a report for this and so on. As you can see above on the last screenshot the shadow looks very ugly with non default colors.</p>
<p>In order to fix the issue I have replaced the resources in $(BDSLIB)\win32\release\dbctrls.res with the resources from the XE release and copied it to the win64 folder as well. Well XE does not have resources for the new ApplyUpdates and CancelUpdates buttons, but we do not use them. Other options would be to patch TDBNavigator.SetButtonGlyph at runtime or to create a TDBNavigator descendant and override TDBNavigator.SetButtonGlyph. In the IDE are still the new icons, but that does not bug us and if we want to have fancy new TDBNavigator glyphs we can have them when we start using VCL styles.</p>
<p>The good thing about the XE2 TDBNavigator is the new property Kind and now one can have a vertical navigator out-of-the-box.</p>
<p><a name="issue2"></a><strong>TRect scope issue (Delphi lib recompiling issues)</strong></p>
<p>The TRect record and other records do now have some additional methods and properties. TRect for example does have the properties Width and Height. At first that does sound like something good, but in combination with the &#8220;with&#8221; statement it can be something very bad and may cause failures in your application. Since the reason for a failure was a TRect scope issue did I want to identify such scope issues by the help of the compiler. In order to achieve that I have changed the following piece of code in $(BDS)\source\rtl\sys\System.Types.pas from</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">  TRect <span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">record</span>
  <span style="color: #000066;">...</span>
    <span style="color: #808080; font-style: italic;">// changing the width is always relative to Left;</span>
    <span style="color: #000000; font-weight: bold;">property</span> Width<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span> <span style="color: #000066;">read</span> GetWidth <span style="color: #000066;">write</span> SetWidth<span style="color: #000066;">;</span>
    <span style="color: #808080; font-style: italic;">// changing the Height is always relative to Top</span>
    <span style="color: #000000; font-weight: bold;">property</span> Height<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span> <span style="color: #000066;">read</span> GetHeight <span style="color: #000066;">write</span> SetHeight<span style="color: #000066;">;</span>
  <span style="color: #000066;">...</span>
  <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">  TRect <span style="color: #000066;">=</span> <span style="color: #000000; font-weight: bold;">record</span>
  <span style="color: #000066;">...</span>
    <span style="color: #808080; font-style: italic;">// changing the width is always relative to Left;</span>
    <span style="color: #000000; font-weight: bold;">function</span> Width<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span> deprecated <span style="color: #ff0000;">'Check TRect.Width scope'</span><span style="color: #000066;">;</span>
    <span style="color: #808080; font-style: italic;">// changing the Height is always relative to Top</span>
    <span style="color: #000000; font-weight: bold;">function</span> Height<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span> deprecated <span style="color: #ff0000;">'Check TRect.Height scope'</span><span style="color: #000066;">;</span>
  <span style="color: #000066;">...</span>
  <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>Since System.Types is part of the Delphi core RTL it was necessary to recompile the RTL. That can be done with the batch file $(BDS)\source\rtl\buildrtl.bat, which is provided since XE2 Update #2. Even that step was not free of issues for me &#8211; the build process did not found the zlib C object files. I had only Delphi (Pro) installed at work and since I was sure that I had successfully rebuild the RTL at home I tried to add C++Builder too via the installers upgrade function, because C++Builder installed yes/no was the difference between the installation at home and at work. The upgrade somehow failed, because bcbwin32.7zip could not be downloaded correctly and even before I have started the setup it was in the download folder. I had to abort the installation, my Delphi installation was completely broken and I have reinstalled Delphi and C++Builder. Afterwards the batch file recompiled the important RTL files and stopped with a problem in a Winapi DirectX unit, but did not care about that. Then I tried to compile our application, the compiler told me that there is a problem with the TeeChart units and that is completely okay &#8211; when you want to repeat the steps you need the source of all the components and there is no source provided for the TeeChart Embarcadero edition. TeeChart was only used in a few units and I just removed it in this units. Then another Delphi installation issue did bite me &#8211; the C object files for Vcl.Imaging.jpeg are not delivered even not when C++Builder is installed, I did use the files from Delphi XE and faked three missing methods. </p>
<p>Side note: I hate such delivery issues and over the years I have told Embarcadero several times the automation steps that would catch almost all source or lib file delivery issues. Great for you Embarcadero that you have all the files you need.</p>
<p>Well back to topic &#8211; afterwards I continued the attempt to compile our application and actually found some TRect scope issue, but not in our code. I found one issue in Vcl.DBGrids in the WriteText procedure and some other issues in 3rd party components. This WriteText issue might be only in theory an issue, because the code branch might never be execute &#8211; is there a way to make the following &#8220;if&#8221; be False?</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">  I <span style="color: #000066;">:</span><span style="color: #000066;">=</span> ColorToRGB<span style="color: #000066;">&#40;</span>ACanvas<span style="color: #000066;">.</span><span style="color: #006600;">Brush</span><span style="color: #000066;">.</span><span style="color: #006600;">Color</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">if</span> GetNearestColor<span style="color: #000066;">&#40;</span>ACanvas<span style="color: #000066;">.</span><span style="color: #006600;">Handle</span><span style="color: #000066;">,</span> I<span style="color: #000066;">&#41;</span> <span style="color: #000066;">=</span> I <span style="color: #000000; font-weight: bold;">then</span></pre></div></div>

<p>How get the TRect scope issues detected by the change?</p>
<p>Actually my changes detect the usage of the new TRect properties, but for code that compiled with pre XE2 releases it means in almost any case that there is a TRect scope issue. When TRect.Width or TRect.Height are accessed then the compiler puts out the warning</p>
<p><code>[DCC Warning] Foo.dpr(line): W1000 Symbol 'Width' is deprecated: 'Check TRect.Width scope'</code></p>
<p>and that tells you that there is supposed to be a problem. To make sure that there is actually no problem in our code I have just placed some sort of <a href="http://en.wikipedia.org/wiki/Elephant_in_Cairo">elephants in Cairo</a>.</p>
<p><a name="issue3"></a><strong>&#8220;Package Foo.bpl can&#8217;t be installed because it was created with a different version of Delphi or CBuilder.&#8221;</strong></p>
<p>That the Delphi reinstallation did not make me too angry is just a result of the fact that I have build an installer that does setup the IDEs paths, compiles and installs the component packages and compiles the library DCUs for the components. However we had not installed all the necessary components in the IDE from the very beginning and once when adding some missing components I forgot to add a package to the requires section of the package with our own components and received the message </p>
<p><em>&#8220;Package Foo.bpl can&#8217;t be installed because it was created with a different version of Delphi or CBuilder.&#8221;</em></p>
<p>when starting the IDE. </p>
<p>Hey I have just compiled all the packages with XE2!</p>
<p>Actually the message is trying to say that our package did contain an unit that is also included in another package. So when you receive that message it maybe actually because of a duplicate unit issue. The best advice I can give you here is that you try to compile the package in the IDE and hope it tells you which packages needs to be added to the requires section.</p>
<p>I have not checked with XE2 versions before Update #3, but at least XE showed the message </p>
<p><em>Cannot load package &#8216;%s.&#8217;  It contains unit &#8216;%s&#8217;, which is also contained in package &#8216;%s&#8217;</em></p>
<p>and so this is regression. That message is still in System.SysConst.pas in XE2.</p>
<p>BTW, it is &#8220;cannot&#8221; and &#8220;C++Builder&#8221; and not &#8220;can&#8217;t&#8221; and &#8220;CBuilder&#8221;.</p>
<p><a name="issue4"></a><strong>F12 performance</strong></p>
<p>We do use data modules and in contrast to XE switching between Code and Design for them is very slow. It seems to be the slower the more components are on a form, frame or data module. Since fields on a data module are components too a data module can have a lot components. It is also the slower the more components are installed into the IDE and the time to switch seems to be the product of the amount of installed components and the amount of components on form, frame or data module. I have debugged the IDE with the IDE and have hit F12 to break into the debugger to find out what the IDE is doing when switching between Code and Design and yes F12 is the key to switch between Code and Design and when running under the debugger I have used the menu to switch. (Note the F12 debugger hotkey requires <a href="http://andy.jgknet.de/blog/">Andy&#8217;s</a> &#8220;Delphi F12 Debug Hotkey support&#8221; expert when using Windows 6.x.) Whenever I hit F12 I saw the method &#8220;@Comppalmgr@TComponentPalettePageItemDelegate@CheckValid&#8221; in delphicoreide160.bpl. That lead me without a look into that method to the conclusion that the IDE is filtering the available components. That also explained why setting the ClassGroup property improves the switch times. Without that set the switch took about ten seconds for our largest data module and after setting it to Vcl.Controls.TControl it took about three seconds. That is still pain and so I have looked into &#8220;@Comppalmgr@TComponentPalettePageItemDelegate@CheckValid&#8221;. I did not try to find out how it is actually working, because understanding assembler is not my easiest exercise, but what I understood was enough to fix the issue for our needs. The solution has a lot disvantages, but they do not affect us because we do only develop for Windows with the VCL and seeing TButton on the Tool Palette or Component Toolbar for data modules is absolutely no problem for us. The rewritten version looks like this and brings for us the speed back to the XE level.</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> NewCheckValid<span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">Self</span><span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">;</span> <span style="color: #000000; font-weight: bold;">const</span> AIntf1<span style="color: #000066;">:</span> IInterface<span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">const</span> AW<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">WordBool</span><span style="color: #000066;">;</span> AIntf2<span style="color: #000066;">:</span> IInterface<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">var</span>
  ComponentPalettePageItem<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">;</span>
  PIntf<span style="color: #000066;">:</span> IOTABasePaletteItem<span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">begin</span>
  ComponentPalettePageItem <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">&#40;</span><span style="color: #000066; font-weight: bold;">PDWord</span><span style="color: #000066;">&#40;</span><span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">&#40;</span><span style="color: #000000; font-weight: bold;">Self</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">+</span> <span style="color: #9ac;">$30</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">^</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000066;">Assigned</span><span style="color: #000066;">&#40;</span>ComponentPalettePageItem<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">and</span>
    <span style="color: #000066;">Supports</span><span style="color: #000066;">&#40;</span>ComponentPalettePageItem<span style="color: #000066;">,</span> IOTABasePaletteItem<span style="color: #000066;">,</span> PIntf<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span>
    PIntf<span style="color: #000066;">.</span><span style="color: #006600;">Visible</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> <span style="color: #000066;">Assigned</span><span style="color: #000066;">&#40;</span>AIntf1<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">and</span> 
      <span style="color: #000066;">&#40;</span><span style="color: #000066;">Pos</span><span style="color: #000066;">&#40;</span><span style="color: #ff0000;">'TComponentBased.FMX'</span><span style="color: #000066;">,</span> PIntf<span style="color: #000066;">.</span><span style="color: #006600;">IDString</span><span style="color: #000066;">&#41;</span> <span style="color: #000066;">=</span> <span style="color: #0000ff;">0</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>The advice I can give you regarding this issue is setting the ClassGroup property of the data module.</p>
<p><a name="issue5"></a><strong>Excel automation</strong></p>
<p>One of the first bug reports that came in for the XE2 build was about the export to Excel. It failed with &#8220;Add method of Workbooks class failed&#8221;. I know that there is a dataset to Excel function in the <a href="http://jvcl.delphi-jedi.org/">JVCL</a> (ExportDataSetToExcel in JvgExport), I have tried it and it worked. The difference between our code and the code in the JVCL is that we pass xlWBATWorksheet as parameter. After removing the parameter our code worked too, but now there were three worksheets instead of one. I did remember a thread in embarcadero.public.delphi.oleautomation, which I have had &#8220;read&#8221; a few days ago and did remember something about a change in XE2 regarding the passed parameter type. I have changed the following code from</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">XLApp<span style="color: #000066;">.</span><span style="color: #006600;">Workbooks</span><span style="color: #000066;">.</span><span style="color: #006600;">Add</span><span style="color: #000066;">&#40;</span>xlWBATWorksheet<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></pre></div></div>

<p>to</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">XLApp<span style="color: #000066;">.</span><span style="color: #006600;">Workbooks</span><span style="color: #000066;">.</span><span style="color: #006600;">Add</span><span style="color: #000066;">&#40;</span><span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">&#40;</span>xlWBATWorksheet<span style="color: #000066;">&#41;</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span></pre></div></div>

<p>and afterwards it worked with that Integer typecast. The thread is &#8220;EOleException on XE2 Update 2 (works fine under XE)&#8221; and this particular <a href="https://forums.embarcadero.com/thread.jspa?messageID=427969&#038;tstart=0#427969">message from the helpful Bruneau</a> (Jean-Marie Babet) explains the problem and provides workarounds. Some hours after I have made the fix Bruneau posted a promising message in this thread that there might be an option (System.Variants.DispatchUnsignedAsSigned) in the next update which enables the old behavior. Meanwhile there is a section about the problem and this option in the preliminary Update #4 release notes. My suggestion is that you test your Excel automation code properly and in case of problems use one of the workarounds provided. In case you would have to touch too much calls then hope that the DispatchUnsignedAsSigned is actually in the Update #4 release.</p>
<p><a name="issue6"></a><strong>Open File At Cursor</strong></p>
<p>We do have not added our own (component) library units with the &#8220;in&#8221; clause to our projects. Their path is in the IDEs library path and for some reason trying to open these units ended up with the open dialog poping up and showing &#8220;LibUnit&#8221; without the &#8220;.pas&#8221; suffix. That was an ugly issue in Delphi 2007, had been fixed Delphi 2009 and still worked in XE, but it is back in XE2. </p>
<p>I have tried it at home and could not repeat the problem. After six or seven RAD re-installations I found the reason &#8211; this issue occurs when you have only installed Delphi or only use the Delphi personality (-pDelphi) when Delphi and C++Builder are installed. I have filed the issue into QC as <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=102434">QC 102434</a>. Luckily I found a workaround and this is enabling &#8220;Replace Open File At Cursor&#8230;&#8221; in <a href="http://andy.jgknet.de/blog/ide-tools/ddevextensions/">DDevExtensions</a>. So if you have also C++Builder installed then start RAD Studio with both personalities and otherwise try DDevExtensions.</p>
<p><a name="issue7"></a><strong>TDBGrid cell painting</strong></p>
<p>We have had an XE Unicode build with enabled theming for quite a while and noticed that the text in the focused grid cell was somehow bold, but we never looked into it. Now we have started to look into it and it turned out that this is no feature. It is rather a bug in our OnDrawColumnCell event handler. First some screenshots that you know what I am talking about.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ThemedDBGrid.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ThemedDBGrid.png" alt="" title="Themed DBGrid" width="550" height="220" class="alignnone size-full wp-image-1838" /></a><br />
<em>Themed TDBGrid without OnDrawColumnCell event handler</em></p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ThemedDBGridWithWrongDrawEvent.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ThemedDBGridWithWrongDrawEvent.png" alt="" title="Themed DBGrid With Wrong DrawEvent" width="550" height="220" class="alignnone size-full wp-image-1839" /></a><br />
<em>Themed TDBGrid with supposed to be wrong OnDrawColumnCell event handler</em></p>
<p>In the second screenshot you should see that &#8220;Foo&#8221; in the focused cell is bolder than it is in first screenshot. The OnDrawColumnCell event implementation is just this:</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> TForm21<span style="color: #000066;">.</span><span style="color: #006600;">DBGrid1DrawColumnCell</span><span style="color: #000066;">&#40;</span>Sender<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">;</span> <span style="color: #000000; font-weight: bold;">const</span> <span style="color: #000066;">Rect</span><span style="color: #000066;">:</span> TRect<span style="color: #000066;">;</span>
  DataCol<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">Integer</span><span style="color: #000066;">;</span> Column<span style="color: #000066;">:</span> TColumn<span style="color: #000066;">;</span> State<span style="color: #000066;">:</span> TGridDrawState<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">begin</span>
  Column<span style="color: #000066;">.</span><span style="color: #006600;">Grid</span><span style="color: #000066;">.</span><span style="color: #006600;">DefaultDrawColumnCell</span><span style="color: #000066;">&#40;</span><span style="color: #000066;">Rect</span><span style="color: #000066;">,</span> DataCol<span style="color: #000066;">,</span> Column<span style="color: #000066;">,</span> State<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>Well this is not the code we use, but it is enough to demo the issue.</p>
<p>So why is the text in the focused column bold?</p>
<p>The reason is that TDBGrid sets in themed mode TDBGrid.Canvas.Brush.Style to bsClear for the focused column when DefaultDrawing is True. This happens in TCustomGrid.DrawCellHighlight. After drawing the focus rect the text is drawn and afterwards the OnDraw events are called. With DefaultDrawColumnCell and Brush.Style bsClear the text is painted twice to the same place and I guess antialiasing in themed mode does make it bold then. We have not finished the work on this topic and for now my advise is that you look at your Draw events and try to understand the code in the grid units.</p>
<p><strong>More?</strong></p>
<p>Yes, there might be more. I have other issues that we have experienced (debugger does stop on breakpoints that have been removed, &#8220;File | Reopen&#8221; does not like forms with open descendants) or task like the ModalResult check on my list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/01/29/xe2-issues-1/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>ITE re-evaluation experience</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/01/23/ite-re-eval/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/01/23/ite-re-eval/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 22:15:41 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[IDE]]></category>
		<category><![CDATA[QC]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=1763</guid>
		<description><![CDATA[At work we do use right now GNU Gettext for the localization of our application and are not looking for another localization solution. However we have decided sometime ago to re-evaluate the ITE (Integrated Translation Environment) when we switch to &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/01/23/ite-re-eval/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At work we do use right now <a href="http://dxgettext.po.dk/Home">GNU Gettext</a> for the localization of our application and are not looking for another localization solution. However we have decided sometime ago to re-evaluate the ITE (Integrated Translation Environment) when we switch to XE2. We have used the ITE once with Delphi32 for a discontinued project and our experience was not that good. I have not worked on that topic and do not remember the issues, but I believe the translation run did abort when the CPU load was too low.</p>
<p>I have given the ITE in XE2 now a try and the following is what I did, what happened and so on.</p>
<p>At first I have tried with a new VCL application if forms, which are not explicitly added to the project, get added to the localized project, because we have not yet added all forms or frames explicitly to the project. They do not get added and I do not consider this to be an issue. I do not know a tool that does add all forms or units to the project and I could have tried to add all forms to the application by hand. I did not like that idea and my plan was to update the project source with the help of the dependency information that the compiler can output. First I tried to get that information by enabling &#8220;Output unit dependency information&#8221; in the project options and compile from the IDE. I was prepared that it may not work, because I filed <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=93897">QC 93897</a> some time ago for XE. This hurdle can be easily solved by copying the compiler command line from the message panes Output tab and execute it on the command line. With the information from the d file and some additional code (not supposed to be published) I have updated the project source including the information that tells the IDE if it is a unit, form, frame or data module.</p>
<p>The second step was to open the project and add a new language (I am using ENG here) and when I pressed the &#8220;Finish&#8221; button in the &#8220;Add Languages&#8221; dialog I received the following message (partly translated as I am using a german OS)</p>
<p><code>[Window Title]<br />
Error</p>
<p>[Content]<br />
Cannot open file "project folder\ENG\FooForm.dfm". Access denied</p>
<p>[OK]</code></p>
<p>The reason for this was the readonly attribute of &#8220;project folder\ENG\FooForm.dfm&#8221;, but wait this file was not there before I started the process. The reason for this seems to be the fact that the language creation process copies the source file including the file attributes from the source file and most of our source files do have the +R attribute as they are managed by <a href="http://jvcs.delphi-jedi.org/">JEDI VCS</a>. Checking out every module before adding a new language is close to impossible and so I just removed locally the +R attribute for all the modules. I do not see the need for copying the +R attribute, consider this to be a bug and logged this as <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=102776">QC 102776</a>.</p>
<p>My second attempt to add a language was successful, but it took almost 30 minutes with 100 percent CPU load on one core. Note compiling the project with <a href="http://andy.jgknet.de/blog/ide-tools/ide-fix-pack-2009-10/">Compiler Speed Pack</a> installed takes between 20 and 30 seconds when the files are already in the OS cache. A second run confirmed that long time. The refresh of the language project took three minutes. I do not know what exactly happens when adding the new language, but guess when I would rewrite the language creation process for our needs it might take a tenth of the time. I will not and have not done this, but nevertheless the shorter runtime for our needs is not a complete wild guess as I did run recently another process that processed all project files.</p>
<p>Then I looked with the Translation Editor at some forms I have seen a lot of stuff I do not want to see there. For example we do not translate SQL statements. I found an enhancement request in QC asking to exclude some properties from translation that are customizable by the user. This is <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=92279">QC 92279</a>. This report also mentions the Explicit* properties and it is really strange to see them in the Translation Manager and I guess with an exclude list the language creation and update process could be speed up.</p>
<p>Then I tried to compile the localized project, but got the following error in the message pane:</p>
<p><code>[Fatal Error] F2039 Could not create output file 'project folder\ENG\c:\tmp\d16exe\LocaleTest.ENG'</code></p>
<p>I have tried it with a new VCL app and there it worked. Looking at the TargetName in LocaleTest_ENG.bdsproj and of the new VCL app told me that this is supposed to be a relative path and when the project folder is on a different drive than the output dir then there is no relative path. After fixing the BDSProj file the project could be compiled. I think this issue is already in QC as <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=87820">QC 87820</a>.</p>
<p>Then I checked the Translation Manager with an inherited form and found no option to show the inherited stuff &#8211; not in the list nor when I show the original form or the translated form. Well of course one has only to translate the new stuff in an inherited form, but which forms and frames has the translator to translate when only specific forms should be translated and strings in these forms come from different inheritence levels?</p>
<p>Another problem is that there seems to be no way to refresh a language project from the command line for example by passing a parameter to etm.exe and so we cannot integrate it in the build process. For us this is mandatory.</p>
<p>I have not looked deeper into the (External) Translation Manager or the Translation Repository, because the amount of work to use successfully parts of the provided translation environment is in my humble opinion to high. I do not have to decide what we do, but I guess we stick with our working GNU Gettext solution and if some day there is a need to have for example different Left or Top properties in localized versions we might rethink the decision.</p>
<p>Another thing I got aware of some days before I looked into it is that the project options for localized projects (the version info) are broken since D2009 and are completely broken since XE2. This issue is in QC as <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=76033">QC 76033</a>. A workaround would be to add the version info with another resource, but you have to readd it after each language refresh.</p>
<p>I am not sure if this post is useful for anyone. For me it is enough if my co-worker does read it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/01/23/ite-re-eval/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Happy New Year and Welcome revised Object Inspector (XE, XE2)</title>
		<link>http://www.bitcommander.de/blog/index.php/2012/01/01/oi-rev/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2012/01/01/oi-rev/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 17:56:06 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[IDE]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=1690</guid>
		<description><![CDATA[Happy New Year to all of you! Last week I have had a look into the Object Inspector and have seen that it could be quite easy to implement my idea of a Favorite page. That Favorite page should show &#8230; <a href="http://www.bitcommander.de/blog/index.php/2012/01/01/oi-rev/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Happy New Year to all of you!</p>
<p>Last week I have had a look into the Object Inspector and have seen that it could be quite easy to implement my idea of a Favorite page. That Favorite page should show me properties and events that I need often for a specific control or component and releases me from scrolling and searching. In connection with that I have looked for reports in the Object Inspector area and found the report <a href="http://qc.embarcadero.com/wc/qcmain.aspx?d=10268">QC 10268</a> (January 11, 2005; so far 25 votes) that asks for a filter edit in the Object Inspector. As a little workaround you can so far use the Object Inspectors incremental search feature when you are looking for a specific property. If you do not know about this feature than see what <a href="http://www.malcolmgroves.com">Malcom</a> wrote in <a href="http://www.malcolmgroves.com/blog/?p=176">this blog post</a>. However I find that way a little bit cumbersome and it seems even to confuse QA, because they think it would not be able to find sub items, but how about using &#8220;an.&#8221; to jump to (Vcl.Forms.TForm.)Anchors.akLeft?</p>
<p>Meanwhile I have implemented the filter edit and the Favorite page for the case when the Object Inspector is used for the Form Designer. Even if I could leverage the existing filter mechanism, which separates the properties into the Properties and Events pages, there were a few hurdles to take.</p>
<p>Can anyone tell me for example how one can get the parents of IProperty?<br />
[see $(BDS)\source\ToolsAPI\DesignIntf.pas]</p>
<p><strong>Screenshots and description</strong></p>
<p>Here is a screenshot of the upper part of the default Object Inspector in XE2.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorDefault.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorDefault.png" alt="" title="Object Inspector Default" width="369" height="341" class="alignnone size-full wp-image-1706" /></a><br />
<em>XE2 Object Inspector for a TForm instance</em></p>
<p>Here are a few screenshots of the two new features in the revised Object Inspector with some explanation. At first comes a screenshot which shows the same as the prior image, but with my Object Inspector enhancements installed.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorRevised.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorRevised.png" alt="" title="Object Inspector Revised" width="369" height="342" class="alignnone size-full wp-image-1707" /></a><br />
<em>Revised Object Inspector for a TForm instance (differences are the filter edit and Favorites page on the top)</em></p>
<p>The filter edit enables you to filter the properties by the string in the edit. This filter is case-insensitive and that mean that actually I had not have to enter an upper case &#8220;S&#8221; in the following screenshot. The filter takes the child properties into account and thatswhy you do see the &#8220;Font&#8221; property, because it has the child property &#8220;Style&#8221; that contains &#8220;sty&#8221;. Right now there is no automatic expansion of the items with childs.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorFilterSty.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorFilterSty.png" alt="" title="ObjectInspector Filter Sty" width="369" height="161" class="alignnone size-full wp-image-1708" /></a><br />
<em>Revised Object Inspector with the filter &#8220;Sty&#8221; for a TForm instance (the filter is case-insensitive)</em></p>
<p>What you enter into the edit has to exists somewhere in the full qualified property name. By this I mean I add the parents with dots to the property name and that means the full qualified property name for &#8220;fsBold&#8221; of the &#8220;Style&#8221; property of TForm.Font is &#8220;Font.Style.fsBold&#8221;. You can use the dot in the filter and so &#8220;t.sty&#8221; does only show &#8220;Font.Style&#8221; and childs and not &#8220;BorderStyle&#8221; and so on as on the prior image.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorFilterTDotSty.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorFilterTDotSty.png" alt="" title="Object Inspector Filter t.sty" width="369" height="92" class="alignnone size-full wp-image-1709" /></a><br />
<em>Revised Object Inspector with the filter &#8220;t.sty&#8221; for a TForm instance (the filter is case-insensitive)</em></p>
<p>In order to make a property a favorite property you can use the &#8220;Add Favorite&#8221; popup menu item in the Object Inspector&#8217;s popup menu.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorAddFavoritesPM.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorAddFavoritesPM.png" alt="" title="Object Inspector Add Favorites PM" width="369" height="374" class="alignnone size-full wp-image-1710" /></a><br />
<em>Popup menu item to add a property as favorite property to show up on Favorites page</em></p>
<p>After clicking on the popup menu item the following dialog is shown. It contains the full qualified class name and full qualified property name for the currently selected property (the one with the chevron). Favorite properties are not global by default, but you can make them global by clearing the class name edit. Note the asterisk char or partial names are not supported &#8211; so do not turn &#8220;Font.Style&#8221; into &#8220;Font.S*&#8221; or &#8220;Font.S&#8221; to show &#8220;Font.Size&#8221; and &#8220;Font.Style&#8221;. The same applies to the class names &#8211; you cannot just use &#8220;TForm&#8221; instead of &#8220;Vcl.Forms.TForm&#8221; or &#8220;FMX.Forms.TForm&#8221;.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorAddFavoritesDialog.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorAddFavoritesDialog.png" alt="" title="Object Inspector Add Favorites Dialog" width="344" height="209" class="alignnone size-full wp-image-1711" /></a><br />
<em>Add Favorite dialog</em></p>
<p>If you accidentally added a property as favorite property or just needed some properties for some time for a special task then you can remove them with the &#8220;Remove Favorite&#8221; popup menu item on the Favorites page.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorRemoveFavoritesPM.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorRemoveFavoritesPM.png" alt="" title="Object Inspector Remove Favorites PM" width="369" height="356" class="alignnone size-full wp-image-1712" /></a><br />
<em>Popup menu item to remove a property from the Favorites page</em></p>
<p>If you like the Favorites page, but do not want to have the filter edit or the other way round then you can disable them in the Object Inspectors Properties dialog or in the Environment options on page &#8220;Environment Options | Object Inspector&#8221;. Note the filter edit gets automatically disabled when you disable the &#8220;Show instance list&#8221; option.</p>
<p><a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorPropertiesRevised.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2012/01/ObjectInspectorPropertiesRevised.png" alt="" title="Object Inspector Properties Revised" width="623" height="456" class="alignnone size-full wp-image-1713" /></a><br />
<em>Object Inspector Properties with the two additional options &#8220;Show filter edit&#8221; and &#8220;Show Favorites page&#8221; at the bottom of the Options groupbox</em></p>
<p>Some more words on the favorites filter: When I do filter the properties I first gather a list of classes in the class hierarchie of the selected instance and for example for Vcl.Forms.TForm that means that this list does include Vcl.Forms.TCustomForm and Vcl.Controls.TControl. Afterwards a list of the favorite properties for each class in that list and for the &#8220;any type&#8221; properties is created and that list is used in the filter. That in connection with the following default properties explains why you see by default for every VCL control Left, Top, Height and Width on the Favorites page.</p>
<p>This are the default favorite properties:
<ul>
<li>Left, Top, Height and Width for Vcl.Controls.TControl</li>
<li>Caption, Text, Color and OnClick for any type</li>
</ul>
<p>Before you ask why I have not removed that obviously useless description pane at the bottom of the Object Inspector, which <a href="http://blog.marcocantu.com/blog/getting_rid_description_pane.html">Marco did not understood some time ago</a>, then I have to tell you that it is actually used. To my knownledge it is not really used when the Object Inspector is used for the Form Designer, but it is when it is used by the Modelling feature or any other feature that uses the Object Inspector and so I will not just remove it. However I have to admit that some tuning could help here later.</p>
<p><strong>Known issues</strong>
<ul>
<li>When expanding the instance list with the filter edit visible the drop down width is bigger than the instance list combobox</li>
<li>Multiselect in the Form Designer is supported, but then only the first type in the instance list is used to generate the list of the favorite properties</li>
<li>The filter edit is also shown when Object Inspector is used for the Modelling feature. There the value in the edit has no effect and this is as expected. That the filter edit is shown is right now a side effect of the fact that the instance list combobox is visible too. I am not used to the Modelling feature, that is anyway limited in my Professional Edition and so I do not know right now if the instance list combobox is shown by intention or if this is a bug. For now I could not see any usage and have first to find out which bug needs to be fixed.</li>
</ul>
<p><strong>Setup</strong></p>
<ul>
<li>Download the setup for XE and XE2 from <a href="http://www.bitcommander.de/files/20120101A4528D5E/ObjectInspectorExpertBeta1.exe">here</a></li>
<li>Follow the instructions in the setup</li>
<li>Start the IDE</li>
</ul>
<p>I hope you will find it as useful as I do and there are not too much bugs in the code.<br />
Happy testing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2012/01/01/oi-rev/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>I have to touch that VCL form here. Where does it come from?</title>
		<link>http://www.bitcommander.de/blog/index.php/2011/12/22/controlsinfo/</link>
		<comments>http://www.bitcommander.de/blog/index.php/2011/12/22/controlsinfo/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 23:17:08 +0000</pubDate>
		<dc:creator>Uwe Schuster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.bitcommander.de/blog/?p=1668</guid>
		<description><![CDATA[At day time I do work on a really big project. Since not everything is written by me it happens that I do have to work on a form or frame I do not know or where I cannot remember &#8230; <a href="http://www.bitcommander.de/blog/index.php/2011/12/22/controlsinfo/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At day time I do work on a really big project. Since not everything is written by me it happens that I do have to work on a form or frame I do not know or where I cannot remember the name. Well there are different ways to find out the name like following the code from a point you do know or pausing the application on an action in the form and looking at the call stack, but since Delphi 2009 there is a better way to do it. This way almost trivial &#8211; you just have to combine Windows.GetCursorPos, Controls.FindVCLWindow and TObject.UnitName, this looks like this when you like to show also the parent controls and this is what you would have to put into the developer build of your application&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">procedure</span> TfmControlNames<span style="color: #000066;">.</span><span style="color: #006600;">UpdateTimerTimer</span><span style="color: #000066;">&#40;</span>Sender<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">TObject</span><span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">var</span>
  P<span style="color: #000066;">:</span> TPoint<span style="color: #000066;">;</span>
  S<span style="color: #000066;">:</span> <span style="color: #000066; font-weight: bold;">string</span><span style="color: #000066;">;</span>
  SL<span style="color: #000066;">:</span> TStringList<span style="color: #000066;">;</span>
  C<span style="color: #000066;">:</span> TWinControl<span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">begin</span>
  SL <span style="color: #000066;">:</span><span style="color: #000066;">=</span> TStringList<span style="color: #000066;">.</span><span style="color: #006600;">Create</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">try</span>
    <span style="color: #000000; font-weight: bold;">if</span> GetCursorPos<span style="color: #000066;">&#40;</span>P<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">begin</span>
      C <span style="color: #000066;">:</span><span style="color: #000066;">=</span> FindVCLWindow<span style="color: #000066;">&#40;</span>P<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
      <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #000066;">Assigned</span><span style="color: #000066;">&#40;</span>C<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">do</span>
      <span style="color: #000000; font-weight: bold;">begin</span>
        S <span style="color: #000066;">:</span><span style="color: #000066;">=</span> C<span style="color: #000066;">.</span><span style="color: #006600;">Name</span> <span style="color: #000066;">+</span> <span style="color: #ff0000;">': '</span> <span style="color: #000066;">+</span> C<span style="color: #000066;">.</span><span style="color: #006600;">UnitName</span> <span style="color: #000066;">+</span> <span style="color: #ff0000;">'.'</span> <span style="color: #000066;">+</span> C<span style="color: #000066;">.</span><span style="color: #006600;">ClassName</span><span style="color: #000066;">;</span>
        SL<span style="color: #000066;">.</span><span style="color: #006600;">Add</span><span style="color: #000066;">&#40;</span>S<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
        C <span style="color: #000066;">:</span><span style="color: #000066;">=</span> C<span style="color: #000066;">.</span><span style="color: #006600;">Parent</span><span style="color: #000066;">;</span>
      <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
    <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
    lbInfo<span style="color: #000066;">.</span><span style="color: #006600;">Caption</span> <span style="color: #000066;">:</span><span style="color: #000066;">=</span> SL<span style="color: #000066;">.</span><span style="color: #006600;">Text</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">finally</span>
    SL<span style="color: #000066;">.</span><span style="color: #006600;">Free</span><span style="color: #000066;">;</span>
  <span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span>
<span style="color: #000000; font-weight: bold;">end</span><span style="color: #000066;">;</span></pre></div></div>

<p>In action in the IDE this looks like this.<br />
<a href="http://www.bitcommander.de/blog/wp/wp-content/uploads/2011/12/ControlNamesInAction.png"><img src="http://www.bitcommander.de/blog/wp/wp-content/uploads/2011/12/ControlNamesInAction.png" alt="" title="Control Names In Action" width="386" height="453" class="alignnone size-full wp-image-1676" /></a><br />
If you think you have a need for this control info form in the developer build of your application then you can get the download <a href="http://www.bitcommander.de/files/2011122130D98574/ControlNames20111221.zip">here</a>. It should work with D2009 till XE2, but I have only tested it with XE and XE2. In order to show the form call the following code at a suitable place</p>

<div class="wp_syntax"><div class="code"><pre class="delphi" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">not</span> <span style="color: #000066;">Assigned</span><span style="color: #000066;">&#40;</span>fmControlNames<span style="color: #000066;">&#41;</span> <span style="color: #000000; font-weight: bold;">then</span>
    fmControlNames <span style="color: #000066;">:</span><span style="color: #000066;">=</span> TfmControlNames<span style="color: #000066;">.</span><span style="color: #006600;">Create</span><span style="color: #000066;">&#40;</span>Application<span style="color: #000066;">&#41;</span><span style="color: #000066;">;</span>
  fmControlNames<span style="color: #000066;">.</span><span style="color: #006600;">Show</span><span style="color: #000066;">;</span></pre></div></div>

<p>This will show the control info form that stays on top. Just move the mouse cursor over a control and see what is shown.</p>
<p>There is room for improvements like showing vendor information (e.g. Embarcadero for Vcl.Forms) from a list, showing maintainer information (e.g. USchuster for SvnClientMerge) from a list, show parent class information (e.g. TCustomVirtualStringTree&#8230;TBaseVirtualTree&#8230;TCustomControl for TVirtualStringTree), use TListView or TVirtualStringTree to show the list or open a unit on double click in the IDE&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bitcommander.de/blog/index.php/2011/12/22/controlsinfo/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

