2 * Copyright 2015, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
6 #include "TableCellBoolEditor.h"
11 TableCellBoolEditor::TableCellBoolEditor(::Value
* initialValue
,
12 ValueFormatter
* formatter
)
14 TableCellOptionPopUpEditor(initialValue
, formatter
)
19 TableCellBoolEditor::~TableCellBoolEditor()
25 TableCellBoolEditor::ConfigureOptions()
27 BoolValue
* initialValue
= dynamic_cast<BoolValue
*>(InitialValue());
28 if (initialValue
== NULL
)
31 status_t error
= AddOption("true", true);
35 error
= AddOption("false", false);
39 return SelectOptionFor(initialValue
->GetValue());
44 TableCellBoolEditor::GetSelectedValue(::Value
*& _value
) const
46 const char* name
= NULL
;
47 int32 selectedValue
= 0;
48 SelectedOption(&name
, &selectedValue
);
49 BoolValue
* value
= new(std::nothrow
) BoolValue((bool)selectedValue
);