ban2/png

tutor/gif
Home

cell/gif

Creating and showing Toolbox objects automatically

A very useful feature of the Toolbox is that objects can be created and shown without the need to write code. This example displays a window when it is double-clicked

cell/gif
1/gif Create a shell application via the New app entry in AppBasic's iconbar menu
2/gif Edit the application's resfile so that it contains only a window template
  1. Delete the resfile's templates
    Double-click the resfile to open its display. Selected templates are deleted via the Edit submenu in the resfile-display's popup menu (keypress shortcut: Ctrl-K).
  2. Create a window template
    dis/gifAdjust-select ResEd's iconbar icon to open the object's prototype window. Drag a window template from this display to the resfile display. (You can rename the template if you wish)
3/gif Set the window to be auto-create and auto-show
  1. Open the object flags dbox
    Select the window's template in the resfile display and popup its menu. Follow the route Edit -> Object flags -> dbox
  2. Select the Auto-create and Auto-show options
oflags/gif
The object flags dbox can opened by using the keypress shotcut Ctrl-O
4/gif Apply the Quit_Quit event to the action of closing the window
  1. Double-click the window template (in the resfile display)

    window/gifThis opens an editable copy of the window on the desktop.

    N.B. When most templates are double-clicked in a resfile display their edit dboxes are directly opened. The exception to this rule are Windows (and menus) which display a representation of themselves. They are edited via these representations' popup menus.

  2. Double-click the window
    quit/gifThis opens the window's main dialogue box.

    Insert the Quit_Quit event into Deliver event when hidden.

    close/gif

    (i.e. when the window's close icon is selected the application will close down).
5/gif Save the resfile to the application's resources directory
A keypress shortcut for opening the save dbox is to press function key F3 (when the resfile display has the input focus). Otherwise saving can be performed via the resfile display's popup menu. N.B. The standard name res must be used for the resfile.
6/gif Run the application
The window will open on the desktop exactly in the position and size it was when last viewed in the resfile editing process.
7/gif Worked solution