window_create
window_create (class[, flags[, doc[, geom[, parent[, xuipath]]]]])
This function creates a window of the specified class with optional components given by flags and returns a unique identifier that may be used in subsequent calls to the window_xxx functions. The window created is not initially displayed. Use the window_show function to make the window appear.
Windows are of two types:
• Document class windows that display a document tree and have a class of edit, helpwin[1-4], or msgwin[1-4].
• Dialog class windows that display either a list selection dialog box of classlist or xui.
The class determines the default geometry and, for classes other than list, the class-specific keymap. By default, a new keymap is created for the window on the first map command processed for the window. This keymap has the name windown, where n is the identifier of the window, and is deleted when the window is destroyed. If a set keymap=user command is executed for the window, or if bit 0x00040 is specified in flags, the global keymap for the class will be used. See the flags bit descriptions below.
The flags parameter is a bit mask that depends on the class and is defined below:
The following are the flag bits for list and xui class windows.
• 0x1 — Supply vertical scrollbar.
• 0x2 — Verify input (that is, set verify Item attribute).
• 0x4 — Supply an Apply button,
• 0x8 — Supply a Help button.
• 0x10 — For XUI dialog boxes, delete the document after the window is destroyed. In the following example, $doc will be destroyed automatically after $win is destroyed:
$doc = doc_open('c:\myproject\myxuifile', 1);
$win = window_create('xui', 0x10, $doc);
• 0x040000 — Make the new window a top-level window with its parent being the desktop. This flag is only useful to the xui and list class windows; the windows of all other window classes are created as top-level windows.
OK and Cancel buttons are always supplied.
The following are the flag bits for document class (all non-
list) windows. The “(pane)” note indicates a flag that, when returned by
window_mask, reflects the status for the pane containing the cursor (that is, last active window).
• 0x00001 — Supply vertical scrollbar (pane).
• 0x00002 — Supply menu bar.
• 0x00004 — Supply command subwindow if class is edit.
• 0x00008 — Supply message footer subwindow.
• 0x00010 — Automatically call doc_close on the attached document when the window is destroyed. (pane).
• 0x00020 — Supply edit toolbar (that is, Toolbar 1) (pane).
• 0x00040 — Attach the global window class keymap to the window instead of creating a private keymap (pane).
• 0x00080 — Supply horizontal scrollbar (pane).
• 0x00200 — Split the window into two side–by–side (that is, next to one another other) panes.
|
You should not use this flag with window_create to create a multi-paned window. It is included in the bit mask for status checking using the window_mask function. Create the window with a single flag, but then use the window_split function to create multiple panes.
|
• 0x00400 — Split the window into two top/bottom (that is, one over the other) panes.
|
You should not use this flag with window_create to create a multi-paned window. It is included in the bit mask for status checking using the window_mask function. Create the window with a single flag, but then use the window_split function to create multiple panes.
|
• 0x00800 — Make the window a typical user edit window (as opposed to a display window).
• 0x01000 — Supply a table column width ruler (pane).
• 0x02000 — Supply a table row height ruler (pane).
• 0x04000 — Supply the Markup toolbar (that is, Toolbar 2).
• 0x08000 — Supply the Table toolbar (that is, Toolbar 3).
• 0x10000 — Supply the Application toolbar (that is, Toolbar 4).
• 0x080000 — Do not update the filelist option, the Arbortext EditorFile menu list of recently edited documents, or the Microsoft Windows list of recently edited documents with the path name associated with the doc parameter (if the 0x00800 flag is specified). Note that this does not apply to documents subsequently loaded in the window.
If a menu bar is requested, it must be initialized using the menu_load or menu_add commands before the window is first displayed.
If a message footer is created, error messages and output from the message command are displayed in the left part of the footer if the message is short enough (otherwise a dialog box is used). The message attribute of the window_set function may also be used to set the message text. Any messages directed to the message footer are considered transient and are erased on the next key or button event received in the window.
The doc parameter specifies the identifier of the document tree to be attached to the window. The document must not already be displayed in another window. If it is, the function returns -1. If doc is -1, a scratch document is created that will automatically be destroyed when the window is destroyed. In this case, the associated document type is ascii for edit class windows or the built-in help document type for other classes.
If the flags argument specifies bit 16, the doc_close is called on doc when the window is destroyed by window_destroy. In this case, the normal quit/exit processing is done. If there are unsaved changes, and if an exit command was used to dismiss the window, changes are saved without prompting. If a quit command caused the call to window_destroy, you are prompted to save any unsaved changes. The doc parameter does not apply to list class windows and is ignored if given.
geom specifies the initial geometry for the window and is a string of the form WxH+X+Y, where W and H are the width and height of the window in pixels, and X and Y give the location of the upper left corner of the window. Refer to the description of the
geometry attribute of
window_set for details.
window_set may be used to set various attributes for the window such as its title, status bar message, and destroy callback.
window_create returns -1 if the window cannot be created.
parent it is an optional parameter used as the parent window for the new window. Only supports dialog class. If parent is 0, then the active window is used.
xuipath is an optional parameter used only by edit windows to supply an alternative XUI file to define the toolbars used by the edit window. If xuiPath is not supplied (or empty), then Arbortext パス\lib\dialogs\editwindow.xml is used.