added an option for python Draw.UIBlock(func, mouse_exit) so moving the mouse outside the popup wont close it.

Stops FBX Export and OBJ I/O from flickering a lot.
This commit is contained in:
2008-10-22 08:21:43 +00:00
parent 69c6bd604c
commit 688cc11302
6 changed files with 17 additions and 14 deletions

View File

@@ -235,19 +235,21 @@ def EndAlign():
Use after BeginAlign() to stop aligning the buttons (button layout only).
"""
def UIBlock(draw):
def UIBlock(draw, mouse_exit=1):
"""
This function creates a popup area where buttons, labels, sliders etc can be drawn.
@type mouse_exit: int
@param mouse_exit: When zero the popup wont close when the mouse moves away from the popup.
@type draw: function
@param draw: A function to draw to the popup area, taking no arguments: draw().
@note: The size of the popup will expand to fit the bounds of the buttons created in the draw function.
@note: Be sure to use the mouse coordinates to position the buttons under the mouse,
@note: If mouse_exit is nonzero be sure to use the mouse coordinates if to position the buttons under the mouse,
so the popup dosn't exit as soon as it opens.
The coordinates for buttons start 0,0 at the bottom left hand side of the screen.
@note: Within this popup, Redraw events and the registered button callback will not work.
For buttons to run events, use per button callbacks.
For buttons to run events, use per button callbacks instead.
@note: OpenGL drawing functions wont work within this popup, for text use L{Label} rather then L{Text}
@warning: L{Menu} will not work properly within a UIBlock, this is a limitation with blenders user interface internals.
"""