Ejemplo n.º 1
0
void DropDownBox::draw(SDL_Surface* screen, Point position) {
	if(isVisible() == false) {
		return;
	}

	if(pBackground != NULL) {
		SDL_Rect dest = { position.x, position.y, pBackground->w, pBackground->h };
		SDL_BlitSurface(pBackground,NULL,screen,&dest);
	}

	if((pForeground == NULL) || (pActiveForeground == NULL)) {
        updateForeground();
	}

	if(pForeground != NULL && pActiveForeground != NULL) {
		if(((bHover == true) && pOnClick) || isActive()) {
		    SDL_Rect dest = { position.x + 2, position.y + 2, pActiveForeground->w, pActiveForeground->h };
            SDL_BlitSurface(pActiveForeground,NULL,screen,&dest);
		} else {
		    SDL_Rect dest = { position.x + 2, position.y + 2, pForeground->w, pForeground->h };
            SDL_BlitSurface(pForeground,NULL,screen,&dest);
		}
	}

	openListBoxButton.draw(screen, position + Point(getSize().x - openListBoxButton.getSize().x - 1, 1));
}
Ejemplo n.º 2
0
void EditMetadataDialog::switchToDBStats()
{
#if 0
    setContext(3);

    updateForeground();
    buildFocusList();
#endif
}
Ejemplo n.º 3
0
void EditMetadataDialog::switchToAlbumArt()
{
    setContext(2);

    updateForeground();
    buildFocusList();
    if (metadata_button)
        setCurrentFocusWidget(metadata_button);
}
Ejemplo n.º 4
0
void EditMetadataDialog::switchToMetadata()
{
    setContext(1);

    updateForeground();
    buildFocusList();
    if (albumart_button)
        setCurrentFocusWidget(albumart_button);
}
Ejemplo n.º 5
0
void MSWidget::foreground(unsigned long pixel_)
{ 
  if (pixel_!=foreground()) 
   {
     unsigned long old=foreground();
     _fg=pixel_;
     updateForeground(old);
   }
}
Ejemplo n.º 6
0
void MSTextRect::foreground(unsigned long pixel_)
{
  if (foreground()!=pixel_)
   {
     unsigned long oldfg=_fg;     
     _fg=pixel_;
     textMSGC().foreground(foreground());
     updateForeground(oldfg);     
   }
}
// waits until swap is complete before returning
void SmartMatrix::apply(void) {

	uint8_t r,g,b,brightness;
	uint16_t temp0red,temp0green,temp0blue,temp1red,temp1green,temp1blue;

	bool bHasForeground = hasForeground;
	bool bHasCC = SmartMatrix::_ccmode != ccNone;

        int x,y;
        unsigned offset = 32*128;
        unsigned soff = offset;

		rgb24 *pix = &currentDrawBufferPtr[0][0];

		rgb24 tempPixel0;
		
        for (y=0;y<MATRIX_HEIGHT;y++) {

            for (x=0;x<MATRIX_WIDTH;x++) {
				brightness = dimmingFactor;
				
				
/* 			if (bHasForeground && getForegroundPixel(x, y, &tempPixel0)) {
				if(bHasCC) {
					// load foreground pixel with color correction
					r = colorCorrection(tempPixel0.red);
					g = colorCorrection(tempPixel0.green);
					b = colorCorrection(tempPixel0.blue);
				} else {
					// load foreground pixel without color correction
					r = tempPixel0.red;
					g = tempPixel0.green;
					b = tempPixel0.blue;
				}
			} else {
				if(bHasCC) {
					// load background pixel with color correction
					r = backgroundColorCorrection(pix->red);
					g = backgroundColorCorrection(pix->green);
					b = backgroundColorCorrection(pix->blue);
				} else {
					// load background pixel without color correction
					r = pix->red;
					g = pix->green;
					b = pix->blue;
				}
			} */				
				
				
				if (bHasForeground && getForegroundPixel(x, y, &tempPixel0)) {
					r = tempPixel0.red;
					g = tempPixel0.green;
					b = tempPixel0.blue;				
				}
				else {
					r = pix->red;
					g = pix->green;
					b = pix->blue;
				}
				
				r = ((unsigned)r * brightness)>>8;
				g = ((unsigned)g * brightness)>>8;
				b = ((unsigned)b * brightness)>>8;				
				
				unsigned v = ((unsigned)r<<16) + ((unsigned)g<<8) + ((unsigned)b);
				REGISTER(IO_SLOT(9),soff + x) = v;
                pix++;
            }
            soff+=128;
			handleBufferSwap();
			handleForegroundDrawingCopy();
			calculateBackgroundLUT();
			updateForeground();
        }		
}
Ejemplo n.º 8
0
/* TextStylePrefsPanel::onForegroundChanged
 * Called when the foreground colour is changed
 *******************************************************************/
void TextStylePrefsPanel::onForegroundChanged(wxColourPickerEvent& e)
{
	updateForeground();
	updatePreview();
}
Ejemplo n.º 9
0
/* TextStylePrefsPanel::onCBOverrideForeground
 * Called when the 'Override' foreground colour checkbox is changed
 *******************************************************************/
void TextStylePrefsPanel::onCBOverrideForeground(wxCommandEvent& e)
{
	updateForeground();
	updatePreview();
}