| 1 |
#pragma once |
| 2 |
|
| 3 |
#include <vector> |
| 4 |
#include <wx/event.h> |
| 5 |
|
| 6 |
class wxPanel; |
| 7 |
class wxCheckBox; |
| 8 |
|
| 9 |
namespace objectives |
| 10 |
{ |
| 11 |
|
| 12 |
class Objective; |
| 13 |
|
| 14 |
/** |
| 15 |
* greebo: This encapsulates the widgets needed to set the |
| 16 |
* difficulty levels an objective is applicable to. |
| 17 |
*/ |
| 18 |
class DifficultyPanel : |
| 19 |
public wxEvtHandler |
| 20 |
{ |
| 21 |
private: |
| 22 |
wxCheckBox* _allLevels; |
| 23 |
|
| 24 |
// One toggle for each difficulty level |
| 25 |
std::vector<wxCheckBox*> _toggles; |
| 26 |
|
| 27 |
public: |
| 28 |
// The constructor is preparing the widgets |
| 29 |
DifficultyPanel(wxPanel* container); |
| 30 |
|
| 31 |
// Updates the widgets from the settings found on the objective |
| 32 |
void populateFromObjective(const Objective& obj); |
| 33 |
|
| 34 |
// Updates the objective's difficulty settings |
| 35 |
void writeToObjective(Objective& obj); |
| 36 |
|
| 37 |
private: |
| 38 |
void updateSensitivity(); |
| 39 |
|
| 40 |
// Callback for checkbox toggle |
| 41 |
void _onCheckBoxToggle(wxCommandEvent& ev); // button is manually bound |
| 42 |
}; |
| 43 |
|
| 44 |
} // namespace objectives |