[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14714] trunk/blender/source/blender/src/ interface.c: fix for [#10180] File Browser buttons disappear after clicking on Window Type button

Campbell Barton ideasman42 at gmail.com
Wed May 7 01:58:15 CEST 2008


Revision: 14714
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14714
Author:   campbellbarton
Date:     2008-05-07 01:58:15 +0200 (Wed, 07 May 2008)

Log Message:
-----------
fix for [#10180] File Browser buttons disappear after clicking on Window Type button
Spent some time looking into what this could break and it seems like a safe change.

Modified Paths:
--------------
    trunk/blender/source/blender/src/interface.c

Modified: trunk/blender/source/blender/src/interface.c
===================================================================
--- trunk/blender/source/blender/src/interface.c	2008-05-06 20:55:55 UTC (rev 14713)
+++ trunk/blender/source/blender/src/interface.c	2008-05-06 23:58:15 UTC (rev 14714)
@@ -2328,6 +2328,7 @@
 	ListBase listb= {NULL, NULL};
 	uiBlock *block;
 	int a;
+	short event;
 	
 	but->flag |= UI_SELECT;
 	ui_draw_but(but);
@@ -2348,13 +2349,17 @@
 	   this is needs better implementation */
 	block->win= G.curscreen->mainwin;
 	
-	uiDoBlocks(&listb, 0, 1);
+	event= uiDoBlocks(&listb, 0, 1);
 
 	but->flag &= ~UI_SELECT;
 	ui_check_but(but);
 	ui_draw_but(but);	
-	
-	return but->retval;
+
+	if (event & UI_RETURN_OK) {
+		return but->retval;
+	} else {
+		return 0;
+	}
 }
 
 static int ui_do_but_ICONTEXTROW(uiBut *but)
@@ -2363,7 +2368,7 @@
 	ListBase listb={NULL, NULL};
 	int width, a, xmax, ypos;
 	MenuData *md;
-
+	short event;
 	but->flag |= UI_SELECT;
 	ui_draw_but(but);
 	ui_block_flush_back(but->block);	// flush because this button creates own blocks loop
@@ -2421,7 +2426,7 @@
 
 	uiBoundsBlock(block, 3);
 
-	uiDoBlocks(&listb, 0, 1);
+	event = uiDoBlocks(&listb, 0, 1);
 	
 	menudata_free(md);
 
@@ -2429,10 +2434,12 @@
 	ui_check_but(but);
 	ui_draw_but(but);
 
-	uibut_do_func(but);
-
-	return but->retval;
-
+	if (event & UI_RETURN_OK) {
+		uibut_do_func(but);
+		return but->retval;
+	} else {
+		return 0;
+	}
 }
 
 static int ui_do_but_IDPOIN(uiBut *but)





More information about the Bf-blender-cvs mailing list