comparison os2/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 814c81cae51d
children ee1cfa7d645e
comparison
equal deleted inserted replaced
2739:02c53dd5e21d 2740:9be24001d288
680 firsthwnd = 0; 680 firsthwnd = 0;
681 } 681 }
682 682
683 for(z=beg;_dw_focus_comp(direction, z, end);z+=direction) 683 for(z=beg;_dw_focus_comp(direction, z, end);z+=direction)
684 { 684 {
685 if(box->items[z].type == TYPEBOX) 685 if(box->items[z].type == _DW_TYPE_BOX)
686 { 686 {
687 Box *thisbox = WinQueryWindowPtr(box->items[z].hwnd, QWP_USER); 687 Box *thisbox = WinQueryWindowPtr(box->items[z].hwnd, QWP_USER);
688 688
689 if(thisbox && _dw_focus_check_box(thisbox, handle, start == 3 ? 3 : 0, direction, defaultitem)) 689 if(thisbox && _dw_focus_check_box(thisbox, handle, start == 3 ? 3 : 0, direction, defaultitem))
690 return 1; 690 return 1;
838 /* If the box is going in the direction we want, then we 838 /* If the box is going in the direction we want, then we
839 * return the entire sum of the items. 839 * return the entire sum of the items.
840 */ 840 */
841 for(z=0;z<tmp->count;z++) 841 for(z=0;z<tmp->count;z++)
842 { 842 {
843 if(tmp->items[z].type == TYPEBOX) 843 if(tmp->items[z].type == _DW_TYPE_BOX)
844 { 844 {
845 int s, os; 845 int s, os;
846 846
847 _dw_count_size(tmp->items[z].hwnd, type, &s, &os); 847 _dw_count_size(tmp->items[z].hwnd, type, &s, &os);
848 size += s; 848 size += s;
862 */ 862 */
863 int tmpsize = 0, tmporigsize = 0; 863 int tmpsize = 0, tmporigsize = 0;
864 864
865 for(z=0;z<tmp->count;z++) 865 for(z=0;z<tmp->count;z++)
866 { 866 {
867 if(tmp->items[z].type == TYPEBOX) 867 if(tmp->items[z].type == _DW_TYPE_BOX)
868 _dw_count_size(tmp->items[z].hwnd, type, &tmpsize, &tmporigsize); 868 _dw_count_size(tmp->items[z].hwnd, type, &tmpsize, &tmporigsize);
869 else 869 else
870 { 870 {
871 tmpsize = (type == DW_HORZ ? tmp->items[z].width : tmp->items[z].height); 871 tmpsize = (type == DW_HORZ ? tmp->items[z].width : tmp->items[z].height);
872 tmporigsize = (type == DW_HORZ ? tmp->items[z].origwidth : tmp->items[z].origheight); 872 tmporigsize = (type == DW_HORZ ? tmp->items[z].origwidth : tmp->items[z].origheight);
1102 /* Count up all the space for all items in the box */ 1102 /* Count up all the space for all items in the box */
1103 for(z=0;z<thisbox->count;z++) 1103 for(z=0;z<thisbox->count;z++)
1104 { 1104 {
1105 int itempad, itemwidth, itemheight; 1105 int itempad, itemwidth, itemheight;
1106 1106
1107 if(thisbox->items[z].type == TYPEBOX) 1107 if(thisbox->items[z].type == _DW_TYPE_BOX)
1108 { 1108 {
1109 Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER); 1109 Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
1110 1110
1111 if(tmp) 1111 if(tmp)
1112 { 1112 {
1144 if(thisbox->type == DW_VERT) 1144 if(thisbox->type == DW_VERT)
1145 { 1145 {
1146 if(itemwidth > uxmax) 1146 if(itemwidth > uxmax)
1147 uxmax = itemwidth; 1147 uxmax = itemwidth;
1148 1148
1149 if(thisbox->items[z].hsize != SIZEEXPAND) 1149 if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
1150 { 1150 {
1151 if(itemwidth > upxmax) 1151 if(itemwidth > upxmax)
1152 upxmax = itemwidth; 1152 upxmax = itemwidth;
1153 } 1153 }
1154 else 1154 else
1155 { 1155 {
1156 if(itempad > upxmax) 1156 if(itempad > upxmax)
1157 upxmax = itempad; 1157 upxmax = itempad;
1158 } 1158 }
1159 thisbox->minheight += itemheight; 1159 thisbox->minheight += itemheight;
1160 if(thisbox->items[z].vsize != SIZEEXPAND) 1160 if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
1161 thisbox->usedpady += itemheight; 1161 thisbox->usedpady += itemheight;
1162 else 1162 else
1163 thisbox->usedpady += itempad; 1163 thisbox->usedpady += itempad;
1164 } 1164 }
1165 else 1165 else
1166 { 1166 {
1167 if(itemheight > uymax) 1167 if(itemheight > uymax)
1168 uymax = itemheight; 1168 uymax = itemheight;
1169 if(thisbox->items[z].vsize != SIZEEXPAND) 1169 if(thisbox->items[z].vsize != _DW_SIZE_EXPAND)
1170 { 1170 {
1171 if(itemheight > upymax) 1171 if(itemheight > upymax)
1172 upymax = itemheight; 1172 upymax = itemheight;
1173 } 1173 }
1174 else 1174 else
1175 { 1175 {
1176 if(itempad > upymax) 1176 if(itempad > upymax)
1177 upymax = itempad; 1177 upymax = itempad;
1178 } 1178 }
1179 thisbox->minwidth += itemwidth; 1179 thisbox->minwidth += itemwidth;
1180 if(thisbox->items[z].hsize != SIZEEXPAND) 1180 if(thisbox->items[z].hsize != _DW_SIZE_EXPAND)
1181 thisbox->usedpadx += itemwidth; 1181 thisbox->usedpadx += itemwidth;
1182 else 1182 else
1183 thisbox->usedpadx += itempad; 1183 thisbox->usedpadx += itempad;
1184 } 1184 }
1185 } 1185 }
1206 int width = thisbox->items[z].width; 1206 int width = thisbox->items[z].width;
1207 int itempad = thisbox->items[z].pad * 2; 1207 int itempad = thisbox->items[z].pad * 2;
1208 int thispad = thisbox->pad * 2; 1208 int thispad = thisbox->pad * 2;
1209 1209
1210 /* Calculate the new sizes */ 1210 /* Calculate the new sizes */
1211 if(thisbox->items[z].hsize == SIZEEXPAND) 1211 if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
1212 { 1212 {
1213 if(thisbox->type == DW_HORZ) 1213 if(thisbox->type == DW_HORZ)
1214 { 1214 {
1215 int expandablex = thisbox->minwidth - thisbox->usedpadx; 1215 int expandablex = thisbox->minwidth - thisbox->usedpadx;
1216 1216
1218 width = (int)(((float)width / (float)expandablex) * (float)(x - thisbox->usedpadx)); 1218 width = (int)(((float)width / (float)expandablex) * (float)(x - thisbox->usedpadx));
1219 } 1219 }
1220 else 1220 else
1221 width = x - (itempad + thispad + thisbox->grouppadx); 1221 width = x - (itempad + thispad + thisbox->grouppadx);
1222 } 1222 }
1223 if(thisbox->items[z].vsize == SIZEEXPAND) 1223 if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
1224 { 1224 {
1225 if(thisbox->type == DW_VERT) 1225 if(thisbox->type == DW_VERT)
1226 { 1226 {
1227 int expandabley = thisbox->minheight - thisbox->usedpady; 1227 int expandabley = thisbox->minheight - thisbox->usedpady;
1228 1228
1340 /* Everything else */ 1340 /* Everything else */
1341 _dw_set_window_pos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad, 1341 _dw_set_window_pos(handle, thisbox->hwnd, HWND_TOP, currentx + pad, currenty + pad,
1342 width, height, SWP_MOVE | SWP_SIZE | SWP_ZORDER); 1342 width, height, SWP_MOVE | SWP_SIZE | SWP_ZORDER);
1343 1343
1344 /* After placing a box... place its components */ 1344 /* After placing a box... place its components */
1345 if(thisbox->items[z].type == TYPEBOX) 1345 if(thisbox->items[z].type == _DW_TYPE_BOX)
1346 { 1346 {
1347 Box *boxinfo = WinQueryWindowPtr(handle, QWP_USER); 1347 Box *boxinfo = WinQueryWindowPtr(handle, QWP_USER);
1348 1348
1349 if(boxinfo) 1349 if(boxinfo)
1350 { 1350 {
3648 */ 3648 */
3649 WinShowWindow(hWnd, FALSE); 3649 WinShowWindow(hWnd, FALSE);
3650 3650
3651 _dw_do_resize(mybox, swp->cx, swp->cy); 3651 _dw_do_resize(mybox, swp->cx, swp->cy);
3652 3652
3653 if(mybox->count == 1 && mybox->items[0].type == TYPEBOX) 3653 if(mybox->count == 1 && mybox->items[0].type == _DW_TYPE_BOX)
3654 { 3654 {
3655 mybox = (Box *)WinQueryWindowPtr(mybox->items[0].hwnd, QWP_USER); 3655 mybox = (Box *)WinQueryWindowPtr(mybox->items[0].hwnd, QWP_USER);
3656 3656
3657 for(z=0;z<mybox->count;z++) 3657 for(z=0;z<mybox->count;z++)
3658 _dw_check_resize_notebook(mybox->items[z].hwnd); 3658 _dw_check_resize_notebook(mybox->items[z].hwnd);
3774 { 3774 {
3775 int z; 3775 int z;
3776 3776
3777 for(z=0;z<thisbox->count;z++) 3777 for(z=0;z<thisbox->count;z++)
3778 { 3778 {
3779 if(thisbox->items[z].type == TYPEBOX) 3779 if(thisbox->items[z].type == _DW_TYPE_BOX)
3780 { 3780 {
3781 Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER); 3781 Box *tmp = WinQueryWindowPtr(thisbox->items[z].hwnd, QWP_USER);
3782 _dw_change_box(tmp, percent, type); 3782 _dw_change_box(tmp, percent, type);
3783 } 3783 }
3784 else 3784 else
3785 { 3785 {
3786 if(type == DW_HORZ) 3786 if(type == DW_HORZ)
3787 { 3787 {
3788 if(thisbox->items[z].hsize == SIZEEXPAND) 3788 if(thisbox->items[z].hsize == _DW_SIZE_EXPAND)
3789 thisbox->items[z].width = (int)(((float)thisbox->items[z].origwidth) * (((float)percent)/((float)100.0))); 3789 thisbox->items[z].width = (int)(((float)thisbox->items[z].origwidth) * (((float)percent)/((float)100.0)));
3790 } 3790 }
3791 else 3791 else
3792 { 3792 {
3793 if(thisbox->items[z].vsize == SIZEEXPAND) 3793 if(thisbox->items[z].vsize == _DW_SIZE_EXPAND)
3794 thisbox->items[z].height = (int)(((float)thisbox->items[z].origheight) * (((float)percent)/((float)100.0))); 3794 thisbox->items[z].height = (int)(((float)thisbox->items[z].origheight) * (((float)percent)/((float)100.0)));
3795 } 3795 }
3796 } 3796 }
3797 } 3797 }
3798 } 3798 }
3807 WinShowWindow(handle1, FALSE); 3807 WinShowWindow(handle1, FALSE);
3808 WinShowWindow(handle2, FALSE); 3808 WinShowWindow(handle2, FALSE);
3809 3809
3810 if(type == DW_HORZ) 3810 if(type == DW_HORZ)
3811 { 3811 {
3812 int newx = (int)((float)x * ratio) - (SPLITBAR_WIDTH/2); 3812 int newx = (int)((float)x * ratio) - (_DW_SPLITBAR_WIDTH/2);
3813 3813
3814 WinSetWindowPos(handle1, NULLHANDLE, 0, 0, newx, y, SWP_MOVE | SWP_SIZE); 3814 WinSetWindowPos(handle1, NULLHANDLE, 0, 0, newx, y, SWP_MOVE | SWP_SIZE);
3815 _dw_do_resize(tmp, newx - 1, y - 1); 3815 _dw_do_resize(tmp, newx - 1, y - 1);
3816 3816
3817 dw_window_set_data(hwnd, "_dw_start", (void *)newx); 3817 dw_window_set_data(hwnd, "_dw_start", (void *)newx);
3818 3818
3819 tmp = WinQueryWindowPtr(handle2, QWP_USER); 3819 tmp = WinQueryWindowPtr(handle2, QWP_USER);
3820 3820
3821 newx = x - newx - SPLITBAR_WIDTH; 3821 newx = x - newx - _DW_SPLITBAR_WIDTH;
3822 3822
3823 WinSetWindowPos(handle2, NULLHANDLE, x - newx, 0, newx, y, SWP_MOVE | SWP_SIZE); 3823 WinSetWindowPos(handle2, NULLHANDLE, x - newx, 0, newx, y, SWP_MOVE | SWP_SIZE);
3824 _dw_do_resize(tmp, newx - 1, y - 1); 3824 _dw_do_resize(tmp, newx - 1, y - 1);
3825 } 3825 }
3826 else 3826 else
3827 { 3827 {
3828 int newy = (int)((float)y * ratio) - (SPLITBAR_WIDTH/2); 3828 int newy = (int)((float)y * ratio) - (_DW_SPLITBAR_WIDTH/2);
3829 3829
3830 WinSetWindowPos(handle1, NULLHANDLE, 0, y - newy, x, newy, SWP_MOVE | SWP_SIZE); 3830 WinSetWindowPos(handle1, NULLHANDLE, 0, y - newy, x, newy, SWP_MOVE | SWP_SIZE);
3831 _dw_do_resize(tmp, x - 1, newy - 1); 3831 _dw_do_resize(tmp, x - 1, newy - 1);
3832 3832
3833 tmp = WinQueryWindowPtr(handle2, QWP_USER); 3833 tmp = WinQueryWindowPtr(handle2, QWP_USER);
3834 3834
3835 newy = y - newy - SPLITBAR_WIDTH; 3835 newy = y - newy - _DW_SPLITBAR_WIDTH;
3836 3836
3837 WinSetWindowPos(handle2, NULLHANDLE, 0, 0, x, newy, SWP_MOVE | SWP_SIZE); 3837 WinSetWindowPos(handle2, NULLHANDLE, 0, 0, x, newy, SWP_MOVE | SWP_SIZE);
3838 _dw_do_resize(tmp, x - 1, newy - 1); 3838 _dw_do_resize(tmp, x - 1, newy - 1);
3839 3839
3840 dw_window_set_data(hwnd, "_dw_start", (void *)newy); 3840 dw_window_set_data(hwnd, "_dw_start", (void *)newy);
3922 3922
3923 3923
3924 if(type == DW_HORZ) 3924 if(type == DW_HORZ)
3925 { 3925 {
3926 rclFrame.xLeft = start; 3926 rclFrame.xLeft = start;
3927 rclFrame.xRight = start + SPLITBAR_WIDTH; 3927 rclFrame.xRight = start + _DW_SPLITBAR_WIDTH;
3928 } 3928 }
3929 else 3929 else
3930 { 3930 {
3931 rclFrame.yBottom = start; 3931 rclFrame.yBottom = start;
3932 rclFrame.yTop = start + SPLITBAR_WIDTH; 3932 rclFrame.yTop = start + _DW_SPLITBAR_WIDTH;
3933 } 3933 }
3934 3934
3935 if(percent) 3935 if(percent)
3936 { 3936 {
3937 rc = _dw_track_rectangle(hwnd, &rclFrame, &rclBounds); 3937 rc = _dw_track_rectangle(hwnd, &rclFrame, &rclBounds);
3942 int height = (rclBounds.yTop - rclBounds.yBottom); 3942 int height = (rclBounds.yTop - rclBounds.yBottom);
3943 3943
3944 if(type == DW_HORZ) 3944 if(type == DW_HORZ)
3945 { 3945 {
3946 start = rclFrame.xLeft - rclBounds.xLeft; 3946 start = rclFrame.xLeft - rclBounds.xLeft;
3947 if(width - SPLITBAR_WIDTH > 1 && start < width - SPLITBAR_WIDTH) 3947 if(width - _DW_SPLITBAR_WIDTH > 1 && start < width - _DW_SPLITBAR_WIDTH)
3948 *percent = ((float)start / (float)(width - SPLITBAR_WIDTH)) * 100.0; 3948 *percent = ((float)start / (float)(width - _DW_SPLITBAR_WIDTH)) * 100.0;
3949 } 3949 }
3950 else 3950 else
3951 { 3951 {
3952 start = rclFrame.yBottom - rclBounds.yBottom; 3952 start = rclFrame.yBottom - rclBounds.yBottom;
3953 if(height - SPLITBAR_WIDTH > 1 && start < height - SPLITBAR_WIDTH) 3953 if(height - _DW_SPLITBAR_WIDTH > 1 && start < height - _DW_SPLITBAR_WIDTH)
3954 *percent = 100.0 - (((float)start / (float)(height - SPLITBAR_WIDTH)) * 100.0); 3954 *percent = 100.0 - (((float)start / (float)(height - _DW_SPLITBAR_WIDTH)) * 100.0);
3955 } 3955 }
3956 _dw_handle_splitbar_resize(hwnd, *percent, type, width, height); 3956 _dw_handle_splitbar_resize(hwnd, *percent, type, width, height);
3957 _dw_handle_splitbar_resize(hwnd, *percent, type, width, height); 3957 _dw_handle_splitbar_resize(hwnd, *percent, type, width, height);
3958 } 3958 }
3959 } 3959 }
5508 (font && WinSetPresParam(group ? group : handle, PP_FONTNAMESIZE, strlen(font)+1, (void *)font))) 5508 (font && WinSetPresParam(group ? group : handle, PP_FONTNAMESIZE, strlen(font)+1, (void *)font)))
5509 { 5509 {
5510 Item *item = _dw_box_item(handle); 5510 Item *item = _dw_box_item(handle);
5511 5511
5512 /* Check to see if any of the sizes need to be recalculated */ 5512 /* Check to see if any of the sizes need to be recalculated */
5513 if(item && (item->origwidth == -1 || item->origheight == -1)) 5513 if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
5514 { 5514 {
5515 _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL); 5515 _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
5516 /* Queue a redraw on the top-level window */ 5516 /* Queue a redraw on the top-level window */
5517 _dw_redraw(_dw_toplevel_window(handle), TRUE); 5517 _dw_redraw(_dw_toplevel_window(handle), TRUE);
5518 } 5518 }
5519 return DW_ERROR_NONE; 5519 return DW_ERROR_NONE;
5520 } 5520 }
5724 Box *newbox = calloc(1, sizeof(Box)); 5724 Box *newbox = calloc(1, sizeof(Box));
5725 WindowData *blah = calloc(1, sizeof(WindowData)); 5725 WindowData *blah = calloc(1, sizeof(WindowData));
5726 ULONG winStyle = 0L; 5726 ULONG winStyle = 0L;
5727 5727
5728 newbox->type = DW_VERT; 5728 newbox->type = DW_VERT;
5729 newbox->vsize = newbox->hsize = SIZEEXPAND; 5729 newbox->vsize = newbox->hsize = _DW_SIZE_EXPAND;
5730 5730
5731 flStyle |= FCF_NOBYTEALIGN; 5731 flStyle |= FCF_NOBYTEALIGN;
5732 5732
5733 if(flStyle & DW_FCF_TITLEBAR) 5733 if(flStyle & DW_FCF_TITLEBAR)
5734 newbox->titlebar = 1; 5734 newbox->titlebar = 1;
7490 /* If we changed the bitmap... */ 7490 /* If we changed the bitmap... */
7491 { 7491 {
7492 Item *item = _dw_box_item(handle); 7492 Item *item = _dw_box_item(handle);
7493 7493
7494 /* Check to see if any of the sizes need to be recalculated */ 7494 /* Check to see if any of the sizes need to be recalculated */
7495 if(item && (item->origwidth == -1 || item->origheight == -1)) 7495 if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
7496 { 7496 {
7497 _dw_control_size(handle, item->origwidth == -1 ? &item->width : NULL, item->origheight == -1 ? &item->height : NULL); 7497 _dw_control_size(handle, item->origwidth == DW_SIZE_AUTO ? &item->width : NULL, item->origheight == DW_SIZE_AUTO ? &item->height : NULL);
7498 /* Queue a redraw on the top-level window */ 7498 /* Queue a redraw on the top-level window */
7499 _dw_redraw(_dw_toplevel_window(handle), TRUE); 7499 _dw_redraw(_dw_toplevel_window(handle), TRUE);
7500 } 7500 }
7501 } 7501 }
7502 } 7502 }
7670 /* If we changed the text... */ 7670 /* If we changed the text... */
7671 { 7671 {
7672 Item *item = _dw_box_item(handle); 7672 Item *item = _dw_box_item(handle);
7673 7673
7674 /* Check to see if any of the sizes need to be recalculated */ 7674 /* Check to see if any of the sizes need to be recalculated */
7675 if(item && (item->origwidth == -1 || item->origheight == -1)) 7675 if(item && (item->origwidth == DW_SIZE_AUTO || item->origheight == DW_SIZE_AUTO))
7676 { 7676 {
7677 int newwidth, newheight; 7677 int newwidth, newheight;
7678 7678
7679 _dw_control_size(handle, &newwidth, &newheight); 7679 _dw_control_size(handle, &newwidth, &newheight);
7680 7680
7681 /* Only update the item and redraw the window if it changed */ 7681 /* Only update the item and redraw the window if it changed */
7682 if((item->origwidth == -1 && item->width != newwidth) || 7682 if((item->origwidth == DW_SIZE_AUTO && item->width != newwidth) ||
7683 (item->origheight == -1 && item->height != newheight)) 7683 (item->origheight == DW_SIZE_AUTO && item->height != newheight))
7684 { 7684 {
7685 if(item->origwidth == -1) 7685 if(item->origwidth == DW_SIZE_AUTO)
7686 item->width = newwidth; 7686 item->width = newwidth;
7687 if(item->origheight == -1) 7687 if(item->origheight == DW_SIZE_AUTO)
7688 item->height = newheight; 7688 item->height = newheight;
7689 /* Queue a redraw on the top-level window */ 7689 /* Queue a redraw on the top-level window */
7690 _dw_redraw(_dw_toplevel_window(handle), TRUE); 7690 _dw_redraw(_dw_toplevel_window(handle), TRUE);
7691 } 7691 }
7692 } 7692 }
7925 height = 1; 7925 height = 1;
7926 if(hsize && !width) 7926 if(hsize && !width)
7927 width = 1; 7927 width = 1;
7928 7928
7929 if(strncmp(tmpbuf, "#1", 3)==0 && !dw_window_get_data(item, "_dw_render")) 7929 if(strncmp(tmpbuf, "#1", 3)==0 && !dw_window_get_data(item, "_dw_render"))
7930 tmpitem[index].type = TYPEBOX; 7930 tmpitem[index].type = _DW_TYPE_BOX;
7931 else 7931 else
7932 { 7932 {
7933 if ( width == 0 && hsize == FALSE ) 7933 if ( width == 0 && hsize == FALSE )
7934 dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); 7934 dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
7935 if ( height == 0 && vsize == FALSE ) 7935 if ( height == 0 && vsize == FALSE )
7936 dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); 7936 dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
7937 7937
7938 tmpitem[index].type = TYPEITEM; 7938 tmpitem[index].type = _DW_TYPE_ITEM;
7939 } 7939 }
7940 7940
7941 tmpitem[index].hwnd = item; 7941 tmpitem[index].hwnd = item;
7942 tmpitem[index].origwidth = tmpitem[index].width = width; 7942 tmpitem[index].origwidth = tmpitem[index].width = width;
7943 tmpitem[index].origheight = tmpitem[index].height = height; 7943 tmpitem[index].origheight = tmpitem[index].height = height;
7944 tmpitem[index].pad = pad; 7944 tmpitem[index].pad = pad;
7945 tmpitem[index].hsize = hsize ? SIZEEXPAND : SIZESTATIC; 7945 tmpitem[index].hsize = hsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
7946 tmpitem[index].vsize = vsize ? SIZEEXPAND : SIZESTATIC; 7946 tmpitem[index].vsize = vsize ? _DW_SIZE_EXPAND : _DW_SIZE_STATIC;
7947 7947
7948 /* If either of the parameters are -1 ... calculate the size */ 7948 /* If either of the parameters are -1 (DW_SIZE_AUTO) ... calculate the size */
7949 if(width == -1 || height == -1) 7949 if(width == DW_SIZE_AUTO || height == DW_SIZE_AUTO)
7950 _dw_control_size(item, width == -1 ? &tmpitem[index].width : NULL, height == -1 ? &tmpitem[index].height : NULL); 7950 _dw_control_size(item, width == DW_SIZE_AUTO ? &tmpitem[index].width : NULL, height == DW_SIZE_AUTO ? &tmpitem[index].height : NULL);
7951 7951
7952 thisbox->items = tmpitem; 7952 thisbox->items = tmpitem;
7953 7953
7954 if(thisitem) 7954 if(thisitem)
7955 free(thisitem); 7955 free(thisitem);