Download as a PDF - RISC

Transcript
CHAPTER 5. IMPLEMENTATION
45
Finally, if the type of the cell is an Input/Output then the user has the option to switch
to a cell interaction technique at this point. If the user switches, the content of the cell
is being extracted in the form of an expression and stored in the global variable CellExp
and the flag $atNB is set to false to activate the cell interaction function.
In-case the type of the cell is a title, section or subsection then it is spoken to the user
without switching to a cell interaction, assuming that the user wouldn’t interact with a
static text except listening to its content.
This introduces us to a very important constraint in the type of notebooks this program
supports; it supports only simple notebooks and doesn’t allow mixing text with mathematical contents, because these cases are not handled.
For example it doesn’t support : Today I had a very difficult math problem in class where
the teacher wanted us to figure out the value of 1/x based on some equations where x
...etc.
As in Mathematica these types of texts has another category in pattern matching which
wasn’t supported in this program.
4. The base case is the default case that is being checked each time, this case holds the
possibility that the PosNB includes “-1” which is out of the notebook boundaries. If this
case takes place the user is being notified that there are no children at this current position
of the notebook and the position of the PosNB is being preserved before this error takes
place. Another case handling if the user wishes to access a child’s node were this node
happens to be a leaf, then the user is also notified that he/she is accessing a node with
no children and the position in preserved before this error occurs as well. This step is an
error handling and giving notification to the user so as not to step out of bounds.
5.3.2
Lower Level “Cell Level”
As we want to move from the higher level and go further to lower level to the cell level, the
user can do this switch gesture command which adjusts a flag $atNB to allow the interaction
over the required level and activates the required interaction function.
As we mentioned before this switch command sets the flag and also assigns to the global variable
CellExp the current expression the PosNB was pointing at.
The user can browse and interact with the values in the CellExp as long as the pointer position
is in the current cell. The user can explore the cell and its content as a tree, access the tree
children and move to its leaves. And as the user moves to another cell the CellExp is updated
and the position in the cell is initiated as soon as a new cell starts.
The switch case is checked with the flag value $atNB, by each input gesture the user enters.
Each gesture is encoded with an integer number, which is recognized inside the implementation
code and according to this integer an action is being performed. The user has many possibilities
of interaction in a single cell as shown in the cases below.
As the CellExp is assigned a new cell expression, a pointer is initiated to point at the position
in the cell and treats it as a tree which traverses its nodes, the pointer inside the cell is also a
list and referred to as PosCell.