comparison os2/dw.c @ 447:5a0779561d0f

Add more tests for dw_pac*() functions. Throw up a messagebox if you try and pack an item into itself; at least under GTK this causes an inifinite loop. Under GTK, add functionality to dw_spinbutton_set_limits() to actually do something.
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 03 Jun 2003 09:13:35 +0000
parents fac2afe7bda3
children e81af9e60697
comparison
equal deleted inserted replaced
446:ab549e2f34b9 447:5a0779561d0f
4976 */ 4976 */
4977 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 4977 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
4978 { 4978 {
4979 Box *thisbox; 4979 Box *thisbox;
4980 4980
4981 /*
4982 * If you try and pack an item into itself VERY bad things can happen; like at least an
4983 * infinite loop on GTK! Lets be safe!
4984 */
4985 if(box == item)
4986 {
4987 dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
4988 return;
4989 }
4990
4981 if(WinWindowFromID(box, FID_CLIENT)) 4991 if(WinWindowFromID(box, FID_CLIENT))
4982 { 4992 {
4983 box = WinWindowFromID(box, FID_CLIENT); 4993 box = WinWindowFromID(box, FID_CLIENT);
4984 thisbox = WinQueryWindowPtr(box, QWP_USER); 4994 thisbox = WinQueryWindowPtr(box, QWP_USER);
4985 } 4995 }
7621 * pad: Number of pixels of padding around the item. 7631 * pad: Number of pixels of padding around the item.
7622 */ 7632 */
7623 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 7633 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
7624 { 7634 {
7625 Box *thisbox; 7635 Box *thisbox;
7636
7637 /*
7638 * If you try and pack an item into itself VERY bad things can happen; like at least an
7639 * infinite loop on GTK! Lets be safe!
7640 */
7641 if(box == item)
7642 {
7643 dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
7644 return;
7645 }
7626 7646
7627 if(WinWindowFromID(box, FID_CLIENT)) 7647 if(WinWindowFromID(box, FID_CLIENT))
7628 { 7648 {
7629 box = WinWindowFromID(box, FID_CLIENT); 7649 box = WinWindowFromID(box, FID_CLIENT);
7630 thisbox = WinQueryWindowPtr(box, QWP_USER); 7650 thisbox = WinQueryWindowPtr(box, QWP_USER);