Interface IPropertyPage
- Namespace
- CADability.UserInterface
- Assembly
- CADability.dll
A page (tab) of the control center (IControlCenter) which shows a tree of entries (IPropertyEntry): root entries are added with Add(IPropertyEntry, bool), their sub entries appear when they are opened. The page selects, opens, edits and redraws entries and notifies them through the methods of IPropertyEntry. CADability.Forms implements it; an entry receives its page in Added(IPropertyPage), and the kernel gets the standard pages from GetPropertyPage(string).
public interface IPropertyPage
Properties
ActiveView
The active view of the frame. Kept for the older entries, use ActiveView instead.
IView ActiveView { get; }
Property Value
Frame
The frame the page belongs to (the frame of its control center). Entries use it to reach the project, the active view and the UI services.
IFrame Frame { get; }
Property Value
Selected
The selected entry of the page, or null. Setting it selects the entry, which must be displayed on the page: the previously selected entry gets UnSelected(IPropertyEntry), the new one Selected(IPropertyEntry), an editable value gets its text box or drop down list, and OnSelectionChanged is raised.
IPropertyEntry Selected { get; set; }
Property Value
Methods
Add(IPropertyEntry, bool)
Appends a root entry to the page and selects it. The entry gets Added(IPropertyPage), and its Parent is set to the page.
void Add(IPropertyEntry toAdd, bool showOpen)
Parameters
toAddIPropertyEntrythe entry to add
showOpenbooltrue: also open the entry so that its sub entries are shown
BringToFront()
Makes this page the active page of the control center, i.e. selects its tab.
void BringToFront()
Clear()
Removes all entries from the page.
void Clear()
ContainsEntry(IPropertyEntry)
Tells whether the entry is currently displayed on this page, as a root entry or as a sub entry of an open entry.
bool ContainsEntry(IPropertyEntry entryWithTextBox)
Parameters
entryWithTextBoxIPropertyEntrythe entry to look for
Returns
- bool
true when the entry is displayed on this page
FindFromHelpLink(string, bool)
Finds an entry by its ResourceId (or, for an entry without resource id, by its
label). The displayed entries are searched first; with searchTreeAndOpen the sub entries
of closed entries are searched as well (FindSubItem(string)). Despite the name the
found entry is not opened or selected.
IPropertyEntry FindFromHelpLink(string helpResourceID, bool searchTreeAndOpen = false)
Parameters
helpResourceIDstringthe resource id (or label text) of the entry
searchTreeAndOpenbooltrue: also search entries that are not displayed because their parent is closed
Returns
- IPropertyEntry
the entry, or null when there is none
GetCurrentSelection()
Returns the selected entry of the page, the same as Selected.
IPropertyEntry GetCurrentSelection()
Returns
- IPropertyEntry
the selected entry, or null when none is selected
GetFrame()
Returns the frame the page belongs to. Kept for the older entries, use Frame instead.
IFrame GetFrame()
Returns
- IFrame
the frame
GetParent(IShowProperty)
Returns the parent entry of the given entry. Kept for the older entries, use Parent instead.
IPropertyEntry GetParent(IShowProperty child)
Parameters
childIShowPropertythe entry whose parent is wanted
Returns
- IPropertyEntry
the parent entry, or null for a root entry (whose parent is the page)
IsOnTop()
Tells whether this page is the active page of the control center, i.e. the one whose tab is selected and which the user sees.
bool IsOnTop()
Returns
- bool
true when this page is in front
IsOpen(IShowProperty)
Tells whether the sub entries of the entry are shown. Kept for the older entries, use IsOpen instead.
bool IsOpen(IShowProperty toTest)
Parameters
toTestIShowPropertythe entry to test
Returns
- bool
true when the entry is open
MakeVisible(IPropertyEntry)
Scrolls the page so that the entry is in view. The entry must be displayed, i.e. its parents must be open.
void MakeVisible(IPropertyEntry toShow)
Parameters
toShowIPropertyEntrythe entry to scroll to
OpenSubEntries(IPropertyEntry, bool)
Opens or closes the entry, i.e. shows or hides its sub entries. Opening an entry that is already open rebuilds its sub entries, which serves as a refresh after the sub entries changed.
void OpenSubEntries(IPropertyEntry toOpenOrClose, bool open)
Parameters
toOpenOrCloseIPropertyEntrythe entry, it must be displayed on the page
openbooltrue: show the sub entries, false: hide them
Refresh(IPropertyEntry)
Redraws the entry after its label, value or flags changed. When the entry is open, its sub entries are collected again, so a changed SubItems array is reflected as well. When the entry is being edited, the text box is updated with its new Value.
void Refresh(IPropertyEntry toRefresh)
Parameters
toRefreshIPropertyEntrythe entry to redisplay
Remove(IPropertyEntry)
Removes a root entry (one that was added with Add(IPropertyEntry, bool)) from the page. An edit in progress is ended first; the entry and its displayed sub entries get Removed(IPropertyPage).
void Remove(IPropertyEntry toRemove)
Parameters
toRemoveIPropertyEntrythe root entry to remove
SelectEntry(IPropertyEntry)
Selects the entry, the same as setting Selected; null is ignored. The page is not brought to the front.
void SelectEntry(IPropertyEntry toSelect)
Parameters
toSelectIPropertyEntrythe entry to select, it must be displayed on the page
StartEditLabel(IPropertyEntry)
Opens the text box on the label of the entry, e.g. to let the user name a newly created item. The entry gets StartEdit(bool) with false and, when the edit ends, EndEdit(bool, bool, string).
void StartEditLabel(IPropertyEntry ToEdit)
Parameters
ToEditIPropertyEntrythe entry whose label is edited, it must be displayed on the page
Events
OnPreProcessKeyDown
Raised for a key pressed while this page is active which neither the action nor the control center handled (see PreProcessKeyDown). An entry may subscribe to react to keys while it is displayed.
event PreProcessKeyDown OnPreProcessKeyDown
Event Type
OnSelectionChanged
Raised after the selected entry of the page changed; the handler gets the previously and the newly selected entry, either of which may be null (see SelectionChanged).
event SelectionChanged OnSelectionChanged