void GxDockArea::Draw() { GxDraw* draw = GxDraw::Get(); // Draw the dock bars. for(int i=0; i<binCount; ++i) if(myBins[i]) myBins[i]->Draw(); // Draw the floating docks. for(int i=0; i<myDocks.Size(); ++i) if(myDocks[i]->IsFloating() && !myDocks[i]->IsHidden()) myDocks[i]->Draw(); // Draw docking area highlights. if(myDragHl > 0.01f) { GxVec2i mpos = GxInput::Get()->GetMousePos(); int hl = myGetBinAt(mpos.x, mpos.y); if(myActionType != FA_DRAG) hl = -1; for(int i=0; i<binCount; ++i) if(myBins[i]) { GxRecti r = myBins[i]->myRect; GxColor c(128, 128, (hl == i) ? 160 : 128, 0); draw->Rect(r.x, r.y, r.w, r.h, c.Alpha(myDragHl * 0.5f)); r.Shrink(1); draw->Rect(r.x, r.y, r.w, r.h, c.Alpha(myDragHl * 0.2f)); } } }
void GxColorEdit::Draw() { GxExpandingButton::Draw(); GxDraw* draw = GxDraw::Get(); GxStyle& style = *GxStyle::Get(); GxRecti r = myRect; // Draw the preview color. r.Shrink(3, 3, myButtonW + 3, r.h - myButtonH + 3); draw->Rect(r.x, r.y, r.w, r.h, style.c.frameOutline); r.Shrink(1); GxVec4f colf = GetSliderColor(mySliders); GxColor col(colf.x, colf.y, colf.z, colf.w); draw->Rect(r.x, r.y, r.w, r.h, col); if(col.a < 255) draw->Rect(r.x, r.y, r.w/2, r.h, col.Alpha(255)); }
GxRecti GxSelectList::myGetListRect() const { if(myScrollbar->IsHidden()) { GxRecti r = myRect; r.Shrink(2); return r; } const int ofs = 2 - GxInt(myScrollbar->GetValue()); return GxRecti(myRect.x + 2, myRect.y + ofs, myRect.w - 20, myItems.Size() * 16); }
GxVec2i GxDock::myGetResizeDir(int x, int y) const { GxVec2i dir(0, 0); GxRecti r = myRect; r.Shrink(6); if(x < r.x) dir.x = -1; if(x > r.x+r.w) dir.x = +1; if(y < r.y) dir.y = -1; if(y > r.y+r.h) dir.y = +1; return dir; }