Page 1 of 1

modify my statictext vertical scrollbar position

Posted: Sun Jul 03, 2011 19:58
by Sniper Binaire
Hi ! I'm coming with troubles... :(
I try to get somting like a console, as the one said here http://www.cegui.org.uk/wiki/index.php/Game_chat_box but with a different approach :
firstly, I don't need to get an input box, as I'm creating an information window, input is given by the application itself.
Another point is that I want to get a full history of all the gived output, so my strategy is to use a simple Static Text window, and stack to the Text field the requested log message.
The main problem is that when my window is full off output, the next is drawn under the window (and so hided).
I want to make my vertical Scrollbar staying at the bottom of the frame to get rid of this.

Here is how I've setup this StaticText :

Code: Select all

<Window Type="TaharezLook/StaticText" Name="Sandbox_interface/Live_debugger" >
  <Property Name="Text" Value="Live Debugger disabled" />
  <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
  <Property Name="VertFormatting" Value="TopAligned" />
  <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
  <Property Name="UnifiedAreaRect" Value="{{0,0},{0.33,0},{0.4,0},{0.9,0}}" />
  <Property Name="BackgroundEnabled" Value="False" />      
  <Property Name="FrameEnabled" Value="True" />   
  <Property Name="VertScrollbar" Value="True" />
</Window>


But I don't find the way to get an access to that scrollbar and change his position.
any idea ?

Re: modify my statictext vertical scrollbar position

Posted: Sun Jul 03, 2011 20:21
by Kulik
I do it like this for now (0.7.5):

You have to alter your StaticText looknfeel and link the property accordingly to the child scrollbar widget:
https://github.com/mpreisler/ember/blob ... feel#L3946

Then scrolling to bottom gets simple:
https://github.com/mpreisler/ember/blob ... e.lua#L241

There is a ticket for this for 0.8 that is currently assigned to me:
http://www.cegui.org.uk/mantis/view.php?id=450

If you would like to fix this for 0.8, give me a PM, I will reassign the ticket to you and pull your changes. Should be a fairly painless patch (CEGUI needs you! :) )

HTH!

Re: modify my statictext vertical scrollbar position

Posted: Sun Jul 03, 2011 22:21
by Sniper Binaire
Okey I'm on it !
Your solution works flawlessly on 0.7.4 also :D
You're very efficient ^^

So if I've understood, I just have to create CEGUI::Window::VertScrollPosition and CEGUI::Window::HorisScrollPosition ?

Re: modify my statictext vertical scrollbar position

Posted: Mon Jul 04, 2011 08:16
by Kulik
Yeah,

2 property links - HorzScrollPosition and VertScrollPosition - but for all looknfeels (all StaticTexts).

EDIT: The ticket is yours - http://www.cegui.org.uk/mantis/view.php?id=450 - don't forget that you have to clone mercurial repo and work on that (default branch = development branch = CEGUI 0.8) - http://www.youtube.com/watch?v=ZjFOvLGnAiU