Interface IFrame
- Namespace
- CADability
- Assembly
- CADability.dll
The application frame: the central object that holds the open Project, its views, the stack of running
actions, the control center (properties explorer) and the user interface services, and that routes menu commands and
settings. Actions, views and property entries reach the rest of the application through this interface. The kernel
provides the implementation FrameImpl, from which the concrete application derives (e.g. CadFrame
in CADability.Forms). The current frame is also available as MainFrame.
public interface IFrame
Properties
ActionStack
The stack of running actions. The views forward their mouse events to it and it distributes menu commands to the actions. For starting and terminating actions SetAction(Action), RemoveActiveAction() and ActiveAction are usually sufficient.
ActionStack ActionStack { get; }
Property Value
ActiveAction
Returns the currently active action. Call GetID() to find out more about that action.
Action ActiveAction { get; }
Property Value
ActiveView
Returns the currently active view
IView ActiveView { get; set; }
Property Value
AllViews
Returns an array of all views currently open in the frame
IView[] AllViews { get; }
Property Value
- IView[]
CommandHandler
Update and execute menus with this command handler
ICommandHandler CommandHandler { get; }
Property Value
ContextMenuSource
The property entry that opened the context menu which is currently displayed or being processed. Property entries set this before they show their context menu, so that the command handler can find out which entry a command refers to.
IPropertyEntry ContextMenuSource { get; set; }
Property Value
ControlCenter
The control center (properties explorer) of the application: the tab control that shows the property pages "Action", "Project", "Global" and "View". May be null when the application runs without a properties explorer.
IControlCenter ControlCenter { get; }
Property Value
CurrentMenuId
Returns the menu id of the currently running action
string CurrentMenuId { get; }
Property Value
GlobalSettings
Returns the global settings
Settings GlobalSettings { get; set; }
Property Value
Project
Returns the project that is open in this frame
Project Project { get; }
Property Value
SelectedObjects
Gets or sets the selected objects. There must be no other action running when this property is used. If there is another action running, nothing will be set and the get property returns null
GeoObjectList SelectedObjects { get; set; }
Property Value
SnapMode
Gets or sets the current SnapPointFinder.SnapModes
SnapPointFinder.SnapModes SnapMode { get; set; }
Property Value
SolidModellingMode
When Solid objects get inserted into a model, this is how it will be handeled
Make3D.SolidModellingMode SolidModellingMode { get; set; }
Property Value
UIService
The user interface services of the application: message boxes, file and color dialogs, clipboard access, progress bar and similar functions that the kernel needs but cannot provide itself (see IUIService).
IUIService UIService { get; }
Property Value
Methods
AssureModelView()
If the ActiveView is not a ModelView then the first ModelView of the current Project will be displayed
void AssureModelView()
GetActivePropertyDisplay()
Returtns the name of the currently selected property page of the control center
string GetActivePropertyDisplay()
Returns
GetBooleanSetting(string, bool)
Gets the boolen setting for the Name. If not found Default will be returned.
GetSetting(string)
bool GetBooleanSetting(string Name, bool Default)
Parameters
Returns
GetColorSetting(string, Color)
Gets the color setting for the Name. If not found Default will be returned.
GetSetting(string)
Color GetColorSetting(string Name, Color Default)
Parameters
Returns
GetDoubleSetting(string, double)
Gets the double setting for the Name. If not found Default will be returned.
GetSetting(string)
double GetDoubleSetting(string Name, double Default)
Parameters
Returns
GetIntSetting(string, int)
Gets the integer setting for the Name. If not found Default will be returned.
GetSetting(string)
int GetIntSetting(string Name, int Default)
Parameters
Returns
GetPropertyDisplay(string)
Returns the property page of the control center with the given name. The names of the standard pages are "Action", "Project", "Global" and "View".
IPropertyPage GetPropertyDisplay(string Name)
Parameters
NamestringName of the property page
Returns
- IPropertyPage
The property page, or null if there is no such page or no control center
GetSetting(string)
Gets the Settings for the provided Name. First the Projects settings are
checked, if it is not defined there, the global settings will be queried.
object GetSetting(string Name)
Parameters
Namestring
Returns
GetStringSetting(string, string)
Gets the string setting for the Name. If not found Default will be returned.
GetSetting(string)
string GetStringSetting(string Name, string Default)
Parameters
Returns
ProcessContextMenu(ICommandHandler, string, ref bool)
Raises the ProcessContextMenuEvent. Called by the command handlers of context menus (e.g. the selection) before they execute a context menu command, so that the application can intercept the command.
void ProcessContextMenu(ICommandHandler target, string MenuId, ref bool Processed)
Parameters
targetICommandHandlerThe command handler to which the command is targeted
MenuIdstringThe menu id of the command (see MenuResource.xml)
ProcessedboolSet to true by a handler that has processed the command
RaiseActionStartedEvent(Action)
Raises the ActionStartedEvent. Called by the ActionStack when an action is set; there is no need to call it from elsewhere.
void RaiseActionStartedEvent(Action Action)
Parameters
ActionActionThe action that has been started
RaiseActionTerminatedEvent(Action)
Raises the ActionTerminatedEvent. Called by the ActionStack when an action is removed; there is no need to call it from elsewhere.
void RaiseActionTerminatedEvent(Action Action)
Parameters
ActionActionThe action that has terminated
RemoveActiveAction()
Removes the active action froom the action stack. Usually actions terminate themselves by calling RemoveThisAction().
void RemoveActiveAction()
SetAction(Action)
Starts the provided action. The currently active action will either be aborted or pushed down on the action stack until the provided action terminates.
void SetAction(Action Action)
Parameters
ActionAction
SetControlCenterFocus(string, string, bool, bool)
Sets the focus to a given entry in a given tabpage of the controlcenter. The names of the standard tabpgaes are: "Action","Project","Global","View","Symbol". If resourceId is null only the specified tabpage is selected.
bool SetControlCenterFocus(string tabPageName, string resourceId, bool openEntry, bool popupCOntextMenu)
Parameters
tabPageNamestringName of a tabpage
resourceIdstringresource id of an entry or null
openEntryboolthe subentries of this entry should be opened
popupCOntextMenuboolthe context menu of this entry should be displayed
Returns
ShowPropertyDisplay(string)
Brings the property page with the Name to front (in the tab control)
void ShowPropertyDisplay(string Name)
Parameters
Namestring
UpdateContextMenu(ICommandHandler, string, CommandState, ref bool)
Raises the UpdateContextMenuEvent. Called by the command handlers of context menus before a context menu is displayed, so that the application can set the enabled and checked state of the commands.
void UpdateContextMenu(ICommandHandler target, string MenuId, CommandState CommandState, ref bool Processed)
Parameters
targetICommandHandlerThe command handler to which the command is targeted
MenuIdstringThe menu id of the command (see MenuResource.xml)
CommandStateCommandStateThe state (enabled, checked) of the command, which the handlers may modify
ProcessedboolSet to true by a handler that has provided the state
UpdateMRUMenu(string[])
Updates the list of most recently used files in the file menu of the application. The frame calls it after a file has been opened or saved. The implementation in FrameImpl does nothing; the application overrides it to fill its menu.
void UpdateMRUMenu(string[] mruFiles)
Parameters
mruFilesstring[]The full names of the most recently used files
Events
ActionStartedEvent
Notification that a Action started
event ActionStartedDelegate ActionStartedEvent
Event Type
ActionTerminatedEvent
Notification that a Action terminated
event ActionTerminatedDelegate ActionTerminatedEvent
Event Type
ControlCenterCreatedEvent
This event will raised when the ControlCenter has been created. You can use the method ControlCenter.HideEntry to suppress entries in the ControlCenter
event ControlCenterCreatedDelegate ControlCenterCreatedEvent
Event Type
ProcessCommandEvent
Provide a event handler if you want to be notified on command routed through this frame or to execute command handlers for some routed commands-
event ProcessCommandDelegate ProcessCommandEvent
Event Type
ProcessContextMenuEvent
Provide a event handler if you want to be notified on contex menue commands routed through this frame or to execute command handlers for some routed commands-
event ProcessContextMenuDelegate ProcessContextMenuEvent
Event Type
ProjectClosedEvent
Provide a event handler if you want to be notified when a project is beeing closed.
event ProjectClosedDelegate ProjectClosedEvent
Event Type
ProjectOpenedEvent
Provide a event handler if you want to be notified when a project is opened.
event ProjectOpenedDelegate ProjectOpenedEvent
Event Type
SettingChangedEvent
Register here to get notified when a setting has changed
event SettingChangedDelegate SettingChangedEvent
Event Type
UpdateCommandEvent
Provide a event handler if you want to control the appearnce of commands in the menu or toolbar (set the enabled and check flags).
event UpdateCommandDelegate UpdateCommandEvent
Event Type
UpdateContextMenuEvent
Provide a event handler if you want to control the appearance of commands in a context the menu (set the enabled and check flags).
event UpdateContextMenuDelegate UpdateContextMenuEvent
Event Type
ViewsChangedEvent
Provide a event handler if you want to be notified when new views are created or views are closed.
event ViewsChangedDelegate ViewsChangedEvent