public override void Draw(CustomGraphics g) { var selected = NeedsHighlight; var s = "Audio Out"; if (mLabelNum > 1) { s = "Audio " + mLabelNum; } int textWidth = (int)g.GetTextSize(s).Width; g.LineColor = CustomGraphics.GrayColor; int pct = mDataFull ? textWidth : textWidth * mDataPtr / mDataCount; g.FillRectangle(P2.X - textWidth / 2, P2.Y - 10, pct, 20); g.LineColor = selected ? CustomGraphics.SelectColor : CustomGraphics.WhiteColor; setLead1(1 - (textWidth / 2.0) / mLen); setBbox(mPoint1, mLead1, 0); drawCenteredText(s, P2, true); if (selected) { g.LineColor = CustomGraphics.SelectColor; } else { g.LineColor = CustomGraphics.GrayColor; } drawLead(mPoint1, mLead1); drawPosts(); }
public void DrawHandles(CustomGraphics g) { if (mLastHandleGrabbed == -1) { g.FillRectangle(CustomGraphics.PenHandle, P1.X - 3, P1.Y - 3, 7, 7); } else if (mLastHandleGrabbed == 0) { g.FillRectangle(CustomGraphics.PenHandle, P1.X - 4, P1.Y - 4, 9, 9); } if (NumHandles == 2) { if (mLastHandleGrabbed == -1) { g.FillRectangle(CustomGraphics.PenHandle, P2.X - 3, P2.Y - 3, 7, 7); } else if (mLastHandleGrabbed == 1) { g.FillRectangle(CustomGraphics.PenHandle, P2.X - 4, P2.Y - 4, 9, 9); } } }