Beispiel #1
0
void Widget::checkHit(int _x, int _y, Widget ** _last)
{
	//_y -= 240;
	//_y = abs(_y);
	if(_x >= this->location->x && _x <= this->location->x+this->size->width)
	{
		if(_y >= this->location->y && _y <= this->location->y+this->size->height)
		{
			if(!pressed)
			{
				*_last = (Widget*)this;
				pressed = true;
			}
		}
    else
      pressed = false;
	}
  else
    pressed = false;


	if(binding)
	{
		drawSingle();
		//Serial.println("drawSingle");
	}



  if(next != NULL)
	  next->checkHit(_x, _y, _last);

}
 QImage *render_qimage( int w, int h )
 {
     if( LH_Bar::render_qimage(w,h) == NULL ) return NULL;
     if( state()->mem_data.tot_virt )
     {
         qreal used_mem = ( state()->mem_data.tot_virt - state()->mem_data.free_virt );
         drawSingle( used_mem * 1000.0 / (qreal) (state()->mem_data.tot_virt) );
     }
     return image_;
 }
QImage *LH_MonitoringBar::render_qimage( int w, int h )
{
    if( LH_Bar::render_qimage(w,h) == NULL ) return NULL;
    if(ui_ && ui_->data_)
    {
        float max;
        if(ui_->data_->getUpperLimit(max))
        {
            this->setup_max_->setHidden(true);
            this->setup_min_->setHidden(true);
            this->setMax((qreal)max);
            this->setMin((qreal)0);
        }
        else
        {
            this->setup_max_->setHidden(false);
            this->setup_min_->setHidden(false);
        }
        if(!ui_->data_->isGroup())
        {
            float currVal=0;
            if(ui_->data_->getValue(currVal))
                drawSingle( currVal );
        } else {
            int barCount;
            ui_->data_->getCount(barCount);

            float deadVal;
            bool hasDead = (ui_->data_->getDeadValue_Transformed(deadVal));

            QVector<qreal> currVals;
            for(int i=0; i<barCount; i++)
            {
                float currVal=0;
                ui_->data_->getValue(currVal, i);
                if (!hasDead || (deadVal != currVal) )
                    currVals.append(currVal);
            }
            drawList(currVals);
        }
    }
    return image_;
}
 QImage *render_qimage( int w, int h )
 {
     if( LH_Graph::render_qimage(w,h) == NULL ) return NULL;
     drawSingle( );
     return image_;
 }
QImage *LH_NowPlayingBar::render_qimage( int w, int h )
{
    if( LH_Bar::render_qimage(w,h) == NULL ) return NULL;
    drawSingle( value_ );
    return image_;
}