Mercurial > dwindows
comparison gtk/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 | 7c8bd3bc6c27 |
comparison
equal
deleted
inserted
replaced
437:903fb3085d42 | 438:fac2afe7bda3 |
---|---|
6167 GtkWidget *tmp; | 6167 GtkWidget *tmp; |
6168 | 6168 |
6169 if(!box) | 6169 if(!box) |
6170 return; | 6170 return; |
6171 | 6171 |
6172 /* Can't use dw_messagebox() !!! */ | |
6173 if ( width == 0 && hsize == FALSE ) | |
6174 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); | |
6175 if ( height == 0 && vsize == FALSE ) | |
6176 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); | |
6177 /* | |
6178 if ( width == 0 && hsize == FALSE ) | |
6179 fprintf(stderr,"dw_box_pack_end() - Width and expand Horizonal both unset for box: %lx item: %lx",(long)box,(long)item); | |
6180 if ( height == 0 && vsize == FALSE ) | |
6181 fprintf(stderr,"dw_box_pack_end() - Height and expand Vertical both unset for box: %lx item: %lx",(long)box,(long)item); | |
6182 */ | |
6183 | |
6184 DW_MUTEX_LOCK; | 6172 DW_MUTEX_LOCK; |
6185 | 6173 |
6186 if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) | 6174 if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) |
6187 box = tmp; | 6175 box = tmp; |
6188 | 6176 |
6210 { | 6198 { |
6211 gtk_container_add(GTK_CONTAINER(eventbox), item); | 6199 gtk_container_add(GTK_CONTAINER(eventbox), item); |
6212 pad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); | 6200 pad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); |
6213 item = eventbox; | 6201 item = eventbox; |
6214 } | 6202 } |
6203 } | |
6204 else | |
6205 { | |
6206 /* Only show warning if item is not a box */ | |
6207 if ( width == 0 && hsize == FALSE ) | |
6208 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); | |
6209 if ( height == 0 && vsize == FALSE ) | |
6210 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); | |
6215 } | 6211 } |
6216 | 6212 |
6217 if(boxtype == DW_VERT) | 6213 if(boxtype == DW_VERT) |
6218 gtk_table_resize(GTK_TABLE(box), boxcount + 1, 1); | 6214 gtk_table_resize(GTK_TABLE(box), boxcount + 1, 1); |
6219 else | 6215 else |
6248 { | 6244 { |
6249 gtk_container_add(GTK_CONTAINER(eventbox), item); | 6245 gtk_container_add(GTK_CONTAINER(eventbox), item); |
6250 pad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); | 6246 pad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); |
6251 item = eventbox; | 6247 item = eventbox; |
6252 } | 6248 } |
6249 } | |
6250 else | |
6251 { | |
6252 /* Only show warning if item is not a box */ | |
6253 if ( width == 0 && hsize == FALSE ) | |
6254 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); | |
6255 if ( height == 0 && vsize == FALSE ) | |
6256 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); | |
6253 } | 6257 } |
6254 | 6258 |
6255 gtk_container_border_width(GTK_CONTAINER(box), pad); | 6259 gtk_container_border_width(GTK_CONTAINER(box), pad); |
6256 gtk_container_add(GTK_CONTAINER(box), vbox); | 6260 gtk_container_add(GTK_CONTAINER(box), vbox); |
6257 gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); | 6261 gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); |
7340 GtkWidget *tmp; | 7344 GtkWidget *tmp; |
7341 | 7345 |
7342 if(!box) | 7346 if(!box) |
7343 return; | 7347 return; |
7344 | 7348 |
7345 if ( width == 0 && hsize == FALSE ) | |
7346 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); | |
7347 if ( height == 0 && vsize == FALSE ) | |
7348 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); | |
7349 | |
7350 DW_MUTEX_LOCK; | 7349 DW_MUTEX_LOCK; |
7351 | 7350 |
7352 if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) | 7351 if((tmp = gtk_object_get_data(GTK_OBJECT(box), "_dw_boxhandle"))) |
7353 box = tmp; | 7352 box = tmp; |
7354 | 7353 |
7377 { | 7376 { |
7378 gtk_container_add(GTK_CONTAINER(eventbox), item); | 7377 gtk_container_add(GTK_CONTAINER(eventbox), item); |
7379 pad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); | 7378 pad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); |
7380 item = eventbox; | 7379 item = eventbox; |
7381 } | 7380 } |
7381 } | |
7382 else | |
7383 { | |
7384 /* Only show warning if item is not a box */ | |
7385 if ( width == 0 && hsize == FALSE ) | |
7386 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); | |
7387 if ( height == 0 && vsize == FALSE ) | |
7388 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); | |
7382 } | 7389 } |
7383 | 7390 |
7384 if(boxtype == DW_VERT) | 7391 if(boxtype == DW_VERT) |
7385 { | 7392 { |
7386 x = 0; | 7393 x = 0; |
7423 { | 7430 { |
7424 gtk_container_add(GTK_CONTAINER(eventbox), item); | 7431 gtk_container_add(GTK_CONTAINER(eventbox), item); |
7425 pad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); | 7432 pad = (int)gtk_object_get_data(GTK_OBJECT(item), "_dw_boxpad"); |
7426 item = eventbox; | 7433 item = eventbox; |
7427 } | 7434 } |
7435 } | |
7436 else | |
7437 { | |
7438 /* Only show warning if item is not a box */ | |
7439 if ( width == 0 && hsize == FALSE ) | |
7440 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); | |
7441 if ( height == 0 && vsize == FALSE ) | |
7442 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); | |
7428 } | 7443 } |
7429 | 7444 |
7430 gtk_container_border_width(GTK_CONTAINER(box), pad); | 7445 gtk_container_border_width(GTK_CONTAINER(box), pad); |
7431 gtk_container_add(GTK_CONTAINER(box), vbox); | 7446 gtk_container_add(GTK_CONTAINER(box), vbox); |
7432 gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); | 7447 gtk_box_pack_end(GTK_BOX(vbox), item, TRUE, TRUE, 0); |