changeset 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 12ba7e744560
children 2d7b27204cd4
files os2/dw.c
diffstat 1 files changed, 33 insertions(+), 67 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Wed Jul 09 07:20:17 2003 +0000
+++ b/os2/dw.c	Wed Jul 09 19:50:05 2003 +0000
@@ -4999,6 +4999,7 @@
 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
 {
 	Box *thisbox;
+	char *funcname = "dw_box_pack_end()";
 
 		/*
 		 * If you try and pack an item into itself VERY bad things can happen; like at least an
@@ -5006,7 +5007,7 @@
 		 */
 	if(box == item)
 	{
-		dw_messagebox("dw_box_pack_end()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
+		dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
 		return;
 	}
 
@@ -5014,41 +5015,24 @@
 	{
 		box = WinWindowFromID(box, FID_CLIENT);
 		thisbox = WinQueryWindowPtr(box, QWP_USER);
-	}
-	else
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
-	if(thisbox)
-	{
-		if(thisbox->type == DW_HORZ)
-			_dw_box_pack_start(box, item, width, height, hsize, vsize, pad, "dw_box_pack_end()");
-		else
-			_dw_box_pack_end(box, item, width, height, hsize, vsize, pad, "dw_box_pack_end()");
-	}
-}
-
-void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
-{
-	Box *thisbox;
-
-	if(WinWindowFromID(box, FID_CLIENT))
-	{
-		box = WinWindowFromID(box, FID_CLIENT);
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
 		hsize = TRUE;
 		vsize = TRUE;
 	}
 	else
 		thisbox = WinQueryWindowPtr(box, QWP_USER);
-	if(!thisbox)
-	{
-		box = WinWindowFromID(box, FID_CLIENT);
-		if(box)
-		{
-			thisbox = WinQueryWindowPtr(box, QWP_USER);
-			hsize = TRUE;
-			vsize = TRUE;
-		}
-	}
+	if(thisbox)
+	{
+		if(thisbox->type == DW_HORZ)
+			_dw_box_pack_start(box, item, width, height, hsize, vsize, pad, funcname);
+		else
+			_dw_box_pack_end(box, item, width, height, hsize, vsize, pad, funcname);
+	}
+}
+
+void _dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
+{
+	Box *thisbox = WinQueryWindowPtr(box, QWP_USER);
+
 	if(thisbox)
 	{
 		int z;
@@ -7655,6 +7639,7 @@
 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad)
 {
 	Box *thisbox;
+	char *funcname = "dw_box_pack_start()";
 
 		/*
 		 * If you try and pack an item into itself VERY bad things can happen; like at least an
@@ -7662,7 +7647,7 @@
 		 */
 	if(box == item)
 	{
-		dw_messagebox("dw_box_pack_start()", DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
+		dw_messagebox(funcname, DW_MB_OK|DW_MB_ERROR, "Danger! Danger! Will Robinson; box and item are the same!",box,item);
 		return;
 	}
 
@@ -7670,26 +7655,6 @@
 	{
 		box = WinWindowFromID(box, FID_CLIENT);
 		thisbox = WinQueryWindowPtr(box, QWP_USER);
-	}
-	else
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
-	if(thisbox)
-	{
-		if(thisbox->type == DW_HORZ)
-			_dw_box_pack_end(box, item, width, height, hsize, vsize, pad, "dw_box_pack_start()");
-		else
-			_dw_box_pack_start(box, item, width, height, hsize, vsize, pad, "dw_box_pack_start()");
-	}
-}
-
-void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
-{
-	Box *thisbox;
-
-	if(WinWindowFromID(box, FID_CLIENT))
-	{
-		box = WinWindowFromID(box, FID_CLIENT);
-		thisbox = WinQueryWindowPtr(box, QWP_USER);
 		hsize = TRUE;
 		vsize = TRUE;
 	}
@@ -7697,6 +7662,19 @@
 		thisbox = WinQueryWindowPtr(box, QWP_USER);
 	if(thisbox)
 	{
+		if(thisbox->type == DW_HORZ)
+			_dw_box_pack_end(box, item, width, height, hsize, vsize, pad, funcname);
+		else
+			_dw_box_pack_start(box, item, width, height, hsize, vsize, pad, funcname);
+	}
+}
+
+void _dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad, char *functionname)
+{
+	Box *thisbox = WinQueryWindowPtr(box, QWP_USER);
+
+	if(thisbox)
+	{
 		int z;
 		Item *tmpitem, *thisitem = thisbox->items;
 		char tmpbuf[100];
@@ -7954,24 +7932,12 @@
 		strcat(fild.szFullFile, ext);
 	}
 
+	memset(&fild, 0, sizeof(FILEDLG));
 	fild.cbSize = sizeof(FILEDLG);
-	fild.fl = /*FDS_HELPBUTTON |*/ FDS_CENTER | FDS_OPEN_DIALOG;
+	fild.fl = FDS_CENTER | FDS_OPEN_DIALOG;
 	fild.pszTitle = title;
 	fild.pszOKButton = ((flags & DW_FILE_SAVE) ? "Save" : "Open");
-	fild.ulUser = 0L;
 	fild.pfnDlgProc = (PFNWP)WinDefFileDlgProc;
-	fild.lReturn = 0L;
-	fild.lSRC = 0L;
-	fild.hMod = 0;
-	fild.x = 0;
-	fild.y = 0;
-	fild.pszIType       = (PSZ)NULL;
-	fild.papszITypeList = (PAPSZ)NULL;
-	fild.pszIDrive      = (PSZ)NULL;
-	fild.papszIDriveList= (PAPSZ)NULL;
-	fild.sEAType        = (SHORT)0;
-	fild.papszFQFilename= (PAPSZ)NULL;
-	fild.ulFQFCount     = 0L;
 
 	hwndFile = WinFileDlg(HWND_DESKTOP, HWND_DESKTOP, &fild);
 	if(hwndFile)
@@ -7979,7 +7945,7 @@
 		switch(fild.lReturn)
 		{
 		case DID_OK:
-            return strdup(fild.szFullFile);
+			return strdup(fild.szFullFile);
 		case DID_CANCEL:
 			return NULL;
 		}