Mercurial > dwindows
comparison win/dw.c @ 438:fac2afe7bda3
Only throw up the messagebox when expand and size are both 0 and the item
being packed is not a box. Also moved some private OS/2 prototypes out
of the header.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 29 May 2003 09:18:54 +0000 |
parents | 98d6c00fe11e |
children | 7f39be80dec3 |
comparison
equal
deleted
inserted
replaced
437:903fb3085d42 | 438:fac2afe7bda3 |
---|---|
4731 */ | 4731 */ |
4732 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) | 4732 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) |
4733 { | 4733 { |
4734 Box *thisbox; | 4734 Box *thisbox; |
4735 | 4735 |
4736 if ( width == 0 && hsize == FALSE ) | |
4737 dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); | |
4738 if ( height == 0 && vsize == FALSE ) | |
4739 dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); | |
4740 | |
4741 thisbox = (Box *)GetWindowLong(box, GWL_USERDATA); | 4736 thisbox = (Box *)GetWindowLong(box, GWL_USERDATA); |
4742 if(thisbox) | 4737 if(thisbox) |
4743 { | 4738 { |
4744 int z; | 4739 int z; |
4745 Item *tmpitem, *thisitem = thisbox->items; | 4740 Item *tmpitem, *thisitem = thisbox->items; |
4760 width = 1; | 4755 width = 1; |
4761 | 4756 |
4762 if(strnicmp(tmpbuf, FRAMECLASSNAME, 2)==0) | 4757 if(strnicmp(tmpbuf, FRAMECLASSNAME, 2)==0) |
4763 tmpitem[thisbox->count].type = TYPEBOX; | 4758 tmpitem[thisbox->count].type = TYPEBOX; |
4764 else | 4759 else |
4760 { | |
4761 if ( width == 0 && hsize == FALSE ) | |
4762 dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); | |
4763 if ( height == 0 && vsize == FALSE ) | |
4764 dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); | |
4765 | |
4765 tmpitem[thisbox->count].type = TYPEITEM; | 4766 tmpitem[thisbox->count].type = TYPEITEM; |
4767 } | |
4766 | 4768 |
4767 tmpitem[thisbox->count].hwnd = item; | 4769 tmpitem[thisbox->count].hwnd = item; |
4768 tmpitem[thisbox->count].origwidth = tmpitem[thisbox->count].width = width; | 4770 tmpitem[thisbox->count].origwidth = tmpitem[thisbox->count].width = width; |
4769 tmpitem[thisbox->count].origheight = tmpitem[thisbox->count].height = height; | 4771 tmpitem[thisbox->count].origheight = tmpitem[thisbox->count].height = height; |
4770 tmpitem[thisbox->count].pad = pad; | 4772 tmpitem[thisbox->count].pad = pad; |
7528 */ | 7530 */ |
7529 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) | 7531 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) |
7530 { | 7532 { |
7531 Box *thisbox; | 7533 Box *thisbox; |
7532 | 7534 |
7533 if ( width == 0 && hsize == FALSE ) | |
7534 dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); | |
7535 if ( height == 0 && vsize == FALSE ) | |
7536 dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); | |
7537 | |
7538 thisbox = (Box *)GetWindowLong(box, GWL_USERDATA); | 7535 thisbox = (Box *)GetWindowLong(box, GWL_USERDATA); |
7539 if(thisbox) | 7536 if(thisbox) |
7540 { | 7537 { |
7541 int z; | 7538 int z; |
7542 Item *tmpitem, *thisitem = thisbox->items; | 7539 Item *tmpitem, *thisitem = thisbox->items; |
7557 width = 1; | 7554 width = 1; |
7558 | 7555 |
7559 if(strnicmp(tmpbuf, FRAMECLASSNAME, 2)==0) | 7556 if(strnicmp(tmpbuf, FRAMECLASSNAME, 2)==0) |
7560 tmpitem[0].type = TYPEBOX; | 7557 tmpitem[0].type = TYPEBOX; |
7561 else | 7558 else |
7559 { | |
7560 if ( width == 0 && hsize == FALSE ) | |
7561 dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item); | |
7562 if ( height == 0 && vsize == FALSE ) | |
7563 dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item); | |
7564 | |
7562 tmpitem[0].type = TYPEITEM; | 7565 tmpitem[0].type = TYPEITEM; |
7566 } | |
7563 | 7567 |
7564 tmpitem[0].hwnd = item; | 7568 tmpitem[0].hwnd = item; |
7565 tmpitem[0].origwidth = tmpitem[0].width = width; | 7569 tmpitem[0].origwidth = tmpitem[0].width = width; |
7566 tmpitem[0].origheight = tmpitem[0].height = height; | 7570 tmpitem[0].origheight = tmpitem[0].height = height; |
7567 tmpitem[0].pad = pad; | 7571 tmpitem[0].pad = pad; |