Copy form menu (OpenInsight 32-Bit)
At 10 APR 2007 04:59:50PM Bruce Cameron wrote:
I would like to be able to copy a form menu (complete structure) to another form. Is this possible and if so how could I accomplish this?
Thanks
At 10 APR 2007 05:08PM Karen Oland wrote:
No doubt not the approved method, I copy menus and other items (fields, boxes, etc) using the editor.
Start the window and save it with one menu item, open both in the editor and CAREFULLY cut and paste.
At 10 APR 2007 05:24PM Gerald Lovel wrote:
I save forms with prebuilt menus; one form for each standard window type – collector, databound, readonly, etc. Then my promoted create event "pastes" (using CREATE and DESTROY, I believe) the correct menu into the window form as the window is opened. This accomplishes several things:
1) only exceptional items (special keys and relations) need be defined for a form; all other menu items come from the extensive default menus.
2) revision to menu items does not require recreation of all forms.
3) menu item displays are dynamic, just like in Windows.
4) access security is handled for all menu items as forms are created; that is, access security is dynamic rather than static.
Source code is available for this in the Atlas Framework.
At 10 APR 2007 05:29PM Karen Oland wrote:
No doubt not the approved method, I copy menus and other items (fields, boxes, etc) using the editor.
Start the window and save it with one menu item, open both in the editor and CAREFULLY cut and paste. Don't forget to update the first line with the total number of menu items (value 9, includes first line in count).
Needless to say, not for the fainthearted. Or those who do it so often they can write a utility to do it for them.
At 10 APR 2007 10:16PM Warren Auyong wrote:
Isn't it a bit more complicated since bits and pieces such as scripts are stored in the repository and also you have to update the compiled version of the forms also?
I did work on a menu cloner that lets you copy menus from one MDI to another. I suppose it would work on forms. It mostly works but does trash your menus once in awhile, but it backs up the form/mdi so that's not too much of a problem.
At 11 APR 2007 11:51AM Karen Oland wrote:
Sure - which is why I then open it back up and save it, so it gets recompiled (and edit any references to the wrong source table if copying databound prompts first, while it's up in the editor).
You also have to be very careful to only copy into one section at time, so you don't go past any record marks.
I also make a backup first, in case I break it.
I don't copy menus much, tho - almost all menu functions are provided by the main frame of the app and most windows have no menus at all. But a few do, if they are called as dialog boxes (any more, I use a window copier to start with a window that is close to what I want to end up with, so seldom find a need to copy menus anymore, but do copy prompts fairly often).