Enable File Open

538 views
Skip to first unread message

Gestbiz

unread,
Sep 23, 2012, 5:38:22 AM9/23/12
to multisoft...@googlegroups.com
Is there a way to ENABLE File Open to True within an application depending of the user ?

Paul

unread,
Sep 24, 2012, 6:26:26 AM9/24/12
to multisoft...@googlegroups.com
Hi,


On Sunday, September 23, 2012 11:38:22 AM UTC+2, Gestbiz wrote:
Is there a way to ENABLE File Open to True within an application depending of the user ?

Any file opened by USE, DbUseArea(), Fopen(), Fcreate() etc. remains open until you (i.e. the application) closes it. At the application end or it termination, all open files are closed automatically.

Paul

Gestbiz

unread,
Sep 27, 2012, 3:18:32 PM9/27/12
to multisoft...@googlegroups.com
Thanks for the support 

My question was misunderstood 
I am talking about File Open from the Top menu  
cb_File_Open 

How does this option can be enable within an application ?

Thanks again,
Message has been deleted

Paul

unread,
Jul 1, 2020, 10:49:33 AM7/1/20
to multisoft...@googlegroups.com
The top menu item "File -> Open..." is disabled by default, see comments in the .../system/initiomenu.prg. To change it, add somewhere at application begin:

    local oMenu := m->oTopBar:FindMenuProperty( {|obj| obj:Caption == "&Open..."} )
    if valtype(oMenu) == "O" .and. IsObjClass(oMenu,"_MenuItem")
        oMenu:Data    := {|obj,id| MyFileOpen(obj,id) }
        oMenu:enabled := .T.
        m->oTopBar:Display(.T.)
    endif


and then perform the required action in your  FUNCTION MyFileOpen(...).

Note: In FlagShip8, there is also an alternative function FileSelect() which uses common file dialogs.


Paul
Reply all
Reply to author
Forward
0 new messages