View previous topic :: View next topic |
Author |
Message |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Fri Feb 23, 2007 10:18 pm Post subject: keyboard inputs to %bv |
|
|
When a %bv control is used, pressing a letter key jumps you to a branch starting with that letter, say for example you have 2 items "Michael" and "Mary" (with Michael first), then pressing M jumps to "Michael" and the second press goes to "Mary", the third press back to "Michael" and so forth. This strikes me as intentional, not random. Closed-up branches aren't included - until they are opened (which the space bar does) ... and then they are. This is an implicit type of accelerator key behaviour that I couldn't see documented anywhere.
All well and good until one uses the cursor keys, whereupon we jump between entries with no discernable pattern, (including highlighting buttons) eventually ending up with an Access Violation error.
After the mouse, cursor keys are the next most intuitive way to go up and down a %bv list, so this interesting behaviour has to be handled. Presumably the correct method is to call ADD_KEYBOARD_MONITOR@ abd deal with the key presses as they occur. Can the ADD_KEYBOARD_MONITOR@ callback simply throw the keypresses away as they are caught? Since the control clearly does handle keyboard input, what precisely is it doing in response to cursor keys please?
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8036 Location: Salford, UK
|
Posted: Sat Feb 24, 2007 8:50 am Post subject: |
|
|
I haven't time to answer your question in full but here are my initial thoughts.
%bv is simply a wrapper for the Microsoft Treeview control that you get in Windows Explorer etc. The behaviour is that produced by the Microsoft control which is either widely known or is picked up by trial and error.
If you can post a simple program that illustrates the access violation then I will take a look at it to see what is going wrong. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Sat Feb 24, 2007 11:39 am Post subject: |
|
|
Paul,
The stuff I sent you during the week (to your private e mail) displays precisely this behaviour. I'm presuming now that it didn't arrive, so I'll send it again -- this time it will come from my home rather from the Uni.
Regards
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8036 Location: Salford, UK
|
Posted: Thu Mar 01, 2007 3:39 pm Post subject: |
|
|
Eddie
I have finally found time to look at your application.
I cannot think of a simple way to get a border around the html text. The lack of a border must be due to %ob/%cb because %ht works fine without it. The alternative to using %ob/%cb would be to use a multidocument approach via child windows and %aw.
I cannot get your application to fail when using cursor keys so maybe this is OS dependent (I am using Windows XP). The problem is more likely to be down to the Microsoft control rather than the ClearWin+ wrapper. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Thu Mar 01, 2007 6:33 pm Post subject: |
|
|
Hi Paul,
Many thanks for looking at it. I've tried that little app on several computers, mostly running XP Prof, but one with XP Home, and whether if gets the Asccess violation on the first keypress, or after several, seems to be random. For example, last night I demonstrated it to a friend, and it didn't fall over until about 10 or 12 presses of the cursor keys - on Saturday, it was falling over at the first keypress on my XP computer at home. I wonder if I can impose on you to have another go ... perhaps use the cursor keys until it crashes.
An erratic problem is always more difficult to deal with that one that happens every time. If it really doesn't crash for you, then perhaps I need to upgrade to v5 from 4.9 - I'm assuming that you are using the latest salflibc.dll. I presume that you didn't recompile my .EXE, just ran it, so there could be some difference in the dll.
I decided to go for putting my help info properly in a CHM file, as I don't want my application to fall over with a system message however infrequently. Some months ago you recommended WinExec to someone - I have used start_pprocess@ to launch hh.exe, ad that seems to work. Are there benefits to WinExec over start_pprocess@? Is there a way to see if HH.exe is already running, as presumably one can start multiple instances of HH, and it would be nice to be able to inhibit that.
Regards
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8036 Location: Salford, UK
|
Posted: Thu Mar 01, 2007 11:26 pm Post subject: |
|
|
Eddie
I have tried your application again, this time using Windows 2000, and I still cannot get it to fail (even when I hold down an arrow key).
START_PROCESS@ uses CreateProcess. WinExec is the API predecessor to CreateProcess. Use whichever is more convenient. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8036 Location: Salford, UK
|
Posted: Fri Mar 02, 2007 8:24 am Post subject: |
|
|
The simplest way to test for existing instances of hh.exe is probably to use the Windows API function FindWindow. One of its arguments can be set to NULL (i.e. CORE4(0) in FTN95) and the other one is used to find either the caption or the Classname. The caption is unlikely to be static so you will need to use the Classname. This can be obtained by using a Spy utility such as that provided by Microsoft. |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Sat Mar 03, 2007 10:00 am Post subject: %bv - Access violation |
|
|
I am also getting random behaviour with the %bv control when the cursor keys are pressed, resulting in access violations.
Compiled using FTN95 5.01.0, running on Windows 2000. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Sat Mar 03, 2007 11:58 am Post subject: |
|
|
Hmmm� curioser and curioser. I spent (parts of) Friday afternoon and (all of) Friday evening exploring the problem. I tried my simple code on a dozen or so machines at my Uni, and then in the evening, all five at home. They all give me an Access Violation after a certain amount of cursor key pressing � up down left right, although sometimes the odd mouse click on the %bv nodes helps it along. The machines are a mix of RM desktops, Samsung and Acer notebooks, and some self-builds. They use a mix of Intel and AMD cpus, and nVidia, ATI, and onboard intel and Via video chips. Since the common factor (apart from all using XP) is the presence of Macafee and MS Office, I did a fresh install of Windows XP on a machine, and tried that. I downloaded FTN95pe (to see if using the latest salflibc.dll would help), and I also recompiled with that.
Whatever computers you have at Silverfrost, they are golden!
I had to strip the application right down to a single %bv command, with no %mi icon, no 3d look etc (and I�m only using the 3d look because of the dratted incomplete %rd boxes if I don�t!) before the access violation effect would go away.
I would have been much, much, happier to have discovered that it was my incomplete understanding of the instructions � but that can�t be the case or my code wouldn�t have worked for you. %bv goes into my personal �Room 101�.
The advice on seeing if the application launched by start_pprocess@ is still active is intriguing. It is clearly far more involved than I want to get into, and I will let users of my program launch as many copies of HH.exe as they wish. However, I suggest that something between start_process@ and start_pprocess@ could be useful, with perhaps a 3rd parameter that could be used to check if the process was active (so that duplicates are not launched), and stop it if required.
Ian: Thanks. I was beginning to feel very lonely!
Eddie |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Sun Mar 04, 2007 3:20 pm Post subject: %bv |
|
|
I think you need to get out more!
Don't we all |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Wed Mar 07, 2007 9:52 am Post subject: |
|
|
Ian,
I'm taking your advice, and getting out today.
I just can't leave this business alone. I've discovered that in a %ht window (which I'm using in connection with %bv to make a primitive help system), if there is a %ts in operation, it affects the hypertext "body text", but not the H1 ... Hn headings! The font is unaltered (Times) even if a %fn is in operation too.
The %ts is there as part of a "DO NOT TOUCH THE KEYBOARD" message, which is the only way I can overcome the problem.
Hmmm....
Eddie |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Wed Mar 07, 2007 1:14 pm Post subject: %ht fornt size |
|
|
Try using html markup codes, the %ht format accets a subset of these. For a reference try http://www.echoecho.com/htmltext02.htm
Here is the first section of your help file with text size modification, although the face=arial does not seem to work.
Code: |
<HTML><DOCNAME="HELPINTRO"><H1><font size="5">Introduction</font></H1>
<P>This is The main help file.This is The main help file. This is The main help file. This is The main help file. This is The main help file. This is The main help file.
<br><font size="7" face="arial">DO NOT TOUCH THE KEYBOARD<br></font>
This is The main help file. This is The main help file.This is The main help file. This is The main help file. This is The main help file. This is The main help file.
This is The main help file. This is The main help file. This is The main help file. This is The main help file. </P></HTML>
|
Regards
Ian |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Thu Mar 08, 2007 10:42 am Post subject: |
|
|
Well well well. What a duffer I am. I looked at the %ht section in the FTN95 help file, and assumed that only the tags listed would work. I will explore to see what else is there.
I wonder if there ought to be a forum for serendipitous discoveries of things not in the documentation!
Eddie |
|
Back to top |
|
|
|