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
void FillHorisontalRect(wal::GC &gc, crect rect, unsigned a, unsigned b)
{
	 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);
	}

}
	/*
	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); 
}