Mercurial > dwindows
diff template/dw.c @ 2740:9be24001d288
Style update. Add DW_SIZE_AUTO (-1) for passing automatic sizing to packing.
Also convert SIZEEXPAND/STATIC and TYPEBOX/ITEM to the new format based on
our new style guidelines. as _DW_SIZE_EXPAND/STATIC and _DW_TYPE_BOX/ITEM.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 19 Dec 2021 15:39:43 +0000 |
parents | 2acc7ba5dea0 |
children | ee1cfa7d645e |
line wrap: on
line diff
--- a/template/dw.c Sat Dec 18 19:31:57 2021 +0000 +++ b/template/dw.c Sun Dec 19 15:39:43 2021 +0000 @@ -75,7 +75,7 @@ { int itempad, itemwidth, itemheight; - if(thisbox->items[z].type == TYPEBOX) + if(thisbox->items[z].type == _DW_TYPE_BOX) { Box *tmp = (Box *)_dw_window_pointer_get(thisbox->items[z].hwnd); @@ -111,7 +111,7 @@ if(itemwidth > uxmax) uxmax = itemwidth; - if(thisbox->items[z].hsize != SIZEEXPAND) + if(thisbox->items[z].hsize != _DW_SIZE_EXPAND) { if(itemwidth > upxmax) upxmax = itemwidth; @@ -122,7 +122,7 @@ upxmax = itempad; } thisbox->minheight += itemheight; - if(thisbox->items[z].vsize != SIZEEXPAND) + if(thisbox->items[z].vsize != _DW_SIZE_EXPAND) thisbox->usedpady += itemheight; else thisbox->usedpady += itempad; @@ -131,7 +131,7 @@ { if(itemheight > uymax) uymax = itemheight; - if(thisbox->items[z].vsize != SIZEEXPAND) + if(thisbox->items[z].vsize != _DW_SIZE_EXPAND) { if(itemheight > upymax) upymax = itemheight; @@ -142,7 +142,7 @@ upymax = itempad; } thisbox->minwidth += itemwidth; - if(thisbox->items[z].hsize != SIZEEXPAND) + if(thisbox->items[z].hsize != _DW_SIZE_EXPAND) thisbox->usedpadx += itemwidth; else thisbox->usedpadx += itempad; @@ -173,7 +173,7 @@ int thispad = thisbox->pad * 2; /* Calculate the new sizes */ - if(thisbox->items[z].hsize == SIZEEXPAND) + if(thisbox->items[z].hsize == _DW_SIZE_EXPAND) { if(thisbox->type == DW_HORZ) { @@ -185,7 +185,7 @@ else width = x - (itempad + thispad + thisbox->grouppadx); } - if(thisbox->items[z].vsize == SIZEEXPAND) + if(thisbox->items[z].vsize == _DW_SIZE_EXPAND) { if(thisbox->type == DW_VERT) { @@ -602,23 +602,23 @@ /* Fill in the item data appropriately */ if(0 /* Test to see if "item" is a box */) - tmpitem[index].type = TYPEBOX; + tmpitem[index].type = _DW_TYPE_BOX; else - tmpitem[index].type = TYPEITEM; + tmpitem[index].type = _DW_TYPE_ITEM; tmpitem[index].hwnd = item; tmpitem[index].origwidth = tmpitem[index].width = width; tmpitem[index].origheight = tmpitem[index].height = height; tmpitem[index].pad = pad; if(hsize) - tmpitem[index].hsize = SIZEEXPAND; + tmpitem[index].hsize = _DW_SIZE_EXPAND; else - tmpitem[index].hsize = SIZESTATIC; + tmpitem[index].hsize = _DW_SIZE_STATIC; if(vsize) - tmpitem[index].vsize = SIZEEXPAND; + tmpitem[index].vsize = _DW_SIZE_EXPAND; else - tmpitem[index].vsize = SIZESTATIC; + tmpitem[index].vsize = _DW_SIZE_STATIC; thisbox->items = tmpitem;