void clFileAssociationsListWin::DrawItem( wal::GC& gc, int n, crect rect ) { if ( n < 0 || n >= ( int )m_ItemList->size( ) ) { gc.SetFillColor( UiGetColor( uiBackground, 0, 0, 0xB0B000 ) ); gc.FillRect( rect ); //CCC return; } UiCondList ucl; if ( ( n % 2 ) == 0 ) { ucl.Set( uiOdd, true ); } if ( n == this->GetCurrent() ) { ucl.Set( uiCurrentItem, true ); } unsigned bg = UiGetColor( uiBackground, uiItem, &ucl, 0xB0B000 ); unsigned color = UiGetColor( uiColor, uiItem, &ucl, 0 ); unsigned fcColor = UiGetColor( uiFcColor, uiItem, &ucl, 0xFFFF ); gc.SetFillColor( bg ); gc.FillRect( rect ); const clNCFileAssociation* p = &m_ItemList->at( n ); if ( p ) { gc.Set( GetFont() ); gc.SetTextColor( color ); gc.TextOutF( rect.left + 10, rect.top + 1, p->GetMask().data() ); gc.SetTextColor( fcColor ); gc.TextOutF( rect.left + 10, rect.top + 1, p->GetMask().data(), 1 ); } }
void NCNumberWin::Paint( wal::GC& gc, const crect& paintRect ) { crect rect = ClientRect(); gc.SetFillColor( UiGetColor( uiBackground, 0, 0, 0xFFFFFF ) ); gc.FillRect( rect ); gc.SetTextColor( UiGetColor( uiColor, 0, 0, 0 ) ); gc.Set( GetFont() ); unicode_t c[32]; unicode_t buf[32]; unicode_t* s = buf; int64_t n = _num; bool minus = n < 0; if ( minus ) { n = -n; } int i = 0; for ( ; n > 0; i++, n /= 10 ) { c[i] = char( n % 10 ) + '0'; } if ( minus ) { *s = '-'; s++; } if ( i == 0 ) {*s = '0'; s++; }; for ( i--; i >= 0; i-- ) { *( s++ ) = c[i]; } *s = 0; gc.TextOut( 0, 0, buf ); }
void CharsetListWin::DrawItem(wal::GC &gc, int n, crect rect) { if (cList && n >= 0 && n < cCount) { bool frame = false; UiCondList ucl; if ((n % 2)==0) ucl.Set(uiOdd, true); if (n == this->GetCurrent()) ucl.Set(uiCurrentItem, true); unsigned bg = UiGetColor(uiBackground, uiItem, &ucl, 0xFFFFFF); unsigned textColor = UiGetColor(uiColor, uiItem, &ucl, 0); unsigned frameColor = UiGetColor(uiFrameColor, uiItem, &ucl, 0);; if (n == this->GetCurrent()) frame = true; gc.SetFillColor(bg); gc.FillRect(rect); gc.Set(GetFont()); int x = 0; const unicode_t *txt = 0; gc.SetTextColor(textColor); gc.TextOutF(rect.left+10, rect.top+2, utf8_to_unicode(cList[n]->name).ptr()); gc.TextOutF(rect.left+10+15*fontW, rect.top+2, utf8_to_unicode(cList[n]->comment).ptr() ); } else { gc.SetFillColor(UiGetColor(uiBackground, uiItem, 0, 0xFFFFFF)); gc.FillRect(rect); } }
void TBToolTip::Paint(wal::GC &gc, const crect &paintRect) { gc.SetFillColor(UiGetColor(uiBackground, 0,0, 0xFFFFFF)/*GetColor(IC_BG)*/); //0x80FFFF); crect r = ClientRect(); gc.FillRect(r); gc.SetTextColor(UiGetColor(uiColor, 0,0, 0)/*GetColor(IC_TEXT)*/); //gc.TextOutF(0,0,text.ptr()); DrawStaticText(gc, 2, 1, text.ptr(), GetFont(), false); }
void OperFileNameWin::Paint(wal::GC &gc, const crect &paintRect) { crect rect = ClientRect(); gc.SetFillColor(UiGetColor(uiBackground,0,0,0xFFFFFF)); gc.FillRect(rect); gc.SetTextColor(UiGetColor(uiColor,0,0,0)); gc.Set(GetFont()); unicode_t *p = text.ptr(); if (p) { int l = unicode_strlen(p); if (l > _ccount) { p += l - _ccount; } DrawStaticText(gc,0,0,p); } }
void PathListWin::DrawItem(wal::GC& gc, int n, crect rect) { const PathList::Data* curr = m_dataList.GetData(n); if (curr) { std::vector<unicode_t> text = GetItemText( curr ); UiCondList ucl; if ((n % 2) == 0) { ucl.Set(uiOdd, true); } if (n == this->GetCurrent()) { ucl.Set(uiCurrentItem, true); } unsigned bg = UiGetColor(uiBackground, uiItem, &ucl, 0xB0B000); unsigned color = UiGetColor(uiColor, uiItem, &ucl, 0); // unsigned fcColor = UiGetColor(uiFcColor, uiItem, &ucl, 0xFFFF); gc.SetFillColor(bg); gc.FillRect(rect); gc.Set(GetFont()); gc.SetTextColor(color); gc.TextOutF( rect.left + 10, rect.top + 1, text.data() ); //gc.SetTextColor(fcColor); //gc.TextOutF(rect.left + 10, rect.top + 1, name, 1); } else { gc.SetFillColor(UiGetColor(uiBackground, 0, 0, 0xB0B000)); gc.FillRect(rect); } }
void clSelectDriveDlgMenu::Paint( wal::GC& gc, const crect& paintRect ) { cfont* font = GetFont(); gc.Set( font ); int y = 0; int bgColor = UiGetColor( uiBackground, 0, 0, 0xB0B000 ); int count = _data->Count(); int Splitters = 0; int SplitterTop = 0; int SplitterBottom = 0; for ( int i = 0; i < count; i++ ) { if ( _data->list[i].cmd == 0 ) { gc.SetFillColor( bgColor ); gc.FillRect( crect( 0, y, _width, y + _splitterH ) ); crect rect( 0, y + 1, 0 + _width, y + 2 ); gc.SetFillColor( ColorTone( bgColor, -150 ) ); gc.FillRect( rect ); rect.top += 1; rect.bottom += 1; gc.SetFillColor( ColorTone( bgColor, +50 ) ); gc.FillRect( rect ); y += _splitterH; Splitters++; if ( Splitters == 1 ) { SplitterTop = y; } if ( Splitters == 2 ) { SplitterBottom = y - _splitterH; } } else { UiCondList ucl; if ( i == _current ) { ucl.Set( uiCurrentItem, true ); } unsigned bg = UiGetColor( uiBackground, uiItem, &ucl, 0xFFFFFF ); unsigned textColor = UiGetColor( uiColor, uiItem, &ucl, 0 ); unsigned fcColor = UiGetColor( uiFcColor, uiItem, &ucl, 0xFF ); unsigned commentColor = UiGetColor( uiCommentColor, uiItem, &ucl, 0 ); gc.SetFillColor( bg ); gc.FillRect( crect( 0, y, _width, y + _itemH ) ); cicon icon; if ( _data->list[i].icon >= 0 ) { icon.Load( _data->list[i].icon, 16, 16 ); } else { icon.Load( _data->list[i].cmd, 16, 16 ); } gc.DrawIcon( 0, y, &icon ); gc.SetTextColor( textColor ); int x = 16 + 5; const unicode_t* name = _data->list[i].name.data(); const unicode_t* comment1 = _data->list[i].comment1.data(); const unicode_t* comment2 = _data->list[i].comment2.data(); if ( name ) { gc.TextOutF( x, y, name ); gc.SetTextColor( fcColor ); gc.TextOutF( x, y, name, 1 ); } if ( comment1 ) { gc.SetTextColor( commentColor ); gc.TextOutF( x + _nameW + 5, y, comment1 ); } if ( comment2 ) { gc.SetTextColor( commentColor ); gc.TextOutF( x + _nameW + 5 + _comment1W + 30, y, comment2 ); } y += _itemH; } } if ( _comment2W && SplitterTop && SplitterBottom ) { int cx = _nameW + 5 + _comment1W + 30; gc.SetFillColor( ColorTone( bgColor, -150 ) ); gc.FillRect( crect( cx, SplitterTop, cx + _splitterW, SplitterBottom ) ); } }