Table of Contents

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__

.NET

def __init__(self, name: str) -> None

Makes an empty palette.

Properties and fields

DefaultIconSize

.NET

DefaultIconSize: ClassVar[int]

The icon size a palette starts with, in pixels.

MaxIconSize

.NET

MaxIconSize: ClassVar[int]

The largest icon size, in pixels.

MinIconSize

.NET

MinIconSize: ClassVar[int]

The smallest icon size, in pixels.

IconSize

.NET

@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

.NET

@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

.NET

@property
def Tools(self) -> System.Collections.Generic.IReadOnlyList[CadTool]

Gets the tools, in the order they are listed.

ViewStyle

.NET

@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

.NET

def Add(self, tool: CadTool) -> None

Puts a tool last.

Clone

.NET

def Clone(self) -> CadToolPalette

Gets a copy of the palette, tools and view included, each tool a copy.

Insert

.NET

def Insert(self, index: int, tool: CadTool) -> None

Puts a tool at a place of the list.

Move

.NET

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

.NET

def Remove(self, tool: CadTool) -> bool

Takes a tool out.