Stefano Ceccherini
ee4e1e5076
We can make use of the widthbuffer now that BFont::GetEscapements() works correctly
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12793 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-23 21:11:47 +00:00
Stefano Ceccherini
6ef50d339e
asynchronous mouse tracking starts working. At least, selection does.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12792 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-23 21:06:35 +00:00
Stephan Aßmus
38c5a7b7fa
Implemented StringWidth in ServerFont, updated ServerApp to use it, and removed a -1 from TextView in the char location calculation, which I didn't understand and without which the cursor location and related stuff now finally work.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12744 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-20 17:36:55 +00:00
Stefano Ceccherini
91b84c7729
Some initial code for async mouse tracking. Just playing around actually.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12709 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-18 10:45:36 +00:00
Stefano Ceccherini
e3c6cec42e
Fixed a bad typo
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12700 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-17 15:53:17 +00:00
Stephan Aßmus
6d8d6cad9d
Work in progress to improve BTextView and BTextControl. I don't know what _BTextInput_::AlignTextRect() was thought to do. Some of the fixes are Haiku specific and we need to make sure that we don't need them later on (flushing drawing commands).
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12685 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-16 12:02:23 +00:00
Stephan Aßmus
5b5e713f82
Skip synchronous mouse polling if the window has B_ASYNCHRONOUS_CONTROLS in its flags. Added a TODO comment
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12618 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-10 11:31:44 +00:00
Stefano Ceccherini
9487d15bee
Disabled WidthBuffer once again (for now), as it uses an unimplemented BFont method
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12581 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-07 10:36:30 +00:00
Stefano Ceccherini
d15aa22b8e
Re-fixed widthbuffer locking. I obviously broke this when I made that change in InterfaceDefs.cpp
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-02 15:22:32 +00:00
Stefano Ceccherini
e005dc757f
Simplified the code for input method highlighting. This had the nice side effect of fixing the multi line highlighting bug.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11291 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-08 17:43:56 +00:00
Stefano Ceccherini
a5e772c9c2
Fixed the other bug reported by Axel: the blinking caret spuriously drawn at a wrong position.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10546 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-30 07:59:24 +00:00
Stefano Ceccherini
d5aba99a5e
Refresh() has to do some operations even if there is no window available.
...
This fixes a bug in Diskprobe, thanks to Axel for reporting.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10543 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-29 11:15:22 +00:00
Stefano Ceccherini
0115269685
When Clear() was called, an undo action was created even if undo was disabled. Fixed, and added a comment to it. Some more checks for NULL, some variable renaming.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10476 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-16 08:27:09 +00:00
Stefano Ceccherini
ff6f3ceb3c
Line wrapping was done a character off. Added 1 to the line origins calculation.Lines have now the same height of the be's version. Note that this last change made some visual glitches appear again when selecting. Need to research that.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10386 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-11 08:27:49 +00:00
shatty
d9c9c29b59
do not block program-invoked edits when read-only
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10381 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-09 19:03:17 +00:00
Stefano Ceccherini
4ce5abc64b
Stupid me: kBlackColor is a static, and so it's initialized to 0, so text was drawn in a transparent color, if no default color was specified.
...
Added +1 to the pen position to draw text more correctly.
Thanks to Andrew for reporting
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10366 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-07 10:32:04 +00:00
Stefano Ceccherini
322853c8d3
Last fix screwed selection in other places: Fixed. Some more cleanups. Inline inputted text now highlights at least line, in case of multiple lines.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10357 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-04 17:49:09 +00:00
Stefano Ceccherini
6e6f8fff95
Line wrapping didn't work with multi byte charachters. Fixed.
...
If the view was resized when there was a selection, the selection disappeared. Fixed.
Added some more documentation and some more comments. Improved comments.
Removed some debug output.
Improved some code here and there.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10353 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-02 18:26:49 +00:00
Stefano Ceccherini
8b7faba29f
Made double buffering a compile time option (disabled by default as there is some issues with it)
...
Made widthbuffer a compile time option (disabled by default).
Some minor changes.
Updated the "known bugs" section
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10225 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-25 11:00:50 +00:00
Stefano Ceccherini
970c2591f5
Double buffering support (as it's in the original version). Needs some testing to see if it's cheaper/better than direct drawing.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9988 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-17 11:02:16 +00:00
shatty
d601f6e882
rename RecalLineBreaks to RecalculateLineBreaks ; use ceil() when computing the origins for lines
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9913 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-11 10:07:40 +00:00
Stefano Ceccherini
2d60bd8b95
- Avoid setting the input method active if it is already
...
- Now we use the textview coordinate system correctly in OffsetAt()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9780 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-04 07:36:23 +00:00
Stefano Ceccherini
84fed7e642
Line wrapping needs to work at charachter level, not byte level
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9762 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-03 11:54:38 +00:00
shatty
2d7662810e
abs -> fabs, disable WidthBuffer, patch for confirmation in HandleInputMethodChanged
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9761 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-03 11:12:24 +00:00
Stefano Ceccherini
2f597f2eb7
fixed a warning, that amazingly didn't appear here (thanks andrew)
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9759 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-03 09:40:27 +00:00
Stefano Ceccherini
8ca0bfcbb0
ifdeffed out some code in OffsetAt(), and added some simpler (and hopefully more correct) code, to handle multi byte charachters correctly when selecting via mouse.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9757 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-03 09:33:55 +00:00
Stefano Ceccherini
a13f233057
Finished input method stuff: now we do also the red highlighting.
...
InlineInput.cpp will probably be simplified in the future.
Some subtle fixes to the keyboard/mouse selection code,
which wasn't yet behaving as the real BTextView.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9494 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-25 06:34:51 +00:00
Stefano Ceccherini
7bb5b0eaed
Fixed a bad bug in WidthBuffer, which would make BTextView behave in a weird way.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9404 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-18 21:37:00 +00:00
Stefano Ceccherini
cbc9d62f52
Fixed issue with Lock/UnlockStaticBuffer() on R5
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9286 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-11 23:33:01 +00:00
Stefano Ceccherini
2910a19bbf
Added an ifdef around static variables, so we use beos ones when COMPILE_FOR_R5 is defined.
...
That makes testing TextView under beos possible, again.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9283 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-11 13:43:39 +00:00
Stefano Ceccherini
d51394ddd6
Fixed bad redrawing of the text when alignment is different than B_ALIGN_LEFT
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9122 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-30 13:10:43 +00:00
Stefano Ceccherini
5302d71190
Fixed LineWidth(): now it calls StyledWidth(). It's not an issue, since charachter widths are cached by _BWidthBuffer_.
...
Marc Flerackers lend me a hand and now alignments should work much better (if not perfectly)
Some cleanups.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9119 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-30 12:49:34 +00:00
Stefano Ceccherini
70751f7bfc
- Fixed every Styling issue (at least the ones exposed by StyledEdit). Setting fonts works now
...
- Cleaned up PageUp/Down handling code
- Now setups undo in Clear()
- Alignment now partially works
- Fixed some visual artifacts which could've showed up during typing with an input method
- Added a "known bugs" section
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9096 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-29 07:18:10 +00:00
Stefano Ceccherini
91f868aeb7
Ok, this time for real.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9083 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-27 23:10:13 +00:00
Stefano Ceccherini
c3c637606a
Fixed an annoying jump-to-last-line-on-END-bug (reported by Waldemar)
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9082 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-27 22:50:23 +00:00
Stefano Ceccherini
6be70a0fa1
Finally fixed the problem with the styling code: now selecting two sections of text
...
with a different color and change the font size works correctly.
Fixed a problem with mouse selection (a regression introduced when I fixed selection with keyboard).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9031 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-23 06:40:22 +00:00
Stefano Ceccherini
7575ec2d87
Uncommented the code which makes auto indenting possible.
...
Correctly maintain fClickOffset in SetText().
Some small style fixes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8988 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-17 10:16:06 +00:00
Stefano Ceccherini
f6cd639a4b
Sheesh! No wonder the styling code wasn't fully working, as we were using different constants for font attributes than the ones used by BeOS R5. Now we use those constants directly. Still not ok, but we are on the right track now (I hope :))
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8738 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-31 07:08:49 +00:00
Stefano Ceccherini
74dca7b4f4
- Fixed crash during unarchiving, caused by the use of the wrong variable (thanks to Bill Hayden for reporting), and added a check which would have avoided the crash.
...
- Style changes to StyleBuffer.cpp plus a small fix in ContinuousGetStyle().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8723 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-30 09:02:31 +00:00
Stefano Ceccherini
6276c26824
- Some more error checking in some functions
...
- Fixed SetMaxBytes(), and made it delete the text if it's longer than the indicated bytes
- Fixed Delete(int32, int32) as it was doing bad things if you deleted the final part of the text
- Fixed PageDown handling (at least, it looks like so)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8673 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-27 08:35:15 +00:00
Stefano Ceccherini
758fe00be9
Started adding input methods "clauses" support.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8672 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-27 06:50:41 +00:00
Stefano Ceccherini
7fd612e59f
And here's the blue highlight when an input method addon like the Japanese one is used (the red one isn't yet there)
...
Some minor changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8657 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-26 06:30:43 +00:00
Stefano Ceccherini
939b1a9c4c
PageDown and PageUp now behave a bit better. Still not completely ok, plus the code is a mess.
...
Needs to cleanup
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8640 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-25 07:50:35 +00:00
Stefano Ceccherini
2a346d67a6
- Fixed a nasty regression which made the control unusable
...
- Fixed the "caret looks like a point" bug
- More work on the Styling code
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8638 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-25 06:49:43 +00:00
Stefano Ceccherini
9705d07a5d
I tought I already committed this:
...
Some small fixes and error checks
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-17 13:52:18 +00:00
Stefano Ceccherini
660a04f377
Fixed some refresh bug I introduced in one of the latest commits. "Where are those millions open source code reviewers when you need them?". Word wrapping should work again. Some small style changes. Added some more TODO items and some comments.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8491 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-07-28 08:33:28 +00:00
Stefano Ceccherini
41e3acb043
Added some comments, some small style changes, and some TODO items.
...
Simplified some code.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-07-23 09:58:25 +00:00
Stefano Ceccherini
a901231dac
Reworked Selection, as it was simply broken before. Still not 100% correct
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8449 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-07-22 09:40:40 +00:00
Stefano Ceccherini
539a90858a
Home / End go to the start/end of the line, not to the start/end of the buffer.
...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-07-21 07:22:22 +00:00
Stefano Ceccherini
c1fa3828af
Fixed Home/End key handling. Thanks to Andrew for reporting.
...
I know this won't be the last one :)
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-07-20 07:41:47 +00:00