Tails Posted September 27, 2014 Share Posted September 27, 2014 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 Link to comment
Castillo Posted September 27, 2014 Share Posted September 27, 2014 You could try using CEGUI properties, I'm not sure if there is one for that though. https://wiki.multitheftauto.com/wiki/GuiSetProperty Link to comment
Dealman Posted September 27, 2014 Share Posted September 27, 2014 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
Tails Posted September 28, 2014 Author Share Posted September 28, 2014 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now