Dynamic menus.


Subject: Dynamic menus.
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Tue Oct 23 2001 - 10:01:09 CDT


After playing with the aiksaurus plugin (which is really cool and a great
feature) I realized we have some fundamental problems with how we do
dynamic menus.

Right now each active frame at the time of the plugin installation gets
the new menu item inserted in it.

This is a problem because.

1. If you open a new abiword frame the menu item from the plugin isn't in
a menu (because the frame wasn't around when the plugin was registered.)

2. Context menu's never get the new menu item because they're created and
destroyed on the fly.

I think these problem can be solved by loading the static menu array
defined from all the menu header files, duplicated into a UT_Vector. This
vector can them be directly accessed via XAP_Menu_Factory class which
includes method createMenuLayout and findContextMenu by examining it's
private UT_Vector of menu items.

This vector and class is created in the constructor of XAP_App and
destroyed in XAP_App destructor. the XAP_Menu_Fractory class is accessed
via the XAP_App pointer.

Then new menu items can be inserted, deleted and moved in this vector
at will. This way new frames will automatically get dynamically loaded
menus and we can place new menu items in context menus.

I've written the XAP_Menu_Factory class already and I have recovered
correct abiword behaviour already.

If all goes well I hope to commit this code within a couple of days.

This code should allow us to arbitray change the menu's dynamically in a
totally XP way.

Joaquin and Dom what do you think?

Should I send you guys a patch before committing?

Cheers

Martin



This archive was generated by hypermail 2b25 : Tue Oct 23 2001 - 10:01:20 CDT