Re: About the MathML Panel (frederic07wang)

On Saturday 30 September 2006 16:09, fwsmail35 wrote:
>     I haven't made any modification on the MathML panel since the last
> time I send files (23/09/2006), but I just want some explanation to
> continue.
>
>     There are now about 160 icons, but as you suggested, it would be
> more convenient for the user to have a separated panel. Note that I've
> already made a classification for the icons. Nevertheless I don't know
> how to add new panels, so I would like you to tell me which part I have
> to modify, as you did for the MathML panel.

Instead of adding new panels, I suggest to change the current Math panel.
It could be configured as the character panel (see Panel_SpeChar.xrc), so at 
the first level the user can select a category of math constructions. When 
that category is selected only the right subset of constructions is 
available.

>
>     The buttons don't work for the moment, because I don't have made the
> corresponding functions yet. In fact, I began with the buttons
> overtilde, overhat etc but there are 2 bugs : the symbol (hat, dot...)
> isn't resize and you can't add the symbol on a selection. The major
> problem is that I don't really understand the mechanism to make new
> elements in the tree, even if I have a bit read the developpers manual
> about the functions of Thot. So I would be very grateful if you could
> explain briefly with an example the way I can select an element in the
> tree and then create and add a new child at this position.

First I suggest you activate the debug option:
You add -DAMAYA_DEBUG in the AMAYA_OPTIONS= line of your Options file
Normally configure with --with-debug does that.
With that debug option, Help>About Amaya generates dumps of all Thot 
structures:
    $HOME/.amaya/tree.debug dumps the document tree
    $HOME/.amaya/view.debug dumps presentation rules attached to each element
    $HOME/.amaya/boxes.debug dumps screen areas attached to each element
So you can see what is the current tree managed by Thot.

When Thot rejects a tree change it calls a function TtaError. To know why the 
change is rejected you can either insert a break point in this function or 
you can test the error code after each Thot operation with TtaGetErrorCode.

To make some changes to the Thot tree you have first to get the current 
selection with TtaGiveFirstSelectedElement and TtaGiveLastSelectedElement.

You can move around that selection with TtaGetParent, TtaNextSibling, 
TtaPreviousSibling, TtaGetFirstChild, TtaGetLastChild

You create a new element with TtaNewElement

Then you insert that new element in the current tree
with TtaInsertFirstChild (as first child of an existing element), or with 
TtaInsertElement (before or after an existing element)

You can delete an existing element with TtaDeleteTree

You can move an existing element with TtaRemoveTree then TtaInsertFirstChild  
or TtaInsertElement.

Normally any tree operation should be registered to allow one to undo the 
whole command. Each undo/redo command may concern a set of operations:
  TtaOpenUndoSequence opens a sequence registered operations.
  TtaCloseUndoSequence closes the open sequence.
  TtaExtendUndoSequence reopens the previous sequence when more operations 
need to be added.
  TtaRegisterElementCreate should be called after a new element is inserted.
  TtaRegisterElementDelete should be called before the element is deleted or 
removed.

-- 
     Irène.
-----
Irène Vatton                     INRIA Rhône-Alpes
INRIA                               ZIRST
e-mail: Irene.Vatton@inria.fr       655 avenue de l'Europe
Tel.: +33 4 76 61 53 61             Montbonnot
Fax:  +33 4 76 61 52 07             38334 Saint Ismier Cedex - France

Received on Monday, 2 October 2006 11:25:54 UTC