-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debugger: Implement float value editor.
FloatValueFormatter: - Implement parsing/validation hooks. FloatValueHandler: - Implement GetTableCellValueEditor() to accordingly return a (newly implemented) TableCellFloatEditor. This allows variable value editing for float/double variables.
- Loading branch information
Showing
7 changed files
with
204 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/apps/debugger/user_interface/gui/value/TableCellFloatEditor.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2015, Rene Gollent, rene@gollent.com. | ||
* Distributed under the terms of the MIT License. | ||
*/ | ||
|
||
#include "TableCellFloatEditor.h" | ||
|
||
#include <ctype.h> | ||
|
||
#include <Variant.h> | ||
|
||
#include "IntegerValue.h" | ||
#include "IntegerValueFormatter.h" | ||
|
||
|
||
TableCellFloatEditor::TableCellFloatEditor(::Value* initialValue, | ||
ValueFormatter* formatter) | ||
: | ||
TableCellTextControlEditor(initialValue, formatter) | ||
{ | ||
} | ||
|
||
|
||
TableCellFloatEditor::~TableCellFloatEditor() | ||
{ | ||
} | ||
|
||
|
||
bool | ||
TableCellFloatEditor::ValidateInput() const | ||
{ | ||
BVariant variantValue; | ||
if (!InitialValue()->ToVariant(variantValue)) | ||
return false; | ||
|
||
return GetValueFormatter()->ValidateFormattedValue(Text(), | ||
variantValue.Type()); | ||
} | ||
|
||
|
||
status_t | ||
TableCellFloatEditor::GetValueForInput(::Value*& _output) const | ||
{ | ||
BVariant variantValue; | ||
if (!InitialValue()->ToVariant(variantValue)) | ||
return B_NO_MEMORY; | ||
|
||
return GetValueFormatter()->GetValueFromFormattedInput(Text(), | ||
variantValue.Type(), _output); | ||
} | ||
|
||
|
25 changes: 25 additions & 0 deletions
25
src/apps/debugger/user_interface/gui/value/TableCellFloatEditor.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright 2015, Rene Gollent, rene@gollent.com. | ||
* Distributed under the terms of the MIT License. | ||
*/ | ||
#ifndef TABLE_CELL_FLOAT_EDITOR_H | ||
#define TABLE_CELL_FLOAT_EDITOR_H | ||
|
||
#include <TextControl.h> | ||
|
||
#include "TableCellTextControlEditor.h" | ||
|
||
|
||
class TableCellFloatEditor : public TableCellTextControlEditor { | ||
public: | ||
TableCellFloatEditor(::Value* initialValue, | ||
ValueFormatter* formatter); | ||
virtual ~TableCellFloatEditor(); | ||
|
||
virtual bool ValidateInput() const; | ||
|
||
virtual status_t GetValueForInput(::Value*& _output) const; | ||
// returns reference | ||
}; | ||
|
||
#endif // TABLE_CELL_INTEGER_EDITOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters