In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Menu Action in CODE

Xailer professional forum in English
ChrisGillard
Mensajes: 384
Registrado: Mar May 01, 2007 5:49 pm

Menu Action in CODE

Mensaje por ChrisGillard »

Am trying to create a general purpose dbf viewer for my applications.
I have an array browse in a form of all dbfs open in my application.
I want to right click on a dbf in the browse & dbfbrowse that dbf.
I am assigning the onContextMenu of first browse as so :
oBrowse:OnContextMenu := { | oSender, nPosX, nPosY | DbfBrowseContextMenu(
oSender, nPosX, nPosY ) }
&
FUNCTION DbfBrowseContextMenu( oSender, nPosX, nPosY )
local oMenu
IF ! oSender:SelectCellFromPoint( nPosX, nPosY )
return nil
ENDIF
MENU POPUP oMenu
MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf( oSender ) }
// ::Process( oSender ) // ::DelListBoxitem()
ENDMENU
oSender:ShowPopupMenu( oMenu, nPosX, nPosY )
RETURN Nil
FUNCTION BrowseDbf( oSender )
MsgInfo( "Hi" ) // Will make a second form & dbfbrowse the dbf clicked
on.
RETURN( NIL )
The menu pops up fine but I cannot get it to action my BrowseDbf() function.
Have tried various ways of defining the MENUITEM ACTION in code.
Help says about the action having to be a 'method' which I have used OK in
another place.
I am really just wanting to ACTION a FUNCTION,
Hopefully this can be done ??
Any help would be appreciated.
Regards
Chris Gillard
Responder