Table of Contents

Class ColorListProperty

Namespace
CADability.UserInterface
Assembly
CADability.dll

The entry of a single color in the property page display of a ColorList. The label shows the name of the color (editable unless the color is static), the value shows a color box; clicking on it opens the color dialog. The context menu ("MenuId.ColorListEntry") allows to delete the color, to make it the current color of the list, to change the color or to rename it. The entry of the current color is shown in bold.

public class ColorListProperty : PropertyEntryImpl, IPropertyEntry, IShowProperty, ICommandHandler
Inheritance
ColorListProperty
Implements
Inherited Members

Constructors

ColorListProperty(ColorList, int)

Creates the entry for the color with the given index in ColorList.

public ColorListProperty(ColorList ColorList, int Index)

Parameters

ColorList ColorList

The list containing the color

Index int

Index of the color in the list

Properties

ContextMenu

Must be overridden, when Flags contains PropertyEntryType.ContextMenu. See ContextMenu

public override MenuWithHandler[] ContextMenu { get; }

Property Value

MenuWithHandler[]

Flags

Implementation of Flags: the derived class states what the entry is and what the user can do with it. The flags must match the overridden members, e.g. HasSubEntries requires SubItems, ValueEditable requires Value and EndEdit(bool, bool, string), DropDown requires GetDropDownList() and ListBoxSelected(int).

public override PropertyEntryType Flags { get; }

Property Value

PropertyEntryType

LabelText

An explicit label text. When set (not null) it is shown instead of the text from the StringTable; use it for entries whose label is not a fixed resource string, e.g. the name of an item. Call Refresh() after changing it while the entry is displayed.

public override string LabelText { get; }

Property Value

string

Value

Must be overridden, when Flags contains PropertyEntryType.ValueEditable

public override string Value { get; }

Property Value

string

Methods

ButtonClicked(PropertyEntryButton)

Must be overridden, when Flags contains PropertyEntryType.HasSpinButton or CancelButton or OKButton

public override void ButtonClicked(PropertyEntryButton button)

Parameters

button PropertyEntryButton

EditTextChanged(string)

May be overridden when Flags contains PropertyEntryType.ValueEditable. See EditTextChanged(string),

public override bool EditTextChanged(string newValue)

Parameters

newValue string

Returns

bool

EndEdit(bool, bool, string)

Must be overridden when Flags contains PropertyEntryType.ValueEditable. See EndEdit(bool, bool, string)

public override void EndEdit(bool aborted, bool modified, string newValue)

Parameters

aborted bool
modified bool
newValue string

GetDropDownList()

Must be overridden when Flags contains PropertyEntryType.DropDown, See GetDropDownList()

public override string[] GetDropDownList()

Returns

string[]

ListBoxSelected(int)

Must be overridden when Flags contains PropertyEntryType.DropDown

public override void ListBoxSelected(int selectedIndex)

Parameters

selectedIndex int