Jump to content

Memos and scrollbars


Tails

Recommended Posts

Hi, I was wondering if it's possible to scale a memo box automatically when resizing a window.

Also is it possible to add a scrollbar at the bottom so that if the text gets too long? Like disabling wrap or something

Thanks in advance

It is possible, using the event onClientGUISize. You can create the memobox as a child of the window, and make its size relative to that of the window.

I don't think it will work just slapping one in there, however, you could create one and hide it. If the text reaches a certain length make it visible. If a user scrolls it you can use the event onClientGUIScroll and then use guiScrollBarGetScrollPosition to get its position.

Then use guiMemoSetCaretIndex to set the caret index depending on the scrollbars position.

Of course, this is just theory so I'm not sure how well it would work in practice.

Link to comment

Thank you both.

CEGUI has a option to disable word wrap so that's done. It also creates a horizontal scrollbar for me.

Now I have another problem. Since I will be using the memo to print new lines every time, I need the memo to scroll down for me automatically.

Is there any way I could set the position of the vertical scrollbar that was created automatically by the memo with guiScrollBarSetScrollPosition?

I managed to make it scroll down with guiMemoSetCaretIndex but it didn't seem efficient to me to get the text every time.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...