Aller au contenu

Photo

UI Snaptobottom not working?


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
comeandsee

comeandsee
  • Members
  • 33 messages

I have another question, here's the code I'm working with.

 

 

 

<UIListbox name="LISTBOX" x=20 y=35 width=440 height=150 yPadding=1 xPadding=1 hidescrollbarwhennotneeded="true" capturemouseclicks="false" showpartialchild=true snaptobottom="TRUE" scrollbaronright=true unequalcontrols=false scrollsegmentsize=1 update=true>

<UIPane name="LISTBOX_ITEM" width=PARENT_WIDTH height="DYNAMIC" tupple=true prototype=true draggable=false>

<UIText name="LISTBOX_ITEM_1" width="PARENT_WIDTH" height=500 multiline="true" idescrollbarwhennotneeded=true prototype=true align="left" valign="top" fontfamily="Default" style="1" />

</UIPane>
<UIScrollBar name="SB" style="STYLE_SB_THIN" />
</UIListbox>

 

The snaptobottom function doesn't seem to work when the listbox is updated with text. Basically what I'm trying to do is create a chat window and when the listbox is updated it needs to scroll all the way to the bottom.

 

Any suggestions?

 

Thanks.



#2
Loki_999

Loki_999
  • Members
  • 430 messages

Not used this feature, but you have the parameter written as ="TRUE" instead of just =true

 

Not sure but maybe the xml is case sensitive? And doesn't require quotes?



#3
kevL

kevL
  • Members
  • 4 070 messages

strict xml requires quotes. Charlie's XML Conformer has never failed me.

 

And it makes things so much easier to edit, using syntax highlighting

 

 

+ i wouldn't use caps on TRUE, either & regardless



#4
comeandsee

comeandsee
  • Members
  • 33 messages

Sorry for slow response. Setting it to ="true" and running it through that program didn't help.



#5
Loki_999

Loki_999
  • Members
  • 430 messages

Have you compared your code with the default chat box?



#6
comeandsee

comeandsee
  • Members
  • 33 messages

Didn't work.

 

 

 

snaptobottom
Setting this to 'true' will make it so that any time the text field in the listbox gets resized, the listbox will snap to the bottom to show the bottom of the text. This is used mostly for situations where text keeps getting added to a text field and you want the list box to keep scrolling to the bottom to display all the text. This is not how the chat window works, BTW

 

Set to snaptobottom=true and not working still. I even copied and paste the listbox right out of the defaultchat xml file and it still doesn't scroll to the bottom when a new listboxrow is added.



#7
Loki_999

Loki_999
  • Members
  • 430 messages

Ah! Your text entry row is 500 high whereas your listbox is only 150, and your pane is set to dynamic. I bet its getting confused.

 

 Make the text box less than or equal to the listbox height and fix the height of the pane as well.... hmmm, not even sure you need that pane anyway as it only contains one entry which is the textbox.

 

Also, make sure your UIScene is at least the size of the listbox.