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

How Do You Exit Brwose With Double Click 1

Status
Not open for further replies.

jerry1117

Programmer
Sep 29, 2003
20
US
I routinely use a browse window to show a grid format of records in the active cursor. Like this.

PUSH KEY CLEAR
BROWSE
POP KEY

You can page up, page down, arrow up, arrow down, click, or double click to select a record. But, you have to press enter, escape, or click the X at the upper right cornor of the browse screen to exit.

I would like to be able to double click on a row to select that row and exit the browse.

Does anyone know how to do that?

Thanks, Jerry
 
Why not use a grid to display the cursor? You could then capture whatever events you need.

-Kevin
 
A quick and dirty routine i have used is and is similar to the way SBT Accounting sware works is:

on key label rightmouse keyboard chr(23)
USE {your file}
brow

Left Click the record you want, Right Click to exit

 
Here's an old Foxpro 2.x routine I use to simulate an Enter keypress with a double-click. Put the following two lines in your startup .prg:
Code:
STORE SECONDS() TO m.m_timeout
STORE .F. TO doubleclicked
Put this code in a procedure file or as a procedure in you main program:
Code:
PROCEDURE mhandler
   
   IF SECONDS() < m.m_timeout
      =INKEY(0, 'HM')
      IF MWINDOW() # WONTOP() .OR. MROW() < 0
         KEYBOARD("{ESCAPE}")
      ELSE
         doubleclicked = .T.
         KEYBOARD("{ENTER}")
      ENDIF 
   ELSE
      STORE SECONDS()+_DBLCLICK TO m.m_timeout
   ENDIF ( SECONDS() < m.m_timeout )
   RETURN
I haven't tested it with VFP, so I'll not guarantee any results, but you may get an idea from it.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Dave, You did, indeed, give me the help I needed. I actually did this.

Start up:
PUBLIC tns_DblClkSecs
tns_DblClkSecs = SECONDS()
.
.
PROCEDURE a_MouseHandler
IF SECONDS() < tns_DblClkSecs
KEYBOARD("{ENTER}")
ELSE
STORE SECONDS()+_DBLCLICK TO tns_DblClkSecs
ENDIF

Before doing browse:
PUSH KEY
ON KEY LABEL LEFTMOUSE DO a_MouseHandler

After browse:
POP KEY

Thanks much. Jerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top