Skip to content

434 remove need for xlistbox max str #435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/elem/XListbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ extern const char GSLC_PMEM ERRSTR_PXD_NULL[];

// ----------------------------------------------------------------------------

// TODO: Combine with GUIslice MAX_STR
// Defines the maximum length of a listbox item
#define XLISTBOX_MAX_STR 20

// ============================================================================
// Extended Element: Listbox
// - A Listbox control
Expand Down Expand Up @@ -620,8 +616,7 @@ bool gslc_ElemXListboxDraw(void* pvGui,void* pvElemRef,gslc_teRedrawType eRedraw
// Determine top-left coordinate of list matrix
nItemBaseX = nX0 + pListbox->nMarginW;
nItemBaseY = nY0 + pListbox->nMarginH;
char acStr[XLISTBOX_MAX_STR+1] = "";

char * acStr = (char *)"";

// Loop through the items in the list
int16_t nItemTop = pListbox->nItemTop;
Expand All @@ -645,8 +640,8 @@ bool gslc_ElemXListboxDraw(void* pvGui,void* pvElemRef,gslc_teRedrawType eRedraw
}

// Fetch the list item
bool bOk = gslc_ElemXListboxGetItem(pGui, pElemRef, nItemInd, acStr, XLISTBOX_MAX_STR);
if (!bOk) {
acStr = gslc_ElemXListboxGetItemAddr(pListbox, nItemInd);
if (NULL == acStr) {
// TODO: Erorr handling
break;
}
Expand Down