Table of Contents

Interface IPropertyTreeView

Namespace
CADability.UserInterface
Assembly
CADability.dll

The interface a property display control provides to the entries (IShowProperty) it shows. CADability implements it in its properties explorer; an application can replace that control by its own, which only has to implement this interface.

public interface IPropertyTreeView

Properties

ActiveView

The active view, or null when there is none.

IView ActiveView { get; set; }

Property Value

IView

AllIds

The help links (HelpLink) of all entries the display currently contains.

string[] AllIds { get; }

Property Value

string[]

DefaultLineHeight

The standard height of a line of the display, in pixels.

int DefaultLineHeight { get; }

Property Value

int

Methods

AddShowProperty(IShowProperty, bool)

Adds the entry to the display, as a root entry.

void AddShowProperty(IShowProperty ToAdd, bool TopMost)

Parameters

ToAdd IShowProperty

the entry to show

TopMost bool

true: as the first entry, false: as the last entry

ChildFocusChanged(IShowProperty, bool)

Notification from an entry that a control it owns received or lost the keyboard focus, so that the display can update its selection and raise FocusChangedEvent.

void ChildFocusChanged(IShowProperty child, bool gotFocus)

Parameters

child IShowProperty

the entry whose control changed its focus

gotFocus bool

true: the control received the focus, false: it lost the focus

Dispose()

Releases the display; every displayed entry gets Removed(IPropertyTreeView) first.

void Dispose()

Finds the IShowProperty object with the given help link (HelpLink). The help link is used as a kind of unique id. It is usually the the resource id for the label text. If the desired entry is not visible it will not be found. You will first have to open the sub entries of the parent entry (OpenSubEntries(IShowProperty, bool)).

IShowProperty FindFromHelpLink(string HelpLink)

Parameters

HelpLink string

The help link for the desired entry

Returns

IShowProperty

The IShowProperty entry

FocusEntered(IShowProperty, IShowProperty, IShowProperty)

Checks, whether a Focus change from oldFocus to newFocus implies a focus change to "toTest" or one of its child entries from some entry outside of "toTest". If newFocus is not toTest or one of its children "false" is returned. If the focus changes from one child of toTest to another or from a child of toTest to toTest itself or from toTest to one of its children, false is returned.

bool FocusEntered(IShowProperty toTest, IShowProperty oldFocus, IShowProperty newFocus)

Parameters

toTest IShowProperty

the entry beeing examined

oldFocus IShowProperty

the entry that lost the focus

newFocus IShowProperty

the entry that got the focus

Returns

bool

true if toTest lost the focus

FocusLeft(IShowProperty, IShowProperty, IShowProperty)

Checks, whether a Focus change from oldFocus to newFocus implies a focus change from "toTest" or one of its child entries to some entry outside of "toTest". If oldFocus is not toTest or one of its children "false" is returned. If the focus changes from one child of toTest to another or from a child of toTest to toTest itself or from toTest to one of its children, false is returned.

bool FocusLeft(IShowProperty toTest, IShowProperty oldFocus, IShowProperty newFocus)

Parameters

toTest IShowProperty

the entry beeing examined

oldFocus IShowProperty

the entry that lost the focus

newFocus IShowProperty

the entry that got the focus

Returns

bool

true if toTest lost the focus

GetBoundsForControl(Rectangle)

Converts a rectangle given relative to the line of an entry into the client coordinates of the display, for entries that place their own control (e.g. an edit box) over their line.

Rectangle GetBoundsForControl(Rectangle position)

Parameters

position Rectangle

the rectangle relative to the entry's line, in pixels

Returns

Rectangle

the rectangle in the client coordinates of the display

GetCurrentSelection()

Returns the selected entry of the display.

IShowProperty GetCurrentSelection()

Returns

IShowProperty

the selected entry, or null when no entry is selected

GetFrame()

Returns the IFrame object of the context of this IPropertyTreeView

IFrame GetFrame()

Returns

IFrame

GetParent(IShowProperty)

