# The User Interface

This section covers miscelaneous aspects related to Maze Editor's user interface such as basical ideology, windows and their meaning and so on.

## Interface ideology

The user-interface is almost-CUA compliant :-) First the terminology: a window does not neccessarily have a title bar or a border, it is just a rectangle which can be filled with anything. Any window can have "child windows" which are "inserted" into "parent" window. Child windows cannot extend over parent's bounds, if they do, they are clipped. There is a exception from this rule which is used, particularily, for menus (windows that have different "parent" and "clip parent" windows).

Here is a example how a CSWS (Crystal Space Windowing System) standard window looks like: (sorry if this looks like a Microsoft Press bullshit :-), this is just to avoid confusion because of different terms used in different windowing systems).

- Windows (won't say "objects" :-) are dragged with right mouse button As a exception, windows can be dragged with left mouse button too.
- Right mouse button click on any window pops up a context menu, if available.

Here and further left mouse button is called shortly LMB and right mouse button is called RMB. There is no support in MazeD for center button since most mices today has only two buttons.

Menus and dialog items often has some underlined characters. They are called "hot keys" and are used if you want to activate that item by keyboard. To use keyboard you should press Alt+"character that is underlined". For example, to activate this menu item: Quit you should press Alt+Q. As a exception from rule, if active dialog field doesn't eat the character (for example, a button labeled PushMe won't eat any keys except P when it is active (AKA focused)) you can press the same letter without Alt.

Menu bars are activated either by mouse (in which case it is deactivated as soon as you release mouse button) or by keyboard. For last one you should press Alt+hotkey, then use arrow keys to navigate around, Enter to choose a menu item (or to open a submenu if item has a arrow to the right of it), left/right keys on a menu item with a submenu opens/closes the submenu(s). Hot keys can be pressed without Alt since (see exception from hot key rule in paragraph above) menu item does not eat any key except its own hot key.

... to be continued ... ;-)

## Maze Editor Windows

Here is how Maze Editor basically looks like: The Tool Box contains a number of buttons that switches between editing modes. Editing mode has impact on how mouse clicks in Draft Editor and 3D View are interpreted. For example, in "Create Vertex" mode (a red little flag in top-left corner of toolbox) mode a LMB click will insert a vertex at given position into current model. Clicking RMB on a toolbox button brings a context menu where you can switch between several editing modes available for assigning to this button. On the picture you can see how the "Create 3D preset" button is set up; if you press for example LMB on the sphere, the picture on the top-level button will be replaced with the sphere and you enter into the "Create sphere" mode.

A short description of each button (buttons are described in the left-to-right and top-to-bottom direction):

- Toolbox:
  - "Create Vertex". Context menu: "Delete Vertex", "Delete Selected Vertices", "Delete Selected Polygons".
  - "Create Light".
  - "Create 2D Preset". Context menu: "Create Triangle", "Create Square", "Create Hexagon", "Create N-gon".
  - "Create 3D Preset". Context menu: "Create Box", "Create Prism", "Create Pyramid", "Create Torus", "Create Sphere". Right clicking on any button should bring the object complexity setup dialog where you can enter the number of vertices, faces, sectors etc.
  - "Create Polygon". Context menu: "Click Each Vertex", "Triangle Fan", "Triangle Strip", "Square Strip".
  - "Select". Context menu: "Select Vertices", "Deselect Vertices", "Invert Vertices", "Select Polygons", "Deselect Polygons", "Invert Polygons".
  - "Move"
  - "Scale"
  - "Rotate"
- Window Manager:
  - "Window Layout 1"
  - "Window Layout 2"
  - "Window Layout 3"
  - "Window Layout 4" When switching window layouts MazeD stores the type, parameters and position of each window except menu bar. Then you can re-position and change other parameters of your windows; when you will switch to previous layout windows will be restored as they were before you changed them.
  - "Close all windows"
  - "Recycle Windows". Windows are restored to their default position and parameters.
  - "Rotate Coordinate System". In this mode, after clicking with LMB in draft editor window you can move the mouse to rotate the coordinate system. Horizontal mouse motion rotates coordinate system horizontally (around OZ axis) while vertical mouse motion rotates coordinate system around OX axis. This is not a fully 6-degree-of-freedom system (although it can be easily expanded to be so), but its enough for practical goals. The problem is that mouse has only two motion directions :-)
  - "Zoom in/out". In this mode clicking LMB inside a draft editor window will zoom the picture in, clicking RMB will zoom it out.
  - "Zoom to rectangle". In this mode you're allowed to drag (with LMB) a rectangle around the area of model you're interested in; after this when you release LMB the view zooms so that selected area will occupy maximally possible area of view.
  - "Pan View". Pressing LMB in a draft editor window will enter into panning mode until you will release it. You can move the draft by moving mouse. Scale and rotation factors are not affected.
  - "Toggle axis". This button shows and allows to be changed the visibility status of coordinate axis.
  - "Toggle grid". This button shows and allows to be changed the visibility status of coordinate grid. RMB on this button will bring up the grid setup dialog box.

## Hot keys

I'm a son of CUA :-) and as such, many keys are alike their counterparts in CUA, whenever possible (and whenever I like it :-) However, most keys are MazeD-specific, I've tried to bind most used functions to a key since mouse is good for beginners, but with keyboard you can work a lot faster.

I've tried to bind most keys to function keys like HOME, END, INS, DEL and their combinations with CTRL, ALT, SHIFT. The reason for this is that that's what they (function keys) were made for :-)

Shift+Q
  Quit editor. I've considered using F3 (CUA) for this but thought that many (including me :-) will consider this weird.
Ins
  Enter "Create Vertices" mode
Del
  Enter "Delete Vertices" mode
Ctrl+Ins
  Enter "Create Polygon By Clicking Each Vertex" mode
Ctrl+Alt+Ins
  Enter "Create Triangle Fan" mode
Ctrl+Shift+Ins
  Enter "Create Triangle Strip" mode
Ctrl+Shift+Alt+Ins
  Enter "Create Quad Strip" mode
Ctrl+Del
  Delete selected vertices (no confirmation!)
Ctrl+Shift+Del (not Ctrl+Alt+Del! :-)
  Delete selected polygons
Home
  Center all draft views to the origin of coordinates
Ctrl+Home
  Make all draft views to maximally fit the active model
Ctrl+1...4
  Choose window layout 1...4
+, -, *
  Enter "Select/Deselect/Invert Vertices" mode
Ctrl+'+', Ctrl+'-', Ctrl+'*'
  Select/Deselect/Invert all vertices of the active model
Shift+'+', Shift+'-', Shift+'*'
  Enter "Select/Deselect/Invert Polygons" mode
Ctrl+Shift+'+', Ctrl+Shift+'-', Ctrl+Shift+'*'
  Select/Deselect/Invert all polygons of the active model