Attached is a patch creating a Math Toolbar. I'm posting it, rather than
commiting it to the repository because I discovered what I think are a couple
of bugs in WorkArea and in ToolbarDefaults, but am not very familiar with the
code, so think I should seek a second opinion...
WorkArea's (width, height, xpos, ypos) returned the dimensions of something
in between the work_area FL_OBJECT and the entire space taken up by WorkArea.
I think that this is wrong and have changed them to return the dimensions of
the entire WorkArea. As the only places these methods are called are in the
new LyXView::showMathToolbar, hideMathToolbar methods, I think I'm safe,
but...
ToolbarDefaults::read had a final lex.next() call that buggered up the
reading of subsequent Toolbar definitions. Removing it fixed the bug.
Other than thses points, the patch is pretty straight forward. It shows,
hides a Math Toolbar when the cursor enters, leaves an InsetFormula and
resizes the WorkArea appropriately. The Tolbar currently contains only a sqrt
and a frac, but the functionality is there.
Note that there's a bug in the mathed stuf that means that the new sqrt, frac
are displayed only by scrolling the InsetFormula out of sight and back again.
I think that this is the bug reported earlier by Dekel.
Angus
mathtoolbar.patch.bz2