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
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
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
titleIdstringthe id of the page, by which GetPropertyPage(string) and ShowPropertyPage(string) find it again
iconIdintthe 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
helpIDstringthe 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
namestringthe 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
titleIdstringthe 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
entryIdstringthe resource id of the entries to hide
hidebooltrue: 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
eKeyEventArgsthe key event
RemovePropertyPage(string)
Removes the property page with the given id from the control center.
bool RemovePropertyPage(string titleId)
Parameters
titleIdstringthe 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
titleIdstringthe id of the page
Returns
- bool
true when the page exists, false otherwise