Table of Contents

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

ActionStack

ActiveAction

Returns the currently active action. Call GetID() to find out more about that action.

Action ActiveAction { get; }

Property Value

Action

ActiveView

Returns the currently active view

IView ActiveView { get; set; }

Property Value

IView

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

ICommandHandler

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

IPropertyEntry

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

IControlCenter

CurrentMenuId

Returns the menu id of the currently running action

string CurrentMenuId { get; }

Property Value

string

GlobalSettings

Returns the global settings

Settings GlobalSettings { get; set; }

Property Value

Settings

Project

Returns the project that is open in this frame

Project Project { get; }

Property Value

Project

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

GeoObjectList

SnapMode

Gets or sets the current SnapPointFinder.SnapModes

SnapPointFinder.SnapModes SnapMode { get; set; }

Property Value

SnapPointFinder.SnapModes

SolidModellingMode

When Solid objects get inserted into a model, this is how it will be handeled

Make3D.SolidModellingMode SolidModellingMode { get; set; }

Property Value

Make3D.SolidModellingMode

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

IUIService

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

string

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

Name string
Default bool

Returns

bool

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

Name string
Default Color

Returns

Color

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

Name string
Default double

Returns

double

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

Name string
Default int

Returns

int

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

Name string

Name 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

Name string

Returns

object

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

Name string
Default string

Returns

string

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

target ICommandHandler

The command handler to which the command is targeted

MenuId string

The menu id of the command (see MenuResource.xml)

Processed bool

Set 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

Action Action

The 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

Action Action

The 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

Action Action

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

tabPageName string

Name of a tabpage

resourceId string

resource id of an entry or null

openEntry bool

the subentries of this entry should be opened

popupCOntextMenu bool

the context menu of this entry should be displayed

Returns

bool

ShowPropertyDisplay(string)

Brings the property page with the Name to front (in the tab control)

void ShowPropertyDisplay(string Name)

Parameters

Name string

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

target ICommandHandler

The command handler to which the command is targeted

MenuId string

The menu id of the command (see MenuResource.xml)

CommandState CommandState

The state (enabled, checked) of the command, which the handlers may modify

Processed bool

Set 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

mruFiles string[]

The full names of the most recently used files

Events

ActionStartedEvent

Notification that a Action started

event ActionStartedDelegate ActionStartedEvent

Event Type

ActionStartedDelegate

ActionTerminatedEvent

Notification that a Action terminated

event ActionTerminatedDelegate ActionTerminatedEvent

Event Type

ActionTerminatedDelegate

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

ControlCenterCreatedDelegate

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

ProcessCommandDelegate

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

ProcessContextMenuDelegate

ProjectClosedEvent

Provide a event handler if you want to be notified when a project is beeing closed.

event ProjectClosedDelegate ProjectClosedEvent

Event Type

ProjectClosedDelegate

ProjectOpenedEvent

Provide a event handler if you want to be notified when a project is opened.

event ProjectOpenedDelegate ProjectOpenedEvent

Event Type

ProjectOpenedDelegate

SettingChangedEvent

Register here to get notified when a setting has changed

event SettingChangedDelegate SettingChangedEvent

Event Type

SettingChangedDelegate

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

UpdateCommandDelegate

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

UpdateContextMenuDelegate

ViewsChangedEvent

Provide a event handler if you want to be notified when new views are created or views are closed.

event ViewsChangedDelegate ViewsChangedEvent

Event Type

ViewsChangedDelegate