コード例 #1
0
ファイル: ncdialogs.cpp プロジェクト: FaionWeb/WCMCommander
void NCDialog::Paint( wal::GC& gc, const crect& paintRect )
{
	int bcolor = UiGetColor( uiBackground, 0, 0, 0x808080 );

	gc.SetFillColor( bcolor );
	gc.FillRect( _borderRect );
	Draw3DButtonW2( gc, _borderRect, bcolor, true );
	crect rect = _frameRect;
	Draw3DButtonW2( gc, _frameRect, bcolor, false );
	rect.Dec();
	rect.Dec();
	DrawBorder( gc, rect, 0 );
}
コード例 #2
0
ファイル: fileopers.cpp プロジェクト: FaionWeb/WCMCommander
void NCProgressWin::Paint( wal::GC& gc, const crect& paintRect )
{
	crect rect = ClientRect();
	int w = rect.Width();

	Draw3DButtonW2( gc, rect, 0x808080, false );
	rect.Dec();
	rect.Dec();
	w -= 2;

	if ( !( _num < _from || _to <= _from || w <= 0 ) )
	{
		int64_t size = _to - _from;
		int n = int( ( w * _num ) / size );

		crect r = rect;
		r.right = n;

		unsigned color = 0xA00000;
		unsigned bColor = ColorTone( color, -80 ), aColor = ColorTone( color, +80 );
		FillHorisont( gc, r, aColor, bColor );

		_lastWidth = w;
		_lastPos = n;
		rect.left += n;
	}

	unsigned color = 0xB0B0B0;
	unsigned bColor = ColorTone( color, +50 ), aColor = ColorTone( color, -50 );
	FillHorisont( gc, rect, aColor, bColor );

}
コード例 #3
0
ファイル: swl_vlist.cpp プロジェクト: 0-wiz-0/WCMCommander
	void VListWin::Paint( GC& gc, const crect& paintRect )
	{
		crect rect = ClientRect();

		switch ( borderType )
		{
			case SINGLE_BORDER:
				DrawBorder( gc, rect, InFocus() ? 0x00C000 : borderColor );
				break;

			case BORDER_3D:
				Draw3DButtonW2( gc, rect, bgColor, false );

			default:
				;
		}

		if ( !scrollRect.IsEmpty() )
		{
			gc.SetFillColor( 0xD0D0D0 );
			gc.FillRect( scrollRect ); //CCC
		}

		if ( itemHeight > 0 )
		{
			int n = ( rect.Height() + ( itemHeight - 1 ) ) / itemHeight;
			crect r = this->listRect;
			int bottom = r.bottom;
			r.bottom = r.top + itemHeight;

			for ( int i = 0; i < n; i++ )
			{
				gc.SetClipRgn( &r );
				crect r1( r );
				r1.left -= xOffset;
				this->DrawItem( gc, i + first, r1 );
				r.top += itemHeight;
				r.bottom += itemHeight;

				if ( r.bottom > bottom ) { r.bottom = bottom; }
			}
		}
		else
		{
			//на всякий случай
			rect.Dec();
			gc.SetFillColor( bgColor );
			gc.FillRect( rect );
		}
	}
コード例 #4
0
ファイル: toolbar.cpp プロジェクト: 0-wiz-0/WCMCommander
void ToolBar::Paint( wal::GC& gc, const crect& paintRect )
{
	crect cr = ClientRect();
	crect rect = cr;
	unsigned colorBg = UiGetColor( uiBackground, 0, 0, 0x808080 ); //GetColor(0);

	unsigned splitColor1 = ColorTone( colorBg, -70 );
	unsigned splitColor2 = ColorTone( colorBg, 70 );

	if ( g_WcmConfig.styleShow3DUI )
	{
		Draw3DButtonW2( gc, rect, colorBg, true );
		rect.Dec();
		rect.Dec();
	}

	gc.SetFillColor( colorBg );
	gc.FillRect( rect );

	gc.Set( GetFont() );
	int x = 2;

	for ( size_t i = 0; i < _list.size(); i++ )
	{
		Node* p = _list[i].ptr();

		if ( p )
		{
			DrawNode( gc, p, _pressed == p ? DRAW_PRESSED : DRAW_NORMAL );
			x += p->rect.Width();
		}
		else
		{
			gc.SetFillColor( splitColor1 );
			int x1 = x + SPLITTER_WIDTH / 2;
			gc.FillRect( crect( x1, rect.top, x1 + 1, rect.bottom ) );
			gc.SetFillColor( splitColor2 );
			gc.FillRect( crect( x1 + 2, rect.top, x1 + 2, rect.bottom ) );
			x += SPLITTER_WIDTH;

		}
	}

	return;
}
コード例 #5
0
	void Button::Paint( GC& gc, const crect& paintRect )
	{
		unsigned colorBg = UiGetColor(uiBackground, uiClassButton, 0, 0x808080); //GetColor(0);
		crect cr = this->ClientRect();
		crect rect = cr;
		DrawBorder( gc, rect, ColorTone( colorBg, +20 ) );
		rect.Dec();
		DrawBorder( gc, rect, ColorTone( colorBg, -200 ) );
		rect.Dec();

		gc.SetFillColor( colorBg );
		gc.FillRect( rect );

		if ( pressed )
		{
#if USE_3D_BUTTONS
			Draw3DButtonW2( gc, rect, colorBg, false );
#endif
			rect.Dec();
			rect.Dec();
		}
		else
		{
#if USE_3D_BUTTONS
			Draw3DButtonW2( gc, rect, colorBg, true );
#endif
			rect.Dec();

			if ( InFocus() )
			{
				DrawBorder( gc, rect, /*GetColor(IC_FOCUS_MARK)*/ UiGetColor( uiFocusFrameColor, 0, 0, 0 ) );
			}

#if USE_3D_BUTTONS
			rect.Dec();
#endif
		}

		//gc.SetTextColor( /*GetColor(IsEnabled() ? IC_TEXT : IC_GRAY_TEXT)*/ UiGetColor( uiColor, 0, 0, 0 ) );
		gc.Set( GetFont() );
		cpoint tsize = text.GetTextExtents(gc);

		/*
		int l = tsize.x + (icon.ptr() ? icon->Width() + ICONX_RIGHTSPACE : 0);

		int w = rect.Width() - LEFTSPACE - RIGHTSPACE;

		if (icon.ptr()) w-=ICONX_RIGHTSPACE;

		//int x = rect.left + LEFTSPACE + (w > l ? (w - l)/2 : 0) +(pressed?2:0);
		int x = rect.left + LEFTSPACE + (w-l)/2 +(pressed?2:0);
		*/

		int l = tsize.x + ( icon.ptr() ? icon->Width() + ICONX_RIGHTSPACE : 0 );
		int w = rect.Width();
		int x = rect.left + ( w > l ? ( w - l ) / 2 : 0 ) + ( pressed ? 2 : 0 );


		if ( icon.ptr() )
		{
			gc.DrawIcon( x, rect.top + ( rect.Height() - icon->Height() ) / 2 + ( pressed ? 2 : 0 ), icon.ptr() );
			x += icon->Width() + ICONX_RIGHTSPACE;
		}

		gc.SetClipRgn( &rect );
		text.DrawItem(gc, x, rect.top + (rect.Height() - tsize.y) / 2 + (pressed ? 2 : 0), 
			UiGetColor(uiColor, uiClassButton, 0, 0), 
			UiGetColor(uiHotkeyColor, uiClassButton, 0, 0));
	}