So I have added scroll bars and a bunch of stuff to IGUIEditBox's.
I have made a patch file but I am working out of the 1.7 SVN branch, not sure if its compatible with the trunk or other versions, it probably is as I don't think these files changed that much.
Patchfile can be downloaded here:
Download
Changes:
* Now has a vertical scroll bar that can be enabled with setVScrollbarEnabled()
* Contains bug fix for weird scrolling issue (see this thread: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=42417)
* The mouse wheel now scrolls the edit box while it has focus. setMouseWheelScrollAmount() can be used to set how much it scrolls by. Defaults to 3 lines which seems to be standard in windows.
* Added setCursorPos() functions which can be used to set where the blinking text cursor is. There are two different versions, one that lets you set by line and position within that line and one that sets by character index.
* You can also get the current cursor position with getCursorPos() functions.
* Added a getMaxScroll() function which returns the maximum scroll value of the scroll bar for use in conjunction with:
* setCurrentScroll() which lets you set the scroll bars current position.
Use and enjoy
IGUIEditBox now with Scrollbars and other stuff
Re: IGUIEditBox now with Scrollbars and other stuff
Just some notes as I'm now sitting on that stuff:
- Please always one feature per patch. Putting more than one feature inside a single patch makes it nearly impossible to read it as I have no idea which line belongs to which feature without double and tribble-reading every single line. And features are always added one-by-one as it's otherwise not possible to test them.
- It would be nice to test patches before posting them. I can see some problems without tests, but in general the rule in programming is: As long as it's not tested it won't work correct. In this case I could see for example on a quick-view that setCursorPos doesn't care about the difference between CursorPosition and text-index (they are not the same because of newlines), but in writing tests I found several more problems in the editbox already.
- Please always one feature per patch. Putting more than one feature inside a single patch makes it nearly impossible to read it as I have no idea which line belongs to which feature without double and tribble-reading every single line. And features are always added one-by-one as it's otherwise not possible to test them.
- It would be nice to test patches before posting them. I can see some problems without tests, but in general the rule in programming is: As long as it's not tested it won't work correct. In this case I could see for example on a quick-view that setCursorPos doesn't care about the difference between CursorPosition and text-index (they are not the same because of newlines), but in writing tests I found several more problems in the editbox already.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm