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.
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
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Menu Action in CODE
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
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
Menu Action in CODE
Chris,
> MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf( oSender ) }
> I am really just wanting to ACTION a FUNCTION,
Then call it as a function:
MENUITEM "Browse this DBF" ACTION BrowseDbf( oSender )
Hope it helps.
Regards,
José Lalín
> MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf( oSender ) }
> I am really just wanting to ACTION a FUNCTION,
Then call it as a function:
MENUITEM "Browse this DBF" ACTION BrowseDbf( oSender )
Hope it helps.
Regards,
José Lalín
Menu Action in CODE
Chris,
> MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf( oSender ) }
> I am really just wanting to ACTION a FUNCTION,
Then call it as a function:
MENUITEM "Browse this DBF" ACTION BrowseDbf( oSender )
Hope it helps.
Regards,
José Lalín
> MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf( oSender ) }
> I am really just wanting to ACTION a FUNCTION,
Then call it as a function:
MENUITEM "Browse this DBF" ACTION BrowseDbf( oSender )
Hope it helps.
Regards,
José Lalín
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Menu Action in CODE
Hi Jose,
Thanks for the reply ...
I dont think its quite as simple as that in my situation ... calling my
function does not work for me.
I have distilled into smallest project I can make.
Possibly its because I am making the Menu at runtime when the right click
happens ??
I have tried making the menu in the MakeFormInCode() function ... but still
I get NO ACTION.
Possibly, even probably I am doing things in a strange way ?!
Any help would be appreciated.
Regards
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46cef962@ozsrv2.ozlan.local...]46cef962@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
>> MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf(
>> oSender ) }
>> I am really just wanting to ACTION a FUNCTION,
>
> Then call it as a function:
>
> MENUITEM "Browse this DBF" ACTION BrowseDbf( oSender )
>
> Hope it helps.
>
> Regards,
> José Lalín
Attached files Form_code.zip (2.2 KB)Â
Thanks for the reply ...
I dont think its quite as simple as that in my situation ... calling my
function does not work for me.
I have distilled into smallest project I can make.
Possibly its because I am making the Menu at runtime when the right click
happens ??
I have tried making the menu in the MakeFormInCode() function ... but still
I get NO ACTION.
Possibly, even probably I am doing things in a strange way ?!
Any help would be appreciated.
Regards
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46cef962@ozsrv2.ozlan.local...]46cef962@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
>> MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf(
>> oSender ) }
>> I am really just wanting to ACTION a FUNCTION,
>
> Then call it as a function:
>
> MENUITEM "Browse this DBF" ACTION BrowseDbf( oSender )
>
> Hope it helps.
>
> Regards,
> José Lalín
Attached files Form_code.zip (2.2 KB)Â
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Menu Action in CODE
Hi Jose,
Thanks for the reply ...
I dont think its quite as simple as that in my situation ... calling my
function does not work for me.
I have distilled into smallest project I can make.
Possibly its because I am making the Menu at runtime when the right click
happens ??
I have tried making the menu in the MakeFormInCode() function ... but still
I get NO ACTION.
Possibly, even probably I am doing things in a strange way ?!
Any help would be appreciated.
Regards
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46cef962@ozsrv2.ozlan.local...]46cef962@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
>> MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf(
>> oSender ) }
>> I am really just wanting to ACTION a FUNCTION,
>
> Then call it as a function:
>
> MENUITEM "Browse this DBF" ACTION BrowseDbf( oSender )
>
> Hope it helps.
>
> Regards,
> José Lalín
Attached files Form_code.zip (2.2 KB)Â
Thanks for the reply ...
I dont think its quite as simple as that in my situation ... calling my
function does not work for me.
I have distilled into smallest project I can make.
Possibly its because I am making the Menu at runtime when the right click
happens ??
I have tried making the menu in the MakeFormInCode() function ... but still
I get NO ACTION.
Possibly, even probably I am doing things in a strange way ?!
Any help would be appreciated.
Regards
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46cef962@ozsrv2.ozlan.local...]46cef962@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
>> MENUITEM "Browse this DBF" ACTION { | oSender | BrowseDbf(
>> oSender ) }
>> I am really just wanting to ACTION a FUNCTION,
>
> Then call it as a function:
>
> MENUITEM "Browse this DBF" ACTION BrowseDbf( oSender )
>
> Hope it helps.
>
> Regards,
> José Lalín
Attached files Form_code.zip (2.2 KB)Â
Menu Action in CODE
Chris,
I've just tested your project and doing the change I suggested in my
previous message all works as expected. See the screenshot:
Regards,
José Lalín
--
Menu Action in CODE
Chris,
I've just tested your project and doing the change I suggested in my
previous message all works as expected. See the screenshot:
Regards,
José Lalín
--
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Menu Action in CODE
Jose,
Thanks for the V.Quick response !! ... its a national holiday here but would
like to solve this problem.
I have just tried what I think you mean & get no action.
I am obviously doing something stupid.
Can you send me your amended progaram please.
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2ae81@ozsrv2.ozlan.local...]46d2ae81@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
> I've just tested your project and doing the change I suggested in my
> previous message all works as expected. See the screenshot:
>
> Regards,
> José Lalín
>
Thanks for the V.Quick response !! ... its a national holiday here but would
like to solve this problem.
I have just tried what I think you mean & get no action.
I am obviously doing something stupid.
Can you send me your amended progaram please.
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2ae81@ozsrv2.ozlan.local...]46d2ae81@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
> I've just tested your project and doing the change I suggested in my
> previous message all works as expected. See the screenshot:
>
> Regards,
> José Lalín
>
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Menu Action in CODE
Jose,
Thanks for the V.Quick response !! ... its a national holiday here but would
like to solve this problem.
I have just tried what I think you mean & get no action.
I am obviously doing something stupid.
Can you send me your amended progaram please.
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2ae81@ozsrv2.ozlan.local...]46d2ae81@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
> I've just tested your project and doing the change I suggested in my
> previous message all works as expected. See the screenshot:
>
> Regards,
> José Lalín
>
Thanks for the V.Quick response !! ... its a national holiday here but would
like to solve this problem.
I have just tried what I think you mean & get no action.
I am obviously doing something stupid.
Can you send me your amended progaram please.
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2ae81@ozsrv2.ozlan.local...]46d2ae81@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
> I've just tested your project and doing the change I suggested in my
> previous message all works as expected. See the screenshot:
>
> Regards,
> José Lalín
>
Menu Action in CODE
Chris,
sure, here it is.
Regards,
José Lalín
--
Menu Action in CODE
Chris,
sure, here it is.
Regards,
José Lalín
--
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Menu Action in CODE
Jose,
Thanks .. I am there now.
My code is like yours now plus I needed to put the line below in a block to
stop it executing the menu as the form was first displayed.
// This needed to be in a block to stop it executing immediately
oForm:OnConTextmenu := { | | MakeContextMenu( oForm ) }
Apologies for being a bit dim on this one.
Regards
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2b354@ozsrv2.ozlan.local...]46d2b354@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
> sure, here it is.
>
> Regards,
> José Lalín
>
>
Thanks .. I am there now.
My code is like yours now plus I needed to put the line below in a block to
stop it executing the menu as the form was first displayed.
// This needed to be in a block to stop it executing immediately
oForm:OnConTextmenu := { | | MakeContextMenu( oForm ) }
Apologies for being a bit dim on this one.
Regards
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2b354@ozsrv2.ozlan.local...]46d2b354@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
> sure, here it is.
>
> Regards,
> José Lalín
>
>
-
- Mensajes: 384
- Registrado: Mar May 01, 2007 5:49 pm
Menu Action in CODE
Jose,
Thanks .. I am there now.
My code is like yours now plus I needed to put the line below in a block to
stop it executing the menu as the form was first displayed.
// This needed to be in a block to stop it executing immediately
oForm:OnConTextmenu := { | | MakeContextMenu( oForm ) }
Apologies for being a bit dim on this one.
Regards
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2b354@ozsrv2.ozlan.local...]46d2b354@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
> sure, here it is.
>
> Regards,
> José Lalín
>
>
Thanks .. I am there now.
My code is like yours now plus I needed to put the line below in a block to
stop it executing the menu as the form was first displayed.
// This needed to be in a block to stop it executing immediately
oForm:OnConTextmenu := { | | MakeContextMenu( oForm ) }
Apologies for being a bit dim on this one.
Regards
Chris
"José Lalín" <notengo@correo.com> wrote in message
news:[email=46d2b354@ozsrv2.ozlan.local...]46d2b354@ozsrv2.ozlan.local...[/email]
>
> Chris,
>
> sure, here it is.
>
> Regards,
> José Lalín
>
>
Menu Action in CODE
Chris,
> Thanks .. I am there now.
Glad to hear that !
> Apologies for being a bit dim on this one.
No need to apologize
Regards,
José Lalín
> Thanks .. I am there now.
Glad to hear that !
> Apologies for being a bit dim on this one.
No need to apologize

Regards,
José Lalín
Menu Action in CODE
Chris,
> Thanks .. I am there now.
Glad to hear that !
> Apologies for being a bit dim on this one.
No need to apologize
Regards,
José Lalín
> Thanks .. I am there now.
Glad to hear that !
> Apologies for being a bit dim on this one.
No need to apologize

Regards,
José Lalín