XLNT 2 gui - Force 'home' with a textbox?

Blitz3D Forums/Blitz3D Programming/XLNT 2 gui - Force 'home' with a textbox?

Zethrax(Posted 2007) [#1]
Hi, I'm having a problem with the xlnt 2 gui lib. I use the textbox gadget to display instructions, help info, etc, in my game. The problem is that when text is added to a textbox, the textbox text ends up scrolled to the bottom. I need the text to be scrolled to the top so that the user can begin reading from the start without needing to scroll or home the text.

Basically I want to do the equivalent of pressing the 'home' key with the textbox gadget's scrollbar having the focus, but I need to do it using code. I've been elbow deep in the xlnt 2 code with no luck.

Thanks for any help.


jfk EO-11110(Posted 2007) [#2]
textbox sometimes acts a lil buggy, anyhow, try this:

GAD.GAD=Object.GAD(MyTextBoxHandle)
GUI_SCROLL_CUR(GAD,-14*1000)
GAD.GAD=Object.GAD(MyTextBoxHandle)
GUI_SCROLL_CUR(GAD,-14)

Assuming there ain't more than 1000 lines in the text.


Zethrax(Posted 2007) [#3]
Finally got around to testing your code, JFK.

Unfortunately the compiler doesn't recognize 'GUI_SCROLL_CUR' for some reason. Possibly its a function you've added to your copy of the gui.


jfk EO-11110(Posted 2007) [#4]
No, it's part of the include file "xio.bb" of XLNT2. Probably there are minor version diffrences between mine and yours. This function is also used by other functions in the xio.bb file. Search for "scroll" in that file.

The docs say the official version of xlnt I am using is:

XLnt ii v1.2

So it's XLnt 2 subversion 1.2


Zethrax(Posted 2007) [#5]
Couldn't find the function in the file mentioned. I'm using XLNT2 version 1.41.


jfk EO-11110(Posted 2007) [#6]
the official site is down and I can't see other servers offering the zipfiles for download, including older versions, such xlnt1.1b.zip, that I'm using an that actually is xlntii v1.2 (at least in its included docs).

I doubt you could transplant the said function from version 1.2 to version 1.41. I have to say, removing things in new versions isn't that nice. Especially since I used to hack xlntii several times, eg. for: transparent backgrounds, TAB to jump to next input gadget, or this scroll home thing, etc.

If you want me to, I can upload the xlnt1.1b.zip the sooner or later.


Zethrax(Posted 2007) [#7]
Thanks for the offer JFK, but I've given up on fiddling around with XLNT2 and just put a message at the bottom of the displayed files telling the user to home the page manually. I'll have to write my own gui code eventually as the third party ones all seem to be inadequate for my purposes, and I find it's generally more trouble than it's worth trying to modify them.

If you like, I can send you version 1.41 of XLNT2. I believe it was the latest version.


jfk EO-11110(Posted 2007) [#8]
Hehe, thanks. That's why I stay with the verison I started to modify. So, no need for 1.41. I do however like XLNT2 very much, and usually it's the most straight forward gui for me, since I got a couple of templates floating around and also because I'm not very familar with other GUI's, other than my own special purpose micro guis. Today I would decide to use xlnt2 or WinBlitz3D, depending on the app requirements ans the kind of potential customer.