changeset 429:f977c80a1dfa

Check for inconsistent parameters in dw_box_pack_start() and dw_box_pack_end(). Throw up messagebox if an error.
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 27 May 2003 03:41:57 +0000
parents fdf111cb0986
children 636a8a19f6c8
files gtk/dw.c os2/dw.c win/dw.c
diffstat 3 files changed, 38 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Tue May 27 03:40:42 2003 +0000
+++ b/gtk/dw.c	Tue May 27 03:41:57 2003 +0000
@@ -1236,7 +1236,7 @@
 	/* Buttons */
 	buttonbox = dw_box_new(DW_HORZ, 10);
 
-	dw_box_pack_start(mainbox, buttonbox, 0, 0, TRUE, FALSE, 0);
+	dw_box_pack_start(mainbox, buttonbox, 0, 40, TRUE, FALSE, 0);
 
 	dwwait = dw_dialog_new((void *)entrywindow);
 
@@ -6169,6 +6169,18 @@
 	if(!box)
 		return;
 
+/* Can't use dw_messagebox() !!! */
+if ( width == 0 && hsize == FALSE )
+		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);
+if ( height == 0 && vsize == FALSE )
+		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);
+/*
+if ( width == 0 && hsize == FALSE )
+		fprintf(stderr,"dw_box_pack_end() - Width and expand Horizonal both unset for box: %lx item: %lx",(long)box,(long)item);
+if ( height == 0 && vsize == FALSE )
+		fprintf(stderr,"dw_box_pack_end() - Height and expand Vertical both unset for box: %lx item: %lx",(long)box,(long)item);
+*/
+
 	DW_MUTEX_LOCK;
 
 	if((tmp  = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle")))
@@ -7330,6 +7342,11 @@
 	if(!box)
 		return;
 
+if ( width == 0 && hsize == FALSE )
+		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);
+if ( height == 0 && vsize == FALSE )
+		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);
+
 	DW_MUTEX_LOCK;
 
 	if((tmp  = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle")))
--- a/os2/dw.c	Tue May 27 03:40:42 2003 +0000
+++ b/os2/dw.c	Tue May 27 03:41:57 2003 +0000
@@ -4976,6 +4976,11 @@
 {
 	Box *thisbox;
 
+if ( width == 0 && hsize == FALSE )
+		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);
+if ( height == 0 && vsize == FALSE )
+		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);
+
 	if(WinWindowFromID(box, FID_CLIENT))
 	{
 		box = WinWindowFromID(box, FID_CLIENT);
@@ -7615,6 +7620,11 @@
 {
 	Box *thisbox;
 
+if ( width == 0 && hsize == FALSE )
+		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);
+if ( height == 0 && vsize == FALSE )
+		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);
+
 	if(WinWindowFromID(box, FID_CLIENT))
 	{
 		box = WinWindowFromID(box, FID_CLIENT);
--- a/win/dw.c	Tue May 27 03:40:42 2003 +0000
+++ b/win/dw.c	Tue May 27 03:41:57 2003 +0000
@@ -4720,6 +4720,11 @@
 {
 	Box *thisbox;
 
+if ( width == 0 && hsize == FALSE )
+		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);
+if ( height == 0 && vsize == FALSE )
+		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);
+
 	thisbox = (Box *)GetWindowLong(box, GWL_USERDATA);
 	if(thisbox)
 	{
@@ -7511,6 +7516,11 @@
 {
 	Box *thisbox;
 
+if ( width == 0 && hsize == FALSE )
+		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);
+if ( height == 0 && vsize == FALSE )
+		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);
+
 	thisbox = (Box *)GetWindowLong(box, GWL_USERDATA);
 	if(thisbox)
 	{