Thank you and everyone else who has replied. I am converting an amateur radio logbook program from DOS to Windows. The original application of around 10,000 lines with "Lotus 123" like menus compiles in Harbour and runs under Windows but lacks a proper GUI and printing facilities. Having said that, when I use the program in a radio competition which also requires me to use the radio equipment and a morse key or microphone at the same time the GUI would be too time consuming and full control from the keyboard is much faster - if I can find or program the required controls. This is my current challenge!
I noticed that PageDown is missing from the On Key control list but is present in the Clipper 5.3 list.
Bob (UK callsign G3OOU, website www.g3oou.co.uk)
Although there's no OnKey for PgDn, I believe that you could use PgDn to invoke an associated procedure, such as to SetFocus on the "Save" or "Next" button, or however you've defined it, the nett effect of which would be to allow you to emulate the DOS_based Clipper input screen.
You could similarly assign procedures to UpArrow and DnArrow to set focus on the prior or subsequent TabStop.
For more on this, see the HMG-Help at:
"Guide To CA-Clipper"
Then scroll down to
"SET KEY Assign a procedure invocation to a key"
which, when clicked, displays the page on:
"SET KEY <nInkeyCode> TO [<idProcedure>]"
PgDn is Chr(3) and the InKey() code is K_PGDN. Make sure to " #Include 'inkey.ch' " if you use "K_PGDN" (advised!) rather than the ASCII Value.
I haven't tested it, but see no reason why it wouldn't work. (Famous last words, right?)
- Posts: 4452
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
BobFBurns wrote: I noticed that PageDown is missing from the On Key control list ...
Code: Select all
#include <hmg.ch> PROCEDURE Main() DEFINE WINDOW frmMain at 0, 0 WIDTH 400 HEIGHT 300 MAIN ON KEY ESCAPE ACTION ThisWindow.Release ON KEY PRIOR ACTION MsgBox( "Page Up" ) ON KEY NEXT ACTION MsgBox( "Page Down" ) END WINDOW // frmMain CENTER WINDOW frmMain ACTIVATE WINDOW frmMain RETURN // Main() *-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.-._.
Thanks for the suggestions. The initial problem is resolved. As advised in the previous post I also discovered that PgDn is known as NEXT and PgUp as PREVIOUS. The following code is one way to emulate the navigation process in Clipper. No doubt there are more elegant ways to code it but this does work.
set navigation extended /* Allow Return to move to next text box */
FldPtr := 1 /* Field number */
FldMax := 4 /* Maximum number of text boxes */
DEFINE WINDOW Win_1 ;
AT 0, 0;
WIDTH 600 ;
HEIGHT 300 ;
TITLE 'HMG Test';
on key UP of Win_1 action kytest(1) /* cursor up */
on key DOWN of Win_1 action kytest(2) /* cursor down */
on key Next of Win_1 action kytest(3) /* PgDn */
@ 40, 10 label label_1 value "Str1" width 40
@ 80, 10 label label_2 value "Str2" width 40
@ 120, 10 label label_3 value "Str3" width 40
@ 160, 10 label label_4 value "Str4" width 40
@ 40, 80 TEXTBOX TEXT_1 ;
NUMERIC INPUTMASK "999,999.99"
@ 80, 80 TEXTBOX TEXT_2 value "test"
@ 120, 80 TEXTBOX TEXT_3
@ 160, 80 textbox text_4
CENTER WINDOW Win_1
ACTIVATE WINDOW Win_1
on key TAB of Win_1 action kytest()
case P_1 = 1 /* Cursor Up */
fldptr = fldptr - 1
if fldptr < 1
fldptr := 1
case P_1 = 2 /* Cursor Down */
fldptr := fldptr + 1
if fldptr > FldMax
fldptr := FldMax
Case P_1 = 3 /* PgDn - only active in Edit mode */
fldptr := 1
/* save current record and close Edit mode */
// msginfo ("Fld Ptr = "+str(fldptr))
case P_2 = 1
case P_2 = 2
case P_2 = 3
case P_2 = 4
Muy bien !!!
Quiero sugerirte que utilices los controles que hay arriba donde escribes tu Post, hay unos botones que ayudan a mejorar a que se vea mejor el código, hay un botón que se llama "Code" y entre los Code pones tu código para que se vea más claro. Por ejemplo:
Code: Select all
IF nCode == 0 MsgBox("El nCode Vale 0") ELSE MsgBox("El nCode NO Vale 0") END IF
I want to suggest you use the controls that are above where you write your post, there are buttons that help to improve the code look better, there is a button called "Code" and enter the code you put your code to make it look more clear. For example:
Code: Select all
IF nCode == 0 MsgBox ("The nCode Vale 0") ELSE MsgBox ("The nCode NOT Vale 0") END IF