Age | Commit message (Collapse) | Author |
|
while testing richview I noticed it's fairly slow, though only if there
are font changes in the content. So I added a font cache to the richview
fontmanager and now there is almost no delay to render content in the
richview. Big, big speed improvement.
|
|
|
|
|
|
|
|
We always did StretchDraw() which is rather CPU intensive. Now we check
the image dimensions first, then decide if StretchDraw() is really
needed or not. If not, then do the much faster DrawImage() call.
|
|
docview now uses a single fpGUI call to do encoding conversions. This
make is much easier to maintaing - a single method needs to be
modified if new encoding conversions get added.
|
|
|
|
Before we were forced to only set text in the OnShow or later.
|
|
Attached is another patch I made for the richtext edit. Now the
red/green/blue/black tags can/must be closed by a correct
red/green/blue/black closing tag.
That means that except for the margin tags, all tags can/must now
be closed with a matching tag.
|
|
1) h1, h2 h3 are now ended by /h1 /h2 /h3
2) <wrap yes> and <wrap no> are changed to <nowrap> </nowrap>
3) The size part of the font tag is now optional.
I suspect a small change is still needed in order to apply
the font size if one is specified anyway. I put a comment
in the text for that.
4) I adapted the sample01.txt so it reflects the 1. and 2. changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Very weird, there was even a code comment saying that it was wrong!! The constructor of
TRichTextSettings already sets the "normal font". So by ignoring the ASettings parameter,
the end-user couldn't assign a new normal font values.
Anyway, this is now fixed.
|
|
client area
There was a hard-coded 2px margin at the top and bottom of the text client area. So when
scrolling the text disappeared 2px away from the actual widget border. This was inconsistent
with other text widgets in fpGUI, and I simply didn't like it either.
So GetTextAreaRect() now returns the same values as GetDrawRect().
|
|
* Also took into account theming support, so we get the size of the default borders from the
theme class.
* Improved the method that sets the coordinates of the scrollbar
|
|
|
|
We checked for the same fontdesc, but never for the same instance. So the NewFont
instance might not have been freed, causing the memory leak.
|
|
|
|
The above mentioned method called CreateWnd() twice, thus causing a memory
leak. Now CreateWnd() is simply called once in the constructor.
|
|
The code is more human readable now.
|
|
|
|
|
|
|
|
|
|
|
|
This shoud prevent the 'Index out of bounds' errors.
|
|
|
|
This helps those odd borderline cases, so now the scrollbar always seems
appropriate when it is visible.
|
|
Now that we correctly the FLayout.Width value this change could now be
made.
|
|
- Ultimately this is so we can fix the Layout.Width problem when UTF-8
characters are used in INF documents. eg: the FPC ref.inf file.
- UTF-8 characters can be greater than one byte, so we had to make some
changes.
- Changed some usages of Char to TfpgChar
TODO:
- CopyPlainTextToBuffer() implementation has been commented, until we can
rewrite it for use with fpGUI.
This is a big changes, but I tested DocView with numerous INF documents and
all seems well.
|
|
instead we should be looking at the overall FScrollBarWidth field value
which defines the Width or Height of all Scrollbars in RichView.
|
|
|
|
|
|
Refactored the code, so we only use UpdateScrollBarCoords() method.
|
|
It's the rectangle between the two scrollbars.
|
|
- added a unit header comment
- removed old code comments not needed any more
- removed old debug lines
|
|
|
|
A recent commit forced this change so it is consistent with fpGUI and
RTL usage of array property.
|
|
This gives an overall improved margin size. In future we should make this
user selectable in Docview's Preferences dialog.
|
|
- Rename Settings parameter to ASettings. This is to prevent possible
confusion with the Settings global variable.
- ApplyStyleTag had many issues, applying the style changes to the
wrong properties. Manyly, styling was applied to the ASettings parameter
when they should have been applied to the Style parameter.
- Code formatting improvements.
|
|
Settings is a global variable for RichView component. I renamed the
parameter Settings to ASettings so as to prevent any possible confusion
between the two.
|
|
|
|
|
|
|
|
|
|
The global variable DefaultTopicFont already contained the font size, so
we didn't need to append it.
|