Provides window-message and layout integration for forms whose non-client UI is rendered by a child control. Derived behaviors supply the form element and handle form-state and composition changes.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Type Parameters:
T
The RadNonClientUIControl that renders the non-client UI.
Syntax:
public abstract class RadNonClientUIBaseFormBehavior<T> : ThemedFormBehavior, IComponent, IDisposable where T : RadNonClientUIControl
Inheritance: objectMarshalByRefObjectComponentFormControlBehaviorThemedFormBehaviorRadNonClientUIBaseFormBehavior<T>...
Derived Classes:
Implements:
Inherited Members
Constructors
Creates an instance of the "RadNonClientUIBaseFormBehavior" class.
public RadNonClientUIBaseFormBehavior()
Creates an instance of the "RadNonClientUIBaseFormBehavior" class.
public RadNonClientUIBaseFormBehavior(IComponentTreeHandler treeHandler, bool shouldHandleCreateChildItems)
The associated IComponentTreeHandler implementation.
shouldHandleCreateChildItemsboolDetermines whether the behavior handles the CreateChildItems call.
Creates an instance of the "RadNonClientUIBaseFormBehavior" class.
public RadNonClientUIBaseFormBehavior(IComponentTreeHandler treeHandler)
The IComponentTreeHandler implementation associated with this behavior.
Fields
The non-client element whose mouse capture is released when the pointer leaves the form.
protected RadElement capturedNCItem
Caps the frame-border inset used when calculating the region of a maximized form with composition enabled.
protected const int MaxFormBorderHeight = 4
Minimum bottom inset used to keep the auto-hide taskbar reveal area available.
protected const int RegionHeightEllipse = 9
Properties
Gets or sets value indicating whether the NC control is drawn over the Aero glass under Vista or later versions of Windows.
[Browsable(false)]
public override bool AllowTheming { get; set; }
Overrides:
Returns a zero for the caption height.
public override int CaptionHeight { get; }
Overrides:
Gets the caption text element's bounds in the hosted control, or an empty rectangle if the control is absent.
public override Rectangle CaptionTextBounds { get; }
Overrides:
Gets the margin reserved for the client area, accounting for the form border and composition state. When maximized, the bottom margin uses RegionHeightEllipse to preserve the taskbar reveal area.
public override Padding ClientMargin { get; }
Overrides:
Gets a boolean value indicating whether composition effects are enabled for the form.
public bool CompositionEffectsEnabled { get; }
Gets a value indicating whether composition effects are enabled for the Operating System.
protected bool CompositionEnabled { get; }
Gets the element that renders this behavior's form chrome.
public override RadElement FormElement { get; }
Overrides:
This behavior renders icon content through the hosted non-client control rather than a separate native region.
public override Rectangle IconBounds { get; }
Overrides:
This behavior renders menu content through the hosted non-client control rather than a separate native region.
public override Rectangle MenuBounds { get; }
Overrides:
Gets the hosted non-client control, locating and caching it among the associated form's child controls when needed.
protected virtual T NonClientUIControl { get; set; }
The control attached to the form, or null when no matching control is present.
Gets the system-buttons element's bounds in the hosted control, or an empty rectangle if the control is absent.
public override Rectangle SystemButtonsBounds { get; }
Overrides:
Gets an integer representing the top client margin of the form when composition is enabled.
public abstract int TopCompositionMargin { get; }
Methods
Applies behavior-specific changes required by the current desktop-composition state.
protected abstract void AdjustBehaviorForCompositionSate()
Updates the hosted icon element from the form's icon and visibility settings. Application-menu forms and tool-window styles hide the icon.
public virtual void AdjustFormIconVisibility()
Updates custom system-button visibility and enabled states to match the form's border and box settings.
protected void AdjustSystemButtonsForStyle()
Creates the form element and adds it to the supplied parent element.
public override void CreateChildItems(RadElement parent)
The element that receives the form element.
Overrides:
Creates the element that renders the form's custom non-client UI.
Removes the native caption style when operating without desktop composition.
public override CreateParams CreateParams(CreateParams parameters)
The native window parameters to adjust.
Returns:The adjusted window parameters.
Overrides:
Provides a cleanup hook for derived behaviors to release resources associated with the non-client control.
protected virtual void DisposeNonClientUIControlImpls()
Extends the desktop-composition frame into the client area by TopCompositionMargin. Does nothing until the form has a handle.
protected virtual void ExtendFrameIntoClientArea()
Provides a hook for derived behaviors to respond to a child control being added to the form.
protected virtual void Form_ControlAdded(object sender, ControlEventArgs e)
The form raising the event.
eControlEventArgsInformation about the added control.
Loads the hosted non-client control's element tree after the form handle is created.
public override void FormHandleCreated()
Overrides:
Dispatches selected non-client, activation, style, icon, text, and mouse messages when CanHandleWndProc() permits it. Depending on composition state, unhandled messages are delegated to the base behavior or left unhandled.
Provides a hook to initialize menu-strip state required by a derived non-client behavior.
protected virtual void InitializeDummyMenuStrip()
Initializes the hosted control that renders the form's non-client UI.
protected abstract void InitializeNonClientUIControl()
Converts a client-coordinate point to the non-client coordinate space by applying ClientMargin.
Synchronizes the hosted non-client control's text with the form after the active MDI child text changes.
protected override void OnActiveMDIChildTextChanged()
Overrides:
Calls the base background handler when needed, then excludes the top composition margin from the paint clip.
public override bool OnAssociatedFormPaintBackground(PaintEventArgs args)
The paint arguments for the associated form.
Returns:false because this behavior does not report the background as handled.
Overrides:
Subscribes to form lifecycle events and initializes composition and non-client state immediately or on load.
protected override void OnFormAssociated()
Overrides:
Sets the minimum tracking width to the system minimized-window width and the minimum height to 100, then lets the base behavior process the request.
protected override void OnGetMinMaxInfo(MinMaxInfo minMaxInfo)
The native minimum and maximum tracking information to update.
Overrides:
Updates derived non-client state after the base behavior processes a window activation message.
protected abstract void OnWMActivateCore(ref Message m)
The activation message.
Handles a non-client left-button press dispatched from HandleWndProc(ref Message).
protected abstract void OnWmNCLeftMouseButtonDown(ref Message m)
The non-client mouse message.
Handles a non-client left-button release dispatched from HandleWndProc(ref Message).
protected abstract void OnWmNCLeftMouseButtonUp(ref Message m)
The non-client mouse message.
Routes a non-client right-button release to the form and opens the system menu when the title bar was hit.
protected virtual void OnWMNCRightButtonUp(ref Message m)
The non-client mouse message.
Provides a design-time hook for handling parent notifications; the base implementation does nothing.
protected virtual void OnWmParentNotifyInDesigner(ref Message m)
The parent-notification message.
Forwards the icon message to the native form and synchronizes its small icon with the hosted title-bar element.
protected virtual void OnWmSetIcon(ref Message m)
The window message containing the icon handle and icon size.
Forwards the text-setting message to the base window procedure.
protected virtual void OnWmSetText(ref Message m)
The window message containing the new form text.
Applies an inset region to an unconstrained maximized form, or uses the root element's shape (falling back to a rounded region) for other window states.
protected void ResetFormRegion()
Provides a hook for derived behaviors to refresh MDI buttons and caption text before non-client recalculation.
protected virtual void UpdateMDIButtonsAndCaptionText()
Updates the form and non-client control after the operating system's composition state changes.
protected abstract void UpdateNCComposition()