Table of Contents

Class RowResizingTool

Namespace
Northwoods.Go.Tools.Extensions
Assembly
RowResizingWinForms.dll

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

public class RowResizingTool : Tool
Inheritance
RowResizingTool
Inherited Members

Constructors

RowResizingTool()

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

public RowResizingTool()

Properties

AdornedTable

This read-only property returns the Panel of type PanelLayoutTable whose rows are being resized.

public Panel AdornedTable { get; }

Property Value

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.

public GraphObject Handle { get; }

Property Value

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.

public GraphObject HandleArchetype { get; set; }

Property Value

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.

public string TableName { get; set; }

Property Value

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.

public override bool CanStart()

Returns

bool

ComputeResize(Point)

This can be overridden in order to customize the resizing process.

public virtual Point ComputeResize(Point p)

Parameters

p Point

the point where the handle is being dragged.

Returns

Point

DoActivate()

Find the Handle, ensure type PanelLayoutTable, capture the mouse, and start a transaction.

public override void DoActivate()

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.

public override void DoDeactivate()

DoKeyDown()

Pressing the Delete key removes any column width setting and stops this tool.

public override void DoKeyDown()

DoMouseMove()

Call Resize(Point) with a new size determined by the current mouse point.

public override void DoMouseMove()

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.

public override void DoMouseUp()

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.

public void Resize(Point newPoint)

Parameters

newPoint Point

the value returned by the call to ComputeResize(Point)

UpdateAdornments(Part)

Show an Adornment with a resize handle at each row.

public override void UpdateAdornments(Part part)

Parameters

part Part

Remarks

Don't show anything if TableName doesn't identify a Panel that has a Type of type PanelLayoutTable.