Axel Dörfler
5ce268a62d
You shouldn't eat mouse moved messages outside of the mouse down/up cycle.
...
At least there is a pending bug in BView::GetMouse() that causes this restriction.
This fixes bug #762 for now (will do the part in GetMouse() next).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-24 08:53:28 +00:00
Stefano Ceccherini
a8945c367b
added +1 to the textrect width in AutoResize(). Maybe it needs still more space. Fixes bug 764.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18584 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-23 10:11:44 +00:00
Stefano Ceccherini
f9d284011a
invalidate the null style in BTextView::MakeEditable(). Fixes bug 362
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18568 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-22 15:25:24 +00:00
Stefano Ceccherini
e8db36f1d2
Don't scroll to the selection when calling BTextView::Insert(). This fixes bug 506
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18547 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-21 12:42:01 +00:00
Stefano Ceccherini
6636dcac56
BTextView::DrawLines() was drawing some text over some already existing one. Fixes bug 738 (and also the weird text redrawing in Terminal and StyledEdit)
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18518 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-17 08:00:27 +00:00
Stefano Ceccherini
8ba08d23c4
fClickOffset wasn't maintained when Select() was called. Should improve problem described in bug 494 a bit
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-08 15:39:31 +00:00
Stefano Ceccherini
ea4eba9f14
Simplified a bit a part of FindLineBreak. Removed a now useless comment
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-08-03 13:12:54 +00:00
Stefano Ceccherini
b92418a82c
Check for NULL text, otherwise strlen() can crash. Might even fix bug 677
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-07-05 19:50:08 +00:00
Stefano Ceccherini
3e9e6a58c8
DrawLines() didn't respect the passed offset, thus redrawing over the old text. This exposed some other bugs in the refreshing mechanism. Hopefully fixed them all, although there might be some problems still with the inline input method
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-17 12:14:02 +00:00
Jérôme Duval
7f0858ae68
Selection => selection
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17763 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-07 16:08:38 +00:00
Jérôme Duval
f4fc3d626a
* fixed some more GetSupportedSuites implementations
...
* fixed some local variables names
* fixed the case of some message attribute names
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17734 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-06-06 12:35:27 +00:00
Stefano Ceccherini
5a5960830d
some changes, improved double buffered mode, it still has some problems, though
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17374 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-08 20:13:35 +00:00
Stefano Ceccherini
71c3e4ad7d
Fixed bug 516, worked some more on AutoResize() (which is still not correct, but improves the situation, looks like bug 161 wasn't completely fixed yet)
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17342 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-05 18:08:35 +00:00
Stefano Ceccherini
2420234dff
BTextView::AutoResize() wasn't still completely correct, causing bug 464
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-17 14:09:32 +00:00
Stefano Ceccherini
337ab7d069
Align the textview to the correct alignment if it resized itself.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17055 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-10 19:29:13 +00:00
Stefano Ceccherini
abb7ab0861
Check if we have a window in BTextView::DrawLines(). This should fix bug 383. We might remove it from there and check in the caller instead, as DrawLines is a private function (maybe add an ASSERT() call)
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16999 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-04-04 07:46:09 +00:00
Stefano Ceccherini
98b5c6b926
Sorry, this was just a test and wasn't meant to be committed.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16816 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-16 11:15:42 +00:00
Stefano Ceccherini
f6e3e0a259
Redraw the text when MakeResizable is called. Fixes bug 187
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16798 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-14 21:30:19 +00:00
Stefano Ceccherini
c44a5bea8b
Don't switch to I_BEAM cursor if the textview isn't editable nor selectable. Fixes bug 246 for real
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16797 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-14 21:02:39 +00:00
Stefano Ceccherini
88ae0d494c
Seems like BeBook lies on BTextView's autoresizing mode. The textview itself isn't resized, but only the textrect is. Fixes bug 161, but maybe it needs more work
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16770 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-13 19:51:15 +00:00
Axel Dörfler
04d40ff247
* Fixed flattening/unflattening text_run_arrays; they have to be converted to
...
and from big endian - this fixes our StyledEdit not being able to read files
written under BeOS and vice versa.
* Made UnflattenRunArray() more robust against missing fonts; the style is now
tried to be preserved. Note that BeOS doesn't maintain the "face" field in
the flattened run arrays correctly.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-11 12:58:31 +00:00
Stefano Ceccherini
b704350079
Add the textrect border width to the total width of the control when in autoresize mode
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16693 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-10 22:35:30 +00:00
Axel Dörfler
318b5ed2cc
SetFontAndColor() now ignores the offset when the text view is not stylable.
...
This fixes BTextControl's text staying gray when it was once disabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16646 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-08 14:48:08 +00:00
Stefano Ceccherini
9c2db284a8
Now BTextView::AutoResize() resizes also the textrect as it should
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16609 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-06 15:50:51 +00:00
Stefano Ceccherini
8013da5719
Replaced ceil with ceilf in a number of places
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16601 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-06 11:15:53 +00:00
Stefano Ceccherini
ace32536d4
ActualTabWidth() takes a location parameter, not an offset. Fixed bug 249 for real
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16600 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-06 11:03:53 +00:00
Stefano Ceccherini
a073611bbc
BTextView::OffsetAt() wasn't working with TAB charachters. Fixes bug 249
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16597 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-06 10:45:18 +00:00
Stefano Ceccherini
2c11ec31c8
BMenuItem also draws ctrl bitmap if needed, BTextView::AutoResize implemented more correctly
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-03 19:31:09 +00:00
Axel Dörfler
5891e232e2
BTextView::SetFontAndColor() no longer crashes with a NULL font pointer.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16560 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-01 17:39:08 +00:00
Stefano Ceccherini
56edd77bdd
Implemented AutoResize(), probably not completely correct. Removed duplicated code
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-20 22:07:58 +00:00
Stefano Ceccherini
971af42f6f
Fixed a memory leak (another)!
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-16 20:29:30 +00:00
Stefano Ceccherini
e333843348
Added Alloc/Copy/FreeRunArray() as Axel's suggestion, and used it internally in TextView. Also fixed small memory leak
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16224 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-03 21:22:00 +00:00
Stefano Ceccherini
d81069bfad
Waldemar made me notice this leak.
...
Adding a comment as I can't test the changes now.
I'd like some comments on this problem as it isn't
a minor one, especially if we add a BFont destructor in the future.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16195 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-02 08:52:07 +00:00
Stefano Ceccherini
f4a0e8303d
offset wasn't taken into account in BTextView::UnflattenRunArray(). Loading styled text didn't work correctly for that reason
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16194 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-02-01 21:02:16 +00:00
Stefano Ceccherini
3d453d2da3
Fixed redrawing when alignment is center or right. Extended a comment to a bug which I can't reproduce anymore
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15912 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-11 17:44:22 +00:00
Stefano Ceccherini
4639f874c7
You shall compile before commit
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15245 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 18:37:15 +00:00
Stefano Ceccherini
17adbf1f0c
Misc style changes
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15243 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-30 17:56:56 +00:00
Stefano Ceccherini
a4368fc50d
Small cleanups and simplifications. Removed duplicated code
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15209 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-29 10:34:06 +00:00
Axel Dörfler
4aeff099bf
* Removed all *Ptr types (and just use pointers to the type instead).
...
* minor style guide changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15044 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-20 16:12:38 +00:00
Axel Dörfler
ee694ac85f
* Disallowed chars now work correctly and no longer prevent the BTextView from
...
being edited.
* A non editable BTextView is now still navigable.
* Made cursor one pixel shorter (at least it looked a bit too long to me...).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-12 13:04:29 +00:00
DarkWyrm
fdbc56b338
Fixed build for R5 target
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13936 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-11 20:50:58 +00:00
Stefano Ceccherini
148413eb24
Added working multi-word selection (asynchronous version)
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13836 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-27 10:09:07 +00:00
Stefano Ceccherini
29e6ad95d0
No need to explicitly Flush(), as it's done in BWindow after B_PULSE message handling
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13072 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-12 06:05:46 +00:00
Stefano Ceccherini
2753f0d240
Added code for multiword selection. Currently it's disabled because it doesn't work due to some bugs in app server
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12794 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-23 22:07:50 +00:00
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