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.
- C#
- VB.NET
public class XSalToolbox : SalDialogBox, IMessageFilter
Public Class XSalToolbox
Inherits SalDialogBox
Implements 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
XSalToolbox()
Initializes the toolbox dialog and its drag handle.
Properties
Flags
ToolboxFlags: Gets or sets toolbox behavior flags while suspending docking-toolbar layout during the update.
Owner
Form: Gets the application form that owns the toolbox and its docking toolbar system.
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
CanDock(side)
Determines whether the toolbox may dock on a given edge.
| Parameter | Type | Description |
|---|---|---|
| side | Side | The proposed docking edge. |
Returns: Boolean. True by default; override to restrict docking.
CanFloat()
Determines whether the toolbox may become a floating window.
Returns: Boolean. True by default; override to prevent floating.
Create(name, form, position, flags)
Creates a toolbox from a registered SAL window template and configures its owner, docking, flags, and child layout.
| Parameter | Type | Description |
|---|---|---|
| name | String | The window template name to create. |
| form | Form | The owning form. |
| position | ToolboxPositions | The initial docked or floating position. |
| flags | ToolboxFlags | Initial toolbox behavior and visibility flags. |
Returns: XSalToolbox. The configured toolbox, or null when the template cannot be created.
Throws:
- ArgumentNullException The owner form is null.
- ArgumentException The created template does not derive from XSalToolbox.
FromHandle(handle)
Resolves a native window handle to a toolbox.
| Parameter | Type | Description |
|---|---|---|
| handle | SalWindowHandle | The toolbox window handle. |
Returns: XSalToolbox. The toolbox, or null when no managed control is associated.
Throws:
- InvalidCastException The associated control is not an XSalToolbox.
FromName(form, name)
Finds a docked or floating toolbox by its exact control name.
| Parameter | Type | Description |
|---|---|---|
| form | Form | The owning form. |
| name | String | The case-sensitive toolbox name. |
Returns: XSalToolbox. The matching toolbox, or null when the form or toolbox is unavailable.
OnClosing(e)
Cancels closing and hides the toolbox before raising the base closing event.
| Parameter | Type | Description |
|---|---|---|
| e | CancelEventArgs | The closing event and cancellation state. |
OnHandleCreated(e)
Applies flat toolbar styling at run time when the shared toolbar appearance requests it.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The handle-creation event data. |
OnMouseDown(e)
Starts moving the toolbox or resizing a docked fill-client edge.
| Parameter | Type | Description |
|---|---|---|
| e | MouseEventArgs | The mouse position and button information. |
OnMouseLeave(e)
Restores the default pointer before raising the base mouse-leave event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data. |
OnMouseMove(e)
Updates active move or resize feedback, or selects a resize cursor over an eligible edge.
| Parameter | Type | Description |
|---|---|---|
| e | MouseEventArgs | The mouse event data. |
OnMouseUp(e)
Commits an active move or resize operation.
| Parameter | Type | Description |
|---|---|---|
| e | MouseEventArgs | The mouse event data. |
OnPaint(e)
Draws the docked toolbox border when themed backgrounds are disabled, then raises the base paint event.
| Parameter | Type | Description |
|---|---|---|
| e | PaintEventArgs | The drawing surface and clip bounds. |
OnPaintBackground(e)
Paints an orientation-aware themed background when enabled, or delegates to the base dialog.
| Parameter | Type | Description |
|---|---|---|
| e | PaintEventArgs | The drawing surface and clip bounds. |
OnResize(e)
Remembers the floating client size before raising the base resize event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data. |
SetMetrics(value, type)
Assigns a shared toolbox size or placement-offset metric.
| Parameter | Type | Description |
|---|---|---|
| value | Int32 | The metric value in pixels. |
| type | ToolbarMetrics | The width, height, left-offset, or top-offset metric to update. |
SetVisibleCore(value)
Synchronizes the Visible toolbox flag with the requested visibility.
| Parameter | Type | Description |
|---|---|---|
| value | Boolean | True to show the toolbox; false to hide it. |
UpdateLayout()
Reloads stored child bounds and requests layout from the current parent.
Implements
| Name | Description |
|---|---|
| ISalWindow |