Documentation of BanghamLab utilities

From BanghamLab
Revision as of 16:16, 30 March 2013 by AndrewBangham (talk | contribs)
Jump to navigation Jump to search

[Return to Software]

In preparation

GuiDemo for rapidly creating user interfaces from simple dialogues to full applications

Whilst the Matlab guide is very useful for rapidly creating graphical user interfaces (GUIs) with an arbitrary layout, we find that it is even quicker to base a GUI on GuiDemo.
Why? Because we find it easier to delete things we don't want, and modify those that we do want, rather than starting with a blank screen.

Creating a GUI based on GuiDemo

Description of how the ConnectedSets Gui was created.

  1. Copy the contents of \DArT_Toolshed\ToolBag\Demo of JRK GUI to your working directory.
  2. Rename, e.g. GuiDemo.m to ConnectedSets.m and GuiDemoLayout.txt to ConnectedSetsLayout.txt
  3. Within ConnectedSets.m replace all strings GuiDemo by ConnectedSets. We now have a working template.
Working template created by GuiDemo.

It has names (GuiDemo), menus, buttons and a graphics window. All of which can readily be changed or deleted.
ClosiItalic textng either window closes both.
Having selected a menu item or pressed a button, the callback is displayed in the command window. This makes it easier to edit/add the required functions.

Heartdrawing
  1. Text and the left hand, GUI, panel is specified by the text file ConnectedSetsLayout.txt. A small fragment is shown here
  2. figure { string "GuiDemo" tag figure_GuiDemo callback GuiDemo inherit callback menu { string "File" size "0 0" menu { string "New Project" } menu { string "Open Project..." } menu { string "Save Project As..." } menu { string "Close Project" } menu { string "Show Project On Desktop" } } Full listing of template

    Once again replace all strings GuiDemo by ConnectedSets within ConnectedSetsLayout.txt.
  3. Notice all the buttons and menu items are specifed in ConnectedSetsLayout.txt. The layout is automatically created from the structure of ConnectedSetsLayout.txt. Callback names etc. tags etc. are created automatically.
  4. For the new ConnectedSet application we will probably need the main menus. For the moment we can change the View menu, modify the buttons and add a couple of dropdown lists (to select images, and to select what we want to display. For working examples, in addition to ConnectedSetLayout.txt also look at MTtboxLayout.txt