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 DRIVING_WIDGET_HXX
19#define DRIVING_WIDGET_HXX
20
21class Controller;
22class ButtonWidget;
23class CheckboxWidget;
24class DataGridWidget;
25
26#include "ControllerWidget.hxx"
27
28class DrivingWidget : public ControllerWidget
29{
30 public:
31 DrivingWidget(GuiObject* boss, const GUI::Font& font, int x, int y,
32 Controller& controller);
33 virtual ~DrivingWidget() = default;
34
35 private:
36 enum {
37 kGrayUpCmd = 'DWup',
38 kGrayDownCmd = 'DWdn',
39 kFireCmd = 'DWfr'
40 };
41 ButtonWidget *myGrayUp, *myGrayDown;
42 DataGridWidget* myGrayValue;
43 CheckboxWidget* myFire;
44
45 int myGrayIndex;
46
47 static uInt8 ourGrayTable[4];
48
49 private:
50 void loadConfig() override;
51 void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
52
53 void setValue(int idx);
54
55 // Following constructors and assignment operators not supported
56 DrivingWidget() = delete;
57 DrivingWidget(const DrivingWidget&) = delete;
58 DrivingWidget(DrivingWidget&&) = delete;
59 DrivingWidget& operator=(const DrivingWidget&) = delete;
60 DrivingWidget& operator=(DrivingWidget&&) = delete;
61};
62
63#endif
64