For some time, I have been having ideas for how to make a tree-based topographic query editor.  Today I've been working my way towards the preliminaries for an implementation of those ideas. That is, I have been working on getting the tree displays that are in the wx/htreecanvas.cpp source code file to look much better.  That's the first step.

The ideas can be laid out as follows:

  1. Have an interactive query-editor in which the query looks like a  linguistic tree, with the root (Query) at the top and its branches (going dowards) going to nodes that represent object blocks, power blocks, gap blocks, optional gap blocks, groupings, etc.
  2. For object blocks, the main node name should be the object type.  Below the object type name is shown the node number (e.g., "Clause 1") (this becomes an object reference declaration, e.g., "AS CLause1"). Any repetition (kleene star) gets shown below the node number, e.g., "*{1-3}" or simply "*". Then, if there are any feature-restrictions, they get to be shown below it, probably as a subtree of nodes where each AND becomes two new nodes (with OR being the node name), and each OR becomes another line in a stacked box of disjoined terms.
  3. For power blocks, the node name is simply "..." and below it we find any monad-restrictions spelled out (e.g., "< 5").
  4. For gap blocks, the node name is simply "gap".
  5. For optional gap blocks, the node name is simply "optional gap".
  6. For groupings, the node name is simply "group".  Any repetition (kleene star) gets shown below the "group" name, e.g., "*{1-3}" or simply "*".
  7. For OR between strings of blocks, the node name is simply "OR".

There should be a palette from which to choose these node types.

Each node should result in a side-panel which shows the options for this node-type

If it is an object block:

  • All features, together with the possible values (e.g., for enumerations, a checklistbox; for strings, a text control, etc.)
  • A way of saying that such and such a feature is equal to (less than, greater than, different from, etc.) some other feature of some other, named node in the tree.
  • Whether the object block should NOTEXIST or not.
  • Whether the object block should be FIRST, LAST, or FIRST AND LAST within the context.
  • Any repetition (Kleene Star).

If it is a power block:

  • Any monad-restrictions.

If it is a gap or optional gap block:

  • Nothing to select.

If it is a grouping:

  • Any repetition (Kleene Star).

If it is an OR between strings of blocks:

  • Nothing to select.

There should be ways of moving nodes around, and copying and pasting subtrees.

The tree should probably have slanted lines rather than lines that are perpendicular.

The tree should not have the leaf nodes in a straight line at the bottom, but should have the leaf nodes that are at the same level be horizontally laid out in a straight line.

The above is a general overview of what it should look and feel like. Much inspiration was taken from the way that Logos Bible Software does it. They, however, have a tree which grows from the left and goes right.

I do believe that the above will make it easier for the user to understand what is going on.

The above is only a sketch, with lots of details to be filled out.

But it's a start.

Ulrik