Class SelectedObjectsProperty
- Namespace
- CADability.UserInterface
- Assembly
- CADability.dll
Property entry for the currently selected objects, shown in the control center by SelectObjectsAction. It is regenerated whenever the selection changes and contains the properties of each selected object as a sub entry, so that every object can be edited individually; with more than one object it also offers their common attributes (layer, color, style etc.) for a combined change. The hotspots of the sub entries are passed on to the views.
public class SelectedObjectsProperty : PropertyEntryImpl, IPropertyEntry, IShowProperty, IDisplayHotSpots
- Inheritance
-
SelectedObjectsProperty
- Implements
- Inherited Members
Constructors
SelectedObjectsProperty(IFrame)
Creates the entry with an empty list of selected objects. Use Construct(IFrame) to create an instance.
protected SelectedObjectsProperty(IFrame Frame)
Parameters
FrameIFrameThe frame in which the entry is used
Fields
Constructor
Hook to replace the entry for the selected objects by an application specific one: when set, Construct(IFrame) calls this delegate instead of creating a plain SelectedObjectsProperty.
public static SelectedObjectsProperty.ConstructionDelegate Constructor
Field Value
focusedSelectedObject
The selected object whose property entry is currently selected in the property page, or null. The SelectObjectsAction paints it highlighted and uses it as the target of some of its commands. Changes are reported by FocusedObjectChangedEvent.
public IGeoObject focusedSelectedObject
Field Value
selectedObjects
The currently selected objects, as set by SetGeoObjectList(GeoObjectList).
protected GeoObjectList selectedObjects
Field Value
Properties
ContextMenu
Must be overridden, when Flags contains PropertyEntryType.ContextMenu. See ContextMenu
public override MenuWithHandler[] ContextMenu { get; }
Property Value
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
SubItems
Must be overridden, when Flags contains PropertyEntryType.HasSubEntries. See SubItems
public override IPropertyEntry[] SubItems { get; }
Property Value
Methods
Construct(IFrame)
Creates the property entry for the selected objects, via Constructor when that is set, otherwise as a plain SelectedObjectsProperty. Called by SelectObjectsAction when it starts.
public static SelectedObjectsProperty Construct(IFrame Frame)
Parameters
FrameIFrameThe frame in which the entry is used
Returns
- SelectedObjectsProperty
The new entry with an empty list of selected objects
OnCreateSubContextMenue(IGeoObjectShowProperty, List<MenuWithHandler>)
Will be called when a context menu of a sub entry has been generated. This implementation adds the standard menu entries for selected objects.
protected void OnCreateSubContextMenue(IGeoObjectShowProperty sender, List<MenuWithHandler> toManipulate)
Parameters
senderIGeoObjectShowPropertyThe ControlCenter entry that has its context menu created
toManipulateList<MenuWithHandler>The context menu, which may be manipulated
OnShowPropertyStateChanged(IPropertyEntry, StateChangedArgs)
Will be called when the state of an entry in the ControlCenter changes. this implementation must be called by a class overriding this method.
protected void OnShowPropertyStateChanged(IPropertyEntry sender, StateChangedArgs args)
Parameters
senderIPropertyEntryThe ShowProperty that changed its state
argsStateChangedArgsThe new state
OnSubHotspotChanged(IHotSpot, HotspotChangeMode)
Forwards the hotspot changes of the entries of the selected objects to HotspotChangedEvent.
protected void OnSubHotspotChanged(IHotSpot sender, HotspotChangeMode mode)
Parameters
senderIHotSpotThe hotspot that changed
modeHotspotChangeModeThe kind of change
OpenSubEntries()
Expands the sub entries in the property page and selects this entry: with a single selected object its property entry is expanded, with several objects only the group with the common attributes. Does nothing when the entry is not displayed.
public void OpenSubEntries()
Refresh()
Asks the property page to redisplay this entry (see Refresh(IPropertyEntry)); call it after the label, the value or the sub entries changed. Does nothing while the entry is not shown.
public override void Refresh()
ReloadProperties()
public void ReloadProperties()
SetGeoObjectList(GeoObjectList)
Replaces the list of selected objects. The entry unsubscribes from the change events of the previous objects, subscribes to those of the new ones, discards its sub entries (they are recreated on demand from GetShowProperties(IFrame)) and refreshes its display. Called by the SelectObjectsAction whenever the selection changes.
public void SetGeoObjectList(GeoObjectList SelectedObjects)
Parameters
SelectedObjectsGeoObjectListThe new selection; the list is used directly, not copied
ShowOpen(IShowProperty)
Expands the given sub entry (e.g. the entry of one of the selected objects) in the property page, provided this entry is displayed.
public void ShowOpen(IShowProperty toShow)
Parameters
toShowIShowPropertyThe sub entry to expand
ShowSelected(IShowProperty)
Selects the given sub entry in the property page. The entry must be displayed on a property page.
public void ShowSelected(IShowProperty ToSelect)
Parameters
ToSelectIShowPropertyThe sub entry to select
Events
FocusedObjectChangedEvent
Raised when the user selects or deselects the entry of one of the selected objects, i.e. when focusedSelectedObject changes.
public event SelectedObjectsProperty.FocusedObjectChangedDelegate FocusedObjectChangedEvent
Event Type
HotspotChangedEvent
Raised when a hotspot of one of the selected objects is to be shown, hidden, selected, deselected or moved (implements HotspotChangedEvent). The hotspots originate from the property entries of the selected objects.
public event HotspotChangedDelegate HotspotChangedEvent