I am working on a CVI application where I need multiple plot windows. I have choosen to create multiple panels, each with one OGL-control. From the CVI examples for an OpenGL control, I have:
1. a panel with a picture control
2. the picture converted to a OGL control
3. inserted a RedrawObject-activity in the control callback for event OGLEVENT_REFRESH
I have attached a test programme. Loading instrument drivers 'cviogl.fp' from CVI subdir toolslib\custctrl and loading 'toolbox.fp' from CVI subdir \toolslib\toolbox is needed.
I want to use left-mouse click to zoom 2x
I want to use right-mouse click to zoom 0.5x
With OGL-attribute enable-pan-zoom ON, the left-mouse click seems to generate an OGLEVENT
_REFRESH on mouse-down, an OGLEVENT_REFRESH on mouse-up and the CVI event EVENT_LEFT_CLICK. Therefore the draw-activity is repeated 3 times. With OGL-attribute for enable-pan-zoom OFF, the left-mouse click generates no events at all. In both cases, the right-mouse click generates one event just as I want to. As the actual application uses several seconds to calculate the RedrawObjects, I want to limit the RedrawObjects to once for each mouse click.
I tried to seperate the OGLRefresh and the actual object drawing by removing the ReDrawObjects from the control callback and calling the RedrawObjects seperately just before/after OGLRefresh; the screen stays empty. I have tried to insert an empty if-statement *wParam==WM_NCLBUTTONDOWN into the windows-callback "OpenglKeyboardActivity" to catch the bottondown event; I am not familiar with Windows SDK and this did not solve anything.
Please tell me how (if possible) to adapt the attached programme so the both left and right mousebuttons
, generate only one RedrawObjects,
Regards, Jos