To create a COM or Java application that uses a drawable wrapper object, you must subclass your IDL object from one of the following object classes before generating the wrapper:
- IDLgrWindow: Provides a canvas for graphic objects
- IDLitWindow: Provides a canvas for iTool visualizations
- IDLitDirectWindow: Provides a canvas for Direct Graphic routine output
Note: Java drawable objects are not supported on macOS.
Requirements for Drawable Objects
Objects that inherit from IDLgrWindow must set the GRAPHICS_TREE property following creation of the objects hierarchy. This supports the automatic redraw capabilities of the OnExpose method.
Note: Common drawable object methods (such as OnKeyboard or OnMouseMotion) are typically not displayed in the Export Bridge Assistant when exporting a drawable object. See Drawable Object Event Handlers for details.
In addition, IDL objects derived from IDLitDirectWindow must first provide a call of self->makeCurrent at the beginning of each method to ensure that the graphics rendering occurs in the wrapper’s drawable window, as described below.
Direct Graphics Support
To provide IDL Direct Graphics support, the export bridge uses an object to create an IDL Direct Graphics drawing surface. The Direct Graphics object, IDLitDirectWindow, differs from standard IDL Direct Graphics in the following manner:
- The object implements the Active Window event handler callback methods to manage events. As such, to perform any event processing in IDL the user must sub-class this object and override the desired event callback methods.
- To make the window object current in the underlying direct graphics driver the user calls the IDLitDirectWindow::MakeCurrent method on the object. This is similar to a WSET operation in IDL, but no window index is required.
- Once a window is current, any IDL direct graphics routine can be called to draw graphics on the provided drawing surface. The user can add a method on the object they implement to render graphics or use the execute string functionality of the bridge to issue IDL commands.
While the Export Bridge implementation provides a different method to create and interact with a Direct Graphics Window, the differences are minor and let users rapidly port their IDL Direct Graphics implementation for use with this technology.