dummy filechooser

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@375 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-16 18:45:45 +00:00
parent c63bc52363
commit 4bd7537801
14 changed files with 421 additions and 23 deletions

View File

@@ -169,7 +169,7 @@ static void frame_draw(MwWidget handle) {
p.x = 0;
for(j = 0; j < arrlen(lb->list[i].name); j++) {
p.x += MwDefaultBorderWidth;
if(strlen(lb->list[i].name[j]) > 0) MwDrawText(handle, &p, lb->list[i].name[j], 0, MwALIGNMENT_BEGINNING, selected ? base : text);
MwDrawText(handle, &p, lb->list[i].name[j], 0, MwALIGNMENT_BEGINNING, selected ? base : text);
p.x += get_col_width(lb, j) - MwDefaultBorderWidth;
}
p.y += MwTextHeight(handle, "M") / 2;
@@ -249,10 +249,7 @@ static int create(MwWidget handle) {
static void destroy(MwWidget handle) {
MwListBox lb = handle->internal;
int i;
for(i = 0; i < arrlen(lb->list); i++) {
free(lb->list[i].name);
}
MwListBoxReset(handle);
arrfree(lb->list);
arrfree(lb->width);
free(handle->internal);
@@ -413,6 +410,24 @@ void MwListBoxDelete(MwWidget handle, int index) {
}
}
void MwListBoxReset(MwWidget handle) {
MwListBox lb = handle->internal;
int i;
while(arrlen(lb->list) > 0) {
for(i = 0; i < arrlen(lb->list[0].name); i++) {
if(lb->list[0].name[i] != NULL) free(lb->list[0].name[i]);
}
arrfree(lb->list[0].name);
arrdel(lb->list, 0);
}
lb->selected = -1;
resize(handle);
MwForceRender(lb->frame);
}
void MwListBoxInsertMultiple(MwWidget handle, int index, int count, MwLLPixmap* pixmap, ...) {
va_list va;
va_start(va, pixmap);