Lisp HUG Maillist Archive

implementing my own layout

My application has a window with complicated scrolling requirements.
The display has headings at the left hand edge which can scroll up and
down but are locked at the left hand edge of the window.  There are
also headings across the top which can scroll sideways but are locked
at the top of the window.  The remainer of the window can be scrolled
on both axes, but the applicxation allows for split scrolling, so that
scrollable horizontal (and vertical) portion of the window can be
divided arbitrarily into two independent scrolling regions, each with
its own scroll bar at the bottom (right hand edge) of the window.

Since the required behavior does not appear to be provided by any
existing CAPI components, I'm trying to make my own.

I've been getting some advice from a friend who's experienced with
CAPI but hasn't used it in a while.  He suggested that I define my own
layout type for this.

I've defined a layout which has a main pane in which all display
occurs.  Dependng on the dimensions required by the output as compared
with the size of the window, and the state of the user controlled
scroll splitting, the layout may decrease the size of the display pane
and install scroll bars at the bottom and right edges.

Note that for the intended use of this layout the value passed for the
:DESCRIPTION initarg is irrelevant.  The layout knows what kind of
pane to make for the display and it makes the scroll bars at its own
discretion.

I discovered that in order for anything to be displayed by the layout,
its CAPI:INTERPRET-DESCRIPTION methos must return GEOMETRY objects for
each of its contained elements.  This is apparently the only way for
the layout to find out who its children are.

No where in the CAPI documentation or examples can I find out how to
either create a GEOMETRY object or how to extract the exitsing one
from a CAPI object.  Using the class inspector I found the
undocumented, unexported slot accessor CAPI::GEOMETRY-CACHE which
seems to do what I need.

When the the display pane is not wide enough for the data or the user
has opted for split scrolling, the mechanism which leads to the call
to CAPI:INTERPRET-DESCRIPTION must be invoked again so that the layout
can be fully aware of its components.  I've been doing (SETF
(LAYOUT-DESCRIOTION ...) ...) do do this.  Is there another exported
interface to that mechanism?


Updated at: 2020-12-10 08:57 UTC