void CommandDialog::draw () { drawBackground (); drawBorder ("HERMIT Commands"); writeText (2, 2, "Select a command with the cursor and press Enter"); writeText (2, 3, "to activate it, or press Esc to cancel."); }
/** Draw the givenh MultiColumnList * * \param qr The QuadRenderer used to draw * \param mcl The MultiColumnList to draw * */ void RainbruRPG::OgreGui::wdMultiColumnList:: draw(QuadRenderer* qr, MultiColumnList* mcl){ mCurrentMcl = mcl; // Test initialization and init if needed // Call preDrawingComputation cause it is first drawing if (!wasInit){ init(mcl); preDrawingComputation( mcl ); } LOGA(mWidgetParent, "MultiColumnList parent poiner is NULL"); // Get event driven values (cannot be got with preDrawingComputation) int movingColumn=mcl->getMovedColumnIndex(); // Draws multicolumnlist drawBorder(qr); drawAllHeaders(qr, mcl, movingColumn); drawAllItems(qr, mcl, movingColumn); // Set the scissor rectangle as the parent window corners // It is used because, as the next widgets drawn are the ScrollBars // (please see MultiColumnList::draw() implementation), they will // be cut off be the parent scissor setting (the Window corners) qr->setUseParentScissor(false); qr->setScissorRectangle(mWidgetParent->getCorners()); qr->setUseParentScissor(true); mDebugSettings->reset(); }
/* * redrawViewWnd - process the WM_PAINT message for the view windows */ static void redrawViewWnd( HWND hwnd ) { WPI_PRES pres; WPI_PRES hps; WPI_PRES mempres; HDC memdc; HBITMAP bitmap; HBITMAP oldbitmap; img_node *node; PAINTSTRUCT ps; node = SelectFromViewHwnd( hwnd ); if( node == NULL ) { return; } hps = _wpi_beginpaint( hwnd, NULL, &ps ); drawBorder( node ); pres = _wpi_getpres( hwnd ); bitmap = CreateViewBitmap( node ); mempres = _wpi_createcompatiblepres( pres, Instance, &memdc ); oldbitmap = _wpi_selectbitmap( mempres, bitmap ); _wpi_bitblt( pres, BORDER_WIDTH, BORDER_WIDTH, node->width, node->height, mempres, 0, 0, SRCCOPY ); _wpi_getoldbitmap( mempres, oldbitmap ); _wpi_deletebitmap( bitmap ); _wpi_deletecompatiblepres( mempres, memdc ); _wpi_releasepres( hwnd, pres ); _wpi_endpaint( hwnd, hps, &ps ); } /* redrawViewWnd */
void ofxFFTBase::drawLogarithmic(int x, int y, int w, int h) { vector<float> &fftLogNormData = logData.dataNorm; vector<float> &fftLogPeakData = logData.dataPeak; vector<int> &fftLogCutData = logData.dataCut; ofPushMatrix(); ofTranslate(x, y); drawBg(fftData, w, h); int renderSingleBandWidth = w / (float)fftLogNormData.size(); int bx, by; // border. bx = by = renderBorder; // draw cut data ofPushStyle(); ofFill(); ofSetColor(200); for(int i=0; i<fftLogCutData.size(); i++) { ofDrawRectangle(i * renderSingleBandWidth + bx, h + by, renderSingleBandWidth, -fftLogCutData[i] * h); } ofPopStyle(); //draw normalized data ofPushStyle(); for(int i=0; i<fftLogNormData.size(); i++) { ofFill(); ofSetColor(100); if (logData.dataBeats[i]) ofSetColor(10, 200, 255); ofDrawRectangle(i * renderSingleBandWidth + bx, h + by, renderSingleBandWidth, -fftLogNormData[i] * h); ofNoFill(); ofSetColor(232); ofDrawRectangle(i * renderSingleBandWidth + bx, h + by, renderSingleBandWidth, -fftLogNormData[i] * h); } ofPopStyle(); //draw peak data ofPushStyle(); ofFill(); ofSetColor(0); for(int i=0; i<fftLogPeakData.size(); i++) { float p = fftLogPeakData[i]; ofDrawRectangle(i * renderSingleBandWidth + bx, (1 - p) * (h - 2) + by, renderSingleBandWidth - 1, 2); } ofPopStyle(); drawBorder(w, h); drawThresholdLine(fftData, w, h); ofPopMatrix(); //drawThresholdLine(audioData, width, height); }
void UILineEdit::drawSelf() { drawBackground(m_rect); drawBorder(m_rect); drawImage(m_rect); drawIcon(m_rect); //TODO: text rendering could be much optimized by using vertex buffer or caching the render into a texture int textLength = m_text.length(); const TexturePtr& texture = m_font->getTexture(); g_painter.setColor(m_color); for(int i=0;i<textLength;++i) g_painter.drawTexturedRect(m_glyphsCoords[i], texture, m_glyphsTexCoords[i]); // render cursor if(isExplicitlyEnabled() && (isActive() || m_alwaysActive) && m_cursorPos >= 0) { assert(m_cursorPos <= textLength); // draw every 333ms const int delay = 333; if(g_clock.ticksElapsed(m_cursorTicks) <= delay) { Rect cursorRect; // when cursor is at 0 or is the first visible element if(m_cursorPos == 0 || m_cursorPos == m_startRenderPos) cursorRect = Rect(m_drawArea.left()-1, m_drawArea.top(), 1, m_font->getGlyphHeight()); else cursorRect = Rect(m_glyphsCoords[m_cursorPos-1].right(), m_glyphsCoords[m_cursorPos-1].top(), 1, m_font->getGlyphHeight()); g_painter.drawFilledRect(cursorRect); } else if(g_clock.ticksElapsed(m_cursorTicks) >= 2*delay) { m_cursorTicks = g_clock.ticks(); } } }
void ICircuitView::drawImpl(const QVector<int>& inputPadding, const QVector<int>& outputPadding, const QString& text) { const QPoint& begin = beginPoint(); const QPoint second{begin.x() + CIRCUIT_WIDTH, begin.y()}; const QPoint third{begin.x() + CIRCUIT_WIDTH, begin.y() + CIRCUIT_HEIGHT}; const QPoint fourth{begin.x(), begin.y() + CIRCUIT_HEIGHT}; foreach (const int padding, outputPadding) DrawingHelper::drawOutputWire({second.x(), second.y() + padding}); foreach(const int padding, inputPadding) DrawingHelper::drawInputWire({begin.x(), begin.y() + padding}); DrawingHelper::drawPolygon(QPolygon({begin, second, third, fourth}), Qt::white); DrawingHelper::drawPolygonBorder(QPolygon({begin, second, third, fourth}), Qt::black); if (m_isSelected) drawBorder(); if (m_model != NULL) DrawingHelper::drawText({m_begin.x(), m_begin.y() + CIRCUIT_HEIGHT + 10}, "E" + QString::number(m_model->id()), m_editor); DrawingHelper::drawText(QPoint(begin.x() + CIRCUIT_WIDTH / 5, begin.y() + CIRCUIT_HEIGHT / 2), text, editor()); }
qreal KDReports::SpreadsheetReportLayout::paintTableVerticalHeader( qreal x, qreal y, QPainter& painter, int row ) { QAbstractItemModel* model = m_tableLayout.m_model; const QRectF cellRect( x, y, m_tableLayout.vHeaderWidth(), m_tableLayout.rowHeight() ); painter.setFont( m_tableLayout.verticalHeaderScaledFont() ); painter.fillRect( cellRect, m_tableSettings.m_headerBackground ); drawBorder( cellRect, painter ); const QColor foreground = qvariant_cast<QColor>( model->headerData( row, Qt::Vertical, Qt::ForegroundRole ) ); if ( foreground.isValid() ) painter.setPen( foreground ); const QString cellText = model->headerData( row, Qt::Vertical ).toString(); const qreal padding = m_tableLayout.scaledCellPadding(); const Qt::Alignment alignment( model->headerData( row, Qt::Vertical, Qt::TextAlignmentRole ).toInt() ); const QVariant cellDecoration = model->headerData( row, Qt::Vertical, Qt::DecorationRole ); const QVariant decorationAlignment = model->headerData( row, Qt::Vertical, KDReports::AutoTableElement::DecorationAlignmentRole ); const QRectF cellContentsRect = cellRect.adjusted( padding, padding, -padding, -padding ); //painter.drawText( cellContentsRect, alignment, cellText ); paintTextAndIcon( painter, cellContentsRect, cellText, cellDecoration, decorationAlignment, alignment ); if ( foreground.isValid() ) painter.setPen( Qt::black ); x += cellRect.width(); return x; }
void ArxDbgDbAdeskLogo::commonDraw(AcGiCommonDraw* drawContext) { if (drawContext->regenAbort()) return; AcGeMatrix3d scaleMat; m_scale.getMatrix(scaleMat); AcGeMatrix3d mat; getEcs(mat); // push ECS of this Logo mat *= scaleMat; drawContext->rawGeometry()->pushModelTransform(mat); ArxDbgDbAdeskLogoStyle* lStyle = NULL; Acad::ErrorStatus es = acdbOpenObject(lStyle, m_logoStyleId, AcDb::kForRead); drawLogo(drawContext, lStyle); drawLabel(drawContext, lStyle); drawBorder(drawContext, lStyle); if (es == Acad::eOk) lStyle->close(); drawContext->rawGeometry()->popModelTransform(); drawRefLine(drawContext); }
/** * run * Run is the main control body of the program. It first prints the header which * contains directions on how to use the program then enters the paused state * in which the user may edit the population using a cursor controlled by the * arrow keys. If the user presses Enter, the simulation is started and will * continue until the user again presses Enter to pause or Esc to exit. **/ void run(int model[][ROWS]) { printHeader(); //prints directions drawBorder(GRIDCOLOR); //draws a border swapBuff(); int i = COLUMNS/2; //initializes position of cursor to middle of screen int j = ROWS/2; raw_key = 0x1C; //sets raw_key = ENTER while (raw_key != 0x01) { //loops until user hits Esc if (raw_key==0x1C) { //checks for enter pressed raw_key=0; waitVRetrace(); drawGrid(GRIDCOLOR); //draws grid on screen for edit mode drawSquare(i,j,SELCOLOR); //draws cursor at position on screen while (raw_key!=0x1C && raw_key!=0x01) { //loops until Esc or Enter waitVRetrace(); if (raw_key==0x48) { //up arrow has been pressed raw_key = 0; updateSquare(model,i,j); //erases cursor if (j>0) {j--;} //updates cursor position drawSquare(i,j,SELCOLOR); //draws cursor at new position } if (raw_key==0x50) { //down arrow has been pressed raw_key = 0; updateSquare(model,i,j); if (j<ROWS-1) {j++;} drawSquare(i,j,SELCOLOR); } if (raw_key==0x4B) { //left arrow has been pressed raw_key = 0; updateSquare(model,i,j); if (i>0) {i--;} drawSquare(i,j,SELCOLOR); } if (raw_key==0x4D) { //right arrow has been pressed raw_key = 0; updateSquare(model,i,j); if (i<COLUMNS-1) {i++;} drawSquare(i,j,SELCOLOR); } if (raw_key==0x39) { //spacebar has been pressed raw_key = 0; //flips the life state of current square if (model[i][j]==1) {model[i][j]=0;} else {model[i][j]=1;} } swapBuff(); } //clears raw key if enter was pressed if (raw_key==0x1C) {raw_key=0;} updateSquare(model,i,j); //erases cursor drawGrid(BGCOLOR); //erases grid for simulation mode while(raw_key!=0x01 && raw_key!=0x1C) { //loops until Esc or Enter updateModel(model); //simulates game of life and redraws squares waitVRetrace(); swapBuff(); } } } }
void Grid::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option) Q_UNUSED(widget) drawBorder(painter); if (m_DrowLines) drawLines(painter); }
void testApp :: drawFinal () { drawBorder( finalImg, 0xFFFFFF, 2 ); ofFill(); ofSetColor( 0xFFFFFF ); finalImg.draw( 0, 0 ); }
//============================================================== // Функция вызывается при перерисовке //============================================================== void FormAnimationFrames::paintEvent(QPaintEvent*) { QPainter painter {this}; drawFrames(painter); drawCurrentFrame(painter); drawBorder(painter); }
void testApp :: drawHSV () { drawBorder( hsvProcessedImg, 0xFFFFFF, 2 ); ofFill(); ofSetColor( 0xFFFFFF ); hsvProcessedImg.draw( 0, 0 ); }
void testApp :: drawMotionImage () { drawBorder( motionImg, 0xFFFFFF, 2 ); ofFill(); ofSetColor( 0xFFFFFF ); motionImg.draw( 0, 0 ); }
void testApp :: drawDebug () { ofRectangle smlRect; smlRect.width = 160; smlRect.height = 120; int pad; pad = 10; glPushMatrix(); glTranslatef( ofGetWidth() - smlRect.width - pad, pad, 0 ); drawBorder( smlRect ); cameraColorImage.draw( 0, 0, smlRect.width, smlRect.height ); glTranslatef( 0, smlRect.height + pad, 0 ); drawBorder( smlRect ); cameraGrayDiffImage.draw( 0, 0, smlRect.width, smlRect.height ); glTranslatef( 0, smlRect.height + pad, 0 ); drawBorder( smlRect ); logoSmall.draw( 0, 0, smlRect.width, smlRect.height ); glTranslatef( 0, smlRect.height + pad, 0 ); drawBorder( smlRect ); logoSmallIntersect.draw( 0, 0, smlRect.width, smlRect.height ); glTranslatef( 0, smlRect.height + pad, 0 ); drawBorder( smlRect ); opticalField.drawOpticalFlow( 10 ); glPopMatrix(); glPushMatrix(); glTranslatef( logoCropRect.x, logoCropRect.y, 0 ); glPopMatrix(); // contourFinder.draw(); // drawShapes(); }
void ofxFFTBase::drawData(const ofxFFTData & audioData, int width, int height) { drawBg(audioData, width, height); drawGlitchData(audioData, width, height); // drawFftData(audioData, width, height); // this is audio data before its been normalised, good for debugging. drawFftNormData(audioData, width, height); drawFftPeakData(audioData, width, height); drawThresholdLine(audioData, width, height); drawBorder(width, height); }
void Resum::draw() { sf::Vector2f pos; changeView(pos); drawBorder(pos); drawText(pos); _window->setView(*_view); }
void SpikeViewer::clearProjections() { for (int n = 0; n < 6; n++) { setViewportForProjectionN(n); drawBorder(); } }
void ofxDatGuiComponent::draw() { ofPushStyle(); if (mStyle.border.visible) drawBorder(); drawBackground(); drawLabel(); if (mStyle.stripe.visible) drawStripe(); ofPopStyle(); }
void scdk::SCStyledBorder::setBorderStyleCustom(int ls, int rs, int ts, int bs, int tl, int tr, int bl, int br) { _borderStyle = CUSTOM; _ls = ls; _rs = rs; _ts = ts; _bs = bs; _tl = tl; _tr = tr; _bl = bl; _br = br; drawBorder(); }
void SpikeViewer::clearWaveforms() { for (int n = 0; n < 4; n++) { setViewportForWaveN(n); drawBorder(); } }
void buttonHolder::draw(int _x, int _y) { drawBorder(area); area.x=x=_x; area.y=y=_y; int xPos=pad/2; for (unsigned int i=0; i<objs.size(); i++) { objs[i]->draw(x+xPos,y+(area.height-objs[i]->h)/2); xPos+=objs[i]->w+space; } }
void resetPainter() { paintX = sw / 2; paintY = sh / 2; paintScreen(screen_color); painterIntro(); drawBorder(screen_background, 0, 4, 80, sh - 1); }
void SoView2DLiftChart::draw(View2DSliceList *dsl, View2DSlice *dslice, int slice) { _dsl = dsl; // Drawing field enabled, i.e. are we supposed to draw? if (_liftChartData && drawingOn.getValue()){ // Yes, get size of connected image from the slice list. Note that this is the // list of slices connected to the SoView2D. Note that there is usually no need // for an additional image connected to this SoView2DExtension since that one of // the SoView2D accessable by dsl->getInputImage() is the relevant one. int x, y, z, c, t; dsl->getInputImage()->getSize(x, y, z, c, t); // Set image dimension as extent of the LiftChart float start[3], end[3]; dsl->mapVoxelToWorld(0, 0, 0, start[0], start[1], start[2]); dsl->mapVoxelToWorld(x, y, z, end[0], end[1], end[2]); _liftChartData->setExtension(start, end); // Get the 2d devices (pixel) coordinates of the origin and the opposite corner of the // 2D region in which the slice is drawn. Note that these coordinates have nothing to do // with voxel coordinates. These coordinates are directly drawable device coordinates. float dx1, dy1; float dx2, dy2; dslice->getVisibleDeviceRect(dx1, dy1, dx2, dy2); _height = dy2 - _bottomOffset - (dy1 + _topOffset); // Balken fuer Strukturen einzeichnen switch (_liftChartData->getAggregation()) { case LiftChartData::AGGREGATE_ALL: _width = drawAllStructuresInOneColumn(dx1 + _leftOffset, dy1 + _topOffset); break; case LiftChartData::AGGREGATE_STRUCTURE: _width = drawOneStructurePerColumn(dx1 + _leftOffset, dy1 + _topOffset); break; case LiftChartData::AGGREGATE_STRUCTUREGROUP: _width = drawOneStructureGroupPerColumn(dx1 + _leftOffset, dy1 + _topOffset); break; case LiftChartData::AGGREGATE_NONE: _width = drawOneEntryPerColumn(dx1 + _leftOffset, dy1 + _topOffset); break; } // Rahmen zeichnen drawBorder(dx1 + _leftOffset, dy1 + _topOffset, dx1 + _leftOffset + _width, dy2 - _bottomOffset); drawBookmarks(); // Slider für aktuelle Schicht int pos = 1 + dy1 + _topOffset + _height - (int) ((float)_height * ((float)slice / (float)(z - 1))); drawSliceIndicator(dx1 + _leftOffset, dx1 + _leftOffset + _width, pos, slice); } _dsl = 0; }
void TextInstrument::updateText(ImageArea *imageArea, QString textString) { mText = textString; imageArea->setImage(mImageCopy); if (!mIsEdited) { makeUndoCommand(*imageArea); mIsEdited = true; } paint(*imageArea); drawBorder(*imageArea); }
void NormalizeBox::draw(void) { drawGradient(theme->col_list_highlight1, theme->col_list_highlight2, 0, 0, width, 16); drawLine(0,16, width, 1, RGB15(0,0,0)|BIT(15)); drawFullBox(0, 17, width, NORMALIZEBOX_HEIGHT-17, theme->col_light_bg); drawBorder(); u8 titlewidth = getStringWidth(title)+5; drawString(title, (NORMALIZEBOX_WIDTH-titlewidth)/2, 2, titlewidth+5); gui.draw(); }
void testApp :: drawBlobs () { drawBorder( blobImg, 0xFFFFFF, 2 ); ofFill(); ofSetColor( 0xFFFFFF ); blobImg.draw( 0, 0 ); // ofNoFill(); // ofSetLineWidth( 0.1 ); // contourFinder.draw(); }
void WorldUIView::draw() { if(isVisible()){ drawBg(); drawSurface(); drawObjects(); drawBorder(); drawParams(); UIView::draw(); } }
/** Calls all the methods to draw a complete Dialog * * This method must be called by the subclasses. */ void RainbruRPG::Terminal::Dialog::drawDialog(){ if (visible){ drawEmpty(); drawBorder(); drawShadow(); if (title.length()>0) drawTitle(); drawCaption(); drawButtons(); } }
void Decorator::draw( Pictures& stack, const Rect& rectangle, Decorator::Mode mode, Rects* rects, bool negY ) { switch( mode ) { case whiteArea: drawArea( stack, rectangle, 348, 10, 12 ); break; case blackArea: drawArea( stack, rectangle, 487, 5, 7 ); break; case greyPanel: drawPanel( stack, rectangle, 25, rects ); break; case lightgreyPanel: drawPanel( stack, rectangle, 22, rects ); break; case greyPanelBig: drawPanel( stack, rectangle, 631, rects ); break; case lightgreyPanelBig: drawPanel( stack, rectangle, 634, rects ); break; case greyPanelSmall: drawPanel( stack, rectangle, 68, rects ); break; case brownPanelSmall: drawPanel( stack, rectangle, 65, rects ); break; case greenPanelSmall: drawPanel( stack, rectangle, 62, rects ); break; case redPanelSmall: drawPanel( stack, rectangle, 1165, rects ); break; case whiteBorder: drawBorder( stack, rectangle, 336, 468, 347, 358, 10, 12, 335, 467, 346, 478 ); break; case blackBorder: drawBorder( stack, rectangle, 480, 522, 486, 492, 5, 7, 479, 521, 485, 527 ); break; case brownBorder: drawBorder(stack, rectangle, 555 ); break; case whiteBorderA: drawBorder( stack, rectangle, 547 ); break; case whiteFrame: { Point offset( 16, 16 ); draw( stack, Rect( rectangle.lefttop() + offset, rectangle.rightbottom() - offset ), whiteArea ); draw( stack, rectangle, whiteBorder ); // draws borders } break; case blackFrame: draw(stack, Rect( rectangle.lefttop(), rectangle.rightbottom() - Point( 16, 16 ) ), blackArea ); // draws the inside of the box draw(stack, rectangle, blackBorder ); // draws borders break; case brownFrame: drawFrame(stack, rectangle, 28); break; case greyFrame: drawFrame(stack, rectangle, 37); break; case pure: break; default: break; } if( !negY ) reverseYoffset( stack ); }