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
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