Exemplo n.º 1
0
void ListedTextItems::Repaint( const WidgetPainter &painter )
{
    int entry_h = GetEntryHeight();
    int font_h = GetFontHeight();
    int shy = ( entry_h - font_h +1)/2;

    if (!_items.Empty())
    {
        int shsel = (_shift<0)? (-_shift) : 0;
        int shtxt = (_shift<0)? 0: _shift;
        int i,n,y;
        bool be_always_dirty = false;
        for( i=0, n=_items.Size(), y=0; i<n; ++i )
        {
            __Item k = _items[i];
 
            _skins.Select(k._state);
            _skins.Paint( painter, Pos( shsel,y ), Rect(0,0,GetWidth(),entry_h)+Pos( shsel,y ) );

            _fonts.Select(k._state);
            _fonts.Paint( painter, k._caption, Pos(shtxt, y+shy) );
            
            be_always_dirty |= IsAlwaysDirty();

            y += entry_h;
        }
        
        BeAlwaysDirty( be_always_dirty);
    }
}
Exemplo n.º 2
0
//************************************************************************
// Called to draw the specified entry
//************************************************************************
void CEventLog::DrawEntry(CLCDGfx *pGfx,CEventLogEntry *pEntry,bool bSelected)
{
	SelectObject(pGfx->GetHDC(),m_hFont);

	bool bLargeIcons = GetEntryHeight() > 8;
	int iOffset = (m_iFontHeight-(bLargeIcons?8:6))/2;
	HBITMAP hBitmap = CAppletManager::GetInstance()->GetEventBitmap(pEntry->eType,bLargeIcons);
	pGfx->DrawBitmap(0,iOffset<0?0:iOffset,bLargeIcons?8:6,bLargeIcons?8:6,hBitmap);

	iOffset = bLargeIcons?10:7;
	if(CConfig::GetBoolSetting(NOTIFY_TIMESTAMPS))
		pGfx->DrawText(iOffset,0,pGfx->GetClipWidth()-iOffset,pEntry->strTimestamp + pEntry->strValue);
	else
		pGfx->DrawText(iOffset,0,pGfx->GetClipWidth()-iOffset,pEntry->strValue);

	if(bSelected && GetTickCount() - m_dwLastScroll < 1000)
	{
		RECT invert = { 0,0,GetWidth(),m_iFontHeight};
		InvertRect(pGfx->GetHDC(),&invert);
	}
}