Returns the entry that contains child among its sub entries.

IShowProperty GetParent(IShowProperty child)

Parameters

child IShowProperty

the entry whose parent is wanted

Returns

IShowProperty

the parent entry, or null for a root entry

GetPointForControl(Point)

Converts a point given relative to the line of an entry into the client coordinates of the display, the counterpart of GetBoundsForControl(Rectangle) for a single point.

Point GetPointForControl(Point loc)

Parameters

loc Point

the point relative to the entry's line, in pixels

Returns

Point

the point in the client coordinates of the display

HasTopLevelShowProperty(IShowProperty)

Determins whether the given IShowProperty LookForThis is one of the root ShowProperties.

bool HasTopLevelShowProperty(IShowProperty LookForThis)

Parameters

LookForThis IShowProperty

look for this IShowProperty object

Returns

bool

true, if LookForThis is a root ShowProperty, false otherwise

IsOnTop()

Determins whether this IPropertyTreeView is on top of all IPropertyTreeView objects. Several IPropertyTreeViews reside in the ControlCenter in different tab pages. Determins whether this IPropertyTreeView is in the selected tab page.

bool IsOnTop()

Returns

bool

true if on top, false otherwise

IsOpen(IShowProperty)

Tells whether the sub entries of the entry are currently shown.

bool IsOpen(IShowProperty toTest)

Parameters

toTest IShowProperty

the entry to test

Returns

bool

true when the entry is open, false when it is closed or not displayed

MakeVisible(IShowProperty)

Scrolls the display so that the entry is visible, opening its parents if necessary.

void MakeVisible(IShowProperty ToShow)

Parameters

ToShow IShowProperty

the entry to show

OpenSubEntries(IShowProperty, bool)

The sub entries of the object given in the parameter shall be (created and) visible.

void OpenSubEntries(IShowProperty ToOpen, bool open)

Parameters

ToOpen IShowProperty

The object whose sub entries are to be opened or closed

open bool

true to open (show) the sub entries, false to close them

PopupContextMenu(IShowProperty)

Shows the context menu of the entry, as if the user had clicked its context menu button.

void PopupContextMenu(IShowProperty entry)

Parameters

entry IShowProperty

the entry whose context menu is shown

Refresh(IShowProperty)

Redisplays the entry, e.g. after its value or its list of sub entries has changed.

void Refresh(IShowProperty ToRefresh)

Parameters

ToRefresh IShowProperty

the entry to redisplay

RemoveShowProperty(IShowProperty)

Removes the entry from the display.

void RemoveShowProperty(IShowProperty ToRemove)

Parameters

ToRemove IShowProperty

the entry to remove

ReplaceShowProperty(IShowProperty, IShowProperty)

Replaces an entry of the display by another one, at the same position.

void ReplaceShowProperty(IShowProperty ToReplace, IShowProperty ToInsert)

Parameters

ToReplace IShowProperty

the entry to replace

ToInsert IShowProperty

the new entry

SelectEntry(IShowProperty)

Selects (highlights) the entry.

void SelectEntry(IShowProperty NewSelection)

Parameters

NewSelection IShowProperty

the entry to select

SelectNext(IShowProperty, bool)

Moves the focus from the object given in the parameter to the next or previous object in the tab order.

void SelectNext(IShowProperty CurrentProperty, bool Forward)

Parameters

CurrentProperty IShowProperty

The currently focused object

Forward bool

true sets the focus on the next object in the tab order, false on the previous one

SetFont(Font)

Sets the font in which the display draws its entries.

void SetFont(Font font)

Parameters

font Font

the new font

StartEditLabel(IShowProperty)

Starts editing the label text of the entry.

void StartEditLabel(IShowProperty ToEdit)

Parameters

ToEdit IShowProperty

the entry whose label is edited

Events

FocusChangedEvent

Raised when the keyboard focus moves from one entry of the display to another, or enters or leaves the display (see FocusChangedDelegate).

event FocusChangedDelegate FocusChangedEvent

Event Type

FocusChangedDelegate