MODERNIZE interacts better with TEDIT split windows, THINFILES works better on filenames, not just extensions. TEDIT-PF is new: provides commands tpf and ts for doing PFCOPYBYTES or SEE to scrollable read-only TEDIT windows, also functions for remembering and reusing the regions of windows of particular types.
79 lines
3.9 KiB
Plaintext
79 lines
3.9 KiB
Plaintext
MODERNIZE documentation
|
|
|
|
Ron Kaplan, February 2021
|
|
|
|
[A renaming of an earlier MACINTERFACE package]
|
|
|
|
MODERNIZE is a simple Lispusers package that changes the mouse actions on Medley windows so that moving and shaping can be done in a way that approximates the behavior of windows on modern platforms, Mac, Windows, etc. It also adds some meta keys to also emulate more conventional behavior.
|
|
|
|
Thus, for a window that has been created or transformed in this way, you can move the window by left-clicking in the title bar and dragging the window's ghost region. Or you can reshape by clicking in a corner of the title bar or near the bottom of the window to drag out the ghost region by that corner.
|
|
|
|
The menu behavior for other buttons or buttons clicked in other positions is unchanged.
|
|
|
|
|
|
For bottom corners, "near" means inside the window within MODERN-WINDOW-MARGIN (initially 25) pixels above or to the left/right of the corner.
|
|
|
|
For top corners, "near" means within the title bar and within the margin from the left/right edges.
|
|
|
|
(Windows that don't have a title-bar, like Snap windows, can be set up so that moving can happen by clicking anywhere, and shaping at the top is determined by the margin inside the window region.)
|
|
|
|
When the package is loaded, this behavior is installed for the following kinds of windows:
|
|
|
|
Tedit
|
|
Debugger/break
|
|
Sedit
|
|
Inspector
|
|
Snap
|
|
Exec
|
|
File Browser
|
|
Grapher
|
|
|
|
The function MODERNWINDOW.SETUP establishes the new behavior for classes of windows:
|
|
|
|
(MODERNWINDOW.SETUP ORIGFN MODERNWINDOWFN ANYWHERE TITLEPROPORTION)
|
|
|
|
ORIGFN is either the name of the BUTTONEVENTFN for a class of windows (e.g. \TEDIT.BUTTONEVENTFN for Tedit windows) or it is a function that creates windows of a particulate kind (e.g. SNAPW or ADD-EXEC).
|
|
|
|
MODERNWINDOW.SETUP moves the definition of ORIGFN to the name (PACK* 'MODERN-ORIG- ORIGFN), and then provides a new definition for ORIGFN that does the moving or reshaping for clicks in the triggering locations, and otherwise passes control through to the original definition.
|
|
|
|
If ORIGNFN is a button event function, then MODERNWINDOWFN should not be specified. In that case a new definition for ORIGFN is constructed to provide the desired windowing behavior.
|
|
|
|
Otherwise, if ORIGFN is the function that creates windows of a class (e.g. SNAPW), then a MODERNWINDOWFN should be provided to create such windows (by calling (PACK* MODERN-ORIG- ORIGFN)). The definition of MODERNWINDOWFN replaces the original definition of ORIGFN.
|
|
|
|
If the flag ANYWHERE is non-NIL, especially for windows without a title bar, then the moving behavior is triggered by a click anywhere in the window (except the corners).
|
|
|
|
Because this works by redefining existing functions, it is important that the MODERNIZE package be loaded AFTER Tedit and Sedit, if those are not already in the sysout. And it should be called to upgrade the proper functions for other window classes that might later be added.
|
|
|
|
Provided these capabilities are already loaded, the following window classes are "modernized" when MODERNIZE is loaded are:
|
|
|
|
TEDIT
|
|
SEDIT
|
|
INSPECTOR
|
|
SNAP
|
|
DEBUGGER
|
|
EXEC
|
|
TABLEBROWSER
|
|
FILEBROWSER
|
|
FREEMENU
|
|
GRAPHER
|
|
PROMPTWINDOW
|
|
|
|
If it is not known or it is inconvenient to systematically upgrade a button function or a window-creation function, the new behavior can be provided after a particular window has been created, by invoking
|
|
|
|
(MODERNWINDOW WINDOW ANYWHERE TITLEPROPORTION)
|
|
|
|
This saves the windows existing BUTTONEVENTFN as a window property PREMODERN-BUTTONEVENTFN, and installs a simple stub function in its place.
|
|
|
|
If things go awry:
|
|
|
|
(UNMODERN.SETUP ORIGFN) is provided to restore the original behavior for windows whose buttonevent function is ORIGIN.
|
|
|
|
(UNMODERNWINDOW WINDOW) restores a modernized window (via MACWINDOW) to its original state.
|
|
|
|
Known issues:
|
|
|
|
Clicking at the bottom of an EXEC window running TTYIN is effective only when the input line is empty.
|
|
|
|
|
|
|