CadToolPalette
from OpenCAD2D import CadToolPalette
class CadToolPalette(System.Object) ยท CadToolPalette in the .NET reference
A tool palette: a name and the tools in the order they are listed, and how they are listed (CadToolPalette.ViewStyle and CadToolPalette.IconSize). A palette of a set is made through CadToolPalettes.
Constructors
__init__
def __init__(self, name: str) -> None
Makes an empty palette.
Properties and fields
DefaultIconSize
DefaultIconSize: ClassVar[int]
The icon size a palette starts with, in pixels.
MaxIconSize
MaxIconSize: ClassVar[int]
The largest icon size, in pixels.
MinIconSize
MinIconSize: ClassVar[int]
The smallest icon size, in pixels.
IconSize
@property
def IconSize(self) -> int
@IconSize.setter
def IconSize(self, value: int) -> None
Gets or sets the size of the icons in pixels, from CadToolPalette.MinIconSize to CadToolPalette.MaxIconSize; 32 until set.
Name
@property
def Name(self) -> str
@Name.setter
def Name(self, value: str) -> None
Gets or sets the name shown on the palette's tab; the set it is in keeps them apart where it renames.
Tools
@property
def Tools(self) -> System.Collections.Generic.IReadOnlyList[CadTool]
Gets the tools, in the order they are listed.
ViewStyle
@property
def ViewStyle(self) -> CadToolViewStyle
@ViewStyle.setter
def ViewStyle(self, value: CadToolViewStyle) -> None
Gets or sets how the tools are listed; icons alone until set.
Methods
Add
def Add(self, tool: CadTool) -> None
Puts a tool last.
Clone
def Clone(self) -> CadToolPalette
Gets a copy of the palette, tools and view included, each tool a copy.
Insert
def Insert(self, index: int, tool: CadTool) -> None
Puts a tool at a place of the list.
Move
def Move(self, tool: CadTool, index: int) -> bool
Moves a tool to another place of the list, as dragging it within the palette does.
Remove
def Remove(self, tool: CadTool) -> bool
Takes a tool out.