Table of Contents

Interface IControlCenter

Namespace
CADability.UserInterface
Assembly
CADability.dll

The control center (properties explorer) of the user interface: a tabbed control that holds the property pages (IPropertyPage) in which CADability shows the properties of the current action, of the project, of the global settings and of the view. CADability.Forms implements it; the kernel reaches it through ControlCenter and creates the standard pages with AddPropertyPage(string, int).

public interface IControlCenter

Properties

ActivePropertyPage

The property page whose tab is currently selected, or null when there is none.

IPropertyPage ActivePropertyPage { get; }

Property Value

IPropertyPage

Frame

The frame this control center belongs to. The frame sets it when it takes over the control center; the pages created afterwards get it as their Frame.

IFrame Frame { get; set; }

Property Value

IFrame

Methods

AddPropertyPage(string, int)

Creates a new, empty property page as a tab of the control center. The text and the tool tip of the tab are taken from the StringTable with the id titleId+"TabPage".

IPropertyPage AddPropertyPage(string titleId, int iconId)

Parameters

titleId string

the id of the page, by which GetPropertyPage(string) and ShowPropertyPage(string) find it again

iconId int

the index of the tab's icon in the image list of the control center

Returns

IPropertyPage

the new page

DisplayHelp(string)

Shows the help topic with the given id. CADability.Forms does not implement it (the method throws a NotImplementedException) and nothing in CADability calls it.

void DisplayHelp(string helpID)

Parameters

helpID string

the id of the help topic, usually the resource id of an entry

FindItem(string)

Finds the entry with the given resource id (or label text) on the active property page, searching open and closed entries (see FindFromHelpLink(string, bool)).

IPropertyEntry FindItem(string name)

Parameters

name string

the resource id or label text of the entry

Returns

IPropertyEntry

the entry, or null when there is no active page or no such entry

GetPropertyPage(string)

Returns the property page that was created with the given id.

IPropertyPage GetPropertyPage(string titleId)

Parameters

titleId string

the id given to AddPropertyPage(string, int), e.g. "Action", "Project", "Global" or "View" for the standard pages

Returns

IPropertyPage

the page, or null when there is none with this id

HideEntry(string, bool)

Hides (or shows again) every entry whose ResourceId equals entryId on all pages of the control center. Takes effect when the pages are next rebuilt, e.g. when an entry is added, opened or closed.

void HideEntry(string entryId, bool hide)

Parameters

entryId string

the resource id of the entries to hide

hide bool

true: hide the entries, false: show them again

PreProcessKeyDown(KeyEventArgs)

Lets the control center handle a key before the focused control gets it: Tab and the arrow keys move the selection, Ctrl+Tab switches the page, Enter and Escape end or abort an edit, and the rest is passed on to OnPreProcessKeyDown of the active page. The frame calls it with the keys the active action did not handle; Handled is set when the key was consumed.

void PreProcessKeyDown(KeyEventArgs e)

Parameters

e KeyEventArgs

the key event

RemovePropertyPage(string)

Removes the property page with the given id from the control center.

bool RemovePropertyPage(string titleId)

Parameters

titleId string

the id of the page

Returns

bool

true when the page was removed, false when there is none with this id

ShowPropertyPage(string)

Brings the property page with the given id to the front, i.e. selects its tab.

bool ShowPropertyPage(string titleId)

Parameters

titleId string

the id of the page

Returns

bool

true when the page exists, false otherwise