Debugger: Implement editor hooks for integer values.
IntegerValueHandler: - Add hook for acquiring value editor.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2015, Rene Gollent, [email protected].
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
#include "SettingsDescription.h"
|
#include "SettingsDescription.h"
|
||||||
#include "SettingsMenu.h"
|
#include "SettingsMenu.h"
|
||||||
#include "TableCellFormattedValueRenderer.h"
|
#include "TableCellFormattedValueRenderer.h"
|
||||||
|
#include "TableCellIntegerEditor.h"
|
||||||
|
|
||||||
|
|
||||||
static const char* const kFormatSettingID = "format";
|
static const char* const kFormatSettingID = "format";
|
||||||
@@ -181,6 +183,42 @@ IntegerValueHandler::GetTableCellValueRenderer(Value* _value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
IntegerValueHandler::GetTableCellValueEditor(Value* _value,
|
||||||
|
Settings* settings, TableCellValueEditor*& _editor)
|
||||||
|
{
|
||||||
|
IntegerValue* value = dynamic_cast<IntegerValue*>(_value);
|
||||||
|
if (value == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
IntegerValueFormatter::Config* config = NULL;
|
||||||
|
status_t error = CreateIntegerFormatterConfig(value, config);
|
||||||
|
if (error != B_OK)
|
||||||
|
return error;
|
||||||
|
BReference<IntegerValueFormatter::Config> configReference(config, true);
|
||||||
|
|
||||||
|
ValueFormatter* formatter;
|
||||||
|
error = CreateValueFormatter(config, formatter);
|
||||||
|
if (error != B_OK)
|
||||||
|
return error;
|
||||||
|
BReference<ValueFormatter> formatterReference(formatter, true);
|
||||||
|
|
||||||
|
TableCellIntegerEditor* editor = new(std::nothrow) TableCellIntegerEditor(
|
||||||
|
value, formatter);
|
||||||
|
if (editor == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
BReference<TableCellIntegerEditor> editorReference(editor, true);
|
||||||
|
error = editor->Init();
|
||||||
|
if (error != B_OK)
|
||||||
|
return error;
|
||||||
|
|
||||||
|
editorReference.Detach();
|
||||||
|
_editor = editor;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
IntegerValueHandler::CreateTableCellValueSettingsMenu(Value* value,
|
IntegerValueHandler::CreateTableCellValueSettingsMenu(Value* value,
|
||||||
Settings* settings, SettingsMenu*& _menu)
|
Settings* settings, SettingsMenu*& _menu)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2015, Rene Gollent, [email protected].
|
||||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
@@ -28,6 +29,9 @@ public:
|
|||||||
ValueFormatter*& _formatter);
|
ValueFormatter*& _formatter);
|
||||||
virtual status_t GetTableCellValueRenderer(Value* value,
|
virtual status_t GetTableCellValueRenderer(Value* value,
|
||||||
TableCellValueRenderer*& _renderer);
|
TableCellValueRenderer*& _renderer);
|
||||||
|
virtual status_t GetTableCellValueEditor(Value* value,
|
||||||
|
Settings* settings,
|
||||||
|
TableCellValueEditor*& _editor);
|
||||||
virtual status_t CreateTableCellValueSettingsMenu(Value* value,
|
virtual status_t CreateTableCellValueSettingsMenu(Value* value,
|
||||||
Settings* settings, SettingsMenu*& _menu);
|
Settings* settings, SettingsMenu*& _menu);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user