PlayButton.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * The contents of this file are subject to the Mozilla Public
  3. * License Version 1.1 (the "License"); you may not use this file
  4. * except in compliance with the License. You may obtain a copy of
  5. * the License at http://www.mozilla.org/MPL/
  6. *
  7. * Software distributed under the License is distributed on an "AS
  8. * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9. * implied. See the License for the specific language governing
  10. * rights and limitations under the License.
  11. *
  12. * The Original Code is Vision.
  13. *
  14. * The Initial Developer of the Original Code is The Vision Team.
  15. * Portions created by The Vision Team are
  16. * Copyright (C) 1999, 2000, 2001 The Vision Team. All Rights
  17. * Reserved.
  18. *
  19. * Contributor(s): Rene Gollent
  20. * Todd Lair
  21. */
  22. #include <Window.h>
  23. #include "PlayButton.h"
  24. StopButton::StopButton (BPoint left_top, BMessage *msg)
  25. : BButton (
  26. BRect (left_top, left_top + BPoint (21, 17)),
  27. "stop", "", msg)
  28. {
  29. }
  30. StopButton::~StopButton (void)
  31. {
  32. }
  33. void
  34. StopButton::AttachedToWindow (void)
  35. {
  36. BButton::AttachedToWindow();
  37. ResizeTo (22, 18);
  38. }
  39. void
  40. StopButton::Draw (BRect frame)
  41. {
  42. rgb_color black = {0, 0, 0, 255};
  43. rgb_color white = {255, 255, 255, 255};
  44. BButton::Draw (frame);
  45. frame = Bounds();
  46. frame.InsetBy (9, 7);
  47. SetHighColor (Value() ? white : black);
  48. FillRect (frame);
  49. }