modify my statictext vertical scrollbar position

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Sniper Binaire
Just popping in
Just popping in
Posts: 7
Joined: Sat Feb 12, 2011 14:29

modify my statictext vertical scrollbar position

Postby Sniper Binaire » Sun Jul 03, 2011 19:58

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 ?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: modify my statictext vertical scrollbar position

Postby Kulik » Sun Jul 03, 2011 20:21

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!

Sniper Binaire
Just popping in
Just popping in
Posts: 7
Joined: Sat Feb 12, 2011 14:29

Re: modify my statictext vertical scrollbar position

Postby Sniper Binaire » Sun Jul 03, 2011 22:21

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 ?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: modify my statictext vertical scrollbar position

Postby Kulik » Mon Jul 04, 2011 08:16

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


Return to “Help”

Who is online

Users browsing this forum: No registered users and 20 guests