Skip to main content

XSalToolbox

Namespace: PPJ.Runtime.XSal

Assembly: PPJ.Runtime.XSal.50 (5.0.0.0)

Provides a SAL dialog-based toolbox that can dock on an owner form or float in its own window.

public class XSalToolbox : SalDialogBox, IMessageFilter

Create application toolbox templates through Create to initialize the owner and docking toolbar system.

Example:

void HideTools(System.Windows.Forms.Form owner)
{
var tools = PPJ.Runtime.XSal.XSalToolbox.FromName(owner, "Tools");
if (tools != null)
tools.Hide();
}

Constructors

Instance member XSalToolbox()

Initializes the toolbox dialog and its drag handle.

Properties

Instance member Flags

ToolboxFlags: Gets or sets toolbox behavior flags while suspending docking-toolbar layout during the update.

Instance member Owner

Form: Gets the application form that owns the toolbox and its docking toolbar system.

Instance member Position

ToolboxPositions: Gets or sets the docking or floating position and rearranges toolbox contents.

Changing position restores a saved toolbar child order when available.

Methods

Protected member CanDock(side)

Determines whether the toolbox may dock on a given edge.

ParameterTypeDescription
sideSideThe proposed docking edge.

Returns: Boolean. True by default; override to restrict docking.

Protected member CanFloat()

Determines whether the toolbox may become a floating window.

Returns: Boolean. True by default; override to prevent floating.

Static member Create(name, form, position, flags)

Creates a toolbox from a registered SAL window template and configures its owner, docking, flags, and child layout.

ParameterTypeDescription
nameStringThe window template name to create.
formFormThe owning form.
positionToolboxPositionsThe initial docked or floating position.
flagsToolboxFlagsInitial toolbox behavior and visibility flags.

Returns: XSalToolbox. The configured toolbox, or null when the template cannot be created.

Throws:

Static member FromHandle(handle)

Resolves a native window handle to a toolbox.

ParameterTypeDescription
handleSalWindowHandleThe toolbox window handle.

Returns: XSalToolbox. The toolbox, or null when no managed control is associated.

Throws:

Static member FromName(form, name)

Finds a docked or floating toolbox by its exact control name.

ParameterTypeDescription
formFormThe owning form.
nameStringThe case-sensitive toolbox name.

Returns: XSalToolbox. The matching toolbox, or null when the form or toolbox is unavailable.

Protected member OnClosing(e)

Cancels closing and hides the toolbox before raising the base closing event.

ParameterTypeDescription
eCancelEventArgsThe closing event and cancellation state.

Protected member OnHandleCreated(e)

Applies flat toolbar styling at run time when the shared toolbar appearance requests it.

ParameterTypeDescription
eEventArgsThe handle-creation event data.

Protected member OnMouseDown(e)

Starts moving the toolbox or resizing a docked fill-client edge.

ParameterTypeDescription
eMouseEventArgsThe mouse position and button information.

Protected member OnMouseLeave(e)

Restores the default pointer before raising the base mouse-leave event.

ParameterTypeDescription
eEventArgsThe event data.

Protected member OnMouseMove(e)

Updates active move or resize feedback, or selects a resize cursor over an eligible edge.

ParameterTypeDescription
eMouseEventArgsThe mouse event data.

Protected member OnMouseUp(e)

Commits an active move or resize operation.

ParameterTypeDescription
eMouseEventArgsThe mouse event data.

Protected member OnPaint(e)

Draws the docked toolbox border when themed backgrounds are disabled, then raises the base paint event.

ParameterTypeDescription
ePaintEventArgsThe drawing surface and clip bounds.

Protected member OnPaintBackground(e)

Paints an orientation-aware themed background when enabled, or delegates to the base dialog.

ParameterTypeDescription
ePaintEventArgsThe drawing surface and clip bounds.

Protected member OnResize(e)

Remembers the floating client size before raising the base resize event.

ParameterTypeDescription
eEventArgsThe event data.

Static member SetMetrics(value, type)

Assigns a shared toolbox size or placement-offset metric.

ParameterTypeDescription
valueInt32The metric value in pixels.
typeToolbarMetricsThe width, height, left-offset, or top-offset metric to update.

Protected member SetVisibleCore(value)

Synchronizes the Visible toolbox flag with the requested visibility.

ParameterTypeDescription
valueBooleanTrue to show the toolbox; false to hide it.

Instance member UpdateLayout()

Reloads stored child bounds and requests layout from the current parent.

Implements

NameDescription
ISalWindow