Page 1 of 3

Scrollbars on StaticText

Posted: Mon Aug 16, 2004 14:38
by spannerman
Hi Eddie,

I would like to attach a vertical scrollbar to a Taharez Static Text control...how do I do that??

Basically, if the text I add to a Static Text control exceeds its size, I want the scrollbar to kick in. Sorry if its silly question, Im really just looking for a hint or two to get me started. I was originally using a MultiLineEditBox, but this doesnt have what I need like with the Static Text (visually).

I will be looking into how the MultiLineEditBox does it, but in case theres existing 'quick tricks' to do what I need I thought I'd ask here first.

Scrollbars on StaticText

Posted: Mon Aug 16, 2004 15:30
by CrazyEddie
No quick tricks really. Off the top of my head, the following comes to mind...

99% of the code for these widgets is actually in the base system at the moment, which is different than all the other widgets. With adding a concrete widget of another type, you will probably want to split this part out into the Taharez classes - since the base system itself has no concept of what a Taharez Scrollbar is.

Once you have the creation done, you'll need a layout method to adjust the size and positioning of the scroll bar when the parent (the static text) size changes. And finally, modify the rendering code (which is in the base class for this widget) to grab the scroll bar position and offset the rendering appropriately.

You also need to update the rendering/formatting code to consider the width of the scroll bar when it is visible.

HTH

CE.

Scrollbars on StaticText

Posted: Mon Aug 16, 2004 21:16
by spannerman
Aaah, a tad bit more complex for me than I'd hoped :?
Thanks for the info, though.

On a side note, is it just me or is the CEGUI CVS repository playing up a bit? I cant get through, and even if I try browsing (http://sourceforge.net/cvs/?group_id=93749) I get the following error:

Bad Gateway
The proxy server received an invalid response from an upstream server.

Scrollbars on StaticText

Posted: Tue Aug 17, 2004 06:22
by CrazyEddie
The CVS things is a Sourceforge issue. A couple of other people have had this also. Sourceforge had disabled pserver access totally for certain projects (beginning with c,d,g,a,w,x and u) a few days back due to problems they were having. I guess they should get this fixed soon.

Scrollbars on StaticText

Posted: Wed Aug 18, 2004 14:21
by spannerman
Aah, that sux, still cant update my cegui_mk2 code from CVS. Hope it gets fixed soon, I really want to try out Sinbads Tab widget.

Eddie, about the scrollbars, is what you described pretty much the same in on order to add scrollbars to any other widgets, even like the frame windows?

Scrollbars on StaticText

Posted: Wed Aug 18, 2004 17:54
by CrazyEddie
Yep, that's the general pattern used for all compound widgets. I'll be adding a scrollable pane some time (I know that time frame is not very helpful), this will be usable in a frame window to do all kinds of stuff :)

Maybe I'll add optional scrollbars to StaticText, shouldn't be too hard for me as I think I know what I'm doing :shock:

CVS being down is a pita :( But Sinbads Tab Widget has not got that far yet as I've been messing about with other stuff (WindowsLook, removing repetetive type-name string literals, and renaming all the Taharez widgets). I'm not sure when some of this will all get put into CVS, as I need to make sure there's a source for the updated data files that will be required (otherwise everything people have written to date will break) - this will be part of a 'samples' directory tree that I'm still pondering about.

If you're desperate for the TabWidget, get Sinbads patch - it has all the bits you need :D

CE.

Scrollbars on StaticText

Posted: Thu Aug 19, 2004 12:39
by CrazyEddie
Just a couple of update notes:
Sinbads Tab widget is now in CVS HEAD. Though there'll be no pserver access until around the 20th at the earliest :(

The snapshots are fully up-to-date though, so you can get the updates there if you need to. The tab widget requires an updated Imageset & image file, which can be gotten from the usual place ---->HERE<-----

I'll be adding line-break support to the StaticText over the weekend, so I might add scrollbars too - it all depends on how things go ;)

CE.

Scrollbars on StaticText

Posted: Thu Aug 19, 2004 17:07
by spannerman
Just a couple of update notes:
Sinbads Tab widget is now in CVS HEAD. Though there'll be no pserver access until around the 20th at the earliest :(

The snapshots are fully up-to-date though, so you can get the updates there if you need to. The tab widget requires an updated Imageset & image file, which can be gotten from the usual place ---->HERE<-----


Excellant, I'll get the snapshot down. I actually started going through Sinbads patch applying the changes manually last night (not as hard or big a job as I thought), but my admittedly self-deprecating motto is "if someone else has done it, chances are its a better job than I can do", so I'll use the snapshot instead :P

I'll be adding line-break support to the StaticText over the weekend, so I might add scrollbars too - it all depends on how things go ;)


Hey, that would be great. But please dont do it on my account alone; I'm in no desperate rush for this. But while your at it, stick some scrollbars on the Frame windows too wont you? Hehe :twisted:

Edit: that last ones a joke. Please dont ban my forum memebership.

Scrollbars on StaticText

Posted: Thu Aug 19, 2004 18:13
by CrazyEddie
I'll be adding line-break support to the StaticText over the weekend, so I might add scrollbars too - it all depends on how things go ;)


Hey, that would be great. But please dont do it on my account alone; I'm in no desperate rush for this.

Well, it's no great shakes for me to do it, and if one person thinks it'll be useful then there's bound to be others (yes, I know you're out there :P ).

