详细介绍:C# NX二次开发:树列表控件Tree详解
大家好,今天介绍ug二次开发过程中的一个叫树列表的控件,这个控件在块UI编辑器中可以使用。

这个控件中的一些属性和方式:就是下面
//
// 摘要:
// Represents the Tree block in block styler automation.
//
// 备注:
// To start utilizing the tree use methods such as NXOpen.BlockStyler.Tree.InsertColumn(System.Int32,System.String,System.Int32),
// NXOpen.BlockStyler.Tree.CreateNode(System.String), NXOpen.BlockStyler.Tree.InsertNode(NXOpen.BlockStyler.Node,NXOpen.BlockStyler.Node,NXOpen.BlockStyler.Node,NXOpen.BlockStyler.Tree.NodeInsertOption)
// etc. It is must to insert the column on the tree before inserting any node. Node
// can be created but cannot be inserted without the column available on the tree.
// Note that some of the methods of this class such as NXOpen.BlockStyler.Tree.InsertColumn(System.Int32,System.String,System.Int32)
// must be used in or after the BlockStyler.BlockDialog.DialogShown callback after
// which tree is fully constructed and ready for use.
// Created in NX7.5.0
public class Tree : UIBlock
{
protected internal Tree();
//
// 摘要:
// Returns the first selected node among the available selected nodes.
//
// 备注:
// Returns a null reference (Nothing in Visual Basic) if no node is selected.
// Created in NX7.5.0
// License requirements: None.
public Node FirstSelectedNode { get; }
//
// 摘要:
// Returns or sets the Height
//
// 备注:
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public int Height { get; set; }
//
// 摘要:
// Returns or sets the Localize
//
// 备注:
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public bool Localize { get; set; }
//
// 摘要:
// Returns or sets the MaximumHeight
//
// 备注:
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public int MaximumHeight { get; set; }
//
// 摘要:
// Returns or sets the MaximumWidth
//
// 备注:
// Created in NX11.0.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public int MaximumWidth { get; set; }
//
// 摘要:
// Returns or sets the MinimumHeight
//
// 备注:
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public int MinimumHeight { get; set; }
//
// 摘要:
// Returns or sets the MinimumWidth
//
// 备注:
// Created in NX11.0.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public int MinimumWidth { get; set; }
//
// 摘要:
// Returns the number of column inserted in the tree.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public int NumberOfColumns { get; }
//
// 摘要:
// Returns or sets the CanStretchWidth.
//
// 备注:
// If true, width of TreeList block will change.
// Created in NX11.0.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public bool CanStretchWidth { get; set; }
//
// 摘要:
// Returns the root node.
//
// 备注:
// If more than one root node is available in top hierarchy then the first root
// node is returned.
// Created in NX7.5.0
// License requirements: None.
public Node RootNode { get; }
//
// 摘要:
// Returns or sets the ScrollLineNumber.
//
// 备注:
// It specifies the number of lines to scroll when the mouse wheel rotates.
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public int ScrollLineNumber { get; set; }
//
// 摘要:
// Returns or sets the SelectionMode
//
// 备注:
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public string SelectionModeAsString { get; set; }
//
// 摘要:
// Returns or sets the ShowExpandCollapseMarker.
//
// 备注:
// If true, displays a sign as a marker alongside first node of the tree indicating
// if it is expanded or collapsed.
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public bool ShowExpandCollapseMarker { get; set; }
//
// 摘要:
// Returns or sets the ShowHeader
//
// 备注:
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public bool ShowHeader { get; set; }
//
// 摘要:
// Returns or sets the ShowMultipleColumns
//
// 备注:
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public bool ShowMultipleColumns { get; set; }
//
// 摘要:
// Returns or sets the ShowToolTips
//
// 备注:
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public bool ShowToolTips { get; set; }
//
// 摘要:
// Returns or sets the SortRootNodes.
//
// 备注:
// If true, sorting of root nodes is allowed.
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public bool SortRootNodes { get; set; }
//
// 摘要:
// Returns or sets the Width
//
// 备注:
// Created in NX11.0.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public int Width { get; set; }
//
// 摘要:
// Returns or sets the ScrollFrozenColumn.
//
// 备注:
// It specifies the number of columns to freeze while scrolling.
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public int ScrollFrozenColumn { get; set; }
//
// 摘要:
// Returns or sets the CanStretchHeight.
//
// 备注:
// If true, height of list box will change.
// Created in NX8.5.0
// License requirements to get this property: None.
// License requirements to set this property: None.
public bool CanStretchHeight { get; set; }
//
// 摘要:
// Copies the existing NXOpen.BlockStyler.Node.
//
// 参数:
// sourceNode:
// Source node. Can be node of other tree.
//
// 返回结果:
// Copied node.
//
// 备注:
// The tree can copy either its own node or the node of another tree. The copied
// node can only be inserted into the tree which has copied that node. The column
// texts are not passed to the copied node.
// Created in NX7.5.0
// License requirements: None.
public Node CopyNode(Node sourceNode);
//
// 摘要:
// Creates the menu.
//
// 备注:
// Use NXOpen.BlockStyler.Tree.SetMenu(NXOpen.BlockStyler.TreeListMenu) to set the
// created menu.
// Created in NX7.5.0
// License requirements: None.
public TreeListMenu CreateMenu();
//
// 摘要:
// Creates the node but does not insert it.
//
// 参数:
// displayText:
// Specifies the display text of the node.
//
// 返回结果:
// Node
//
// 备注:
// Use NXOpen.BlockStyler.Tree.InsertNode(NXOpen.BlockStyler.Node,NXOpen.BlockStyler.Node,NXOpen.BlockStyler.Node,NXOpen.BlockStyler.Tree.NodeInsertOption)
// to insert the node.
// Created in NX7.5.0
// License requirements: None.
public Node CreateNode(string displayText);
//
// 摘要:
// Deletes the node from tree.
//
// 参数:
// node:
// Node to delete
//
// 备注:
// Further usage of deleted node is illegal. The last place where node can be used
// is in BlockStyler.Tree.OnDeleteNodeCallaback callback which gets called when
// node is deleted.
// Created in NX7.5.0
// License requirements: None.
public void DeleteNode(Node node);
//
// 摘要:
// Gets the display type of the column.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// 返回结果:
// Display type.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public ColumnDisplay GetColumnDisplayType(int columnID);
//
// 摘要:
// Gets the column Id for the provided column position.
//
// 参数:
// columnPosition:
// Column position.
//
// 返回结果:
// Unique column Id associated with the column.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public int GetColumnId(int columnPosition);
//
// 摘要:
// Gets column position.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// 返回结果:
// Column position.
//
// 备注:
// Returns -1 if no column is associated with the provided column Id.
// Created in NX7.5.0
// License requirements: None.
public int GetColumnPosition(int columnID);
//
// 摘要:
// Gets the column resize policy.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// 返回结果:
// Resize policy.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public ColumnResizePolicy GetColumnResizePolicy(int columnID);
//
// 摘要:
// Gets the flag indicating whether the column is sortable.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// 返回结果:
// Flag indicating whether the column is sortable.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public bool GetColumnSortable(int columnID);
//
// 摘要:
// Gets the column sort option.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// 返回结果:
// Column sort option.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public ColumnSortOption GetColumnSortOption(int columnID);
//
// 摘要:
// Gets the column title.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// 返回结果:
// Column header title.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public string GetColumnTitle(int columnID);
//
// 摘要:
// Gets the flag indicating whether the column is visible.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// 返回结果:
// Flag indicating whether the column is visible.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public bool GetColumnVisible(int columnID);
//
// 摘要:
// Gets column width
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// 返回结果:
// Column width.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public int GetColumnWidth(int columnID);
//
// 摘要:
// Gets the selected nodes.
//
// 返回结果:
// Selected nodes.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public Node[] GetSelectedNodes();
//
// 摘要:
// Gets the SelectionMode
//
// 返回结果:
// Value to get from the property
//
// 备注:
// Created in NX8.5.0
// License requirements: None.
public string[] GetSelectionModeMembers();
//
// 摘要:
// Inserts a column.
//
// 参数:
// columnID:
// Unique column Id associated with the column. Any further interaction with the
// column is done with this column Id.
//
// columnTitle:
// Column header title.
//
// columnWidth:
// Providing value less than zero will set the default width of 0 for the column.
//
// 返回结果:
// Absolute column position.
//
// 备注:
// Inserts a column with following defaults: NXOpen.BlockStyler.Tree.ColumnSortOption
// as NXOpen.BlockStyler.Tree.ColumnSortOption.Ascending Column sortable as True
// Column visible as True NXOpen.BlockStyler.Tree.ColumnDisplay as NXOpen.BlockStyler.Tree.ColumnDisplay.Text
// NXOpen.BlockStyler.Tree.ColumnResizePolicy as NXOpen.BlockStyler.Tree.ColumnResizePolicy.ConstantWidth
// The new column is placed after the last available column. If no column is available
// then the inserted one becomes the first column of the tree.
// Created in NX7.5.0
// License requirements: None.
public int InsertColumn(int columnID, string columnTitle, int columnWidth);
//
// 摘要:
// Inserts the node.
//
// 参数:
// newNode:
// New Node.
//
// parentNode:
// Parent node under which new node is supposed to be placed. To add the first node,
// pass as NXOpen.BlockStyler.Node.Null
//
// afterNode:
// New node placed after this node. If there is mismatch between parent-node and
// after-node then former is honoured. To add the first node, pass as NXOpen.BlockStyler.Node.Null
//
// nodeInsertOption:
// Node insert option. Provide the value if after node is a null reference (Nothing
// in Visual Basic). This value is not considered if a valid after-node is supplied.
//
// 备注:
// Subsequently BlockStyler.Tree.OnInsertNodeCallback is called. Reinserting the
// node in same or different tree is not allowed.
// Created in NX7.5.0
// License requirements: None.
public void InsertNode(Node newNode, Node parentNode, Node afterNode, NodeInsertOption nodeInsertOption);
//
// 摘要:
// Freezes the tree if the value is set to False which implies that no changes would
// occur in the tree after this point.
//
// 参数:
// redraw:
// Flag corresponds to freeze/unfreeze of tree changes.
//
// 备注:
// The tree remains in that state until the value is set to True, after which the
// tree completely updates itself with the changes performed on it in between the
// two calls. Use this method to efficiently utilize the tree when it is subjected
// to enourmous changes.
// Created in NX7.5.0
// License requirements: None.
public void Redraw(bool redraw);
//
// 摘要:
// Selects the provided node.
//
// 参数:
// node:
// Node to be selected
//
// isSelect:
// Select/Deselect flag. If true, the provided node is selected, else deselected.
//
// isOtherNodeAffected:
// Flag indicating whether selection of other nodes is affected. If true, all the
// previous selected nodes are deselected, else unaffected.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SelectNode(Node node, bool isSelect, bool isOtherNodeAffected);
//
// 摘要:
// Selects the provided nodes.
//
// 参数:
// node:
// Nodes to be selected
//
// isSelect:
// Select/Deselect flag. If true, the provided nodes are selected, else deselected.
//
// isOtherNodeAffected:
// Flag indicating whether selection of other nodes is affected. If true, all the
// previous selected nodes are deselected, else remain so.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SelectNodes(Node[] node, bool isSelect, bool isOtherNodeAffected);
//
// 摘要:
// Sets the node-edit-control callback
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetAskEditControlHandler(AskEditControlCallback cb);
//
// 摘要:
// Sets the display type of the column.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// displayType:
// Display type.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetColumnDisplayType(int columnID, ColumnDisplay displayType);
//
// 摘要:
// Sets the column resize policy.
//
// 参数:
// columnID:
// Unique column Id associated with the column
//
// resizePolicy:
// Resize policy
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetColumnResizePolicy(int columnID, ColumnResizePolicy resizePolicy);
//
// 摘要:
// Sets the flag indicating whether the column is sortable.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// isSortable:
// Flag indicating whether the column is sortable.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetColumnSortable(int columnID, bool isSortable);
//
// 摘要:
// Sets the column sort callback.
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetColumnSortHandler(ColumnSortCallback cb);
//
// 摘要:
// Sets the column sort option.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// sortOption:
// Column sort option.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetColumnSortOption(int columnID, ColumnSortOption sortOption);
//
// 摘要:
// Sets the column title.
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// columnHeaderTitle:
// Column header title.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetColumnTitle(int columnID, string columnHeaderTitle);
//
// 摘要:
// Sets the flag indicating whether the column is visible
//
// 参数:
// columnID:
// Unique column Id associated with the column
//
// isVisible:
// Flag indicating whether the column is visible
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetColumnVisible(int columnID, bool isVisible);
//
// 摘要:
// Sets the column width
//
// 参数:
// columnID:
// Unique column Id associated with the column.
//
// columnWidth:
// Column width.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetColumnWidth(int columnID, int columnWidth);
//
// 摘要:
// Sets the options in edit-control. This method must be used in BlockStyler.Tree.AskEditControlCallback
// to make available the options in edit-control.
//
// 参数:
// stringArray:
// Options to be made availabe in edit-control
//
// defaultIndex:
// Index for default selection. This is zero based, for instance if it is set to
// 1 then 2nd option is selected by default during edit operation.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetEditOptions(string[] stringArray, int defaultIndex);
//
// 摘要:
// Sets the callback handler for node drag
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetIsDragAllowedHandler(IsDragAllowedCallback cb);
//
// 摘要:
// Sets the callback handler for node drop
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetIsDropAllowedHandler(IsDropAllowedCallback cb);
//
// 摘要:
// Sets the menu, resulting the menu to appear on the screen.
//
// 参数:
// menu:
// Menu.
//
// 备注:
// This method must be used in callback which is intended to create menu, such as
// BlockStyler.Tree.OnMenuCallback
// Created in NX7.5.0
// License requirements: None.
public void SetMenu(TreeListMenu menu);
//
// 摘要:
// Sets the on-begin-label-edit callback
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnBeginLabelEditHandler(OnBeginLabelEditCallback cb);
//
// 摘要:
// Sets the on select node callback
//
// 参数:
// cb:
// Callback.
//
// 备注:
// Created in NX7.5.2
// License requirements: None.
public void SetOnDefaultActionHandler(OnDefaultActionCallback cb);
//
// 摘要:
// Sets on delete node callback
//
// 参数:
// cb:
// Callback.
//
// 备注:
// Created in NX6.0.0
// License requirements: None.
public void SetOnDeleteNodeHandler(OnDeleteNodeCallback cb);
//
// 摘要:
// Sets the callback handler for node drop
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnDropHandler(OnDropCallback cb);
//
// 摘要:
// Sets the callback handler for on drop menu.
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnDropMenuHandler(OnDropMenuCallback cb);
//
// 摘要:
// Sets the on-end-label-edit callback
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnEditOptionSelectedHandler(OnEditOptionSelectedCallback cb);
//
// 摘要:
// Sets the on-end-label-edit callback
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnEndLabelEditHandler(OnEndLabelEditCallback cb);
//
// 摘要:
// Sets the on expand callback to the tree.
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnExpandHandler(OnExpandCallback cb);
//
// 摘要:
// Sets the on insert column callback to the tree.
//
// 参数:
// cb:
// Callback.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnInsertColumnHandler(OnInsertColumnCallback cb);
//
// 摘要:
// Sets the on insert node callback.
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX6.0.0
// License requirements: None.
public void SetOnInsertNodeHandler(OnInsertNodeCallback cb);
//
// 摘要:
// Sets the on menu callback
//
// 参数:
// cb:
// Callback.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnMenuHandler(OnMenuCallback cb);
//
// 摘要:
// Sets the on menu selection callback
//
// 参数:
// cb:
// Callback.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnMenuSelectionHandler(OnMenuSelectionCallback cb);
//
// 摘要:
// Sets on pre select callback
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnPreSelectHandler(OnPreSelectCallback cb);
//
// 摘要:
// Sets the on select node callback
//
// 参数:
// cb:
// Callback.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnSelectHandler(OnSelectCallback cb);
//
// 摘要:
// Sets the on state change callback.
//
// 参数:
// cb:
// Callback
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetOnStateChangeHandler(OnStateChangeCallback cb);
//
// 摘要:
// Sets the pre selection time out.
//
// 参数:
// timeOut:
// Time in millisecond
//
// 备注:
// BlockStyler.Tree.OnPreSelectCallback is called based on this value.
// Created in NX7.5.0
// License requirements: None.
public void SetPreSelectionTimeOut(double timeOut);
//
// 摘要:
// Sets the state icon name callback.
//
// 参数:
// cb:
// Callback.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetStateIconNameHandler(StateIconNameCallback cb);
//
// 摘要:
// Sets the tool tip callback.
//
// 参数:
// cb:
// Callback.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public void SetToolTipTextHandler(ToolTipTextCallback cb);
//
// 摘要:
// Represents the state to accept/reject the edited label of node.
//
// 备注:
// Use these options in callback BlockStyler.Tree.OnEndLabelEditCallback.
public enum EndLabelEditState
{
//
// 摘要:
// Use this option to accept the edited text.
AcceptText = 0,
//
// 摘要:
// Use this option to reject the edited text and retain the previous one.
RejectText = 1
}
//
// 摘要:
// Represents the type of edit options.
//
// 备注:
// Use these options in edit control callback
public enum ControlType
{
//
// 摘要:
// None
None = 0,
//
// 摘要:
// Combo box.
ComboBox = 1,
//
// 摘要:
// List box.
ListBox = 2
}
//
// 摘要:
// Represents the options to accept or reject the changed value.
public enum EditControlOption
{
//
// 摘要:
// Use this option to allow edit.
Accept = 0,
//
// 摘要:
// Use this option to disallow edit.
Reject = 1
}
//
// 摘要:
// Represents the state to allow/disallow the node label edit.
//
// 备注:
// Use these options in callback BlockStyler.Tree.OnBeginLabelEditCallback.
public enum BeginLabelEditState
{
//
// 摘要:
// Use this option to allow label edit.
Allow = 0,
//
// 摘要:
// Use this option to disallow label edit.
Disallow = 1
}
//
// 摘要:
// Represents the node insert option which is used while inserting the node in tree.
public enum NodeInsertOption
{
//
// 摘要:
// Node is placed first in the hierarchy in which it is inserted.
First = 0,
//
// 摘要:
// Node is placed last in the hierarchy in which it is inserted.
Last = 1,
//
// 摘要:
// Node is sorted according to display text and placed accordingly in the hierarchy
// in which it is inserted
Sort = 2,
//
// 摘要:
// Node is placed first in the hierarchy in which it is inserted. This is same as
// NXOpen.BlockStyler.Tree.NodeInsertOption.First, except that it remains first
// after a column sort. If there is more than one node beneath a single parent with
// this option then they will be sorted relative to each other.
AlwaysFirst = 3,
//
// 摘要:
// Node is placed last in the hierarchy in which it is inserted. This is same as
// NXOpen.BlockStyler.Tree.NodeInsertOption.Last, except that it remains last after
// a column sort. If there is more than one node beneath a single parent with this
// option then they will be sorted relative to each other.
AlwaysLast = 4
}
//
// 摘要:
// Represents column resize policy.
public enum ColumnResizePolicy
{
//
// 摘要:
// Constant width
ConstantWidth = 0,
//
// 摘要:
// Width resized with contents.
ResizeWithContents = 1,
//
// 摘要:
// Width resize with tree window resize.
ResizeWithTree = 2
}
//
// 摘要:
// Represents the column sort option.
public enum ColumnSortOption
{
//
// 摘要:
// Unsorted
Unsorted = 0,
//
// 摘要:
// Ascending
Ascending = 1,
//
// 摘要:
// Descending
Descending = 2
}
//
// 摘要:
// Represents the column display type.
//
// 备注:
// If the type is NXOpen.BlockStyler.Tree.ColumnDisplay.Icon then the provided text
// is interpreted as icon.
public enum ColumnDisplay
{
//
// 摘要:
// Text
Text = 0,
//
// 摘要:
// Icon
Icon = 1
}
//
// 摘要:
// Represents the callback which gets called when nodes are dropped on any target
// node.
//
// 参数:
// tree:
// Tree.
//
// node:
// Nodes dropped on any target node. The number of nodes might not be same as number
// of selected nodes as some of the selected node might disallow to drop itself
// on target node.
//
// columnID:
// Column Id of the column from where nodes are dragged.
//
// targetNode:
// Target node on which dragged nodes are dropped.
//
// targetColumnID:
// Column Id of the column where nodes are dropped.
//
// dropType:
// Indicates whether the nodes are dropped On, Before or After target node
//
// dropMenuItemId:
// Menu item Id representing the selected menu item. This menu Id corresponds to
// the menu item added to the NXOpen.BlockStyler.TreeListMenu using NXOpen.BlockStyler.TreeListMenu.AddMenuItem(System.Int32,System.String).
// Refer to callback BlockStyler.Tree.OnDropMenuCallback to make available the menu
// while node drop.
//
// 备注:
// This callback is invoked irrespective of case whether nodes are dragged using
// MB1 or MB3. If nodes are dragged using MB3 then BlockStyler.Tree.OnDropMenuCallback
// is called prior to the invocation of this callback.
// Created in NX7.5.0
// License requirements: None.
public delegate bool OnDropCallback(Tree tree, Node[] node, int columnID, Node targetNode, int targetColumnID, Node.DropType dropType, int dropMenuItemId);
//
// 摘要:
// Represents the callback which gets called when an attempt is made to drop the
// node on any target node. If multiple nodes are selected and dragged then this
// callback is invoked for each of the selected nodes.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node being dragged and dropped on target node.
//
// columnID:
// Column Id of the column from where node is dragged.
//
// targetNode:
// Target node on which node is dropped.
//
// targetColumnID:
// Column Id of the column where node is dropped.
//
// 备注:
// If node is dragged using MB3 then the callback BlockStyler.Tree.OnDropMenuCallback
// is invoked which is expected to provide and show the menu. Subsequently, BlockStyler.Tree.OnDropCallback
// might get invoked.
// Created in NX7.5.0
// License requirements: None.
public delegate Node.DropType IsDropAllowedCallback(Tree tree, Node node, int columnID, Node targetNode, int targetColumnID);
//
// 摘要:
// Represents the callback which gets called when node is dragged.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node being dragged.
//
// columnID:
// Column Id of the column where drag is attempted.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public delegate Node.DragType IsDragAllowedCallback(Tree tree, Node node, int columnID);
//
// 摘要:
// Represents the callback which gets called when one of the menu option is selected.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node on which MB3 is attempted or menu is invoked. a null reference (Nothing
// in Visual Basic) if MB3 is attempted on area other than node.
//
// menuItemID:
// Menu item Id representing the selected menu item. This menu Id corresponds to
// the menu item added to the NXOpen.BlockStyler.TreeListMenu using NXOpen.BlockStyler.TreeListMenu.AddMenuItem(System.Int32,System.String).
//
// 备注:
// Refer to callback BlockStyler.Tree.OnMenuCallback to make available the menu.
// Created in NX7.5.0
// License requirements: None.
public delegate void OnMenuSelectionCallback(Tree tree, Node node, int menuItemID);
//
// 摘要:
// Represents the callback which gets called when MB3 or right click is attempted
// on node or tree.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node on which MB3 is attempted or menu is invoked. a null reference (Nothing
// in Visual Basic) if MB3 is attempted on area other than node.
//
// columnID:
// Column Id of the column on which MB3 is attempted
//
// 备注:
// Value of Node parameter is a null reference (Nothing in Visual Basic) if MB3
// is attempted on area other than node. This distinction allows to have separate
// menu for node and tree.
// The menu can be made available using two methods NXOpen.BlockStyler.Tree.CreateMenu
// and NXOpen.BlockStyler.Tree.SetMenu(NXOpen.BlockStyler.TreeListMenu). Subsequently
// BlockStyler.Tree.OnMenuSelectionCallback is invoked after the menu item is selected.
// Created in NX7.5.0
// License requirements: None.
public delegate void OnMenuCallback(Tree tree, Node node, int columnID);
//
// 摘要:
// Represents the callback which gets called when user selects an option in edit-control
// set by BlockStyler.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node being edited.
//
// columnID:
// Column Id of the column on which edit is performed.
//
// selectedOptionID:
// Index of the selected option. -1 value suggests that edited text is not among
// the available options in edit-control; particularly useful when edit-control
// type is NXOpen.BlockStyler.Tree.ControlType.ListBox.
//
// selectedOptionText:
// The text being edited.
//
// type:
// Edit-control type
//
// 备注:
// Tree.AskEditControlCallback. If returned NXOpen.BlockStyler.Tree.EditControlOption.Accept
// then the edited option/text is accepted else it is rejected and old option/text
// remains.
// Created in NX7.5.0
// License requirements: None.
public delegate EditControlOption OnEditOptionSelectedCallback(Tree tree, Node node, int columnID, int selectedOptionID, string selectedOptionText, ControlType type);
//
// 摘要:
// Represents the callback which gets called when edit is attempted on any cell.
// Edit-control is made available on the cell based on control type returned by
// this callback.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node being edited.
//
// columnID:
// Column Id of the column on which edit is performed.
//
// 备注:
// Use NXOpen.BlockStyler.Tree.SetEditOptions(System.String[],System.Int32) in this
// callback to show the options in the edit-control. Further BlockStyler.Tree.OnEditOptionSelectedCallback
// is called when option is selected.
// Created in NX7.5.0
// License requirements: None.
public delegate ControlType AskEditControlCallback(Tree tree, Node node, int columnID);
//
// 摘要:
// Represents the callback which gets called when label edit is completed on any
// column.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node being edited.
//
// columnID:
// Column Id of the column on which label edit is performed.
//
// editedText:
// Text after edit.
//
// 备注:
// The edited label is accepted/rejected based on return value of this callback.
// Created in NX7.5.0
// License requirements: None.
public delegate EndLabelEditState OnEndLabelEditCallback(Tree tree, Node node, int columnID, string editedText);
//
// 摘要:
// Represents the callback which gets called when label edit is attempted on any
// column.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node being edited.
//
// columnID:
// Column Id of the column on which label edit is performed.
//
// 备注:
// The label edit is allowed/disallowed based on return value of this callback.
// Created in NX7.5.0
// License requirements: None.
public delegate BeginLabelEditState OnBeginLabelEditCallback(Tree tree, Node node, int columnID);
//
// 摘要:
// Represents the callback which gets called when tree seeks the tooltip.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node for which tooltip is sought.
//
// columnID:
// Column Id of the column for which tooltip is sought.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public delegate string ToolTipTextCallback(Tree tree, Node node, int columnID);
//
// 摘要:
// Represents the callback which gets called when the state icon is clicked.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node.
//
// state:
// Current node state.
//
// 备注:
// This callback does not get called when state is changed using the method NXOpen.BlockStyler.Node.SetState(System.Int32).
// The node state can be changed in this callback using NXOpen.BlockStyler.Node.SetState(System.Int32),
// e.g., node can be changed from checked state to unchecked state and vice-versa.
// Created in NX7.5.0
// License requirements: None.
public delegate void OnStateChangeCallback(Tree tree, Node node, int state);
//
// 摘要:
// Represents the callback which gets called when the node is selected.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node.
//
// columnID:
// Column Id of the column on which selection is made.
//
// selected:
// Select/Deselect flag.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public delegate void OnSelectCallback(Tree tree, Node node, int columnID, bool selected);
//
// 摘要:
// Represents the callback which gets called when the node is deleted from tree.
// It is expected to perform only clean-up operation related to the deleted node
// such as clean-up of Node Data.
//
// 参数:
// tree:
// Tree
//
// node:
// Deleted node.
//
// 备注:
// Avoid operations such as node insert, node delete etc, and avoid calling any
// methods of tree. This is particularly severe when dialog is closed (through Ok,
// dialog-reset etc) because by then tree is unavailable and any usage of tree method
// would raise exception. As the callback is called for each node, the exception
// would be raised number of times equaling number of nodes available on tree.
// Created in NX6.0.0
// License requirements: None.
public delegate void OnDeleteNodeCallback(Tree tree, Node node);
//
// 摘要:
// Represents the callback which gets called when pre selection is attempted on
// node.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node.
//
// columnID:
// Column id of the column on which pre-selection is attempted.
//
// selected:
// Select/Deselect flag.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public delegate void OnPreSelectCallback(Tree tree, Node node, int columnID, bool selected);
//
// 摘要:
// Represents the callback which gets called when the node is inserted.
//
// 参数:
// tree:
// Tree.
//
// node:
// Newly inserted node
//
// 备注:
// Created in NX6.0.0
// License requirements: None.
public delegate void OnInsertNodeCallback(Tree tree, Node node);
//
// 摘要:
// Represents the callback which gets called when the node state is set by NXOpen.BlockStyler.Node.SetState(System.Int32)
// and the corresponding state icon of node state is not known.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node.
//
// state:
// Node state for which callback is expected to return state icon name.
//
// 备注:
// This callback is expected to provide the icon name for the node state used in
// the application. This callback is called only once for any given node state.
// Created in NX7.5.0
// License requirements: None.
public delegate string StateIconNameCallback(Tree tree, Node node, int state);
//
// 摘要:
// Represents the callback which gets called for each node when the column is inserted
// using NXOpen.BlockStyler.Tree.InsertColumn(System.Int32,System.String,System.Int32).
// This callback in not invoked if no node is available on the tree.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node.
//
// columnID:
// Column id of the newly inserted column.
//
// 备注:
// In this callback it is expected to provide column text for individual node.
// Created in NX7.5.0
// License requirements: None.
public delegate void OnInsertColumnCallback(Tree tree, Node node, int columnID);
//
// 摘要:
// Represents the callback which gets called when the node is expanded.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node.
//
// 备注:
// This is called only once.
// Created in NX7.5.0
// License requirements: None.
public delegate void OnExpandCallback(Tree tree, Node node);
//
// 摘要:
// Represents the callback to show the menu when nodes are dragged using MB3 or
// right mouse click, and dropped on any target node.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node on which drag initiated.
//
// columnID:
// Column Id of the column from where drag initiated
//
// targetNode:
// Target node on which dragged node is dropped.
//
// targetColumnID:
// Column Id of the column where nodes are dropped.
//
// 备注:
// The menu can be made available using two methods NXOpen.BlockStyler.Tree.CreateMenu
// and NXOpen.BlockStyler.Tree.SetMenu(NXOpen.BlockStyler.TreeListMenu). Subsequently,
// menu is shown and selected menu option is passed as paremeter in the callback
// BlockStyler.Tree.OnDropCallback
// Created in NX7.5.0
// License requirements: None.
public delegate void OnDropMenuCallback(Tree tree, Node node, int columnID, Node targetNode, int targetColumnID);
//
// 摘要:
// Represents the callback which gets called when column sort is attempted. The
// possible return values are 0, positive and negative value, suggesting respectively
// that both nodes are same, first node greater than second, and first node smaller
// than second.
//
// 参数:
// tree:
// Tree.
//
// columnID:
// Column Id of the column on which sort is attempted.
//
// node1:
// First Node for comparision.
//
// node2:
// Second Node for comparision.
//
// 备注:
// Created in NX7.5.0
// License requirements: None.
public delegate int ColumnSortCallback(Tree tree, int columnID, Node node1, Node node2);
//
// 摘要:
// Represents the callback which gets called when double clicked is performed on
// the node.
//
// 参数:
// tree:
// Tree.
//
// node:
// Node on which Double Click is performed.
//
// columnID:
// Column Id of the column on which double click is performed.
//
// 备注:
// Created in NX7.5.2
// License requirements: None.
public delegate void OnDefaultActionCallback(Tree tree, Node node, int columnID);
}
}
本篇文章要介绍的就是这么多,大家下篇文章再见。
浙公网安备 33010602011771号