23 Panel
See panel:single-mixin%.
Sets the active child to be child
Returns the current active child.
This mixin adds single panel functionality to an implementation of the
area-container<%> interface.
Single panels place all of the children in the center of the panel, and allow
make one child to be visible at a time. The
active-child method controls which panel is
currently active.
The
show method is used to hide and show the children of a
single panel.
Hides this child by calling
(send child show #f), unless this is
the first child in which case it does nothing.
Returns the maximum width of all the children and the maximum height of all
of the children.
Returns the positions for single panels and panes.
Factors the border width into the size calculation.
Classes matching this interface implement a panel where the user can adjust
the percentage of the space that each takes up. The user adjusts the size by
clicking and dragging the empty space between the children.
This method is called when the user changes the percentage by dragging the
bar between the children, or when a new child is added to the frame, but
not when
set-percentages is called.
Use get-percentages to find the current
percentages.
Called when the number of children in the panel changes;
the result is used as the initial percentages for each of the new
windows.
The numbers in the result list must sum to 1.
This method is called when the user right-clicks in the space
between two children. It receives the mouse event and the
child before and after the gap where the user clicked.
Call this method to set the percentages that each window takes up of the
panel.
The argument, new-percentages must be a list of numbers that sums
to 1. It’s length must be equal to the number of children of the panel (see
get-children) and each percentage must
correspond to a number of pixels that is equal to or larger than the
minimum with of the child, as reported by min-width.
Return the current percentages of the children.
This method controls the behavior of the other overridden methods in mixins
that implement this interface.
If it returns #t, the panel will be vertically aligned and if it
returns #f, they will be horizontally aligned.
Updates the number of percentages to make sure that it matches the number
of children and calls
after-percentage-change.
When the cursor is dragging the middle bar around, this method handles the
resizing of the two panes.
Places the children vertically in the panel, based on the percentages
returned from
get-percentages. Also leaves a
little gap between each pair of children.
Computes the minimum size the panel would have to be in order to have the
current percentages (see
get-percentages).
A panel that implements
panel:splitter<%>. Children can be split
horizonally or vertically.
This mixin allows panels to split their children either horizontally or
vertically. Children that are split can be further split independant of any
other splitting.
Splits the canvas vertically by creating a new instance using
maker. This splitter object is passed as the argument to
maker and should be used as the parent field of the newly
created canvas.
Similar to split-vertical but splits horizontally.
Removes the given canvas from the splitter hierarchy and collapses
any split panes as necessary.
Returns the minimum width and height for a
panel:dragable<%> object
where
container-info (see
container-size for
more details on that argument) is the children’s info, and
bar-thickness and
vertical? indicate the properties of the panel.
This function is exported mostly for the test suite.
Returns the geometry information for a dragable panel. The inputs
are the
container-info (see
place-children for more info),
the
width and
height of the window, the
percentages for the spacing
of the children, and a real and a boolean indicating the thickness of the bar between
the child panels and whether or not this is a vertical panel, respectively.
This function is exported mostly for the test suite.