comparison os2/dw.c @ 462:9d874ce0124a

Removed obsolete code from dw_box_pack_* and from dw_file_browse(). Looks like I'll be writing my own directory browser for OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 09 Jul 2003 19:50:05 +0000
parents 768f3546c4b5
children 4ff2c7210973
comparison
equal deleted inserted replaced
461:12ba7e744560 462:9d874ce0124a
4997 * pad: Number of pixels of padding around the item. 4997 * pad: Number of pixels of padding around the item.
4998 */ 4998 */
4999 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 4999 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
5000 { 5000 {
5001 Box *thisbox; 5001 Box *thisbox;
5002 char *funcname = "dw_box_pack_end()";
5002 5003
5003 /* 5004 /*
5004 * If you try and pack an item into itself VERY bad things can happen; like at least an 5005 * If you try and pack an item into itself VERY bad things can happen; like at least an
5005 * infinite loop on GTK! Lets be safe! 5006 * infinite loop on GTK! Lets be safe!
5006 */ 5007 */
5007 if(box == item) 5008 if(box == item)
5008 { 5009 {
5009 dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item); 5010 dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
5010 return; 5011 return;
5011 } 5012 }
5012
5013 if(WinWindowFromID(box, FID_CLIENT))
5014 {
5015 box = WinWindowFromID(box, FID_CLIENT);
5016 thisbox = WinQueryWindowPtr(box, QWP_USER);
5017 }
5018 else
5019 thisbox = WinQueryWindowPtr(box, QWP_USER);
5020 if(thisbox)
5021 {
5022 if(thisbox->type == DW_HORZ)
5023 _dw_box_pack_start(box, item, width, height, hsize, vsize, pad, "dw_box_pack_end()");
5024 else
5025 _dw_box_pack_end(box, item, width, height, hsize, vsize, pad, "dw_box_pack_end()");
5026 }
5027 }
5028
5029 void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
5030 {
5031 Box *thisbox;
5032 5013
5033 if(WinWindowFromID(box, FID_CLIENT)) 5014 if(WinWindowFromID(box, FID_CLIENT))
5034 { 5015 {
5035 box = WinWindowFromID(box, FID_CLIENT); 5016 box = WinWindowFromID(box, FID_CLIENT);
5036 thisbox = WinQueryWindowPtr(box, QWP_USER); 5017 thisbox = WinQueryWindowPtr(box, QWP_USER);
5037 hsize = TRUE; 5018 hsize = TRUE;
5038 vsize = TRUE; 5019 vsize = TRUE;
5039 } 5020 }
5040 else 5021 else
5041 thisbox = WinQueryWindowPtr(box, QWP_USER); 5022 thisbox = WinQueryWindowPtr(box, QWP_USER);
5042 if(!thisbox) 5023 if(thisbox)
5043 { 5024 {
5044 box = WinWindowFromID(box, FID_CLIENT); 5025 if(thisbox->type == DW_HORZ)
5045 if(box) 5026 _dw_box_pack_start(box, item, width, height, hsize, vsize, pad, funcname);
5046 { 5027 else
5047 thisbox = WinQueryWindowPtr(box, QWP_USER); 5028 _dw_box_pack_end(box, item, width, height, hsize, vsize, pad, funcname);
5048 hsize = TRUE; 5029 }
5049 vsize = TRUE; 5030 }
5050 } 5031
5051 } 5032 void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
5033 {
5034 Box *thisbox = WinQueryWindowPtr(box, QWP_USER);
5035
5052 if(thisbox) 5036 if(thisbox)
5053 { 5037 {
5054 int z; 5038 int z;
5055 Item *tmpitem, *thisitem = thisbox->items; 5039 Item *tmpitem, *thisitem = thisbox->items;
5056 char tmpbuf[100]; 5040 char tmpbuf[100];
7653 * pad: Number of pixels of padding around the item. 7637 * pad: Number of pixels of padding around the item.
7654 */ 7638 */
7655 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad) 7639 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
7656 { 7640 {
7657 Box *thisbox; 7641 Box *thisbox;
7642 char *funcname = "dw_box_pack_start()";
7658 7643
7659 /* 7644 /*
7660 * If you try and pack an item into itself VERY bad things can happen; like at least an 7645 * If you try and pack an item into itself VERY bad things can happen; like at least an
7661 * infinite loop on GTK! Lets be safe! 7646 * infinite loop on GTK! Lets be safe!
7662 */ 7647 */
7663 if(box == item) 7648 if(box == item)
7664 { 7649 {
7665 dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item); 7650 dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
7666 return; 7651 return;
7667 } 7652 }
7668
7669 if(WinWindowFromID(box, FID_CLIENT))
7670 {
7671 box = WinWindowFromID(box, FID_CLIENT);
7672 thisbox = WinQueryWindowPtr(box, QWP_USER);
7673 }
7674 else
7675 thisbox = WinQueryWindowPtr(box, QWP_USER);
7676 if(thisbox)
7677 {
7678 if(thisbox->type == DW_HORZ)
7679 _dw_box_pack_end(box, item, width, height, hsize, vsize, pad, "dw_box_pack_start()");
7680 else
7681 _dw_box_pack_start(box, item, width, height, hsize, vsize, pad, "dw_box_pack_start()");
7682 }
7683 }
7684
7685 void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
7686 {
7687 Box *thisbox;
7688 7653
7689 if(WinWindowFromID(box, FID_CLIENT)) 7654 if(WinWindowFromID(box, FID_CLIENT))
7690 { 7655 {
7691 box = WinWindowFromID(box, FID_CLIENT); 7656 box = WinWindowFromID(box, FID_CLIENT);
7692 thisbox = WinQueryWindowPtr(box, QWP_USER); 7657 thisbox = WinQueryWindowPtr(box, QWP_USER);
7693 hsize = TRUE; 7658 hsize = TRUE;
7694 vsize = TRUE; 7659 vsize = TRUE;
7695 } 7660 }
7696 else 7661 else
7697 thisbox = WinQueryWindowPtr(box, QWP_USER); 7662 thisbox = WinQueryWindowPtr(box, QWP_USER);
7663 if(thisbox)
7664 {
7665 if(thisbox->type == DW_HORZ)
7666 _dw_box_pack_end(box, item, width, height, hsize, vsize, pad, funcname);
7667 else
7668 _dw_box_pack_start(box, item, width, height, hsize, vsize, pad, funcname);
7669 }
7670 }
7671
7672 void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
7673 {
7674 Box *thisbox = WinQueryWindowPtr(box, QWP_USER);
7675
7698 if(thisbox) 7676 if(thisbox)
7699 { 7677 {
7700 int z; 7678 int z;
7701 Item *tmpitem, *thisitem = thisbox->items; 7679 Item *tmpitem, *thisitem = thisbox->items;
7702 char tmpbuf[100]; 7680 char tmpbuf[100];
7952 { 7930 {
7953 strcat(fild.szFullFile, "."); 7931 strcat(fild.szFullFile, ".");
7954 strcat(fild.szFullFile, ext); 7932 strcat(fild.szFullFile, ext);
7955 } 7933 }
7956 7934
7935 memset(&fild, 0, sizeof(FILEDLG));
7957 fild.cbSize = sizeof(FILEDLG); 7936 fild.cbSize = sizeof(FILEDLG);
7958 fild.fl = /*FDS_HELPBUTTON |*/ FDS_CENTER | FDS_OPEN_DIALOG; 7937 fild.fl = FDS_CENTER | FDS_OPEN_DIALOG;
7959 fild.pszTitle = title; 7938 fild.pszTitle = title;
7960 fild.pszOKButton = ((flags & DW_FILE_SAVE) ? "Save" : "Open"); 7939 fild.pszOKButton = ((flags & DW_FILE_SAVE) ? "Save" : "Open");
7961 fild.ulUser = 0L;
7962 fild.pfnDlgProc = (PFNWP)WinDefFileDlgProc; 7940 fild.pfnDlgProc = (PFNWP)WinDefFileDlgProc;
7963 fild.lReturn = 0L;
7964 fild.lSRC = 0L;
7965 fild.hMod = 0;
7966 fild.x = 0;
7967 fild.y = 0;
7968 fild.pszIType = (PSZ)NULL;
7969 fild.papszITypeList = (PAPSZ)NULL;
7970 fild.pszIDrive = (PSZ)NULL;
7971 fild.papszIDriveList= (PAPSZ)NULL;
7972 fild.sEAType = (SHORT)0;
7973 fild.papszFQFilename= (PAPSZ)NULL;
7974 fild.ulFQFCount = 0L;
7975 7941
7976 hwndFile = WinFileDlg(HWND_DESKTOP, HWND_DESKTOP, &fild); 7942 hwndFile = WinFileDlg(HWND_DESKTOP, HWND_DESKTOP, &fild);
7977 if(hwndFile) 7943 if(hwndFile)
7978 { 7944 {
7979 switch(fild.lReturn) 7945 switch(fild.lReturn)
7980 { 7946 {
7981 case DID_OK: 7947 case DID_OK:
7982 return strdup(fild.szFullFile); 7948 return strdup(fild.szFullFile);
7983 case DID_CANCEL: 7949 case DID_CANCEL:
7984 return NULL; 7950 return NULL;
7985 } 7951 }
7986 } 7952 }
7987 return NULL; 7953 return NULL;