There have not been a great number of problem reports with the beta of Behold so far, but it’s amazing how diverse these problems are. They cover all ends of the spectrum. Some are easy to find and others I don’t know what’s going on yet and require more debugging. Some are easy to fix, and others are very onerous.
I’ve fixed a few already and I’m in the process of fixing about 6 others at the same time.
One involves something that Delphi itself seems to have a problem with. I’ve got a question on StackOverflow for it and one of the resident experts there is helping me out.
Another is a problem with my ElXTree component, and I’ve reported the problem to the LMD people on their newsgroup, and they are helping me with that.
Then I’m debugging some bugs that crash Behold and fixing those. One is simply using the arrow up key to scroll up the window. I had thought I had debugged my Virtualization of the Richview window, but I guess I missed that.
Then there is one that links to the child of a person, but that child is actually the user’s parents. That one is also surprising to me. I checked the GEDCOM thoroughly and it appears to be correct. My linking of this sort has been working correctly for years, and I’m very perplexed by this one. I’ll be interested in seeing the reason.
Then there was someone reporting something in Windows 7 that I can’t reproduce in Vista. So I’ve been loading both Windows 7 and Windows XP into Virtual PC windows so I can reproduce the error and ensure that Behold runs okay under the two systems, without needing multiple computers. (I absolutely love Virtual PC!)
So lots going on here and I’m making good progress. Hopefully in a week I’ll get out a new beta with most of the problems fixed.
Joined: Tue, 14 Oct 2008
20 blog comments, 0 forum posts
Posted: Thu, 10 Dec 2009
Hi Louis
Regarding your shortcut problem, here’s a link that might be helpful:
http://www.codenewsfast.com/isapi/isapi.dll/article?id=9361D893&article=2318724
There are similar issues when using TFrame, by the way.
Regards
Uwe
Joined: Tue, 14 Oct 2008
20 blog comments, 0 forum posts
Posted: Thu, 10 Dec 2009
Louis
Sorry, I just saw that the above link timed out. Here’s the original text:
> Does anyone understand when and how action lists fire?
> An application I’m working on (developed by others, so my intimate knowledge
> is limited) uses action lists as a methodology of invoking Fx key actions on
> various frames. This app has only the main form descending from the Tform
> class, everything else is something of the frame variety. Each module of
> the app has it’s own frame on which one or more other frames and panels
> live. Each module (frame) has an action list, a pop-up menu list and/or a
> number of toolbuttons.
> The problem arises when I want to do something different for, say.. the ‘F6′
> key, in one module than in another. If I start in one of the inner modules
> and press F6, the proper event fires most of the time. If I start in
> another module and press F6, the proper thing for that frame happens again.
> If I go back to the first module I tried and press F6 again, the action from
> the other module fires. This behavior occurs usually, but not all the time.
> Sometimes after a series of the above errors, the behavior starts acting as
> 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.
Joined: Sun, 9 Mar 2003
288 blog comments, 245 forum posts
Posted: Thu, 10 Dec 2009
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.
Joined: Sun, 9 Mar 2003
288 blog comments, 245 forum posts
Posted: Thu, 10 Dec 2009
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.
Joined: Sun, 9 Mar 2003
288 blog comments, 245 forum posts
Posted: Thu, 10 Dec 2009
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.
Joined: Tue, 14 Oct 2008
20 blog comments, 0 forum posts
Posted: Thu, 10 Dec 2009
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.
Joined: Sun, 9 Mar 2003
288 blog comments, 245 forum posts
Posted: Thu, 10 Dec 2009
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.
Joined: Tue, 14 Oct 2008
20 blog comments, 0 forum posts
Posted: Thu, 10 Dec 2009
> 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.