> On Apr 27, 2017, at 7:09 AM, [email protected] wrote:
> 
> Subject: Re: Components, forms & menu bars
> Message-ID: <[email protected] 
> <mailto:[email protected]>>
> Content-Type: text/plain; charset=utf-8
> 
> 
>> Le 27 avr. 2017 à 09:05, David Adams via 4D_Tech <[email protected] 
>> <mailto:[email protected]>> a écrit :
>> 
>> Right, three things that aren't my thing.
>> 
>> If I've got a form in a component, what's the recommended strategy for
>> allowing it to be hooked into the hosts menu bar systems? Or any menu
>> system so that edit, etc. are active?
> 
> Hi David, 
> you'll find in 4dpop XLIFF (4dpopXLIFF.4dbase/source/) a nice example of edit 
> menu constructor based on xml (see 3 methods starting with "mnu_"). But this 
> is ok when the form component is quite "host-independent" (modal dialog, 
> independent window+process). When the form component is more "embedded" in 
> host UI, I'm interested in answers to your question…
> 
> -- 
> Arnaud de Montard 

I’ve recently been trying to do something like this myself. The examples I’ve 
seen are independent of the host database menu systems. In my case that is not 
what I want or need. I suspect that is your issue to. One thing I’ve been 
experimenting with is getting the menu of the calling process(host database) 
before displaying the components form in a separate process and then setting 
the menu for the component to that menu. ie.

$menu:=Get menu bar reference($iCallingProcess)

SET MENU BAR($menu)

Dialog(“component_form”)

The problem with this is that you get a menu bar that doesn’t do anything.

So, I activate the form event (component form) for On Menu Selected. That gets 
the method associated with the menu in the host database and then calls a host 
method that calls EXECUTE FORMULA with the menu’s method.

This has some issues that I’m working on, including menu items that don’t have 
an associated method. I’m not sure this will ultimately work, but, it seems to 
have promise. 

I’d love to hear if/how others have solved this too.

Barclay

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to