KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > General > IMenu_KC
IMenu_KC Interface

IMenu_KC Interface

Enable
GetItemCount
GetItemAt
InsertAt
RemoveAt
Add
InsertSubMenu
GetSubMenu

IMenu_KC interface gives access to context menu (right mouse click) of KernelCAD componet. IMenu_KC can be queried from IView interface of the component.

See also: Light SampleMenu topic


HRESULT Enable(int item, VARIANT_BOOL enable)

Parameters

item - [in] 0-based index of the item

enable - [in] True to enable the item


HRESULT GetItemCount(int *count)

Parameters

count - [out, retval] Current number of items in the menu, including separators


HRESULT  GetItemAt(int index, IMenuItem_KC **item)

Parameters

index - [in] 0-based index of the item. Must be less than the current count of items.

item - [out, retval] IMenuItem_KC interface implemented by the item

Remarks:

Retrieves IMenuItem_KC interface implemented by the item. It is recommended to reacquire the interface after modifications of structure of the menu (items removed or added)


HRESULT InsertAt(int indexAt, IMenuItem_KC **item)

Parameters

indexAt - [in] 0-based index in the menu. Must be less than or equal to the current count of items.

item - [out, retval] - The returned IMenuItem_KC interface implemented by the newly inserted item

Remarks:

Inserts a new default item at the position and returns IMenuItem_KC interface implemented by the newly inserted item, which can be used to set its properties, including the displayed text.


HRESULT RemoveAt(int index)

Parameters

index - [in] 0-based index of the item. Must be less than the current count of items.

Remarks:

Removes the item at the position.


HRESULT Add(IMenuItem_KC **item)

Parameters

item - [out, retval] - The returned IMenuItem_KC interface implemented by the newly inserted item

Remarks:

Adds a new default item at the end of the menu and returns IMenuItem_KC interface implemented by the newly inserted item, which can be used to set its properties, including the displayed text.


HRESULT RemoveAll()

Remarks:

Empties the menu.


HRESULT FindItem(char* name, int *index)

Parameters

name - [in] Text of the item to be found

index - [out, retval] - Index of the found item or -1 if there is no item with the name


HRESULT InsertSubMenu(int indexAt, IMenu_KC** newSubMenu)

Parameters

indexAt - [in] New sub menu will be created at this position

newSubMenu - [out, retval] - The new sub menu

Remarks:

Creates a new submenu at position indexAt. The menu has a single item with all default attributes, which can be modified via GetSubMenu(indexAt, ...) > IMenu_KC > GetItemAt(0, ..) > IMenuItem_KC


HRESULT GetSubMenu(int i, IMenu_KC** subMenu)

Parameters

i -[in] Index (position) of the submenu in this menu

subMenu - [out, retval] - The returned sub menu

Remarks:

This method can be called for any non-negative i, which is less then count of all menu items including submenus as returned by GetItemCount. When item at the position is not a submenu the method returns a NULL reference.