Class ColumnResizingTool
The ColumnResizingTool class lets the user resize each column of a named Table Panel in a selected Part.
Namespace: Northwoods.Go.Tools.Extensions
Assembly: ColumnResizingAvalonia.dll
Syntax
public class ColumnResizingTool : Tool
Constructors
ColumnResizingTool()
Constructs a ColumnResizingTool and sets the handle and name of the tool.
Declaration
public ColumnResizingTool()
Properties
AdornedTable
This read-only property returns the Panel of type PanelLayoutTable whose rows are being resized.
Declaration
public Panel AdornedTable { get; }
Property Value
Type | Description |
---|---|
Panel |
Remarks
This must be contained within the selected Part.
Handle
This read-only property returns the GraphObject that is the tool handle being dragged by the user.
Declaration
public GraphObject Handle { get; }
Property Value
Type | Description |
---|---|
GraphObject |
Remarks
This will be contained by an Adornment whose category is "ColumnResizing". Its AdornedElement is the same as the AdornedTable.
HandleArchetype
Gets or sets small GraphObject that is copied as a resize handle for each column.
Declaration
public Shape HandleArchetype { get; set; }
Property Value
Type | Description |
---|---|
Shape |
Remarks
This tool expects that this object's DesiredSize (width and height) has been set to real numbers.
The default value is a Shape that is a narrow rectangle.
TableName
Gets or sets the name of the Table Panel to be resized.
Declaration
public string TableName { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
The default value is the name "TABLE".
Methods
CanStart()
This tool may run when there is a mouse-down event on a "ColumnResizing" handle, the diagram is not read-only, the left mouse button is being used, and this tool's adornment's resize handle is at the current mouse point.
Declaration
public override bool CanStart()
Returns
Type | Description |
---|---|
bool |
Overrides
ComputeResize(Point)
This can be overridden in order to customize the resizing process.
Declaration
public virtual Point ComputeResize(Point p)
Parameters
Type | Name | Description |
---|---|---|
Point | p | the point where the handle is being dragged |
Returns
Type | Description |
---|---|
Point |
DoActivate()
Find the Handle, ensure type PanelLayoutTable, capture the mouse, and start a transaction.
Declaration
public override void DoActivate()
Overrides
Remarks
If the call to FindToolHandleAt(Point, string) finds no "ColumnResizing" tool handle, this method returns without activating this tool.
DoDeactivate()
Stop the current transaction and release the mouse.
Declaration
public override void DoDeactivate()
Overrides
DoKeyDown()
Pressing the Delete key removes any column width setting and stops this tool.
Declaration
public override void DoKeyDown()
Overrides
DoMouseMove()
Call Resize(Point) with a new size determined by the current mouse point.
Declaration
public override void DoMouseMove()
Overrides
Remarks
This determines the new bounds by calling ComputeResize(Point).
DoMouseUp()
Call Resize(Point) with the final bounds based on the most recent mouse point, and commit the transaction.
Declaration
public override void DoMouseUp()
Overrides
Remarks
This determines the new bounds by calling ComputeResize(Point).
Resize(Point)
Change the Width of the column being resized to a value corresponding to the given mouse point.
Declaration
public void Resize(Point newPoint)
Parameters
Type | Name | Description |
---|---|---|
Point | newPoint | the value returned by the call to ComputeResize(Point) |
UpdateAdornments(Part)
Show an Adornment with a resize handle at each column. ///
Declaration
public override void UpdateAdornments(Part part)
Parameters
Type | Name | Description |
---|---|---|
Part | part |
Overrides
Remarks
Don't show anything if TableName doesn't identify a Panel that has a Type of type PanelLayoutTable.