void ScrollGroup::scrollTo(int x, int y) { lock(); if( hScrollBar != 0 && x != hScrollBar->value) hScrollBar->setValue(x); if( vScrollBar != 0 && y != vScrollBar->value) vScrollBar->setValue(y); unlock(); scrollDraw(); }
void TScroller::handleEvent(TEvent& event) { TView::handleEvent(event); if( event.what == evBroadcast && event.message.command == cmScrollBarChanged && ( event.message.infoPtr == hScrollBar || event.message.infoPtr == vScrollBar ) ) scrollDraw(); }
/* * Creates the virtual envirnment. */ void display (void) { glClearColor (0.0,0.0,0.0,1.0); glClear (GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT); glLoadIdentity(); gluLookAt(eye[0],eye[1],eye[2], center[0],center[1],center[2],up[0],up[1],up[2]); scrollDraw(); //swap buffers glutSwapBuffers(); }
void ScrollGroup::setLimit(int x, int y) { limit.x = x; limit.y = y; lock(); if(hScrollBar != 0) hScrollBar->setParams(hScrollBar->value, 0, x-size.x, size.x-1, 1); if(vScrollBar != 0 ) vScrollBar->setParams(vScrollBar->value, 0, y-size.y, size.y-1, 1); unlock(); scrollDraw(); }
void ScrollGroup::handleEvent(TEvent& event) { TGroup::handleEvent(event); if(event.what == evBroadcast) { if(event.message.command == cmScrollBarChanged && (event.message.infoPtr == hScrollBar || event.message.infoPtr == vScrollBar)) scrollDraw(); else if(event.message.command == cmReceivedFocus && firstThat(isView, event.message.infoPtr) != 0) focusSubView((TView*) event.message.infoPtr); } }