| 1 |
#pragma once |
| 2 |
|
| 3 |
#include "ComponentEditorBase.h" |
| 4 |
#include "ComponentEditorFactory.h" |
| 5 |
#include "SpecifierEditCombo.h" |
| 6 |
#include "../ComponentType.h" |
| 7 |
|
| 8 |
namespace objectives |
| 9 |
{ |
| 10 |
|
| 11 |
namespace ce |
| 12 |
{ |
| 13 |
|
| 14 |
/** |
| 15 |
* ComponentEditor subclass for COMP_INFO_LOCATION component type. |
| 16 |
* |
| 17 |
* An COMP_INFO_LOCATION component usually uses a two specifiers. |
| 18 |
*/ |
| 19 |
class InfoLocationComponentEditor : |
| 20 |
public ComponentEditorBase |
| 21 |
{ |
| 22 |
// Registration class |
| 23 |
static struct RegHelper |
| 24 |
{ |
| 25 |
RegHelper() { |
| 26 |
ComponentEditorFactory::registerType( |
| 27 |
objectives::ComponentType::COMP_INFO_LOCATION().getName(), |
| 28 |
ComponentEditorPtr(new InfoLocationComponentEditor()) |
| 29 |
); |
| 30 |
} |
| 31 |
} regHelper; |
| 32 |
|
| 33 |
// Component to edit |
| 34 |
Component* _component; |
| 35 |
|
| 36 |
// SpecifierEditCombo for the entity in question |
| 37 |
SpecifierEditCombo* _entSpec; |
| 38 |
|
| 39 |
// SpecifierEditCombo for the location the entity should be in (or not) |
| 40 |
SpecifierEditCombo* _locationSpec; |
| 41 |
|
| 42 |
/** |
| 43 |
* Construct a default InfoLocationComponentEditor. |
| 44 |
*/ |
| 45 |
InfoLocationComponentEditor() : |
| 46 |
_component(NULL) |
| 47 |
{} |
| 48 |
|
| 49 |
/** |
| 50 |
* Construct a InfoLocationComponentEditor with a Component object to display and |
| 51 |
* edit. |
| 52 |
* |
| 53 |
* @param component |
| 54 |
* The Component to edit. |
| 55 |
*/ |
| 56 |
InfoLocationComponentEditor(wxWindow* parent, Component& component); |
| 57 |
|
| 58 |
public: |
| 59 |
/* ComponentEditor implementation */ |
| 60 |
|
| 61 |
ComponentEditorPtr create(wxWindow* parent, Component& component) const |
| 62 |
{ |
| 63 |
return ComponentEditorPtr(new InfoLocationComponentEditor(parent, component)); |
| 64 |
} |
| 65 |
|
| 66 |
void writeToComponent() const; |
| 67 |
}; |
| 68 |
|
| 69 |
} // namespace ce |
| 70 |
|
| 71 |
} // namespace objectives |