Thanks everybody for the feedback.
Point 1, for Lars:
this IS almost generic. At least as a first attempt it ain't far off. And for
this, I think you/I must extend a special thank you to Jean-Marc for creating
such a general toolbar code. Even if toolbarItem should be a base class so
that combox and FL_OBJECTs can exist in the same list...
In order to make the stuff completely generic, I think the following points
need to be addressed:
* How to associate Toolbar definitions in default.ui with particular insets?
Something like
Toolbar "text"
...
End
Toolbar "math"
...
End
springs to mind.
* This would allow the signals to be replaced with showToolbar("name"),
hideToolbar("name").
* Finally, the Layout definition in default.ui should be replaced with
DropdownList "layout".
Point 2, for Lars:
> You are removing some of the boundires... LyXView knows about
> BufferView which knows about WorkArea, LyXView is not supposed to know
> anything about WorkArea. (and if it already does, that can be
> considered a bug)
Well then, why have a publically accessible WorkArea * workarea() in
BufferView.h? But I agree with you!
The only things accessing BufferView::workarea() are the new stuff in LyXView
that call
width(), height(), xpos(), ypos()
and insettext, insettabular that call
getClipboard()
Shall I add some wrappers for these calls to BufferView?
Point 3, for Dekel, Allan.
The flicker is annoying isn't it!
If we're thinking of multiple toolbars with only one present at a time, how
about:
A common toolbar, always present
Toolbar "Common"
DropdownList "layouts"
Icon "file-open"
Icon "buffer-write"
Icon "buffer-print"
End
If text is marked, then show this to the right of Toolbar "Common"
Toolbar "Cut&Paste"
Icon "cut"
Icon "copy"
Icon "paste"
End
If in a text inset then this would go to the right of Common or Cut&Paste:
Toolbar "Text"
Icon "font-emph"
Icon "font-noun"
Icon "font-free"
Separator
Icon "tex-mode"
Separator
Icon "depth-next"
Separator
Icon "math-insert"
Icon "footnote-insert"
Icon "marginalnote-insert"
Icon "figure-insert"
Icon "tabular-insert"
End
If in a math inset
Toolbar "Math"
DropdownList "functions"
Icon "math-insert sqrt"
Icon "math-insert frac"
...
End
Shall I have a go at this next time I find a spare couple of hours?
Angus