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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use _med_find outside of menu

Status
Not open for further replies.

JaneJantz

Programmer
Sep 13, 2000
55
0
0
US
Is there any way to execute _med_find from code rather than from a menu? I need to turn off some hot keys first(on key label). _med_find works differently in foxpro for windows. In the windows version, the hot keys are not active during the find, in vfp though, the hot keys are still active.
 
Try:

KEYBOARD '{CTRL+F}'
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks for responding... but I tried that, if I follow the keyboard command with any other code, the find screen never executes. Any other suggestions?
 
Have you tried adding it to your own menu?
Code:
SET SYSMENU TO
SET SYSMENU AUTOMATIC

DEFINE PAD _msm_file OF _MSYSMENU PROMPT &quot;\<File&quot; COLOR SCHEME 3 ;
	NEGOTIATE  LEFT, NONE ;
	KEY ALT+F, &quot;&quot; ;
	MESSAGE &quot;Creates, opens, saves, prints files or quits Visual FoxPro&quot;
DEFINE PAD _msm_edit OF _MSYSMENU PROMPT &quot;\<Edit&quot; COLOR SCHEME 3 ;
	NEGOTIATE  NONE, LEFT ;
	KEY ALT+E, &quot;&quot; ;
	MESSAGE &quot;Edits text or current selection&quot;
ON PAD _msm_file OF _MSYSMENU ACTIVATE POPUP _mfile
ON PAD _msm_edit OF _MSYSMENU ACTIVATE POPUP _medit

DEFINE POPUP _mfile MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR _mfi_quit OF _mfile PROMPT &quot;E\<xit&quot; ;
	PICTRES _mfi_quit ;
	MESSAGE &quot;Quits Visual FoxPro&quot;

DEFINE POPUP _medit MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR _med_find OF _medit PROMPT &quot;\<Find...&quot; ;
	KEY CTRL+F, &quot;Ctrl+F&quot; ;
	PICTRES _med_find ;
	MESSAGE &quot;Searches for specified text&quot;

If I run the above menu, and use CTRL+F, it does open up. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks again for responding.... but the problem is:
I have a hot key defined for another purpose:
ON KEY LABEL 'S' DO SCHEDULE
and a menu defined with all my options including _medit with the hot key CTRL-F defined. I show a browse of all the records in the file.

The problem is, in FoxPro for Windows, the hot key &quot;S&quot; was ignored if I was in the actual &quot;_MED_FIND&quot; popup window, however in Visual FoxPro, the hot key &quot;S&quot; is still active and if I use the letter &quot;S&quot; in the find area, it jumps me to my SCHEDULE routine.

According to the documentation on system menu commands, the _med_find should have inactivated the other ON KEY commands while in it (as is does in FoxPro for Windows). The Visual version (6.0) does not inactivate these keys. The only way I can see to fix this is put in ALT-S for SCHEDULE, however my customers are use to just typing &quot;S&quot; when they see the record they want in the browse...

Is there any way to get multiple lines of code into the menu to put ON KEY before the _MED_FIND and then turn the ON KEY LABEL commands back on when they find the record they want?

I have also tried to write my own FIND, but they are searching multiple fields for matches... name,address,phone,etc. The table is large.

Any help would be appreciated. Thanks for trying.
 
ON KEY LABEL 'S' DO SCHEDULE

I wouldn't recommand using ON KEY LABEL with a single character, the chances that this will trigger your schedule could happen at anytime. Just sell the ON KEY LABEL ALT+S as a new feature.

when they see the record they want in the browse...
I also wouldn't recommand using a browse window directly against the table to located a record. I would suggest and incremental shearch in a grid (faq184-1214). That would eliminate the need for the find.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top