mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph] Display the function's whole name
This commit is contained in:
@@ -44,7 +44,21 @@ HighlightCell * StorageListController::expressionCells(int index) {
|
||||
void StorageListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) {
|
||||
Shared::BufferFunctionTitleCell * myFunctionCell = (Shared::BufferFunctionTitleCell *)cell;
|
||||
StorageCartesianFunction function = m_functionStore->modelAtIndex(j);
|
||||
char bufferName[5] = {*function.name(),'(', m_functionStore->symbol(),')', 0};
|
||||
char bufferName[BufferTextView::k_maxNumberOfChar];
|
||||
const char * functionName = function.name();
|
||||
int index = 0;
|
||||
const char ofXSring[4] = {'(', m_functionStore->symbol(),')', 0};
|
||||
size_t ofXSringSize = strlen(ofXSring);
|
||||
while (*functionName != Ion::Storage::k_dotChar
|
||||
&& index < BufferTextView::k_maxNumberOfChar - ofXSringSize)
|
||||
{
|
||||
// We keep room to write the final "(x)" //TODO should we?
|
||||
assert(functionName < function.name() + strlen(function.name()));
|
||||
bufferName[index] = *functionName;
|
||||
functionName++;
|
||||
index++;
|
||||
}
|
||||
strlcpy(&bufferName[index], ofXSring, ofXSringSize);
|
||||
myFunctionCell->setText(bufferName);
|
||||
KDColor functionNameColor = function.isActive() ? function.color() : Palette::GreyDark;
|
||||
myFunctionCell->setColor(functionNameColor);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
class BufferTextView : public TextView {
|
||||
public:
|
||||
static constexpr int k_maxNumberOfChar = 256;
|
||||
BufferTextView(const KDFont * font = KDFont::LargeFont, float horizontalAlignment = 0.5f, float verticalAlignment = 0.5f,
|
||||
KDColor textColor = KDColorBlack, KDColor backgroundColor = KDColorWhite);
|
||||
void setText(const char * text) override;
|
||||
@@ -12,7 +13,6 @@ public:
|
||||
void appendText(const char * text);
|
||||
static int maxNumberOfCharsInBuffer() { return k_maxNumberOfChar; }
|
||||
private:
|
||||
static constexpr int k_maxNumberOfChar = 256;
|
||||
char m_buffer[k_maxNumberOfChar];
|
||||
};
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ public:
|
||||
typedef uint16_t record_size_t;
|
||||
constexpr static size_t k_storageSize = 16384;
|
||||
static Storage * sharedStorage();
|
||||
constexpr static char k_dotChar = '.';
|
||||
|
||||
class Record {
|
||||
/* A Record is identified by the CRC32 on its fullName because:
|
||||
@@ -88,7 +89,6 @@ public:
|
||||
private:
|
||||
constexpr static uint32_t Magic = 0xEE0BDDBA;
|
||||
constexpr static size_t k_maxRecordSize = (1 << sizeof(record_size_t)*8);
|
||||
constexpr static char k_dotChar = '.';
|
||||
|
||||
/* Getters/Setters on recordID */
|
||||
const char * fullNameOfRecord(const Record record);
|
||||
|
||||
Reference in New Issue
Block a user