Light Visual Basic .NET Sample
Overview
Implementation
LightForm.OnFormLoad()
retrieves IArray interface, controlling the array of all lights in the model.
The IArray is obtained as "LightSourceArray" property from
IPropertyArray,
which in turn is queried from IModel interface. The IArray pointer is kept in
m_iArrLights
member of the form class.
The ILightSource interface
m_iLightSource implemented by the current light
source is retrieved in LightForm.UpdateSourceInfo().
New lights are added or removed in LightForm.SetLightSourceCount(int nCount)
using methods of IArray.
Tools > "Modify Popup Menu" menu option starts CustomizeMenuForm which uses
IMenu_KC
and IMenuItem_KC
to manipulate the menu.
Notice also the LightForm.OnKernelCADEvent
DG Kernel Event handler, which
intercepts the menu commands. When user selects Surface or Wireframe commands
the handler updates the relevant radio buttons on the dialogue to keep it
synchronized with the component state. Notice also how the Save As command is
blocked by e.param1 = True; because the command is
handled by the application itself.
See also: Menu,
ILightSource,
Visual C++ Samples,
All samples.
|