From 3896916ce6769ec937c2417f92625b0dfaa493ac Mon Sep 17 00:00:00 2001 From: Jason Persampieri Date: Thu, 29 Jul 2004 18:41:43 +0000 Subject: [PATCH] Fixed a text alignment bug --- direct/src/gui/DirectScrolledList.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/direct/src/gui/DirectScrolledList.py b/direct/src/gui/DirectScrolledList.py index 7f244456f9..88e0f604dd 100644 --- a/direct/src/gui/DirectScrolledList.py +++ b/direct/src/gui/DirectScrolledList.py @@ -68,7 +68,8 @@ class DirectScrolledList(DirectFrame): optiondefs = ( # Define type of DirectGuiWidget ('items', [], None), - ('items_align', TextNode.ACenter, INITOPT), + ('itemsAlign', TextNode.ACenter, INITOPT), + ('itemsWordwrap', None, INITOPT), ('command', None, None), ('extraArgs', [], None), ('itemMakeFunction', None, None), @@ -229,7 +230,10 @@ class DirectScrolledList(DirectFrame): # If there is a function to create the item item = apply(self['itemMakeFunction'], (item, i, self['itemMakeExtraArgs'])) else: - item = DirectFrame(text = item, relief = None) + item = DirectFrame(text = item, + text_align = self['itemsAlign'], + text_wordwrap = self['itemsWordwrap'], + relief = None) #print "str stacking buttontext[",i,"]",self["items"][i]["text"] # Then add the newly formed item back into the normal item list self["items"][i] = item @@ -251,6 +255,7 @@ class DirectScrolledList(DirectFrame): # If the item is a 'str', then it has not been created # Therefore, use the the function given to make it or # just make it a frame + print "Making " + str(item) if item.__class__.__name__ == 'str': if self['itemMakeFunction']: # If there is a function to create the item @@ -258,7 +263,8 @@ class DirectScrolledList(DirectFrame): (item, i, self['itemMakeExtraArgs'])) else: item = DirectFrame(text = item, - text_align = self['items_align'], + text_align = self['itemsAlign'], + text_wordwrap = self['itemsWordwrap'], relief = None) # Then add the newly formed item back into the normal item list self["items"][i] = item