Class RowResizingTool

GoDiagram®
v10.0.8
by Northwoods Software®

The RowResizingTool class lets the user resize each row of a named Table Panel in a selected Part.

Inheritance
RowResizingTool
Namespace: Northwoods.Go.Tools.Extensions
Assembly: RowResizingWinForms.dll
Syntax
public class RowResizingTool : Tool

Constructors

RowResizingTool()

Constructs a RowResizingTool and sets the handle and name of the tool.

Declaration
public RowResizingTool()

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 "RowResizing". Its AdornedElement is the same as the AdornedTable.

HandleArchetype

Gets or sets small GraphObject that is copied as a resize handle for each row.

Declaration
public GraphObject HandleArchetype { get; set; }
Property Value
Type Description
GraphObject
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 "RowResizing" 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 "RowResizing" 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 Height of the row 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 row.

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.