Table of Contents

Class CadControl

Namespace
CADability.Forms
Assembly
CADability.Forms.dll

This class is an UserControl which allow us to use the cad in a custom form. The idea is not to force the user to use a form derived from CadForm. If the CreateMainMenu property is true, it creates the MainMenu in the parent form. The ProgressAction property allow us to use a custom progress ui.

public class CadControl : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl, ICommandHandler
Inheritance
CadControl
Implements
Inherited Members

Constructors

CadControl()

Default constructor

public CadControl()

Fields

CommandRequest

Func that allow to listen (and eventually handle) the commands

public Func<string, bool> CommandRequest

Field Value

Func<string, bool>

Properties

CadCanvas

public CadCanvas CadCanvas { get; }

Property Value

CadCanvas

CadFrame

public CadFrame CadFrame { get; }

Property Value

CadFrame

CreateMainMenu

Indicates to create the menu on the parent form

public bool CreateMainMenu { get; set; }

Property Value

bool

ProgressAction

Action that delegate the progress. In this way we can use a custom progress ui.

public Action<bool, double, string> ProgressAction { get; set; }

Property Value

Action<bool, double, string>

PropertiesExplorer

public PropertiesExplorer PropertiesExplorer { get; }

Property Value

PropertiesExplorer

PropertiesExplorerVisible

Get or set a value indicating whether the ProperiesExplorer is displayed

public bool PropertiesExplorerVisible { get; set; }

Property Value

bool

ToolbarsVisible

Get or set a value indicating whether the toolbars are displayed

public bool ToolbarsVisible { get; set; }

Property Value

bool

Methods

Dispose(bool)

Clean up any resources being used.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true if managed resources should be disposed; otherwise, false.

OnCommand(string)

Process the command with the given MenuId. Return true if handled, false otherwise.

public virtual bool OnCommand(string MenuId)

Parameters

MenuId string

Returns

bool

true, if handled, false otherwise

OnHandleCreated(EventArgs)

protected override void OnHandleCreated(EventArgs e)

Parameters

e EventArgs

OnSelected(MenuWithHandler, bool)

Notify that the menu item is being selected. No need to react on this notification

public virtual void OnSelected(MenuWithHandler selectedMenuItem, bool selected)

Parameters

selectedMenuItem MenuWithHandler
selected bool

true, if selected, false if deselected

OnUpdateCommand(string, CommandState)

Update the command user interface of the given command. Return true if handled, false otherwise.

public virtual bool OnUpdateCommand(string MenuId, CommandState CommandState)

Parameters

MenuId string
CommandState CommandState

Returns

bool

true, if handled, false otherwise

ProcessCmdKey(ref Message, Keys)

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)

Parameters

msg Message
keyData Keys

Returns

bool