| 1 | //============================================================================ |
| 2 | // |
| 3 | // SSSS tt lll lll |
| 4 | // SS SS tt ll ll |
| 5 | // SS tttttt eeee ll ll aaaa |
| 6 | // SSSS tt ee ee ll ll aa |
| 7 | // SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" |
| 8 | // SS SS tt ee ll ll aa aa |
| 9 | // SSSS ttt eeeee llll llll aaaaa |
| 10 | // |
| 11 | // Copyright (c) 1995-2019 by Bradford W. Mott, Stephen Anthony |
| 12 | // and the Stella Team |
| 13 | // |
| 14 | // See the file "License.txt" for information on usage and redistribution of |
| 15 | // this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 16 | //============================================================================ |
| 17 | |
| 18 | #ifndef COLOR_WIDGET_HXX |
| 19 | #define COLOR_WIDGET_HXX |
| 20 | |
| 21 | class ColorDialog; |
| 22 | class GuiObject; |
| 23 | |
| 24 | #include "Widget.hxx" |
| 25 | #include "Command.hxx" |
| 26 | |
| 27 | /** |
| 28 | Displays a color from the TIA palette. This class will eventually |
| 29 | be expanded with a TIA palette table, to set the color visually. |
| 30 | |
| 31 | @author Stephen Anthony |
| 32 | */ |
| 33 | class ColorWidget : public Widget, public CommandSender |
| 34 | { |
| 35 | friend class ColorDialog; |
| 36 | |
| 37 | public: |
| 38 | ColorWidget(GuiObject* boss, const GUI::Font& font, |
| 39 | int x, int y, int w, int h, int cmd = 0); |
| 40 | virtual ~ColorWidget() = default; |
| 41 | |
| 42 | void setColor(ColorId color); |
| 43 | ColorId getColor() const { return _color; } |
| 44 | |
| 45 | void setCrossed(bool enable) { _crossGrid = enable; } |
| 46 | |
| 47 | protected: |
| 48 | void drawWidget(bool hilite) override; |
| 49 | |
| 50 | protected: |
| 51 | ColorId _color; |
| 52 | int _cmd; |
| 53 | |
| 54 | bool _crossGrid; |
| 55 | |
| 56 | private: |
| 57 | // Following constructors and assignment operators not supported |
| 58 | ColorWidget() = delete; |
| 59 | ColorWidget(const ColorWidget&) = delete; |
| 60 | ColorWidget(ColorWidget&&) = delete; |
| 61 | ColorWidget& operator=(const ColorWidget&) = delete; |
| 62 | ColorWidget& operator=(ColorWidget&&) = delete; |
| 63 | }; |
| 64 | |
| 65 | #endif |
| 66 | |