comparison os2/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 f977c80a1dfa
children 5a0779561d0f
comparison
equal deleted inserted replaced
437:903fb3085d42 438:fac2afe7bda3
32 32
33 MRESULT EXPENTRY _run_event(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2); 33 MRESULT EXPENTRY _run_event(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2);
34 void _do_resize(Box *thisbox, int x, int y); 34 void _do_resize(Box *thisbox, int x, int y);
35 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y); 35 void _handle_splitbar_resize(HWND hwnd, float percent, int type, int x, int y);
36 int _load_bitmap_file(char *file, HWND handle, HBITMAP *hbm, HDC *hdc, HPS *hps, unsigned long *width, unsigned long *height); 36 int _load_bitmap_file(char *file, HWND handle, HBITMAP *hbm, HDC *hdc, HPS *hps, unsigned long *width, unsigned long *height);
37 void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname);
38 void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname);
37 39
38 char ClassName[] = "dynamicwindows"; 40 char ClassName[] = "dynamicwindows";
39 char SplitbarClassName[] = "dwsplitbar"; 41 char SplitbarClassName[] = "dwsplitbar";
40 char *DefaultFont = "9.WarpSans"; 42 char *DefaultFont = "9.WarpSans";
41 43
4974 */ 4976 */
4975 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)
4976 { 4978 {
4977 Box *thisbox; 4979 Box *thisbox;
4978 4980
4979 if ( width == 0 && hsize == FALSE )
4980 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);
4981 if ( height == 0 && vsize == FALSE )
4982 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);
4983
4984 if(WinWindowFromID(box, FID_CLIENT)) 4981 if(WinWindowFromID(box, FID_CLIENT))
4985 { 4982 {
4986 box = WinWindowFromID(box, FID_CLIENT); 4983 box = WinWindowFromID(box, FID_CLIENT);
4987 thisbox = WinQueryWindowPtr(box, QWP_USER); 4984 thisbox = WinQueryWindowPtr(box, QWP_USER);
4988 } 4985 }
4989 else 4986 else
4990 thisbox = WinQueryWindowPtr(box, QWP_USER); 4987 thisbox = WinQueryWindowPtr(box, QWP_USER);
4991 if(thisbox) 4988 if(thisbox)
4992 { 4989 {
4993 if(thisbox->type == DW_HORZ) 4990 if(thisbox->type == DW_HORZ)
4994 dw_box_pack_start_stub(box, item, width, height, hsize, vsize, pad); 4991 _dw_box_pack_start(box, item, width, height, hsize, vsize, pad, "dw_box_pack_end()");
4995 else 4992 else
4996 dw_box_pack_end_stub(box, item, width, height, hsize, vsize, pad); 4993 _dw_box_pack_end(box, item, width, height, hsize, vsize, pad, "dw_box_pack_end()");
4997 } 4994 }
4998 } 4995 }
4999 4996
5000 void dw_box_pack_end_stub(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 4997 void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
5001 { 4998 {
5002 Box *thisbox; 4999 Box *thisbox;
5003 5000
5004 if(WinWindowFromID(box, FID_CLIENT)) 5001 if(WinWindowFromID(box, FID_CLIENT))
5005 { 5002 {
5042 width = 1; 5039 width = 1;
5043 5040
5044 if(strncmp(tmpbuf, "#1", 3)==0) 5041 if(strncmp(tmpbuf, "#1", 3)==0)
5045 tmpitem[thisbox->count].type = TYPEBOX; 5042 tmpitem[thisbox->count].type = TYPEBOX;
5046 else 5043 else
5044 {
5045 if ( width == 0 && hsize == FALSE )
5046 dw_messagebox(functionname, DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
5047 if ( height == 0 && vsize == FALSE )
5048 dw_messagebox(functionname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
5049
5047 tmpitem[thisbox->count].type = TYPEITEM; 5050 tmpitem[thisbox->count].type = TYPEITEM;
5051 }
5048 5052
5049 tmpitem[thisbox->count].hwnd = item; 5053 tmpitem[thisbox->count].hwnd = item;
5050 tmpitem[thisbox->count].origwidth = tmpitem[thisbox->count].width = width; 5054 tmpitem[thisbox->count].origwidth = tmpitem[thisbox->count].width = width;
5051 tmpitem[thisbox->count].origheight = tmpitem[thisbox->count].height = height; 5055 tmpitem[thisbox->count].origheight = tmpitem[thisbox->count].height = height;
5052 tmpitem[thisbox->count].pad = pad; 5056 tmpitem[thisbox->count].pad = pad;
7618 */ 7622 */
7619 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 7623 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
7620 { 7624 {
7621 Box *thisbox; 7625 Box *thisbox;
7622 7626
7623 if ( width == 0 && hsize == FALSE )
7624 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);
7625 if ( height == 0 && vsize == FALSE )
7626 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);
7627
7628 if(WinWindowFromID(box, FID_CLIENT)) 7627 if(WinWindowFromID(box, FID_CLIENT))
7629 { 7628 {
7630 box = WinWindowFromID(box, FID_CLIENT); 7629 box = WinWindowFromID(box, FID_CLIENT);
7631 thisbox = WinQueryWindowPtr(box, QWP_USER); 7630 thisbox = WinQueryWindowPtr(box, QWP_USER);
7632 } 7631 }
7633 else 7632 else
7634 thisbox = WinQueryWindowPtr(box, QWP_USER); 7633 thisbox = WinQueryWindowPtr(box, QWP_USER);
7635 if(thisbox) 7634 if(thisbox)
7636 { 7635 {
7637 if(thisbox->type == DW_HORZ) 7636 if(thisbox->type == DW_HORZ)
7638 dw_box_pack_end_stub(box, item, width, height, hsize, vsize, pad); 7637 _dw_box_pack_end(box, item, width, height, hsize, vsize, pad, "dw_box_pack_start()");
7639 else 7638 else
7640 dw_box_pack_start_stub(box, item, width, height, hsize, vsize, pad); 7639 _dw_box_pack_start(box, item, width, height, hsize, vsize, pad, "dw_box_pack_start()");
7641 } 7640 }
7642 } 7641 }
7643 7642
7644 void dw_box_pack_start_stub(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 7643 void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
7645 { 7644 {
7646 Box *thisbox; 7645 Box *thisbox;
7647 7646
7648 if(WinWindowFromID(box, FID_CLIENT)) 7647 if(WinWindowFromID(box, FID_CLIENT))
7649 { 7648 {
7676 width = 1; 7675 width = 1;
7677 7676
7678 if(strncmp(tmpbuf, "#1", 3)==0) 7677 if(strncmp(tmpbuf, "#1", 3)==0)
7679 tmpitem[0].type = TYPEBOX; 7678 tmpitem[0].type = TYPEBOX;
7680 else 7679 else
7680 {
7681 if ( width == 0 && hsize == FALSE )
7682 dw_messagebox(functionname, DW_MB_OK|DW_MB_ERROR, "Width and expand Horizonal both unset for box: %x item: %x",box,item);
7683 if ( height == 0 && vsize == FALSE )
7684 dw_messagebox(functionname, DW_MB_OK|DW_MB_ERROR, "Height and expand Vertical both unset for box: %x item: %x",box,item);
7685
7681 tmpitem[0].type = TYPEITEM; 7686 tmpitem[0].type = TYPEITEM;
7687 }
7682 7688
7683 tmpitem[0].hwnd = item; 7689 tmpitem[0].hwnd = item;
7684 tmpitem[0].origwidth = tmpitem[0].width = width; 7690 tmpitem[0].origwidth = tmpitem[0].width = width;
7685 tmpitem[0].origheight = tmpitem[0].height = height; 7691 tmpitem[0].origheight = tmpitem[0].height = height;
7686 tmpitem[0].pad = pad; 7692 tmpitem[0].pad = pad;