<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Chip's Tips for Developers » UI Toolkit</title>
	
	<link>http://www.chipstips.com</link>
	<description>Contains coding, but not narcotic.</description>
	<lastBuildDate>Mon, 04 Feb 2013 20:50:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ChipsTipsUiToolkit" /><feedburner:info uri="chipstipsuitoolkit" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Managing simultaneous events in Synergy/DE UI Toolkit</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/9kRXs-a8OdE/</link>
		<comments>http://www.chipstips.com/?p=631#comments</comments>
		<pubDate>Sun, 15 Jan 2012 01:31:05 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[m_signal]]></category>
		<category><![CDATA[synthesis]]></category>
		<category><![CDATA[uitoolkit]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/?p=631</guid>
		<description><![CDATA[I&#8217;ve written before (PDF) about the unique event model of the Synergy/DE UI Toolkit. For historical reasons, these events are often called &#8220;menu entries,&#8221; and even though they are handled in a synchronous, delayed manner you can&#8217;t have more than one such event pending at any given time. This didn&#8217;t cause too many problems back [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=631"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=631" data-text="Managing simultaneous events in Synergy/DE UI Toolkit" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D631&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=631";
			reddit_title = "Managing simultaneous events in Synergy/DE UI Toolkit";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=631";</script>
		<script type="text/javascript">var dzone_title = "Managing simultaneous events in Synergy/DE UI Toolkit";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p><img src="http://chipstips.com/images/synthesis.png" align="left" height="100" width="100" alt="synthesis" style="padding-right:10px;"/>I&#8217;ve <a href="http://www.synergyde.com/common/downloads/EventModelW.pdf">written before (PDF)</a> about the unique <a href="http://www.chipstips.com/?p=78">event model</a> of the Synergy/DE UI Toolkit.  For historical reasons, these events are often called &#8220;menu entries,&#8221; and even though they are handled in a synchronous, delayed manner you can&#8217;t have more than one such event pending at any given time.  This didn&#8217;t cause too many problems back in the old days when they were almost limited to user-initiated events.  But now that they&#8217;ve also become a standard means for converting asynchronous system-level events into synchronous Toolkit events, the need to generate more than one at a time has become something much more than academic.</p>
<p>Consider, for instance, an input field that needs to perform non-trivial processing at three points: when it is modified, when it is displayed, and when focus leaves the field.  Each of these events can be hooked to a &#8220;method&#8221; routine, but if those routines need to do anything involving user interaction, then on Windows it needs to be deferred to the outer loop by means of passing an event to M_SIGNAL.  Why?  Because in an asychronous callback, the UI Toolkit can&#8217;t process Windows messages, so the user will not see any changes to the UI until after that event has been handled and the routine returns.  Non-Windows platforms like Unix and OpenVMS don&#8217;t have that problem, but if your code is portable to Windows then you probably want to write it that way anyway.</p>
<p>Now, when the user types something in the field and then advances to the next field (via Tab, etc.), all three of those events will fire: first the &#8220;change&#8221; event, then the &#8220;display&#8221; event (to display the reformatted value after validation), then the &#8220;leave&#8221; event.  All three associated methods will be called in that order.  If each of them signals a menu entry event, then only the last one will be seen.</p>
<p>I&#8217;ve added a class to my Synthesis library to extend menu-entry signaling to maintain a queue of pending events.  To make use of it, you replace M_SIGNAL with <a href="http://chipstips.com/doc/synthesis/multisignal.html#ref-signal">multi_signal</a>.  In the outer routine that consumes events, you change M_SIGNAL(&#8230;, D_REMOVE) (or testing g_select and g_entnam, after the older form), with a loop of calls to <a href="http://chipstips.com/doc/synthesis/multisignal.html#ref-remove">multi_remove</a>, until it returns ^null.  Each non-null return value will be a string containing an event that was signaled, in the order in which they were signaled.</p>
<p>To ease the transition, I&#8217;ve made multisignal somewhat compatible with M_SIGNAL.  If the consuming code isn&#8217;t changed to the new paradigm, then it will still see the most recent event &#8212; whether it was passed to M_SIGNAL or multisignal.</p>
<p>See the test program (test_multisignal.dbl in the tests subdirectory) for an example of how to solve the scenario I related above.</p>
<p>With this feature, I&#8217;m putting a lid on Synthesis version 2.2.1.  Any further changes will go in the next version.</p>
<div class="downloadbuttons">
    <a href="http://bitbucket.org/sterlingcamden/synthesis"><img src="http://www.chipstips.com/images/bitbucket.png" alt="BitBucket repository" /></a><br />
    <a href="http://www.chipstips.com/download/synthesis.tar.bz2"><img src="http://www.chipstips.com/images/tarball.png" alt="tarball" /></a><br />
    <a href="http://www.chipstips.com/download/synthesis.zip"><img src="http://www.chipstips.com/images/zip.png" alt="Zip archive" /></a>
</div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/9kRXs-a8OdE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=631</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=631</feedburner:origLink></item>
		<item>
		<title>Changing the text and size of drill buttons in Synergy/DE</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/3I_re-N5VLY/</link>
		<comments>http://www.chipstips.com/?p=485#comments</comments>
		<pubDate>Wed, 14 Apr 2010 17:16:53 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[syndrilltext]]></category>
		<category><![CDATA[toolkit]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/?p=485</guid>
		<description><![CDATA[Glynis Lyttle recently asked on the synergy-l mailing list about how to change the appearance of the drill buttons on Synergy/DE UI Toolkit input windows.&#160; These are buttons that are placed to the right of an input field if it has a drill method (IDRILL_METHOD).&#160; They’re always sized to the width of a vertical scroll [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=485"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=485" data-text="Changing the text and size of drill buttons in Synergy/DE" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D485&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=485";
			reddit_title = "Changing the text and size of drill buttons in Synergy/DE";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=485";</script>
		<script type="text/javascript">var dzone_title = "Changing the text and size of drill buttons in Synergy/DE";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>Glynis Lyttle recently asked on the synergy-l mailing list about how to change the appearance of the drill buttons on Synergy/DE UI Toolkit input windows.&#160; These are buttons that are placed to the right of an input field if it has a drill method (IDRILL_METHOD).&#160; They’re always sized to the width of a vertical scroll bar, and contain the text “…” as show below:</p>
<p><a href="http://chipstips.com/wp-content/images/ChangingthetextandsizeofdrillbuttonsinSy_91BB/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://chipstips.com/wp-content/images/ChangingthetextandsizeofdrillbuttonsinSy_91BB/image_thumb.png" width="96" height="63" /></a> </p>
<p>Usually, these buttons are used to launch some sort of lookup function that will populate the field.&#160; But Glynis has multiple uses for these buttons, and would like a way to indicate the distinction between launching the calendar control for a date field versus launching a new email to the address contained in an email address field.</p>
<p>The Synergy UI Toolkit does not provide a documented way to do this, but it can be achieved without resorting to any undocumented functionality.</p>
<p>The download below includes a new function named set_drill_text, which has the following syntax:</p>
<p><code>%set_drill_text(<em>wndid</em>, <em>field</em>, <em>text</em>) =&gt; <em>success</em></code></p>
<p>where</p>
<ul>
<li><em>wndid</em> is the ID of the input window</li>
<li><em>field </em>is either the name or the index of the input field whose drill button will be modified</li>
<li><em>text </em>is the new text for the button</li>
<li><em>success </em>is returned true if successful, false if not</li>
</ul>
<p>The text of the button will be changed to the right-trimmed value of <em>text</em>, and the button will be resized appropriately.&#160; The height of the button will not be changed, but its width will be set to the width of the text plus the width of two 3D edges as described by the current theme.&#160; For example:</p>
<p><a href="http://chipstips.com/wp-content/images/ChangingthetextandsizeofdrillbuttonsinSy_91BB/image_3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://chipstips.com/wp-content/images/ChangingthetextandsizeofdrillbuttonsinSy_91BB/image_thumb_3.png" width="153" height="56" /></a> </p>
<p>The function can fail for a number of reasons:</p>
<ul>
<li><em>wndid </em>is not a valid input window ID</li>
<li><em>field </em>is not the name of a field in the window or a numeric value within the range of 1 to the number of fields</li>
<li>the drill button for the field has not yet been created.&#160; Either I_FRAMES or I_INPUT must have been previously called for an input set that contains the field.</li>
<li>probably something else I haven’t thought of.</li>
</ul>
<p>Note:&#160; whenever the input set controls are recreated, the drill button text and size revert to their original form until you call this function again.&#160; Input set controls are recreated whenever you switch the active input set for I_INPUT/I_FRAMES, or call I_INPFLD, as well as some cases of I_FLDMOD for that field.</p>
<p>It would be nice to be able to change the button to display an image instead of text.&#160; Unfortunately, that’s quite a bit more involved and would require some non-Synergy/DE code (probably C or C++) to subclass the button’s WM_PAINT handler.&#160; We’ll leave that as an exercise for another day.</p>
<div class="downloadbutton"><a href="http://www.chipstips.com/download/syndrilltext.zip"><img alt="download" src="http://www.chipstips.com/images/download.gif" /></a></div>
<div></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/3I_re-N5VLY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=485</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=485</feedburner:origLink></item>
		<item>
		<title>Synthesis 2.0.1: chasing bugs out of the woodwork with coverage analysis</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/rUCMQz5Mc7M/</link>
		<comments>http://www.chipstips.com/?p=421#comments</comments>
		<pubDate>Thu, 31 Dec 2009 22:50:45 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[Regexen]]></category>
		<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[codecoverage]]></category>
		<category><![CDATA[debugger]]></category>
		<category><![CDATA[regexen]]></category>
		<category><![CDATA[synthesis]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/?p=421</guid>
		<description><![CDATA[I just released version 2.0.1 of my Synthesis library for Synergy/DE, which you can download below. As you can see from the change log, this version grew mostly from the application of my tools for analyzing code coverage to my own creations.&#160; By fleshing out my own unit tests to nearly 100% coverage, I shook [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=421"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=421" data-text="Synthesis 2.0.1: chasing bugs out of the woodwork with coverage analysis" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D421&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=421";
			reddit_title = "Synthesis 2.0.1: chasing bugs out of the woodwork with coverage analysis";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=421";</script>
		<script type="text/javascript">var dzone_title = "Synthesis 2.0.1: chasing bugs out of the woodwork with coverage analysis";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>I just released version 2.0.1 of my Synthesis library for Synergy/DE, which you can download below.</p>
<p>As you can see from <a href="http://chipstips.com/doc/synthesis/changelog.html#ver-2.0.1">the change log</a>, this version grew mostly from the application of my tools for <a href="http://chipstips.com/doc/synthesis/htmlcover.html">analyzing</a> code <a href="http://chipstips.com/doc/synthesis/coverage.html">coverage</a> to my own creations.&#160; By fleshing out my own unit tests to nearly 100% coverage, I shook out all nine corrections listed for this version.&#160; So you can see from my own example that achieving 100% test coverage is not merely an academic exercise.&#160; Code always looks more solid when it’s never executed.</p>
<p>These tests also revealed some areas in which my code coverage analysis needed improvement.&#160; The six enhancements listed for the CodeCoverage class all came from those observations.</p>
<p>In fact, this version includes only one change that did not spring from my automated navel-gazing:&#160; the addition of <a href="http://chipstips.com/doc/synthesis/regex.html#ref-extended">the ‘x’ option</a> to Regex.&#160; This, of course, allows white space, line breaks, and comments within a regular expression.&#160; My other enhancement to Regex (optimizing out unnecessary code) was a result of code coverage analysis &#8212; because otherwise I might never have determined that the code removed was not necessary.</p>
<p>My code coverage only suffers from one major flaw, and that is not its own:&#160; the debugger (on which it relies for sampling) sometimes exits prematurely when stepping through code (Synergex tr#30947).&#160; You can tell when this happens by examining the coverage report for your mainline to see where coverage stops.&#160; Unfortunately, one of the places where it regularly happens is within U_START, so analyzing an application that uses the Synergy UI Toolkit shall be an exercise in futility until such time as that tracker shall have been resolved.</p>
<p>However, I would highly recommend using this utility to analyze test coverage for code that doesn’t rely on the Toolkit – as well as for Toolkit code once that debugger bug is fixed.&#160; It’s certainly pointed out some oversights in my code.</p>
<p>I have a few ideas on how to enhance this further:</p>
<ul>
<li>Currently, the command line tools only include sampling from one executable.&#160; I’d like to add the ability to sample multiple runs, combining their statistics.&#160; That way, you could sample a whole test suite and see how well your code is covered by it.</li>
<li>Unreachable code is currently included in the analysis.&#160; For instance, code that’s .ifdef’d out, or an mreturn at the end of a method that always throws an exception (the mreturn being required by the compiler).&#160; I’m thinking of creating a way to tag code as “not to be included in coverage analysis”.</li>
<li>Once analyzing Toolkit code becomes possible, I can foresee sampling taking a lot longer than it needs to, because most users wouldn’t want to include the internals of Toolkit routines in the analysis.&#160; I’d like to create a way to specify the source files that you want to include in sampling, so that the sampler could simply skip over the rest.</li>
</ul>
<p>Anything else that you’d like to see here?</p>
<div class="downloadbutton"><a href="http://www.chipstips.com/download/synthesis.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/rUCMQz5Mc7M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=421</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=421</feedburner:origLink></item>
		<item>
		<title>Got Toolkit?  Sniffing and starting the UI Toolkit in Synergy/DE</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/RIqh4veiFqc/</link>
		<comments>http://www.chipstips.com/?p=327#comments</comments>
		<pubDate>Tue, 14 Jul 2009 18:04:28 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Wildly popular]]></category>
		<category><![CDATA[toolkit]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/?p=327</guid>
		<description><![CDATA[Synergy/DE developers often have a mix of applications, some of which use the Synergy/DE UI Toolkit, and others that don’t.  The UI Toolkit doesn’t always play well with others, especially when it comes to things like allocating file channels or windows – it wants to control those operations itself.  So for a generalized routine, it’s [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=327"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=327" data-text="Got Toolkit?  Sniffing and starting the UI Toolkit in Synergy/DE" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D327&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=327";
			reddit_title = "Got Toolkit?  Sniffing and starting the UI Toolkit in Synergy/DE";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=327";</script>
		<script type="text/javascript">var dzone_title = "Got Toolkit?  Sniffing and starting the UI Toolkit in Synergy/DE";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>Synergy/DE developers often have a mix of applications, some of which use the Synergy/DE UI Toolkit, and others that don’t.  The UI Toolkit doesn’t always play well with others, especially when it comes to things like allocating file channels or windows – it wants to control those operations itself.  So for a generalized routine, it’s useful to know whether the UI Toolkit has been linked into the current application, and if so whether or not it has been started.</p>
<p>The code you can download below includes a function named “GotToolkit”:</p>
<p><em>result </em>= %GotToolkit(<em>start</em>)</p>
<p>where</p>
<p><em>result </em>is returned with one of the following values (defined in gottk.def):<br />
D_NO_TOOLKIT – This application has not included the Toolkit<br />
D_TOOLKIT_AVAILABLE – Toolkit available, but not yet started<br />
D_TOOLKIT_STARTED – Toolkit has been started</p>
<p><em>start</em> is an optional argument indicating whether to attempt to start Toolkit (defined in tools.def):<br />
D_NO_START – Leave things as they are (assumed if not passed)<br />
D_START – Start the Toolkit, but only if available<br />
D_START_ANYWAY – Start the Toolkit, attaching to it if not available</p>
<p>If instructed to start the Toolkit, <em>result </em>is the result of that operation.  In any case, <em>result </em>represents the current state of affairs when the function returns.</p>
<p>Be sure to include gottk.def within the data division of any routine that uses %GotToolkiit – this include file not only defines the literals used in the interface, it also declares the function to have a ^val return type.</p>
<p>In order to make the Toolkit truly optional on Windows and *nix, you must link gottk in an ELB.  Otherwise, because of the way global data section initialization works in Synergy/DE, you’ll be forced to link in the Toolkit also – which means you could never get a D_NO_TOOLKIT return value.  You can put gottk in your own ELB, or use the one built by the enclosed example.</p>
<p>This function should work across all supported Synergy/DE platforms: Windows, *nix, and OpenVMS.</p>
<p>I’ve included some tests in testtk1.dbl, testtk2.dbl, and testtk3.dbl.  For correctly building and executing these tests, I’ve included bld.sh (a *nix shell script) and bld.bat (a Windows batch file).  The tests succeed if you get a STOP message for each program, without throwing any exceptions.</p>
<div class="downloadbutton"><a href="http://www.chipstips.com/download/syngottk.zip"><img src="http://www.chipstips.com/images/download.gif" alt="" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/RIqh4veiFqc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=327</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=327</feedburner:origLink></item>
		<item>
		<title>Scoping a wait cursor in Synergy/DE</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/r3wDdJHxzZk/</link>
		<comments>http://www.chipstips.com/?p=184#comments</comments>
		<pubDate>Mon, 05 May 2008 18:23:28 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[destructor]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[scope]]></category>
		<category><![CDATA[synwait]]></category>
		<category><![CDATA[waitcursor]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/?p=184</guid>
		<description><![CDATA[On Windows, Synergy/DE provides access to the mouse cursor via the WP_CURSOR subfunction of W_PROC. Because this API is purely imperative, managing a wait cursor properly becomes a recurring problem in non-trivial applications. Typically, it begins like this (in pseudo-code): set wait cursor do lengthy process clear wait cursor But what happens if &#8220;do lengthy [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=184"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=184" data-text="Scoping a wait cursor in Synergy/DE" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D184&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=184";
			reddit_title = "Scoping a wait cursor in Synergy/DE";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=184";</script>
		<script type="text/javascript">var dzone_title = "Scoping a wait cursor in Synergy/DE";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>On Windows, Synergy/DE provides access to the mouse cursor via the WP_CURSOR subfunction of W_PROC.  Because this API is purely imperative, managing a wait cursor properly becomes a recurring problem in non-trivial applications.  Typically, it begins like this (in pseudo-code):</p>
<p>set wait cursor<br />
do lengthy process<br />
clear wait cursor</p>
<p>But what happens if &#8220;do lengthy process&#8221; throws an exception that&#8217;s caught outside this code?  You&#8217;ll skip right over &#8220;clear wait cursor&#8221; and leave the user unable to click anything.  What you&#8217;d like to do is more like this:</p>
<p><code>begin<br />
&nbsp;&nbsp;set wait cursor<br />
&nbsp;&nbsp;do lengthy process<br />
end</code></p>
<p>&#8230; and have the cursor reset whenever and however you exit the code block.</p>
<p>The downloadable code below demonstrates how to do this with the new object syntax in Synergy/DE version 9.  The WaitCursor class sets the wait cursor in its constructor and resets it in its destructor.  So you can code it like this:</p>
<p><code>begin<br />
&nbsp;&nbsp;data wait, @*, new WaitCursor()<br />
&nbsp;&nbsp;do lengthy process<br />
end</code></p>
<p>The data statement declares a variable that has the scope of its containing begin-end block.  The variable <em>wait</em> is declared as an object (@*).  We could have more precisely declared it as @WaitCursor, but that&#8217;s just more typing (pun intended).  It&#8217;s initial value is returned by the &#8220;new&#8221; expression, creating a new WaitCursor object.  This invokes its constructor, setting the wait cursor.  When <em>wait</em> goes out of scope, the last reference to the object is lost, and the destructor is invoked and the cursor is reset &#8212; no matter how you get out of the code block.  If you want to preserve the cursor instead, you can just pass a reference to the object out of the block in another variable, and clear that variable when you no longer want the wait cursor.</p>
<p>But what happens if you have nested operations that, agnostic of each other, each want to set a wait cursor?  When the inner one finishes, it will reset the cursor to normal.  That&#8217;s not what you want at all.  I solved this by adding a static counter to the class, so we only reset the cursor if our count of active WaitCursor objects gets back to zero.</p>
<p>Of course it&#8217;s possible that other code is manipulating the cursor without using our class.  That could definitely interfere with our scheme, and should be avoided if possible.  One common case is the set of message box routines in the UI Toolkit (U_MESSAGE, U_MSGBOX, U_WAIT).  These routines always reset the cursor to the normal pointer so the user can use the mouse to click the buttons.  If you want to have the cursor go back to what it was before these routines were called, then you&#8217;ll probably need to <a href="http://www.chipstips.com/?p=109">wrap them in your own version</a> that saves off the current cursor state, calls the original, and then restores the cursor.</p>
<p><a href="http://www.chipstips.com/download/synwait.zip"><img src="http://www.chipstips.com/images/download.gif" alt="" /></a></p>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/r3wDdJHxzZk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=184</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=184</feedburner:origLink></item>
		<item>
		<title>Drawing a blank</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/Jott6414NYw/</link>
		<comments>http://www.chipstips.com/?p=155#comments</comments>
		<pubDate>Tue, 09 Jan 2007 23:39:49 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[apotheon]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[dandesch]]></category>
		<category><![CDATA[harlandfs]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[synmnuchk]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/?p=155</guid>
		<description><![CDATA[Dan Desch of Harland Financial Solutions pointed out a bug in my June 2001 post on checked menu entries in Synergy/DE. Synergy/DE has no built-in function to trim leading spaces from a string, so I had used the following snippet: while (.not. text(1:1)) text = text(2,^size(text)) ;Trim leading spaces which works fine so long as [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=155"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=155" data-text="Drawing a blank" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D155&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=155";
			reddit_title = "Drawing a blank";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=155";</script>
		<script type="text/javascript">var dzone_title = "Drawing a blank";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p><img height="106" alt="" hspace="10" src="http://www.chipstips.com/wp-content/uploads/2007/01/checkedmenu.jpg" width="124" align="left" />Dan Desch of <a href="http://harlandfs.com/">Harland Financial Solutions</a> pointed out a bug in my June 2001 post on <a href="http://www.chipstips.com/?p=94">checked menu entries in Synergy/DE</a>. Synergy/DE has no built-in function to trim leading spaces from a string, so I had used the following snippet:</p>
<pre>
<code>        while (.not. text(1:1))<br />
          text = text(2,^size(text))        ;Trim leading spaces</code>
</pre>
<p>which works fine so long as text contains at least one non-space character. Most menu entries fall into that category, except for those created by the &#8220;.BLANK&#8221; script command. In that case, this code goes into an infinite loop, because the overlay move blank extends to the length of the field, so you end up with exactly what you had to begin with.</p>
<p>Dan&#8217;s proposed solution was to branch around this logic if the entire field was blank, but I took this opportunity to optimize this code a bit. After all, performing iterative overlay moves of the entire field by one character doesn&#8217;t really jingle my <a href="http://sob.apotheon.org/?p=113">elegance</a> bells. So I replaced it with this algorithm:</p>
<pre>
<code>        for ptr2 from 1 thru %trimz(text) ;For trimmed length<br />
          if (text(ptr2:1))   ;Search for non-blank                   <br />
             exitloop<br />
        if (ptr2 .gt. 1)<br />
          text = text(ptr2,^size(text)) ;Trim leading spaces</code>
</pre>
<p>Synergy/DE optimizes the &#8220;for&#8221; statement such that %trimz is only executed once to get the right-trimmed length.  If the field is all blank %trimz returns 0, so we&#8217;ll just exit the loop with ptr2 set to 1.</p>
<p>Now no matter how many leading spaces the field contains, we will do a maximum of 1 overlay move of the data. If the field contains no leading spaces (by far the majority of cases) then we&#8217;ve only executed one iteration of the for loop and the two if&#8217;s.</p>
<p>Naturally, if you have a need to do this sort of thing regularly, you could write your own function using this logic, and instead of moving the data over, just return the left-trimmed portion, else return the original, like so:</p>
<pre>
<code>        for ptr2 from 1 thru %trimz(text) ;For trimmed length<br />
          if (text(ptr2:1))   ;Search for non-blank<br />
            exitloop<br />
        if (ptr2 .gt. 1)<br />
          freturn text(ptr2,^size(text)) ;Trim leading spaces
        freturn text</code>
</pre>
<p>You can download the corrected version at the <a href="http://www.chipstips.com/?p=94">original post</a>.</p>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/Jott6414NYw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=155</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=155</feedburner:origLink></item>
		<item>
		<title>Synergy fibs</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/fGSxHAvq9wU/</link>
		<comments>http://www.chipstips.com/?p=151#comments</comments>
		<pubDate>Fri, 22 Dec 2006 00:10:16 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[fibonacci]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/?p=151</guid>
		<description><![CDATA[Over on SOB, apotheon has a couple of posts and some good discussion on Fibonacci sequences in various programming languages. As a combination response to those posts, programming exercise, and lesson in the language &#8211; I decided to tackle the problem in Synergy/DE. The download below contains a testing harness and three versions of a [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=151"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=151" data-text="Synergy fibs" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D151&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=151";
			reddit_title = "Synergy fibs";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=151";</script>
		<script type="text/javascript">var dzone_title = "Synergy fibs";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>Over on <a href="http://sob.apotheon.org">SOB</a>, apotheon has a <a href="http://sob.apotheon.org/?p=169">couple</a> of <a href="http://sob.apotheon.org/?p=171">posts</a> and some good discussion on Fibonacci sequences in various programming languages. As a combination response to those posts, programming exercise, and lesson in the language &#8211; I decided to tackle the problem in Synergy/DE. The download below contains a testing harness and three versions of a Fibonacci number function.</p>
<p>The first version of the function follows the mathematical definition, and closely resembles the recursive examples given by apotheon from other languages:</p>
<p><code>
<pre>.function fib ,^val, reentrant<br />
;<br />
; Recursive Fibonacci number function<br />
;<br />
    a_index ,n ;Desired index in the sequence<br />
;<br />
.proc<br />
    if (a_index &lt; 2)<br />
      freturn a_index<br />
    freturn %fib(a_index-1) + %fib(a_index-2)<br />
.end</pre>
<p></code></p>
<p>Let&#8217;s look at some of the features of the Synergy/DE language as shown here. Synergy/DE requires the &#8220;%&#8221; character to prefix a function invocation, and uses the freturn statement to return a value from a function. So the functional syntax is not entirely pure, but workable. Functions are not reentrant (for historical compatibility) unless you add the &#8220;reentrant&#8221; qualifier as shown.</p>
<p>The one parameter to this function (a_index) has a type declaration of &#8220;n&#8221;.  That means any numeric type will be handled as passed.  If you pass it an alphanumeric, the argument will be cast as ASCII decimal, so &#8220;12&#8243; works just as well as 12.  You can use static typing if preferred (for instance, &#8220;i&#8221; to indicate integer), and in version 9 your options become stronger.</p>
<p>COBOLics (Hi, my name is Chip, and I am a COBOLic.  I&#8217;ve been COBOL-free for 24 years.) will understand the &#8220;.proc&#8221; statement.  It&#8217;s the equivalent of the COBOL &#8220;PROCEDURE DIVISION&#8221;, dividing the data declarations from the procedural code.</p>
<p>The &#8220;^val&#8221; in the function header indicates that this function will return its value on the stack instead of using a descriptor. It&#8217;s purely an optimization. However, it does limit our Fibonacci sequence to a length of 46 on 32-bit systems. But you&#8217;re likely to lose patience before you ever get there, as the dual recursion starts to hammer performance by about number 20.</p>
<p>As many people have demonstrated in other languages, you can optimize this function by using an iterative algorithm instead of recursion.  This is shown in fib1 in the download below, which also uses a strength of the Synergy/DE language (grouped data) to shift the last two values computed throughout the iteration.  The result?  You can get 5000 iterations of a sequence of length 40 in about 30 seconds (on my computer).</p>
<p>However, if the function is called in sequence order, we can improve performance even more by caching our previous results. See fib2 in the download for how that works.  It shaves another 5 seconds off that 5000 iteration run.</p>
<p>Note that I used a static variable for the data cache, but I don&#8217;t access the static values directly in the routine (even though that would give it a small performance boost). Instead, I take a snapshot of the cache at the beginning and work with the values in stack memory. Then I save the final values back to the static cache. Why go to all that trouble? Because the function is reentrant, so relying on static values could lead to trouble.</p>
<p>BUT, I hear you cry, this function doesn&#8217;t call any other functions that could result in recursion. Why worry about it?</p>
<p>Ah, but on graphical environments (like Windows), events can be fired <em>between execution of individual program statements</em>. So if we anticipate that anyone might need to generate a new Fibonacci sequence when a window gets clicked, for example, then we need to guard against relying on the content of static and global variables for longer than one statement.  Thanks to records being treated as fields in Synergy/DE, I can copy all that data in one statement.</p>
<p>You may notice in the test harness that Synergy/DE allows you to invoke routines dynamically via %xsubr. BTW, you can pass an alphanumeric function name to %xsubr, too. But it&#8217;s more efficient if you pass it a numeric routine address, which can be looked up via %xaddr.</p>
<p>The harness also makes use of %u_cmdlinopt to parse command line options using the form:</p>
<p><code>-opt [arg, ...]</code></p>
<p>The %u_cmdlinopt function is included in the Synergy/DE UI Toolkit.</p>
<p>Any Synergy/DE programmers care to try to optimize this further, or provide a more elegant solution?</p>
<div><a href="http://www.chipstips.com/download/synfib.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/fGSxHAvq9wU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=151</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=151</feedburner:origLink></item>
		<item>
		<title>Changing the foreground color for disabled fields</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/eI47gIsbimM/</link>
		<comments>http://www.chipstips.com/?p=92#comments</comments>
		<pubDate>Wed, 05 Apr 2006 22:46:23 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Wildly popular]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[controlpanel]]></category>
		<category><![CDATA[disabled]]></category>
		<category><![CDATA[graytext]]></category>
		<category><![CDATA[setsyscolors]]></category>
		<category><![CDATA[syndsaclr]]></category>
		<category><![CDATA[user32]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=92</guid>
		<description><![CDATA[In Synergy/DE on Windows, the colors applied to some parts of your application are determined by the Windows registry, rather than by renditions settings in Synergy/DE. This means that most of the time a user can figure out how to control a given component&#8217;s rendition by looking in Windows Control Panel or the Synergy Control [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=92"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=92" data-text="Changing the foreground color for disabled fields" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D92&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=92";
			reddit_title = "Changing the foreground color for disabled fields";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=92";</script>
		<script type="text/javascript">var dzone_title = "Changing the foreground color for disabled fields";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>In Synergy/DE on Windows, the colors applied to some parts of your application are determined by the Windows registry, rather than by renditions settings in Synergy/DE.  This means that most of the  time a user can figure out how to control a given component&#8217;s rendition by looking in Windows Control Panel or the Synergy Control Panel.</p>
<p>Not so for disabled fields.  Windows does not provide a visual means for altering the &#8220;gray text&#8221; rendition, and it forces that rendition on all disabled fields.  There is literally no way around it, short of subclassing the display for edit controls.  With the default background color being a darker gray, the text of disabled fields can be difficult to read, which has caused some frustration for Synergy/DE users and developers.</p>
<p>All Windows colors can be programmatically manipulated via the user32.dll function &#8220;SetSysColors&#8221;. The download below demonstrates how to modify the COLOR_GRAYTEXT system color to whatever color you would like.  Note, however, that after you change that color, the change takes effect for ALL applications from this point forward for the current user.  So, wield this weapon with care.</p>
<p>Blogged about this <a href="http://www.chipstips.com/microblog/index.php/post/335/">here</a>.</p>
<div><a href="http://www.chipstips.com/download/syndsaclr.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/eI47gIsbimM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=92</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=92</feedburner:origLink></item>
		<item>
		<title>Setting Synergy/DE colors to Windows system colors</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/qIXZjHmxek4/</link>
		<comments>http://www.chipstips.com/?p=91#comments</comments>
		<pubDate>Thu, 16 Mar 2006 01:31:35 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[getsyscolor]]></category>
		<category><![CDATA[rgb]]></category>
		<category><![CDATA[synsyscolor]]></category>
		<category><![CDATA[u_wincolor]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=91</guid>
		<description><![CDATA[Ah, the wonderful world of colors&#8230;so many ways to define them. In the Synergy/DE world, a color palette is defined as a set of 16 foreground/background combinations (yes, this seems a little restricted, but it was designed back in the days when it made a difference that the zero-based index could be stored in 4 [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=91"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=91" data-text="Setting Synergy/DE colors to Windows system colors" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D91&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=91";
			reddit_title = "Setting Synergy/DE colors to Windows system colors";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=91";</script>
		<script type="text/javascript">var dzone_title = "Setting Synergy/DE colors to Windows system colors";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>Ah, the wonderful world of colors&#8230;so many ways to define them. In the Synergy/DE world, a color palette is defined as a set of 16 foreground/background combinations (yes, this seems a little restricted, but it was designed back in the days when it made a difference that the zero-based index could be stored in 4 bits).  The foreground and background colors are defined as color codes from 0 to 255, just to create more numeric confusion.  These codes are platform-specific, but on Windows platforms they are each defined as an RGB (red-green-blue) triplet.  You can define them, as well as the palette entries, in the synergy.ini file in the [COLORS] section.  You can also change them at runtime, using the %U_WINCOLOR UI Toolkit function with the D_SETCOLOR subfunction.</p>
<p>Thus our bridge from Windows colors to Synergy/DE colors.  Windows system colors can be retrieved as RGB triplets using the Win32 API function &#8220;GetSysColor&#8221;. The downloadable code below provides a function that will set a Synergy color (0-255) to one of the Windows system colors.  The included example then shows how to assign the newly formed color to a Synergy/DE Toolkit rendition.</p>
<p>Hey, at least we don&#8217;t have to worry about hue, luminosity, and saturation.</p>
<p><strong>News flash!</strong>  Synergy/DE version 8.3 (and later) includes built-in support for Windows system colors as color values above 255.</p>
<div><a href="http://www.chipstips.com/download/synsyscolor.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/qIXZjHmxek4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=91</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=91</feedburner:origLink></item>
		<item>
		<title>Determining the ActiveX list column number of a field</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/vKZEtrQOY-k/</link>
		<comments>http://www.chipstips.com/?p=108#comments</comments>
		<pubDate>Thu, 26 Jan 2006 00:03:47 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[ActiveX]]></category>
		<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[activexlist]]></category>
		<category><![CDATA[get_listfldcol]]></category>
		<category><![CDATA[synaxlistcol]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=108</guid>
		<description><![CDATA[The ActiveX list provided in Synergy/DE includes a number of published methods that take the list column number as an argument. The column number does not directly map to the number of fields and/or prompts, because prompts only get a column if the field is not a checkbox. Thus, a bit of logic is required [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=108"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=108" data-text="Determining the ActiveX list column number of a field" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D108&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=108";
			reddit_title = "Determining the ActiveX list column number of a field";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=108";</script>
		<script type="text/javascript">var dzone_title = "Determining the ActiveX list column number of a field";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>The ActiveX list provided in Synergy/DE includes a number of published methods that take the list column number as an argument.  The column number does not directly map to the number of fields and/or prompts, because prompts only get a column if  the field is not a checkbox.  Thus, a bit of logic is required to programmatically determine the column number for a specific field.</p>
<p>The download below includes a function, %get_listfldcol, to which you pass the ID of the list and either the name or the number of a Toolkit field within the associated input window.  The function returns the ActiveX list column number for the &#8220;field&#8221; portion of the field (i.e., not the prompt), or zero if the field is not found in the window.</p>
<div><a href="http://www.chipstips.com/download/synaxlistcol.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/vKZEtrQOY-k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=108</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=108</feedburner:origLink></item>
		<item>
		<title>Event model programming</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/MIDW4XyHlLI/</link>
		<comments>http://www.chipstips.com/?p=78#comments</comments>
		<pubDate>Wed, 14 Sep 2005 00:28:28 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[ActiveX]]></category>
		<category><![CDATA[OpenVMS]]></category>
		<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[dibol]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[spc2002]]></category>
		<category><![CDATA[syneventmodel]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=78</guid>
		<description><![CDATA[Having trouble with the event-driven programming model and Synergy/DE? Well, at least you&#8217;re not alone. Many Synergy/DE applications have evolved from old DIBOL programs that were anything but event-driven. Making the transition to the event-driven model promoted by the Synergy/DE Toolkit can be daunting. To compound the problem, the event model inherent in Microsoft Windows [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=78"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=78" data-text="Event model programming" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D78&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=78";
			reddit_title = "Event model programming";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=78";</script>
		<script type="text/javascript">var dzone_title = "Event model programming";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>Having trouble with the event-driven programming model and Synergy/DE? Well, at least you&#8217;re not alone.  Many Synergy/DE applications have evolved from old DIBOL programs that were anything but event-driven.  Making the transition to the event-driven model promoted by the Synergy/DE Toolkit can be daunting.  To compound the problem, the event model inherent in Microsoft Windows contains some significant paradigmatic differences that can create even more challenges for the Synergy/DE developer on that platform.</p>
<p>I wrote a white paper for Synergex on this topic.  You can find it in the Synergex Virtual Library on their web site at <a href="http://www.synergex.com/pdf/EventModelW.pdf"> http://www.synergex.com/pdf/EventModelW.pdf</a>. This paper discusses the event-driven programming model both in abstract terms and specifically as it applies to Synergy/DE.  It also draws parallels between the event models in Synergy/DE and other language platforms.</p>
<p>The downloadable code below was created for the Synergex SPC 2002 to demonstrate the difference between modal and non-modal applications, and to give concrete examples of how to implement the latter.  It also includes some useful Windows-specific features.</p>
<p>Note: this example was recently updated to make use of features available in Synergy/DE version 8.3, and will no longer work with previous versions.</p>
<div><a href="http://www.chipstips.com/download/synnonmodal.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/MIDW4XyHlLI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=78</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=78</feedburner:origLink></item>
		<item>
		<title>Creating container windows</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/J2NAjYsxUuQ/</link>
		<comments>http://www.chipstips.com/?p=79#comments</comments>
		<pubDate>Wed, 14 Sep 2005 00:25:12 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[activation]]></category>
		<category><![CDATA[ActiveX]]></category>
		<category><![CDATA[container]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[macros]]></category>
		<category><![CDATA[mem_proc]]></category>
		<category><![CDATA[rcbapi]]></category>
		<category><![CDATA[setparent]]></category>
		<category><![CDATA[syncontainer]]></category>
		<category><![CDATA[tabbingorder]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=79</guid>
		<description><![CDATA[The Synergy/DE Toolkit does not provide much support for container/child relationships between windows, with the exception of tab set containers. However, generic containers can be very useful for presenting a unified interface made up of diverse elements, such as input windows, lists, ActiveX controls, and even tab sets. Download the code below to obtain a [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=79"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=79" data-text="Creating container windows" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D79&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=79";
			reddit_title = "Creating container windows";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=79";</script>
		<script type="text/javascript">var dzone_title = "Creating container windows";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>The Synergy/DE Toolkit does not provide much support for container/child relationships between windows, with the exception of tab set containers. However, generic containers can be very useful for presenting a unified interface made up of diverse elements, such as input windows, lists, ActiveX controls, and even tab sets.  Download the code below to obtain a suite of routines to enable container/child relationships, and to deal with the issues they present.  Some of these issues include tabbing order, activation, clicking between child windows, and many others.  These routines also contain some good examples of using advanced Synergy/DE features such as dynamic memory, RCB dynamic routine calls, macro expansion, window events, and more.</p>
<p>Most of the important code and comments can be found in container.dbl. The file container.def is an include to be used by client routines. The files sample.dbl and sample.wsc comprise a sample client program. Routines are best compiled using -T to avoid passing null arguments created by macro expansions.</p>
<p>Note: this example was recently updated to make use of Synergy/DE version 8.3 features, and will no longer work with previous versions.</p>
<p>Another note: Synergy/DE version 9 plans include a much more robust version of container windows that will also be cross-platform compatible.� If you can wait for that release, you&#8217;d be far better off.</p>
<p>UPDATE:  Synergy/DE version 9 has been released, and it includes a much more robust version (which was written by yours truly).</p>
<div><a href="http://www.chipstips.com/download/syncontainer.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/J2NAjYsxUuQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=79</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=79</feedburner:origLink></item>
		<item>
		<title>Retrieving window handles of Synergy components</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/AbM5tgnWvGA/</link>
		<comments>http://www.chipstips.com/?p=84#comments</comments>
		<pubDate>Wed, 14 Sep 2005 00:25:12 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[handle]]></category>
		<category><![CDATA[syngethandle]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=84</guid>
		<description><![CDATA[To do very much at all with the Windows API, you need access to window handles. Window handles are very much like Synergy window ID&#8217;s, except that they aren&#8217;t. A window handle uniquely identifies each window on the desktop, including the desktop itself and any component windows (windows within windows). Most applications in Windows contain [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=84"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=84" data-text="Retrieving window handles of Synergy components" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D84&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=84";
			reddit_title = "Retrieving window handles of Synergy components";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=84";</script>
		<script type="text/javascript">var dzone_title = "Retrieving window handles of Synergy components";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>To do very much at all with the Windows API, you need access to window handles. Window handles are very much like Synergy window ID&#8217;s, except that they aren&#8217;t. A window handle uniquely identifies each window on the desktop, including the desktop itself and any component windows (windows within windows).  Most applications in Windows contain many component windows, and a Synergy application is no exception. Besides the obvious container window and Synergy windows, every input field is represented by one or more component windows.  Field prompts and display-only fields also have unique handles, as do drill buttons, hyperlinks, and standard buttons.</p>
<p>The downloadable code below includes routines for retrieving the window handles of Synergy windows, lists, buttons, and input field components (field controls, display-only fields, prompts, hyperlinks, and drill buttons).  For complete comprehension, see the copious comments contained therein.</p>
<p>Note: this example was recently updated to make use of features available in Synergy/DE version 8.3, and will no longer work with previous versions.</p>
<div><a href="http://www.chipstips.com/download/syngethandle.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/AbM5tgnWvGA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=84</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=84</feedburner:origLink></item>
		<item>
		<title>Determine what field the user is going to next</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/imT8YIea_rI/</link>
		<comments>http://www.chipstips.com/?p=97#comments</comments>
		<pubDate>Wed, 14 Sep 2005 00:25:12 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[synnxtfld]]></category>
		<category><![CDATA[tabbingorder]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=97</guid>
		<description><![CDATA[Sometimes in a UI Toolkit input window, when the user changes the value of a field, you want to be able to automatically skip over the next field without disabling it or changing it to read-only. However, you don&#8217;t want to do that if the user left the field by clicking on a specific field [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=97"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=97" data-text="Determine what field the user is going to next" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D97&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=97";
			reddit_title = "Determine what field the user is going to next";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=97";</script>
		<script type="text/javascript">var dzone_title = "Determine what field the user is going to next";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>Sometimes in a UI Toolkit input window, when the user changes the value of a field, you want to be able to automatically skip over the next field without disabling it or changing it to read-only.  However, you don&#8217;t want to do that if the user left the field by clicking on a specific field or by pressing Shift-Tab to go to the previous field.</p>
<p>The downloadable code below demonstrates how to determine what field the user is trying to access when the current field&#8217;s change method fires. The main-line program is in tfocus.dbl, which also contains the change method and the all-inportant routine get_focus_field.  Routines for obtaining window handles are in gethandle.dbl, which is also featured in another topic, <a href="http://www.chipstips.com/showtopic.asp?topic=syngethandle">Retrieving window handles of Synergy components</a></p>
<p>Note: this example was recently updated to use features available in Synergy/DE version 8.3, and will no longer work with previous versions.</p>
<div><a href="http://www.chipstips.com/download/synnxtfld.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/imT8YIea_rI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=97</feedburner:origLink></item>
		<item>
		<title>Controlling the application background color</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/dZV_GqVEhko/</link>
		<comments>http://www.chipstips.com/?p=106#comments</comments>
		<pubDate>Tue, 03 May 2005 18:29:18 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[colors]]></category>
		<category><![CDATA[synappclr]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=106</guid>
		<description><![CDATA[While Synergy/DE gives you control over the color of Synergy windows, it does not provide access to the color of the application background area. This always defaults to the current Display/Appearance setting for &#8220;Window background&#8221;. The best solution to this problem is to place a borderless window at pixel position 0,0 and make sure that [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=106"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=106" data-text="Controlling the application background color" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D106&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=106";
			reddit_title = "Controlling the application background color";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=106";</script>
		<script type="text/javascript">var dzone_title = "Controlling the application background color";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>While Synergy/DE gives you control over the color of Synergy windows, it does not provide access to the color of the application background area.  This always defaults to the current Display/Appearance setting for &#8220;Window background&#8221;.</p>
<p>The best solution to this problem is to place a borderless window at pixel position 0,0 and make sure that it fills the application space.  In the example you can download below, we size the window to the size of the screen. This insures that even if the user maximizes the application window, no area of the background will peek out from behind our window. The  example is written specifically for Windows platforms. The same approach  would work for color-enabled cell-based environments, with the Windows-specific  code commented out.</p>
<p>The only downside to this approach is that any text displayed in the application background (via WRITES or DISPLAY to the terminal channel) will not be visible, because it is occluded by our background window. Instead,  you must display it to the background window after sizing the latter appropriately.  Because of this restriction, you might think that the best solution would have been to subclass the application window, as in the topic <a href="http://www.chipstips.com/showtopic.asp?topic=synsubclass">&#8220;Subclassing Synergy windows&#8221;</a>. But as it turns out, there is no way for your subclass procedure to gain access to the text that should be displayed in the window, and the inherited Synergy method for displaying the text would overwrite the background color for the area that the text occupies.</p>
<div><a href="http://www.chipstips.com/download/synappclr.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/dZV_GqVEhko" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=106</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=106</feedburner:origLink></item>
		<item>
		<title>Using UI Toolkit windows for print formatting</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/KtIJpuwXmrE/</link>
		<comments>http://www.chipstips.com/?p=102#comments</comments>
		<pubDate>Thu, 20 Sep 2001 18:19:58 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[dibol]]></category>
		<category><![CDATA[interchangegroup]]></category>
		<category><![CDATA[legacy]]></category>
		<category><![CDATA[printapi]]></category>
		<category><![CDATA[printing]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[stuartbrierley]]></category>
		<category><![CDATA[synprintwnd]]></category>
		<category><![CDATA[xfserverplus]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=102</guid>
		<description><![CDATA[In most legacy applications written in Synergy (or DIBOL), you will find print routines that format the printed output in code. For example, something like pline(1,6) = custno, "XXXXXX" pline(9,38) = cname pline(40,52) = ccrlm, "$,$$$,$$X.XX-" call print What a shame. Applications that use the Synergy Repository already have data formatting rules stored there. Furthermore, [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=102"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=102" data-text="Using UI Toolkit windows for print formatting" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D102&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=102";
			reddit_title = "Using UI Toolkit windows for print formatting";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=102";</script>
		<script type="text/javascript">var dzone_title = "Using UI Toolkit windows for print formatting";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>In most legacy applications written in Synergy (or DIBOL), you will find print routines that format the printed output in code.  For example, something like</p>
<blockquote><p><code> 	pline(1,6) = custno, "XXXXXX"<br />
pline(9,38) = cname<br />
pline(40,52) = ccrlm, "$,$$$,$$X.XX-"<br />
call print </code></p></blockquote>
<p>What a shame.  Applications that use the Synergy Repository already have data formatting rules stored there.  Furthermore, you can use the Synergy Composer to visually lay out windows that arrange the data into columns.  If only you could use that same technology for printing.</p>
<p>Well, you can.  Download the code below for an example of how to use Synergy UI Toolkit windows for formatting printed output.  This idea was first invented by Stuart Brierley at Interchange Group (formerly Servasure) in Nottingham, UK.  First, you display a data structure into an input window, which formats all of the fields.  Then you use the w_info subfunction WI_XFR to extract the text from the window for printing.  A simple but powerful concept.</p>
<p>You may object, &#8220;But I can&#8217;t use this approach with xfServerPlus, because it doesn&#8217;t support Synergy windows.&#8221;  See <a href="http://www.chipstips.com/showtopic.asp?topic=synxfdbr">Using dbr.exe for xfServerPlus services</a> for a solution to that problem.</p>
<p>The example is written for Windows, using the Synergy Windows Print API.  You could, of course, modify that layer of the routines to use other mechanisms that would be portable to other platforms. The example is also much simplified from many real-world printing systems that I have developed or been involved in developing. Some of the features that could be added to it include: lining up columns in a proportional font, vertical pitch control, automatic font sizing, and support for footers, among others.  It does support changing the font within a document, multi-line detail items, and automatic page advance when the next detail item won&#8217;t fit.  One of the most interesting features it contains is the use of input field display methods to handle special fields such as report date, time, and page number.</p>
<p>To build the example, set the environment variable CUSTRPS to &#8220;rpsmain.ism,rpstext.ism&#8221;.  Compile printwnd.wsc using Script to printwnd.ism.  Compile print.dbl and printwnd.dbl using the &#8220;-X&#8221; option (presume ^val functions).  Link with printwnd as the main module, including WND:tklib.elb.  The example previews a report based on the included &#8220;customer&#8221; data file, with option to print.</p>
<div><a href="http://www.chipstips.com/download/synprintwnd.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/KtIJpuwXmrE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=102</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=102</feedburner:origLink></item>
		<item>
		<title>Sorting ActiveX lists by column</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/jEGEjyeWGDc/</link>
		<comments>http://www.chipstips.com/?p=107#comments</comments>
		<pubDate>Thu, 20 Sep 2001 18:19:58 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[ActiveX]]></category>
		<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[activexlist]]></category>
		<category><![CDATA[axlsort]]></category>
		<category><![CDATA[qsort]]></category>
		<category><![CDATA[sorting]]></category>
		<category><![CDATA[synlistsort]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=107</guid>
		<description><![CDATA[The ActiveX list control, available in the Synergy/DE UI Toolkit on Windows platforms, allows you to create columnar lists with button-like headings. Most lists of this sort on Windows also allow you to click on one of the headings to sort the list by that column. Unfortunately, because the Synergy list API loads items on [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=107"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=107" data-text="Sorting ActiveX lists by column" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D107&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=107";
			reddit_title = "Sorting ActiveX lists by column";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=107";</script>
		<script type="text/javascript">var dzone_title = "Sorting ActiveX lists by column";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>The ActiveX list control, available in the Synergy/DE UI Toolkit on Windows platforms, allows you to create columnar lists with button-like headings.  Most lists of this sort on Windows also allow you to click on one of the headings to sort the list by that column.  Unfortunately, because the Synergy list API loads items on demand and does not control the order of loading, the Synergy Toolkit cannot sort the items automatically.</p>
<p>There is a solution, however, as the downloadable example below demonstrates.  Create an event method for the left click event on the list.  In that method, make sure that the click occurred on a column heading, then signal an event back to the list processing routine to indicate what column heading was clicked.  In response to that, restart the list and load the items in the proper order.</p>
<p>The example uses a sorted temporary file, but other approaches will work as well.  If all of the items will fit into an array in memory, XCALL QSORT of the array would be the best and fastest alternative.  Another option would be to have alternate keys on the original ISAM file that correspond to each of the possible sort orders.</p>
<p>Note: A far more excellent version has been posted on the <a href="http://resourcecenter.synergex.com/devres/code-exchange.aspx">Synergy/DE Code Exchange</a> (<a href="http://resourcecenter.synergex.com/devres/code-exchange-details.aspx?id=66">axlsort.zip</a>).  It was written by yours truly, natch.  You must be a supported <a href="http://resourcecenter.synergex.com/helpdesk/default.aspx">HelpDesk</a> customer to access Code Exchange.</p>
<div><a href="http://www.chipstips.com/download/synlistsort.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/jEGEjyeWGDc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=107</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=107</feedburner:origLink></item>
		<item>
		<title>Using dbr.exe for xfServerPlus services</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/q2vGVVlwelU/</link>
		<comments>http://www.chipstips.com/?p=117#comments</comments>
		<pubDate>Wed, 12 Sep 2001 18:06:36 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[dbr]]></category>
		<category><![CDATA[dbs]]></category>
		<category><![CDATA[synxfdbr]]></category>
		<category><![CDATA[xfserverplus]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=117</guid>
		<description><![CDATA[Mostly for performance reasons, Synergy/DE&#8217;s xfServerPlus product uses a special version of the Synergy runtime for processing remote execution requests. This runtime is dbs.exe, which has all of the user-interface features stripped out, except for limited console I/O. In most cases, dbs.exe provides lightweight support for all you need to do on an application server. [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=117"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=117" data-text="Using dbr.exe for xfServerPlus services" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D117&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=117";
			reddit_title = "Using dbr.exe for xfServerPlus services";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=117";</script>
		<script type="text/javascript">var dzone_title = "Using dbr.exe for xfServerPlus services";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>Mostly for performance reasons, Synergy/DE&#8217;s xfServerPlus product uses a special version of the Synergy runtime for processing remote execution requests.  This runtime is dbs.exe, which has all of the user-interface features stripped out, except for limited console I/O.  In most cases, dbs.exe provides lightweight support for all you need to do on an application server.</p>
<p>However, some features of the Synergy runtime that were developed for user interface support can be used in a non-interactive way to provide useful server-side features.  One example is an approach to creating printed output that uses Synergy UI Toolkit windows to format the fields (via I_DISPLAY) and then extracts the formatted text to send it to the printer (see <a href="http://www.chipstips.com/showtopic.asp?topic=synprintwnd"> Using UI Toolkit windows for print formatting</a>).  Unfortunately, Synergy Windows (and therefore Toolkit windows) are not supported by dbs.exe.</p>
<p>Not to worry.  You can create a second xfServerPlus service that uses dbr.exe (the full Synergy runtime) instead of dbs.exe.  Simply create a new service with a unique port number (the Synergy Configuration Program in version 7.3 and up is the easiest way to do this), and in the environment settings for the service set XFPL_DBR=1.  This instructs xfServerPlus to use dbr.exe instead of dbs.exe. Connect to this service using its unique port number, and you&#8217;re in. The terminal number (%tnmbr) for the process is still -1 (indicating a non-UI mode).  If you need to distinguish this process from a dbs.exe session, set your own custom environment variable(s) in the environment settings for each xfServerPlus service.</p>
<p>Of course, dbr.exe has considerably more overhead, both in memory/resource usage and in startup time, so you don&#8217;t want to use it if you don&#8217;t need it. For applications that require Synergy Windows support, however, it sure beats rewriting them.</p>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/q2vGVVlwelU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=117</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=117</feedburner:origLink></item>
		<item>
		<title>Moving, sizing and changing the text of buttons</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/Cf11Ex9VoWc/</link>
		<comments>http://www.chipstips.com/?p=96#comments</comments>
		<pubDate>Fri, 06 Jul 2001 18:56:42 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[synbtnsize]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=96</guid>
		<description><![CDATA[Push-buttons on Synergy/DE Toolkit windows always have the same size (70 x 23 pixels), they are always uniformly arranged along either the bottom or right side of the containing window, and there is no API for modifying the text of the button&#8217;s caption. Download the code below to see how to use the Windows API [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=96"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=96" data-text="Moving, sizing and changing the text of buttons" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D96&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=96";
			reddit_title = "Moving, sizing and changing the text of buttons";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=96";</script>
		<script type="text/javascript">var dzone_title = "Moving, sizing and changing the text of buttons";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>Push-buttons on Synergy/DE Toolkit windows always have the same size (70 x 23 pixels), they are always uniformly arranged along either the bottom or right side of the containing window, and there is no API for modifying the text of the button&#8217;s caption. Download the code below to see how to use the Windows API functions to override the size, position, and text of a button.</p>
<p>Please read the warnings in the comments at the top of the resize_button function. This function depends upon certain behaviors that are not guaranteed to be in future versions of the Toolkit.  Furthermore, any resizing of the containing window may cause the Toolkit to rearrange the buttons, and you&#8217;ll have to move them again.  For a more reliable way to place buttons anywhere you like, see <a href="http://www.chipstips.com/showtopic.asp?topic=synchildbtn"> Using Containers to Place Buttons Anywhere</a>.</p>
<div><a href="http://www.chipstips.com/download/synbtnsize.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/Cf11Ex9VoWc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=96</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=96</feedburner:origLink></item>
		<item>
		<title>Using containers to place buttons anywhere</title>
		<link>http://feedproxy.google.com/~r/ChipsTipsUiToolkit/~3/0Ob1HGuN9VI/</link>
		<comments>http://www.chipstips.com/?p=98#comments</comments>
		<pubDate>Fri, 06 Jul 2001 18:54:08 +0000</pubDate>
		<dc:creator>Sterling Camden</dc:creator>
				<category><![CDATA[SynergyDE]]></category>
		<category><![CDATA[UI Toolkit]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[containers]]></category>
		<category><![CDATA[paulfenton]]></category>
		<category><![CDATA[synchildbtn]]></category>
		<category><![CDATA[tabbingorder]]></category>

		<guid isPermaLink="false">http://www.chipstips.com/new/?p=98</guid>
		<description><![CDATA[The container-child relationship (see Creating container windows) can be employed to solve many different problems in Synergy/DE applications. This example from Paul Fenton of PHF Consultancy (with a little help from yours truly) demonstrates how you can use this principle to place pushbuttons anywhere you like on the window (on Windows platforms, of course). The [...]]]></description>
				<content:encoded><![CDATA[<div class="socialize-in-content socialize-in-content-right"><div class="socialize-in-button socialize-in-button-right"><g:plusone size="tall" href="http://www.chipstips.com/?p=98"></g:plusone></div><div class="socialize-in-button socialize-in-button-right"><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.chipstips.com/?p=98" data-text="Using containers to place buttons anywhere" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-right"><iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.chipstips.com%2F%3Fp%3D98&amp;send=&amp;layout=box_count&amp;width=50&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=arial&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.chipstips.com/?p=98";
			reddit_title = "Using containers to place buttons anywhere";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-right"><script type="text/javascript">var dzone_url = "http://www.chipstips.com/?p=98";</script>
		<script type="text/javascript">var dzone_title = "Using containers to place buttons anywhere";</script>
		<script type="text/javascript">
			<!-- 
			var dzone_style = "1";
			//-->
		</script><script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script></div></div><p>The container-child relationship (see  <a href="http://www.chipstips.com/showtopic.asp?topic=syncontainer">Creating container windows</a>) can be employed to solve many different problems in Synergy/DE applications. This example from Paul Fenton of <a href="http://www.p-h-f.co.uk/">PHF Consultancy</a> (with a little help from yours truly) demonstrates how you can use this principle to place pushbuttons anywhere you like on the window (on Windows platforms, of course).</p>
<p>The sample contains a test program and a routine called &#8220;button_anywhere&#8221; that allows you to create a standard-sized button at any row/column coordinate within a window.  The only limitation is that the button cannot be in the tabbing order for the window, and so also cannot be the default button.  However, you can still use keyboard (Alt-letter) shortcuts, or click the button with the mouse.</p>
<div><a href="http://www.chipstips.com/download/synchildbtn.zip"><img src="http://www.chipstips.com/images/download.gif" /></a></div>
<img src="http://feeds.feedburner.com/~r/ChipsTipsUiToolkit/~4/0Ob1HGuN9VI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chipstips.com/?feed=rss2&amp;p=98</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chipstips.com/?p=98</feedburner:origLink></item>
	</channel>
</rss>