But while your at it, stick some scrollbars on the Frame windows too wont you? Hehe :twisted:

:shock:

Edit: that last ones a joke. Please dont ban my forum memebership.

Hehe, no, I don't ban people for things like this :). But if you see some dude walking towards your house with a baseball bat in his hand, that'll be me :twisted: :twisted: :twisted:

Scrollbars on StaticText

Posted: Fri Aug 20, 2004 23:29
by spannerman
Hehe, no, I don't ban people for things like this :). But if you see some dude walking towards your house with a baseball bat in his hand, that'll be me :twisted: :twisted: :twisted:


:!: Now I see why they call you Crazy Eddie. I think you should ask the nurse to increase your sedative dosage. No more staying up late building GUI's, its early to bed for you.

Anyway, violence solves nothing, except for when silencing old CD-Rom drives that make loud annoying grinding noises.

On a seperate note, anon CVS access is back ! :)

Scrollbars on StaticText

Posted: Sat Aug 21, 2004 06:33
by CrazyEddie
:!: Now I see why they call you Crazy Eddie. I think you should ask the nurse to increase your sedative dosage.

Hehe :D

No more staying up late building GUI's, its early to bed for you.

Whoo hoo!

Anyway, violence solves nothing, except for when silencing old CD-Rom drives that make loud annoying grinding noises.

I entirely agree.

On a seperate note, anon CVS access is back ! :)

Great news!

Btw, did you get the Tab Widget working okay?

Scrollbars on StaticText

Posted: Sat Aug 21, 2004 10:00
by spannerman
No, in between things Im still working on getting a tab control working, unfortunately.

I did a complete clean CVS update yesterday. Everything compiled fine, I updated my xsd files, made sure I had the latest TaharezImageset.xml and Layout.tga, and even added the following factories to my testscheme.xml:

Code: Select all

<WindowFactory Name="Taharez Tab Control" />
<WindowFactory Name="Taharez Tab Button" />
<WindowFactory Name="Taharez Tab Pane" />


Im presuming that I'd get the ball rolling with something like this:

Code: Select all

TabControl* testTab = (TabControl*)winMgr.createWindow((utf8*)"Taharez Tab Control", (utf8*)"test tab control");


However, and this is very odd, I havent got very far because my app does not seem to recognise TabControl, or any of the tab related things like the tabbutton or the tabcontentpane.

I dont get it, I havent changed any of my links or includes paths to my version of CEGUI. I have a heavy feeling in my stomach that Ive missed something obvious, but anyway, Im stuck at the mo.

Scrollbars on StaticText

Posted: Sat Aug 21, 2004 10:26
by CrazyEddie
Hmm, that's odd. You appear to have done everything right. :?

I'll have a play around and see what I can come up with (haven't actually tried it myself yet, you see :) ).

CE.

Scrollbars on StaticText

Posted: Sat Aug 21, 2004 10:39
by spannerman
Hehe, ok thanks man. That would be cool if you could take a look your end. Im pretty sure Ive missed something obvious though (that usually tends to be the case). But if not... *taps baseball bat in hand*...

Scrollbars on StaticText

Posted: Sat Aug 21, 2004 12:21
by CrazyEddie
:shock:

I think the problem is that the CEGUI.h file is missing the tab stuff :oops: No, no! Not the baseball bat, please :o

I'll update CVS in a bit, the patch is simple (see below). Let me know if this fixes things or not.

Code: Select all

Index: include/CEGUI.h
===================================================================
RCS file: /cvsroot/crayzedsgui/cegui_mk2/include/CEGUI.h,v
retrieving revision 1.11
diff -u -r1.11 CEGUI.h
--- include/CEGUI.h   16 Jul 2004 19:03:49 -0000   1.11
+++ include/CEGUI.h   21 Aug 2004 12:18:17 -0000
@@ -80,5 +80,8 @@
 #include "elements/CEGUIListboxTextItem.h"
 #include "elements/CEGUIComboDropList.h"
 #include "elements/CEGUIMultiLineEditbox.h"
+#include "elements/CEGUITabButton.h"
+#include "elements/CEGUITabPane.h"
+#include "elements/CEGUITabControl.h"
 
 #endif   // end of guard _CEGUI_h_