Re: [UFO-devel] UTextEdit reacting strangely
Status: Beta
Brought to you by:
schmidtjf
From: Elie `w. B. <dro...@gm...> - 2006-04-28 18:52:40
|
> > in src/ui/ubasicstyle.cpp > line 873 to 881. > > I'd really like to remove this piece of code as it's really messy. > Probably a scroll pane should work. > Otherwise an entirely new solution should be considered. > I'm not sure of getting all the concept behind UScrollPane completely. I'm supposing a few things that are possibly all wrong, but please correct me and provide some more explanation. I'm willing to contribute on this part a= s you see fit. Hacky fix Considering the bug that annoys me, I think it would be simpler to compute the offset when it changes and store it as a member of UTextWidget. Which means that caret movement might impact the offset as needed (I'm not really sure on how that could be done), so the offending block of code in ubasicstyle.cpp could be removed. This solution could be binded to scrollbars via offset manipulation. Overloading UScrollableWidget methods in UTextWidget to consider the offset seems reasonable to me. Scrollpane fix After looking quickly at the code of uscrollpane.cpp, I'm not really sure o= n the way it works. I'm not familiar with the rendering aspect of the problem= , nor with the content manipulation of the problem. Looking at the code I deducted a few things (that, you can translate to "he didn't understand anything"). Please correct me and enlighten me on the subject. - Scrollpanes are zones that are possibly larger that displayable area. - Displayed area is manipulable with UScrollPane methods, which provides additionnal methods for straight inclusion into other widget, l= ike wheel handling. Special key handling (PG_UP, PG_DOWN, UP/DOWN/LEFT/RIGHT= ) doesn't seem to be considered in this part. - Scrollpanes are designed to be binded to scrollbars. - Scrollpane content is given by providing some UScrollableWidget to the constructor. Looking at morewidgets.cpp (L83), I see that scrollbars are automaticly added for listboxes. Adding stuff to the listbox after creating the scrollpane works fine, the scrollbars continue to work (and are properly resized) with the newly added items. This doesn't work for UTextEdit objects for some strange reason : scrollbar= s don't appear after typing text. Worse, cursor doesn't move the box if a scrollpane is used -- which is normal if the "box moving" part is in the specific drawing code of UTextWidget likes. I'm eagerly waiting for your feedback before starting my coding night ;) -- { drozofil -- www.lwo-lab.net } |