wv-dialog
| (require wv-dialog) |
Dialog-window wrapper built on top of wv-window%.
This module exports the wv-dialog% class. It is a specialized window class whose initial size and position are derived from its parent window.
1 Overview
A wv-dialog% object is a wv-window% that initializes itself as a dialog relative to its parent window.
The class inherits the window lifecycle, event handling, navigation, and dialog support from wv-window%. Its only specialization in the current source is the implementation of init-size.
2 Class: wv-dialog%
|
superclass: wv-window% |
Creates a dialog window.The constructor does not define additional initialization arguments of its own. Construction is delegated to wv-window% through super-new.
method
(send a-wv-dialog init-size) → any/c
Initializes the dialog size and position relative to its parent window.The method reads the parent window geometry from the inherited parent field:
x and y of the parent window
width and height of the parent window
It then determines the dialog width and height from settings, using the keys 'width and 'height. If a stored value is absent, the constructor fields width and height are used if present. Otherwise both dimensions default to 400.
The dialog position is then computed so that the dialog is centered within the parent window:
(let ((xx (/ (- pw dw) 2)) (yy (/ (- ph dh) 2))) ...) The resulting coordinates are rounded, converted to exact integers, and applied using:
(send this move x y) (send this resize dw dh) This method overrides the inherited init-size implementation from wv-window%.