Beispiel #1
0
void LItemLayout::SetPos(crect rect, wal::ccollect<WSS> &wList)
{
	LSize ls;
	l->GetLSize(&ls);
	if (rect.Width() > ls.x.maximal) rect.right = rect.left + ls.x.maximal;
	if (rect.Height() > ls.y.maximal) rect.bottom = rect.top + ls.y.maximal;
	l->SetPos(rect, wList);
}
Beispiel #2
0
void LItemWin::SetPos(crect rect, wal::ccollect<WSS> &wList)
{
	LSize ls;
	if (!w->IsVisible()) return;

	w->GetLSize(&ls);
	if (rect.Width() > ls.x.maximal) rect.right = rect.left + ls.x.maximal;
	if (rect.Height() > ls.y.maximal) rect.bottom = rect.top + ls.y.maximal;
	
	if (w->Rect() != rect) 
	{
		WSS wss;
		wss.rect = rect;
		wss.w = w;
		wList.append(wss);
	}
}
Beispiel #3
0
static void FillHorisont( wal::GC& gc, crect rect, unsigned a, unsigned b )
{
	if ( rect.IsEmpty() ) { return; }

	unsigned ar = a & 0xFF,    ag = ( a >> 8 ) & 0xFF, ab = ( a >> 16 ) & 0xFF,
	         br = b & 0xFF, bg = ( b >> 8 ) & 0xFF, bb = ( b >> 16 ) & 0xFF;

	int h = rect.Height();
	int x1 = rect.left, x2 = rect.right;

	if ( h <= 0 || x1 >= x2 ) { return; }

	for ( int i = 0; i < h; i++ )
	{
		unsigned color = ( MidAB( ar, br, i, h ) & 0xFF ) + ( ( MidAB( ag, bg, i, h ) & 0xFF ) << 8 ) + ( ( MidAB( ab, bb, i, h ) & 0xFF ) << 16 );
		gc.SetLine( color );
		gc.MoveTo( x1, rect.top + i );
		gc.LineTo( x2, rect.top + i );
	}

}
Beispiel #4
0
void Draw3DButtonW2(GC &gc, crect r, unsigned bg, bool up)
{
	static unsigned hp1,lp1;
	static unsigned hp2,lp2;
	static unsigned lastBg = 0;
	static bool initialized = false;

	if (!initialized || lastBg != bg)
	{
		hp1 = ColorTone(bg, -10);
		lp1 = ColorTone(bg, -90);
		hp2 = ColorTone(bg, +150);
		lp2 = ColorTone(bg, -60);
		lastBg = bg;
		initialized = true;
	}

	unsigned php1,plp1,php2,plp2;
	if (up) {
		php1 = hp1;
		plp1 = lp1;
		php2 = hp2;
		plp2 = lp2;
	} else {
		php1 = lp1;
		plp1 = hp1;
		php2 = lp2;
		plp2 = hp2;
	}

	gc.SetLine(plp1);
	gc.MoveTo(r.right-1,r.top);
	gc.LineTo(r.right-1,r.bottom-1);
	gc.LineTo(r.left,r.bottom-1);
	gc.SetLine(php1);
	gc.LineTo(r.left,r.top);
	gc.LineTo(r.right-1,r.top);
	r.Dec();
	gc.MoveTo(r.right-1, r.top);
	gc.SetLine(php2);
	gc.LineTo(r.left, r.top);
	gc.LineTo(r.left, r.bottom-1);
	gc.SetLine(plp2);
	gc.LineTo(r.right-1, r.bottom-1);
	gc.LineTo(r.right-1, r.top);
}
	/*
	types:
	   1 -left 2 - right 3 - horisontal slider
	   4 - up 5 - down   6 - vert. slider
	*/
	void SBCDrawButton( GC& gc, crect rect, int type, unsigned bg, bool pressed )
	{
		static unsigned short up[] = {6, 0x10, 0x38, 0x7c, 0xee, 0x1c7, 0x82};
		static unsigned short down[] = {6, 0x82, 0x1c7, 0xee, 0x7c, 0x38, 0x10,};
		static unsigned short left[] = {9, 0x10, 0x38, 0x1c, 0x0e, 0x07, 0x0e, 0x1c, 0x38, 0x10};
		static unsigned short right[] = {9, 0x02, 0x07, 0x0E, 0x1c, 0x38, 0x1c, 0x0e, 0x07, 0x02};
		DrawBorder( gc, rect, ColorTone( bg, -100 ) );
		rect.Dec();
		Draw3DButtonW1( gc, rect, bg, !pressed );
		//rect.Dec();
		rect.Dec();
		gc.SetFillColor( bg );
		gc.FillRect( rect );
		int xPlus = 0;
		int yPlus = 0;

		if ( pressed )
		{
			// xPlus = 1;
			yPlus = 1;
		}

		unsigned color = ColorTone( bg, -200 );

		switch ( type )
		{
			case 1:
				DrawPixelList( gc, left, rect.left + ( rect.Width() - 6 ) / 2 + xPlus, rect.top + ( rect.Height() - 9 ) / 2 + yPlus, color );
				break;

			case 2:
				DrawPixelList( gc, right, rect.left + ( rect.Width() - 6 ) / 2 + xPlus, rect.top + ( rect.Height() - 9 ) / 2 + yPlus, color );
				break;

			case 4:
				DrawPixelList( gc, up, rect.left + ( rect.Width() - 9 ) / 2 + xPlus, rect.top + ( rect.Height() - 6 ) / 2 + yPlus, color );
				break;

			case 5:
				DrawPixelList( gc, down, rect.left + ( rect.Width() - 9 ) / 2 + xPlus, rect.top + ( rect.Height() - 6 ) / 2 + yPlus, color );
				break;
		};
	}
void Win::Move(crect rect, bool repaint)
{
	::MoveWindow(handle,rect.left, rect.top, rect.Width(), rect.Height(), repaint ? TRUE:FALSE); 
}