<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: All Directions At Once</title>
	<atom:link href="http://www.beholdgenealogy.com/blog/?feed=rss2&#038;p=724" rel="self" type="application/rss+xml" />
	<link>http://www.beholdgenealogy.com/blog/?p=724</link>
	<description>the Development of my Genealogy Program named Behold</description>
	
		<image>
	<link>http://www.beholdgenealogy.com/blog</link>
	<url>http://www.beholdgenealogy.com/blog/../beholdblog.gif</url>
	</image>
	<copyright>Comments by Louis Kessler are Copyright 2000-2013 Louis Kessler, All Rights Reserved.  Comments by others belong to the people who made them.</copyright>
		<item>
		<title>By: uwe</title>
		<link>http://www.beholdgenealogy.com/blog/?p=724#comment-124</link>

				<dc:creator>uwe</dc:creator>

		<pubDate>Fri, 11 Dec 2009 02:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.beholdgenealogy.com/blog/?p=724#comment-124</guid>
		<description>&#62; But, if you want to avoid things too “time consuming”, then you’ll do well to avoid StackOverflow

It's not that I want to ... I *have* to avoid things that are too time consuming. Running my own business eats up most of my time anyway.</description>
		<content:encoded><![CDATA[<p>&gt; But, if you want to avoid things too “time consuming”, then you’ll do well to avoid StackOverflow</p>
<p>It&#8217;s not that I want to &#8230; I *have* to avoid things that are too time consuming. Running my own business eats up most of my time anyway.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Kessler</title>
		<link>http://www.beholdgenealogy.com/blog/?p=724#comment-123</link>

				<dc:creator>Louis Kessler</dc:creator>

		<pubDate>Fri, 11 Dec 2009 02:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.beholdgenealogy.com/blog/?p=724#comment-123</guid>
		<description>Uwe:

StackOverflow's a great place for Delphi programmers. I've got lots of great answers there, and have helped many people myself. For me, it's the social network for programmers. But, if you want to avoid things too "time consuming", then you'll do well to avoid StackOverflow. It can be addictive.</description>
		<content:encoded><![CDATA[<p>Uwe:</p>
<p>StackOverflow&#8217;s a great place for Delphi programmers. I&#8217;ve got lots of great answers there, and have helped many people myself. For me, it&#8217;s the social network for programmers. But, if you want to avoid things too &#8220;time consuming&#8221;, then you&#8217;ll do well to avoid StackOverflow. It can be addictive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uwe</title>
		<link>http://www.beholdgenealogy.com/blog/?p=724#comment-122</link>

				<dc:creator>uwe</dc:creator>

		<pubDate>Fri, 11 Dec 2009 02:24:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.beholdgenealogy.com/blog/?p=724#comment-122</guid>
		<description>Louis

Glad I could help. I was dealing with the same problem as you just a few weeks ago and remembered where I found the solution. Speaking of: I'm not on StackOverflow, so I would appreciate if you could add the reference to the thread. Thanks.

The Delphi Pool: yeah, that was an old project of mine. Although it was very successful (1 million+ page views) I had to stop it because it was too time consuming. Pity, really.</description>
		<content:encoded><![CDATA[<p>Louis</p>
<p>Glad I could help. I was dealing with the same problem as you just a few weeks ago and remembered where I found the solution. Speaking of: I&#8217;m not on StackOverflow, so I would appreciate if you could add the reference to the thread. Thanks.</p>
<p>The Delphi Pool: yeah, that was an old project of mine. Although it was very successful (1 million+ page views) I had to stop it because it was too time consuming. Pity, really.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Kessler</title>
		<link>http://www.beholdgenealogy.com/blog/?p=724#comment-121</link>

				<dc:creator>Louis Kessler</dc:creator>

		<pubDate>Fri, 11 Dec 2009 01:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.beholdgenealogy.com/blog/?p=724#comment-121</guid>
		<description>Uwe: Just tested it out. That  "IsShortcut" bit of code by Peter Below was the solution!! I just had to modify "ctrl is TCustomFrame" to "ctrl is TControl" and it works perfect. That bug is solved! Thanks so much.</description>
		<content:encoded><![CDATA[<p>Uwe: Just tested it out. That  &#8220;IsShortcut&#8221; bit of code by Peter Below was the solution!! I just had to modify &#8220;ctrl is TCustomFrame&#8221; to &#8220;ctrl is TControl&#8221; and it works perfect. That bug is solved! Thanks so much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Kessler</title>
		<link>http://www.beholdgenealogy.com/blog/?p=724#comment-120</link>

				<dc:creator>Louis Kessler</dc:creator>

		<pubDate>Fri, 11 Dec 2009 00:30:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.beholdgenealogy.com/blog/?p=724#comment-120</guid>
		<description>By the way, Uwe. Wasn't this your DelphiPool?  http://web.archive.org/web/20040211160704/http://www.lmc-mediaagentur.de/dpool.htm

I remember it now.</description>
		<content:encoded><![CDATA[<p>By the way, Uwe. Wasn&#8217;t this your DelphiPool?  <a href="http://web.archive.org/web/20040211160704/http://www.lmc-mediaagentur.de/dpool.htm" rel="nofollow">http://web.archive.org/web/20040211160704/http://www.lmc-mediaagentur.de/dpool.htm</a></p>
<p>I remember it now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Kessler</title>
		<link>http://www.beholdgenealogy.com/blog/?p=724#comment-119</link>

				<dc:creator>Louis Kessler</dc:creator>

		<pubDate>Fri, 11 Dec 2009 00:25:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.beholdgenealogy.com/blog/?p=724#comment-119</guid>
		<description>Uwe: You're not on StackOverflow, are you? If so, please add your reference to this as an answer to my post. It might lead to more thoughts from the others there that might help. If not, I'll add a reference to that link there myself.

I found an active link to the thread you're talking about: http://groups.google.com/group/borland.public.delphi.objectpascal/browse_thread/thread/51219ca2accbc1b5/55a68169b70198fe?pli=1

Peter's reply to Tom Below in that thread is also interesting: "... and it didn't work (well, did and didn't)". I'm not quite sure what that means, but I'll try the ideas in that discussion tonight.</description>
		<content:encoded><![CDATA[<p>Uwe: You&#8217;re not on StackOverflow, are you? If so, please add your reference to this as an answer to my post. It might lead to more thoughts from the others there that might help. If not, I&#8217;ll add a reference to that link there myself.</p>
<p>I found an active link to the thread you&#8217;re talking about: <a href="http://groups.google.com/group/borland.public.delphi.objectpascal/browse_thread/thread/51219ca2accbc1b5/55a68169b70198fe?pli=1" rel="nofollow">http://groups.google.com/group/borland.public.delphi.objectpascal/browse_thread/thread/51219ca2accbc1b5/55a68169b70198fe?pli=1</a></p>
<p>Peter&#8217;s reply to Tom Below in that thread is also interesting: &#8220;&#8230; and it didn&#8217;t work (well, did and didn&#8217;t)&#8221;. I&#8217;m not quite sure what that means, but I&#8217;ll try the ideas in that discussion tonight.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uwe</title>
		<link>http://www.beholdgenealogy.com/blog/?p=724#comment-118</link>

				<dc:creator>uwe</dc:creator>

		<pubDate>Thu, 10 Dec 2009 22:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.beholdgenealogy.com/blog/?p=724#comment-118</guid>
		<description>Louis

Sorry, I just saw that the above link timed out. Here's the original text:

&#62; Does anyone understand when and how action lists fire?
&#62; An application I'm working on (developed by others, so my intimate knowledge
&#62; is limited) uses action lists as a methodology of invoking Fx key actions on
&#62; various frames. This app has only the main form descending from the Tform
&#62; class, everything else is something of the frame variety. Each module of
&#62; the app has it's own frame on which one or more other frames and panels
&#62; live. Each module (frame) has an action list, a pop-up menu list and/or a
&#62; number of toolbuttons.
&#62; The problem arises when I want to do something different for, say.. the 'F6'
&#62; key, in one module than in another. If I start in one of the inner modules
&#62; and press F6, the proper event fires most of the time. If I start in
&#62; another module and press F6, the proper thing for that frame happens again.
&#62; If I go back to the first module I tried and press F6 again, the action from
&#62; the other module fires. This behavior occurs usually, but not all the time.
&#62; Sometimes after a series of the above errors, the behavior starts acting as
&#62; I would expect. 

Tom,

key handling in Delphi is fairly complex. The sequence of events as they 
relate to your question are:

- user hits a key, a keydown message is placed into the message queue 
- Application.ProcessMessage gets it from the queue, feeds it through a 
  number of Application methods, one of these is IsKeyMsg.
- IsKeyMsg sends the key down as a CN_KEYDOWN message to the control 
  with focus.
- TwinControl.CNKeyDown calls TwinControl.IsMenuKey
- after checking the popup menu of the control (if any) for the shortcut
  without success IsMenuKey locates the controls parent form and calls its
  IsShortcut method.
- Tcustomform.IsShortcut first checks the forms menu, if any. If not 
  finding a matching shortcut it then walks over the action lists registered
  with the form and calls each lists IsShortcut method, which in turn walks
  over the actions in the list looking for a shortcut.
- If nobody wanted the key as shortcut yet a CM_APPKEYDOWN message is send to
  the Application window for the key, TApplication.WndProc handles this by
  calling the main forms IsShortCut (if the window is enabled only, not when 
  a modal form is up). Note that this means that the main forms IsShortcut
  will be called twice if the active control is on the main form and the 
  key is not a shortcut!
  
The critical part for you is the sequence in which TCustomform.IsShortcut 
walks over the action lists. A TFrame will add its TActionlist to the parent 
forms actionlists list when the parent is assigned to its Parent property (see 
TCustomFrame.SetParent) and remove it when the Parent changes or the 
actionlist is destroyed. As far as i see the sequence of the actionlists does 
not change afterwards. So if you have several enabled frames on your form 
their action lists will be queried in the sequence the frames were added to 
the form, so the form containing the active control may not be the first to be 
queried. 

What this boils down to is this: if you have colliding shortcuts that may act 
differently on different frames on your form then you need to override the 
forms IsShortcut method and take steps there to make sure the frame the active 
control is on gets first crack at the shortcut. Something like this:

 Function TMyform.IsShortcut( var Message: TWMKey): Boolean; { override }
 Var
   ctrl: TWinControl;
   comp: TComponent;
   i: Integer;
 Begin
   ctrl := ActiveControl;
   If ctrl  Nil Then Begin
     Repeat
       ctrl := ctrl.Parent 
     Until (ctrl = nil) or (ctrl Is TCustomframe);
     If ctrl  nil Then Begin
       For i:= 0 To ctrl.componentcount-1 Do Begin
         comp:= ctrl.Components[i];
         If comp Is TCustomActionList Then Begin
           result := TCustomActionList(comp).IsShortcut( message );
           If result Then
             Exit;
         End;
       End; 
     End;
   End;
   inherited;
 End; 
 
Untested!

For performance reason you may want to make sure the actionlist on each frame 
is the first item created (set it to first in the designers createorder menu) 
and you may also want to assume only one action list will be on a frame and 
Exit the for loop once you found it, regardless of Result.</description>
		<content:encoded><![CDATA[<p>Louis</p>
<p>Sorry, I just saw that the above link timed out. Here&#8217;s the original text:</p>
<p>&gt; Does anyone understand when and how action lists fire?<br />
&gt; An application I&#8217;m working on (developed by others, so my intimate knowledge<br />
&gt; is limited) uses action lists as a methodology of invoking Fx key actions on<br />
&gt; various frames. This app has only the main form descending from the Tform<br />
&gt; class, everything else is something of the frame variety. Each module of<br />
&gt; the app has it&#8217;s own frame on which one or more other frames and panels<br />
&gt; live. Each module (frame) has an action list, a pop-up menu list and/or a<br />
&gt; number of toolbuttons.<br />
&gt; The problem arises when I want to do something different for, say.. the &#8216;F6&#8242;<br />
&gt; key, in one module than in another. If I start in one of the inner modules<br />
&gt; and press F6, the proper event fires most of the time. If I start in<br />
&gt; another module and press F6, the proper thing for that frame happens again.<br />
&gt; If I go back to the first module I tried and press F6 again, the action from<br />
&gt; the other module fires. This behavior occurs usually, but not all the time.<br />
&gt; Sometimes after a series of the above errors, the behavior starts acting as<br />
&gt; I would expect. </p>
<p>Tom,</p>
<p>key handling in Delphi is fairly complex. The sequence of events as they<br />
relate to your question are:</p>
<p>- user hits a key, a keydown message is placed into the message queue<br />
- Application.ProcessMessage gets it from the queue, feeds it through a<br />
  number of Application methods, one of these is IsKeyMsg.<br />
- IsKeyMsg sends the key down as a CN_KEYDOWN message to the control<br />
  with focus.<br />
- TwinControl.CNKeyDown calls TwinControl.IsMenuKey<br />
- after checking the popup menu of the control (if any) for the shortcut<br />
  without success IsMenuKey locates the controls parent form and calls its<br />
  IsShortcut method.<br />
- Tcustomform.IsShortcut first checks the forms menu, if any. If not<br />
  finding a matching shortcut it then walks over the action lists registered<br />
  with the form and calls each lists IsShortcut method, which in turn walks<br />
  over the actions in the list looking for a shortcut.<br />
- If nobody wanted the key as shortcut yet a CM_APPKEYDOWN message is send to<br />
  the Application window for the key, TApplication.WndProc handles this by<br />
  calling the main forms IsShortCut (if the window is enabled only, not when<br />
  a modal form is up). Note that this means that the main forms IsShortcut<br />
  will be called twice if the active control is on the main form and the<br />
  key is not a shortcut!</p>
<p>The critical part for you is the sequence in which TCustomform.IsShortcut<br />
walks over the action lists. A TFrame will add its TActionlist to the parent<br />
forms actionlists list when the parent is assigned to its Parent property (see<br />
TCustomFrame.SetParent) and remove it when the Parent changes or the<br />
actionlist is destroyed. As far as i see the sequence of the actionlists does<br />
not change afterwards. So if you have several enabled frames on your form<br />
their action lists will be queried in the sequence the frames were added to<br />
the form, so the form containing the active control may not be the first to be<br />
queried. </p>
<p>What this boils down to is this: if you have colliding shortcuts that may act<br />
differently on different frames on your form then you need to override the<br />
forms IsShortcut method and take steps there to make sure the frame the active<br />
control is on gets first crack at the shortcut. Something like this:</p>
<p> Function TMyform.IsShortcut( var Message: TWMKey): Boolean; { override }<br />
 Var<br />
   ctrl: TWinControl;<br />
   comp: TComponent;<br />
   i: Integer;<br />
 Begin<br />
   ctrl := ActiveControl;<br />
   If ctrl  Nil Then Begin<br />
     Repeat<br />
       ctrl := ctrl.Parent<br />
     Until (ctrl = nil) or (ctrl Is TCustomframe);<br />
     If ctrl  nil Then Begin<br />
       For i:= 0 To ctrl.componentcount-1 Do Begin<br />
         comp:= ctrl.Components[i];<br />
         If comp Is TCustomActionList Then Begin<br />
           result := TCustomActionList(comp).IsShortcut( message );<br />
           If result Then<br />
             Exit;<br />
         End;<br />
       End;<br />
     End;<br />
   End;<br />
   inherited;<br />
 End; </p>
<p>Untested!</p>
<p>For performance reason you may want to make sure the actionlist on each frame<br />
is the first item created (set it to first in the designers createorder menu)<br />
and you may also want to assume only one action list will be on a frame and<br />
Exit the for loop once you found it, regardless of Result.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uwe</title>
		<link>http://www.beholdgenealogy.com/blog/?p=724#comment-117</link>

				<dc:creator>uwe</dc:creator>

		<pubDate>Thu, 10 Dec 2009 16:26:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.beholdgenealogy.com/blog/?p=724#comment-117</guid>
		<description>Hi Louis

Regarding your shortcut problem, here's a link that might be helpful:
http://www.codenewsfast.com/isapi/isapi.dll/article?id=9361D893&#38;article=2318724

There are similar issues when using TFrame, by the way.

Regards
Uwe</description>
		<content:encoded><![CDATA[<p>Hi Louis</p>
<p>Regarding your shortcut problem, here&#8217;s a link that might be helpful:<br />
<a href="http://www.codenewsfast.com/isapi/isapi.dll/article?id=9361D893&amp;article=2318724" rel="nofollow">http://www.codenewsfast.com/isapi/isapi.dll/article?id=9361D893&amp;article=2318724</a></p>
<p>There are similar issues when using TFrame, by the way.</p>
<p>Regards<br />
Uwe</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.707 seconds -->
