void Layer::drawView( View *view, Renderer *ren ) { if( view->isHidden() ) return; if( view->isClipEnabled() ) beginClip( view, ren ); gl::ScopedModelMatrix modelScope; if( view != mRootView || ! mRootView->mRendersToFrameBuffer ) gl::translate( view->getPos() ); view->drawImpl( ren ); for( auto &subview : view->getSubviews() ) { auto subviewLayer = subview->getLayer(); if( subviewLayer ) { subviewLayer->draw( ren ); } else { drawView( subview.get(), ren ); } } if( view->isClipEnabled() ) endClip(); }
DWORD EnhancedStatusLine::WinMessage(DWORD iMessage, DWORD wParam ,DWORD lParam) { switch (iMessage) { case SB_SETPARTS: for (int i=0; i < count; i++) delete items[i].text; delete items; count = wParam; items = new statusItem[count]; for (int i=0; i < wParam; i++) { items[i].offset = ((int *)lParam)[i]; items[i].text = newStr(""); } break; case SB_SETTEXT: wParam &= 0x1f; wParam--; if (wParam < count) { delete items[wParam].text; items[wParam].text = newStr((char *)lParam); drawView(); } break; } }
void Layer::draw( Renderer *ren ) { if( mRootView->mRendersToFrameBuffer ) { ivec2 frameBufferSize = ivec2( mFrameBufferBounds.getSize() ); if( ! mFrameBuffer || ! mFrameBuffer->isUsable() || mFrameBuffer->getSize().x < frameBufferSize.x || mFrameBuffer->getSize().y < frameBufferSize.y ) { mFrameBuffer = ren->getFrameBuffer( frameBufferSize ); LOG_LAYER( "acquiring FrameBuffer for view '" << mRootView->getName() << ", size: " << mFrameBuffer->getSize() << "', mFrameBufferBounds: " << mFrameBufferBounds << ", view bounds:" << mRootView->getBounds() ); } ren->pushFrameBuffer( mFrameBuffer ); gl::pushViewport( 0, mFrameBuffer->getHeight() - frameBufferSize.y, frameBufferSize.x, frameBufferSize.y ); gl::pushMatrices(); gl::setMatricesWindow( frameBufferSize ); gl::translate( - mFrameBufferBounds.getUpperLeft() ); gl::clear( ColorA::zero() ); } drawView( mRootView, ren ); if( mRootView->mRendersToFrameBuffer ) { ren->popFrameBuffer( mFrameBuffer ); gl::popViewport(); gl::popMatrices(); ren->pushBlendMode( BlendMode::PREMULT_ALPHA ); ren->pushColor( ColorA::gray( 1, getAlpha() ) ); auto destRect = mFrameBufferBounds + mRootView->getPos(); ren->draw( mFrameBuffer, Area( 0, 0, mFrameBufferBounds.getWidth(), mFrameBufferBounds.getHeight() ), destRect ); ren->popColor(); ren->popBlendMode(); } }
void TListBox::setData( void *rec ) { TListBoxRec *p = (TListBoxRec *)rec; newList(p->items); focusItem(p->selection); drawView(); }
void TStaticInputLine::newList(TCollection *aList) { if (list) CLY_destroy(list); list = aList; drawView(); }
void ScrollGroup::changeBounds(const TRect& bounds) { lock(); TGroup::changeBounds(bounds); setLimit(limit.x, limit.y); unlock(); drawView(); }
void TButton::setState( ushort aState, Boolean enable ) { TView::setState(aState, enable); if( aState & (sfSelected | sfActive) ) drawView(); if( (aState & sfFocused) != 0 ) makeDefault( enable ); }
void TScroller::checkDraw() { if( drawLock == 0 && drawFlag != False ) { drawFlag = False; drawView(); } }
void display(void) { glClear(GL_COLOR_BUFFER_BIT); drawView(); drawLine(); glFlush(); glutSwapBuffers(); }
void TScroller::changeBounds( const TRect& bounds ) { setBounds(bounds); drawLock++; setLimit(limit.x, limit.y); drawLock--; drawFlag = False; drawView(); }
void TReport::handleEvent(TEvent& event) { TView::handleEvent(event); if (event.what == evBroadcast) { if (event.message.command == cmAsciiTableCmdBase + cmCharFocused) { asciiChar = event.message.infoLong; drawView(); } } }
void TIndicator::setValue( const TPoint& aLocation, Boolean aModified ) { if( (location != aLocation) || (modified != aModified) ) { location = aLocation; modified = aModified; drawView(); } }
void TInputLine::selectAll( Boolean enable ) { selStart = 0; if( enable ) curPos = selEnd = strlen(data); else curPos = selEnd = 0; firstPos = max( 0, curPos-size.x+3 ); drawView(); }
void TStatusLine::update() { TView *p = TopView(); ushort h = ( p != 0 ) ? p->getHelpCtx() : hcNoContext; if( helpCtx != h ) { helpCtx = h; findItems(); drawView(); } }
// set a new maximum iteration & update display void TProgressBar::setTotal(unsigned long newTotal) { unsigned long tmp = total; total = newTotal; memset(bar,backChar,size.x); curWidth = 0; // current width of percentage bar progress = 0; // current iteration curPercent = 0; // current percentage if(tmp) // since it starts with 0, only update if changing drawView(); // update the thermometer bar display }
void TListViewer::setRange(int aRange) { range = aRange; if (focused >= aRange) // BUG FIX - EFW - Tue 06/26/95 focused = (aRange - 1 >= 0) ? aRange - 1 : 0; if (vScrollBar != 0) vScrollBar->setParams(focused, 0, aRange - 1, vScrollBar->pgStep, vScrollBar->arStep); else drawView(); }
// set a new current iteration & update display void TProgressBar::setCurIter ( unsigned long newCur ) { curIter = newCur; calcPercent(); // width change? if ( curPercent != oldPercent ) { drawView(); // paint the thermometer bar } }
void TPuzzleView::winCheck() { /* SS: little change */ int i; for (i = 0; i <= 15; i++) // for(int i = 0; i <= 15; i++) if (board[i / 4][i % 4] != solution[i]) break; if (i == 16) solved = 1; drawView(); }
void TListBox::newList( TCollection *aList ) { destroy( items ); items = aList; if( aList != 0 ) setRange( aList->getCount() ); else setRange(0); if( range > 0 ) focusItem(0); drawView(); }
void TButton::makeDefault( Boolean enable ) { if( (flags & bfDefault) == 0 ) { message( owner, evBroadcast, (enable == True) ? cmGrabDefault : cmReleaseDefault, this ); amDefault = enable; drawView(); } }
TCalendarView::TCalendarView(TRect& r) : TView( r ) { time_t now = time(0); struct tm tme = *localtime(&now); options |= ofSelectable; eventMask |= evMouseAuto; year = curYear = tme.tm_year + 1900; month = curMonth = tme.tm_mon + 1; curDay = tme.tm_mday; drawView(); }
void FFigure:: buildViews(void) { if (!noViewUpdate) { for (vector<FigView*>::iterator views_iter = views.begin(); views_iter != views.end(); views_iter++) { (*views_iter)->clear(); drawView(*views_iter); } viewIsDirty = false; } else { viewIsDirty = true; } }
void display(void) { static GLuint texobjs[6] = { 1, 2 ,3, 4, 5, 6 }; int i; glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(90.0, 1.0, 0.5, 40.0); glViewport(0, 0, texdim, texdim); glScissor(0, 0, texdim, texdim); glEnable(GL_SCISSOR_TEST); glEnable(GL_DEPTH_TEST); /* front view (center) */ for (i=0; i<6; i++) { configFace(i); drawView(0); snagImageAsTexture(1+i); } glDisable(GL_SCISSOR_TEST); glClear(GL_COLOR_BUFFER_BIT); glViewport(0, 0, W, H); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0, 1, 0, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); drawSphereMapMesh(texobjs); glDisable(GL_TEXTURE_2D); if (outline) { glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); glDisable(GL_LIGHTING); glColor3f(1.0, 1.0, 1.0); drawSphereMapMesh(texobjs); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glEnable(GL_LIGHTING); } glDisable(GL_SCISSOR_TEST); /* initial clear */ glViewport(0, 0, W, H); if (bufswap) { glutSwapBuffers(); } }
TCalendarView::TCalendarView(TRect& r) : TView( r ) { struct date d; options |= ofSelectable; eventMask |= evMouseAuto; getdate( &d ); year = curYear = d.da_year; month = curMonth = d.da_mon; curDay = d.da_day; drawView(); }
void TPuzzleView::moveKey(int key) { /* SS: little change */ int i; for (i = 0; i <= 15; i++) // for(int i = 0; i <= 15; i++) if (board[i / 4][i % 4] == ' ') break; int x = i % 4; int y = i / 4; switch (key) { case kbDown: if (y > 0) { board[y][x] = board[y - 1][x]; board[y - 1][x] = ' '; if (moves < 1000) moves++; } break; case kbUp: if (y < 3) { board[y][x] = board[y + 1][x]; board[y + 1][x] = ' '; if (moves < 1000) moves++; } break; case kbRight: if (x > 0) { board[y][x] = board[y][x - 1]; board[y][x - 1] = ' '; if (moves < 1000) moves++; } break; case kbLeft: if (x < 3) { board[y][x] = board[y][x + 1]; board[y][x + 1] = ' '; if (moves < 1000) moves++; } break; } drawView(); }
void MainView::dealCards() // deal hand { for (auto e : _btnCards) { e->setEnabled(true); } for (int i = 0; i < 5; i++) { _hand.addCard(_deck.dealCard()); } drawView(); }
void TClickTester::handleEvent(TEvent& event) { TStaticText::handleEvent(event); if (event.what == evMouseDown) { if (event.mouse.doubleClick) { clicked = (clicked) ? 0 : 1; drawView(); } clearEvent(event); } }
// set a new maximum iteration & update display void TProgressBar::setMaxIter ( unsigned long newMax ) { unsigned long tmp = maxIter; maxIter = newMax; memset( bar, backChar, maxWidth ); curWidth = 0; // current width of percentage bar oldWidth = 0; // old width of percentage bar curIter = 0; // current iteration oldPercent = 0; // old percentage curPercent = 0; // current percentage if ( tmp ) // since it starts with 0, only update if changing { drawView(); // update the thermometer bar display } }
void ThreeDWidget::paintGL() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); drawView(); drawFloor(); drawOriginal(); // drawSkeleton(); drawPointCloud(); if(_calibrated) drawCameras(); }
void TCluster::setState(ushort aState, Boolean enable) { TView::setState(aState, enable); if (aState == sfSelected) { int i = 0, s = sel - 1; do { i++; s++; if (s >= strings->getCount()) s = 0; } while (!(buttonState(s) || i > strings->getCount())); moveSel(i, s); } drawView(); }