/* ------- return the client rectangle of a window ------ */ RECT ClientRect(void *wnd) { RECT rc; RectLeft(rc) = GetClientLeft((WINDOW)wnd); RectTop(rc) = GetClientTop((WINDOW)wnd); RectRight(rc) = GetClientRight((WINDOW)wnd); RectBottom(rc) = GetClientBottom((WINDOW)wnd); return rc; }
void CCtrlBounds::DrawBorders(CBaseSprite* s, bool isActive, size_t d) { if (s == 0 || !s->BeginQuad(1))return; s->Quad(0 + d,Left() , Top() ,GetClientLeft() ,GetClientTop() ,zOrder -0.1f); s->Quad(1 + d,GetClientLeft() , Top() ,GetClientRight() ,GetClientTop() ,zOrder -0.1f); s->Quad(2 + d,GetClientRight() , Top() ,Right() ,GetClientTop() ,zOrder -0.1f); s->Quad(3 + d,Left() , GetClientTop() ,GetClientLeft() ,GetClientBottom() ,zOrder -0.1f); s->Quad(4 + d,GetClientLeft() , GetClientTop() ,GetClientRight() ,GetClientBottom() ,zOrder-0.11f); s->Quad(5 + d,GetClientRight() , GetClientTop() ,Right() ,GetClientBottom() ,zOrder -0.1f); s->Quad(6 + d,Left() , GetClientBottom() ,GetClientLeft() ,Bottom() ,zOrder -0.1f); s->Quad(7 + d,GetClientLeft() , GetClientBottom() ,GetClientRight() ,Bottom() ,zOrder -0.1f); s->Quad(8 + d,GetClientRight() , GetClientBottom() ,Right() ,Bottom() ,zOrder -0.1f); s->EndQuad(); }
size_t CCtrlBounds::GetItemsX(GLfloat i) { GLfloat xl = GetClientRight() - GetClientLeft(); //GetX(GetCountX()-border) - GetX(border); if (xl < 0) xl *= (-1); return (size_t)(xl / i); }