Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accepting Keyboard Input from _Screen

Status
Not open for further replies.

FoxEgg

Programmer
Mar 24, 2002
749
AU
My Main.prg starts off something like this

Code:
_screen.caption = "Socrates"
_screen.backcolor = RGB(50,100,255)
_screen.windowstate = 2  && = 2 Maximized (enlarged to fill the screen) 
_screen.closable = .f.   && False (.F.) 

****asks for a password then if OK

SET DEFAULT TO "C:\foxegg"
DO (gc_menupath + "mainmenu.mpr")

So I have (more of less) just a blueish screen and a menu.


Since I enter a patient's last name at this point AS A MATTER OF ROUTINE... is there some way I can accept keyboard data and .. if it is a character.. start up the patient search form that I have written.

Currently to find a patient.. I type <alt> P (atient) F (ind) and up comes the correct form

I did make a blank form and used the KeyPress event to start the Patient Search form which works... but is there something in _screen which will do it for me ?

FoxEgg
 
If you are wanting a form to appear immediately after the menu has been created then you could call it from the CleanUp procedure of the menu.

Open the Menu Designer then select General Options from the View menu. The dialog which appears has two tick boxes SetUp and CleanUp. SetUp runs before the menu appears, then the menu appears, then CleanUp runs, and then Fox will let the user select an option from the menu. If you put a DO FORM in CleanUp then the form will always open as the application starts.

Geoff Franklin
 

Hi FoxEgg,

Sounds you like you want something like a KeyPress event for _SCREEN. That's not really possible (other than to use BINDEVENTS(), but I suspect that'll be more complicated than you want).

However, I wonder if this is really what you want. It seems to me that a better user interface would be to display a form on start up, in which the user can type the required patient's name. Once they've done that, you can show the patient's details either in a new form or the same one. Or, you can have them enter the name in a textbox in a toolbar, which could be permanently available.

After all, why would the user expect to be able to start typing a name if there is no control visible to receive it? That might have worked in a DOS system, but it's not really the GUI way of doing things.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top