dummy filechooser
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@375 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
parent
c63bc52363
commit
4bd7537801
14 changed files with 421 additions and 23 deletions
|
|
@ -39,8 +39,8 @@ static void draw(MwWidget handle) {
|
|||
r.width = px->width * sh;
|
||||
r.height = px->height * sh;
|
||||
}
|
||||
r.width -= 10;
|
||||
r.height -= 10;
|
||||
r.width -= MwDefaultBorderWidth * 2;
|
||||
r.height -= MwDefaultBorderWidth * 2;
|
||||
|
||||
r.x += (double)(ow - r.width) / 2;
|
||||
r.y += (double)(oh - r.height) / 2;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue