add MwNleftPadding and update binding

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@346 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-15 19:05:32 +00:00
parent 39c09b1fb7
commit a0d8161c2e
12 changed files with 71 additions and 3 deletions

View File

@@ -87,7 +87,7 @@ static void frame_draw(MwWidget handle) {
r.width = MwGetInteger(handle, MwNwidth);
r.height = MwGetInteger(handle, MwNheight);
p.x = MwDefaultBorderWidth;
p.x = MwDefaultBorderWidth + MwGetInteger(handle->parent, MwNleftPadding);
p.y = MwDefaultBorderWidth;
st = get_first_entry(lb);
@@ -167,6 +167,8 @@ static int create(MwWidget handle) {
lb->selected = -1;
lb->click_time = 0;
MwSetInteger(handle, MwNleftPadding, 0);
return 0;
}
@@ -190,6 +192,10 @@ static void draw(MwWidget handle) {
static void prop_change(MwWidget handle, const char* prop) {
if(strcmp(prop, MwNwidth) == 0 || strcmp(prop, MwNheight) == 0) resize(handle);
if(strcmp(prop, MwNleftPadding) == 0) {
MwListBox lb = handle->internal;
MwForceRender(lb->frame);
}
}
MwClassRec MwListBoxClassRec = {