mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Fixed a text alignment bug
This commit is contained in:
parent
120f7ae820
commit
3896916ce6
@ -68,7 +68,8 @@ class DirectScrolledList(DirectFrame):
|
|||||||
optiondefs = (
|
optiondefs = (
|
||||||
# Define type of DirectGuiWidget
|
# Define type of DirectGuiWidget
|
||||||
('items', [], None),
|
('items', [], None),
|
||||||
('items_align', TextNode.ACenter, INITOPT),
|
('itemsAlign', TextNode.ACenter, INITOPT),
|
||||||
|
('itemsWordwrap', None, INITOPT),
|
||||||
('command', None, None),
|
('command', None, None),
|
||||||
('extraArgs', [], None),
|
('extraArgs', [], None),
|
||||||
('itemMakeFunction', None, None),
|
('itemMakeFunction', None, None),
|
||||||
@ -229,7 +230,10 @@ class DirectScrolledList(DirectFrame):
|
|||||||
# If there is a function to create the item
|
# If there is a function to create the item
|
||||||
item = apply(self['itemMakeFunction'], (item, i, self['itemMakeExtraArgs']))
|
item = apply(self['itemMakeFunction'], (item, i, self['itemMakeExtraArgs']))
|
||||||
else:
|
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"]
|
#print "str stacking buttontext[",i,"]",self["items"][i]["text"]
|
||||||
# Then add the newly formed item back into the normal item list
|
# Then add the newly formed item back into the normal item list
|
||||||
self["items"][i] = item
|
self["items"][i] = item
|
||||||
@ -251,6 +255,7 @@ class DirectScrolledList(DirectFrame):
|
|||||||
# If the item is a 'str', then it has not been created
|
# If the item is a 'str', then it has not been created
|
||||||
# Therefore, use the the function given to make it or
|
# Therefore, use the the function given to make it or
|
||||||
# just make it a frame
|
# just make it a frame
|
||||||
|
print "Making " + str(item)
|
||||||
if item.__class__.__name__ == 'str':
|
if item.__class__.__name__ == 'str':
|
||||||
if self['itemMakeFunction']:
|
if self['itemMakeFunction']:
|
||||||
# If there is a function to create the item
|
# If there is a function to create the item
|
||||||
@ -258,7 +263,8 @@ class DirectScrolledList(DirectFrame):
|
|||||||
(item, i, self['itemMakeExtraArgs']))
|
(item, i, self['itemMakeExtraArgs']))
|
||||||
else:
|
else:
|
||||||
item = DirectFrame(text = item,
|
item = DirectFrame(text = item,
|
||||||
text_align = self['items_align'],
|
text_align = self['itemsAlign'],
|
||||||
|
text_wordwrap = self['itemsWordwrap'],
|
||||||
relief = None)
|
relief = None)
|
||||||
# Then add the newly formed item back into the normal item list
|
# Then add the newly formed item back into the normal item list
|
||||||
self["items"][i] = item
|
self["items"][i] = item
|
||||||
|
Loading…
x
Reference in New Issue
Block a user