示例#1
0
void List::draw()
{
    //run update
    update();
    
    //draw caption
    drawCaption(this);
    
    //calculate bounds of List area (-caption)
    ofRectangle scrollableBounds = bounds;
    scrollableBounds.height -= OFXKCTG_CAPTION_LINE_HEIGHT;
    scrollableBounds.y += OFXKCTG_CAPTION_LINE_HEIGHT;
    
    //store old viewport
    GLint oldview[4];
    glGetIntegerv(GL_VIEWPORT, oldview);
    
    //store old matrices
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    
    //apply screenspace transform
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();
    //
    GLfloat orthoMatrix[16] = {
        0,  2/scrollableBounds.width,  0,  0,
        2/scrollableBounds.height,  0,  0, 0,
        0,  0,  1,  0,
        -1,  -1,  0,  1
    };
    glMultMatrixf(orthoMatrix);
    
    
    //setup viewport
    glViewport(scrollableBounds.y, scrollableBounds.x,
               scrollableBounds.height, scrollableBounds.width);

    //scroll transform
    ofTranslate(0, scroll);
    
    //draw all items
    vector<ListItem*>::iterator it;
    for (it = Items.begin(); it != Items.end(); it++)
        (*it)->draw();
    
    //restore old viewport
    glViewport(oldview[0], oldview[1], oldview[2], oldview[3]);
    
    //restore old matrices
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    
    glMatrixMode(GL_MODELVIEW);
    glPopMatrix();
}
示例#2
0
///
/// reimplemented functions
///
void MemChartPrivate::paintEvent(QPaintEvent *e)
{

    QPainter painter(this);
    drawBackground(&painter);
    drawCaption(&painter);
    drawFrame(&painter);
    drawLegend(&painter);
    drawHistogram(&painter);
    drawSelectedRegion(&painter);
}
示例#3
0
/** 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();
  }
}
示例#4
0
QGraphicsPixmapItem* Diagram::draw(QString title){
    if(pixmap == 0)
        return 0;
    QPainter p(pixmap);
    p.setPen(QPen(Qt::white));
    p.setBrush(Qt::white);
    p.drawRect(pixmap->rect());

    calculateAxisSteps();

    drawCaption(p, title);
    drawXAxis(p);
    drawYAxis(p);
    drawValues(p);
    drawHorizontalLines(p);

    return new QGraphicsPixmapItem(*pixmap,0,scene);
}
/**
 * renders the button on lcd
 */
void TouchButton::drawButton() {
// Draw rect
    LocalDisplay.fillRectRel(mPositionX, mPositionY, mWidthX, mHeightY, mButtonColor);
    drawCaption();
}
示例#6
0
/**
 * renders the button on lcd
 */
int8_t TouchButton::drawButton() {
    // Draw rect
    mDisplay->fillRectRel(mPositionX, mPositionY, mWidth, mHeight, mButtonColor);
    return drawCaption();
}
示例#7
0
	void TitleBar::drawAll() const
	{
		drawCaption();
		drawButtons();
	}