void ribi::WtToggleButtonWidget::DrawToggleButton( Wt::WPainter& painter, const int left, const int top, const int width, const int height, const ToggleButton * const button) { { Wt::WPen pen = painter.pen(); pen.setWidth(1); pen.setColor(Wt::WColor(0,0,0)); painter.setPen(pen); } painter.setBrush(Wt::WColor( button->GetRed(), button->GetGreen(), button->GetBlue())); //Draw base painter.drawArc( left + 0, top + (height * 1 / 3), width, height * 2 / 3, 180 * 16, 180 * 16); //Draw top painter.drawEllipse( left + 0, top + (button->IsPressed() ? (height * 1 / 3) - 2 : 0.0), width, height * 2 / 3); painter.drawLine( left + 1, top + (button->IsPressed() ? (height * 2 / 3) - 2 : (height * 1 / 3)), left + 1, top + (height * 2 / 3)); painter.drawLine( left + (width - 1), top + (button->IsPressed() ? (height * 2 / 3) - 2 : (height * 1 / 3)), left + width - 1, top + (height * 2 / 3)); }