On Tuesday 15 May 2001 15:38, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
>
> | A new pair of questions.
> |
> | The user can activate items on the current Menubar and Toolbar by
invoking
> | the methods
> |
> | // Display the top-level submenu "name"
> | void Menubar::Pimpl::openByName(string const & name);
> |
> | // invoke the lyxfunc associated with the nthToolbar button
> | void Toolbar::Pimpl push(int nth);
> |
> | I think that push() is redundant code because we can access the lyxfunc
> | directly. Can I get rid of it?
>
> This is also a lyxfunc right? (toolbar-push)
>
> It is there so that you can bind keys to the buttons regardless of
> what lyx-func that will invoke.
>
> \bind "F1" "toolbar-push 1"
>
> IMO it should not be removed.
Good. I was just looking for a justification.
> | I'm going to extend openByName to open a Combox as well as a
> | Submenu.
> Not sure what you mean.
Well, Jean-Marc goaded me into combining the Menubar and Toolbar. Now
default.ui can contain (this is just an example!)
Menubar "toolbar"
Menu "Layouts|L" "layouts_list_menu"
Combox "layouts_list_combox"
Icon "file-open"
Separator
Icon "cut"
End
Menu "layouts_list_menu"
LayoutsList
End
Combox "layouts_list_combox"
LayoutsList
End
If I can open Menu "layouts_list_menu" by name, then it's only reasonable to
be able to open the Combox "layouts_list_combox" by name also.
My current aim is to be reproduce the functionality of the existing code.
This means that individual Menubars are still hard-coded into LyXView because
we need to specify where to position them and when to show them. Ultimately,
the plan is to augment the default.ui syntax thus:
Menubar "name" Position SomePosition ShowOn ShowEvent
Menu ...
Icon ...
etc
End
where SomePosition = (Top, NewLine, Append)
and ShowEvent is currently (Buffer, NoBuffer), but could concievably be
extended to InsetXXX as well.
This way, all Menubar behaviour can be controlled by the user.
Moreover, I can treat the Menubars as just another Dialog and move them
behind the Dialogs.h "firewall". Communication by the LyX kernel will be
(is!) by signals only.
Angus