Hi AndreasB,
Just change TextObjectCursor property to crDefault
Hope this helps
Hi AndreasB,
Just change TextObjectCursor property to crDefault
Hope this helps
Hi pmanderson,
When you turn on hyphenation, you have to handle Memo.RTFData.OnHyphenate event. In this event is up to you to hyphenate the words (define the syllables).
The hyphencount says how many hyphens the word should have. The hyphen parameter is an array of integers that says each syllabic division.
For instance, the word parameter should result:
pa-ra-me-ter
hyphencount = 3
hyphen = [2,4,6,0,0,..,0]
Hi Julian,
Is there any news about this in WPTools 6? Did you added it, or intend to do so?
Thanks
Alessandro Fragnani
Hi,
I added a behavior in my WPRichText similar to the one existent in MSWord. When the user moves the mouse at the left side of the text, it changes the cursor from crIBean to 'Inverted Mouse' which the cursor points to the right, instead of to the left. It was working great, until now, when the user decided to use wplayShowManualPageBreaks Layout.
Since wplayFullLayout is the most usefull layout, in my opinion, back when it was developed, it was the only one tested, I guess. So, here is the problem.
I use the code below to check if the mouse is 'at the left side'. X and Y parameters comes from MouseMove/MouseDown:
function TMyWPRichText.IsMouseAtLeftSide(x, y: integer): boolean;
begin
CalcMousePageAtXY(x, y);
result := (MouseX + XOffset) < (header.leftMargin - 200);
end;
The problem is that header.leftMargin is not usefull at wplayShowManualPageBreaks layout, because since there is no page to see, there is no margin to respect (I guess). So, how could I know the size of the left area (visible)? Which property/value should I use to determine?
Thanks for your help
Alessandro Fragnani
Hi Julian,
Sorry, but I didn´t receive it again. I really don´t know why. Could you pleas send me a PM so I could read it here, in the forum?
Thanks
Alessandro Fragnani
Hi Julian,
Sorry, but I didn't receive any e-mail from You since the beggining. Could you send me again?
Didn't you note the problem neither in Fields? Or just with basic background color?
I prefer not changing your code, unless you say that will do it in the oficial WPTools code, otherwise I will have to re-code every time I get a new update. I just pointed you the difference between the releases, thinking it could be some collateral effect of another change, hopping you could fix it. Since it appears not being collateral, it will remains untouched, unless the customers note the difference.
Thanks
Alessandro Fragnani
Hi,
I Just downloaded version 5.50 and noted some differences between that and version 5.35
1.There is an white underline AND overline for each blank space between each word in fields. I couldn’t find anything to turn it off. In fact it happens not only for fields, but appears to be something in ‘background paint’ since even for background colors defined in paragraphs, this White underlines also appears. But in this case, it is not always drawn, and doesn´t respect the blank spaces only. I noted this problem when zooming differs from 100%. Unfortunatelly I couldn’t test this in WPTools 6 demo since it doesn´t have background color for fields. I’m using this as AutomaticTextAttr configuration:
oWPRichText.AutomaticTextAttr.BackgroundColor := $00DADADA;
oWPRichText.AutomaticTextAttr.UseBackgroundColor := True;
oWPRichText.AutomaticTextAttr.AlsoUseForPrintout := False;
oWPRichText.AutomaticTextAttr.HotStyleIsActive := True;
oWPRichText.AutomaticTextAttr.UseBackgroundColor := True;
2. I noted that the mouse wheel sensitiveness is different. In version 5.35 I have to hit 14 times the wheel, to scroll a single page. In version 5.50, only 5 is enought. I prefer version 5.35. Versiont 6 demos is smooth, requiring 28 hits;
3. When I try to use Ctrl + Mouse Wheel to change zooming, it has a strange behavior. It changes the zooming, but also scrolls to another page, at the 3rd or 4th key combination. I’m using a 9 pages document, put the cursor at the second paragraph of the first page. Hit Ctrl + Mouse Wheel Down once, it scrools to between first ad second page. Hit again and it goes to the 8th page. Really strange. Unfortunatelly I couldtn’t test this in Version 6 demo, since it doesn’t have zooming on with Ctrl + Mouse Wheel.
Thanks for your help.
Alessandro Fragnani
I don't know if WPTools 5 and 6 works equals in this, but in WPTools 5 you should use ScreenToClient, WPRichText.GetLineFromXY and WPRichText.GetPointFromParLin.
I have done something like this (The poRect will be the Rect for a HintWindow):
procedure TYOURWPRichText.CalcHintArea(var poRect: TRect);
var
oPoint, p: TPoint;
oParagraph: TParagraph;
nPosinpar: integer;
begin
oPoint := Mouse.CursorPos;
if oPoint.x > self.Width then
oPoint.x := self.Width;
oPoint := ScreenToClient(oPoint);
if GetLineFromXY(oPoint.x, oPoint.y, oParagraph, nPosinpar) then
begin
p := GetPointFromParLin(oParagraph, nPosinpar);
p := ClientToScreen(p);
end;
OffsetRect(poRect, p.X, p.Y);
OffsetRect(poRect, 0, -(poRect.Bottom - poRect.Top));
end;
Alles anzeigen
Hope this helps.
Alessandro Fragnani
Hi Julian,
Yes, I did find this event, but I couldn't figure out how to use it to have the behavior I want. The special text attr must be painted normally, just as defined, but the BKColor should be 'the boss' in this case.
I found some code about word highlight in V5 (cafsWordHighlight), but it appears to be incomplete (no read/write routines). Is this? And this word highlight will be 'the boss', or will the special text attr remains on top?
I could accomplish my need with a minor change in WPRTEPaint, method TWPRTFEnginePaint.SetCanvasAttr, while checking for cpa.UseHotBackgroundColor (adding check for Props.Values[WPAT_CharBGColor]). I was intending to create a property (OptionsEx, or something like this) in TWPRichText to define the behavior (who should be the boss), so it should work in both situations. Is this something that you could add to WPTools original code?
Thanks in advance
Alessandro Fragnani
Hi,
I have created a highlight procedure in my text editor, to be used in a 'Find' method. So, I need to highlight every ocurrence of the found words. I defined that the found word would have its background as clLime. This code is done like this:
for every found word...
oWPRichText.Finder.SelectText;
oWPRichText.CurrAttr.BKColor := oWPRichText.CurrAttr.ColorToNr(clLime, false);
But I also have defined that ProtectedTexts would have a defined color to its background (ProtectedTextAttr.UseBackgroundColor is TRUE and ProtectedTextAttr.BackgroundColor is $00D9FDFF).
The problem is simple. The color defined in BKColor never appears, if the found word is inside a protected area.
I tried to find a way to define 'which color is the boss', but with no success.
Does anyone has an idea?
Thanks for your help
Hi Konstantin,
Is it even bigger than when upgrading from version 4 to 5? In that case I just turned on WPRichText.ViewOptions [wpTraditionalMisspellMarkers] and it returned to the 'old clean style' :)
Hope this helps.
Alessandro
Hi,
I know to be a 'not trivial issue', but it doesn´t hurt to ask.
When I use subsequent Paste commands (Ctrl + V), from any content previouly copied, in some situations the editor is not refreshed at 'real time'. I can see the scrollbars growing, and even my own statusbar (row / colum information) increasing, but the text itself doesn´t repaint, until I release the keyboard. I noted that the problem occurs if I paste the content in the middle of the already existing text, specially when the contents bellow need to scroll to another page.
I understant the reason for the delay (the flicker-free engine), but since the problem only happens in some specific situtations, I would like to know if this would be fixed too.
Thanks in advance
Alessandro Fragnani.
Hi,
You may use TWPRulerOptions to solve this, in each Ruller assigned to the WPRichText.
TWPRulerOptions = set of (
wrShowTabSelector,
wrShowTabStops,
wrShowIndents,
wpUseIntervalls,
wpNoVertRulerAttached, // should be enabled when you use a vertical ruler
wpRulerReadOnly, // Don't allow draging of indent merkers
wpPageMarginsReadOnly // Do not change margins of the page
);
Hope this helps
Alessandro Fragnani
Hi,
1. You may use EditOptionsEx [wpDisableEditOfNonBodyDataBlocks]
2. What do you mean about 'to protect the vertical / horizontal rules'? Avoid the user to scroll? If so, just hide the scroll bars with ScrollBars := ssNone
Hope this helps
Alessandro Fragnani
Hi,
Could you link the RTF file and printscreens from both versions to compare? Maybe it is not just the line height that influences the difference.
Alessandro
Hi,
One thing that I noted different between version 4 and 5 about how the text flow was the Space Before in paragraphs. I posted that to Julian in 2006 and he created a FormatOptionsEx option, called wpDontIgnoreSpacebeforeOnTopOfPage. When I'm loading a RTF file created with WPTools4, I apply this to my WPRichText and the text becomes 'just like before'.
I do this:
oWPRichText.Memo.RTFData.FormatOptionsEx :=
oWPRichText.Memo.RTFData.FormatOptionsEx + [wpDontIgnoreSpacebeforeOnTopOfPage];
oWPRichText.Memo.RTFData.UpdateReformatMode(True);
Maybe it could help you
ps. WPTools 5 was made more 'MSWord compatible' in this feature
Alessandro
Eduardo,
Não sei como esse arquivo foi produzido, mas pelo que pude ver, foi salvo usando o OpenOffice (comment StarWriter). Pelo menos num teste simples que fiz, o OpenOffice não criou dessa forma, com o \*\cs10. Ele foi feito com o Word2007? Ou foi copiado/colado de um browser?
Infelizmente, a única forma de fazer o WPTools reconhecer isso, é removendo o '*\', pois caso contrário, como o Julian colocou, todo o trecho é ignorado.
Isso acontece pois o WPTools não suporta estilo de caracter, mas na verdade o RTF criado está errado pois o texto em sí ('cada uma, do Edif...) não deveria estar dentro da tag {\*\.... }
//
Eduardo,
I don't know this file was created, but I guess it was saved using OpenOffice. In a simple test I noted that OpenOffice didn't create the file with \*\cs10 in it. Was it created using Word 2007, or copied from a web browser?
Unfortunelly the only way to solve this is removing the '\*' from it, otherwise, the entire piece will be ignored.
This happenas because WPTools don't support character style, but in fact the problem is in the RTF File, that is wrongly created, because the text itself ('cada uma, do Edif...) should not be inside the tag {\*\.... }
Hi Julian,
It wasn't my intention to be rude. I was just showing since when I have this problem unanswered, and unfortunatelly, the error will not be fixed. At least it was my understanding, based on the description of your post. By the way, I was asking about 'DELETE', not 'INSERT' in empty paragraphs.
About the messages count, yes, its a bit excessive, but what can I do? If you remember, I use WPTools since version 3, starting in 2001. It sums about 7 years and 3 full version upgrades (3 -> 4 and 4 -> 5). And I have users that need my text editor, to be very close to MSWord in features and easy of use. Some features you did improve in basic WPTools. Others I code myself, and send you, and sometimes you accept my changes, and sometimes not, so I update the code myself. If I remember well, I have about 15 code changes in my custom WPTools compilation, without counting my own inheritance level. And besides one or other minor issue, I can tell you with no doubt, that WPTools is a great product. My only missing is to be much more MSWord compatible, behavioral speaking.
About the table_to_text routine, sorry, but while testing it, I get some msword incompatibilty behaviors, and since the 'undo problem' didn´t appears to be a big issue after all, was decided keep with my own code. I forgot to tell you, really sorry.
Alessandro
Hi Julian,
In April 3rd, 2006, I sent you this message, with no answer since:
ZitatAlles anzeigen
Subject: Problem with TWPRTFEngineBasis.IsProtectedI have found a little issue about this procedure. It is not working fine with empty paragraphs.
Let's suppose this scenario.
1. I have five paragraphs.
2. The first paragraph is entirely protected (afsProtected). I set this attribute to pieces of text because I need to "protect" pieces of text to be like a "comments" or"notes" in my system. The user selects a piece of text, clicks a button and I add "afsProtected" to the selection (CurrAttr.AddStyle([afsProtected]);)
3. The second, third and forth paragraphs are "empty" (just an "Enter").
4. The fifth paragraph is anything, it doesn't matter.
5. Put the caret at the second, third or forth paragraph (the empty paragraphs).
6. Hit "DEL" to delete this paragraph, which should move the fifth paragraph one line up. You will note that nothing happens.This is caused because you use the CharAttr attribute from the last character of the last non-empty paragraph, instead of the current paragraph. If I remember well, in some situations (internal checks) the CharAttr value is based on the "previous character", and not "actual character". Maybe this is one of that situations.
I guess that in this particular situation you could change TWPRTFEnginePaint.InputString / procedure SetChar to have a special treatment if this happens.
I was thinking that using aCursor.CPAttr.HasStyle could solve the problem, but it is not returning TRUE for neither of the three empty paragraphs. Calling aCursor.CPAttr.HasStyle only works if I'm inside a non-empty paragraph.
The code that I use to protect the selected text, in this case the first paragraph, is also adding \wpprot1 tag to the second paragraph (the first empty paragraph). Maybe a bug in CurrAttr.AddStyle or in SelectParagraph. But even if I hit DEL in the third or forth paragraph (two empty paragraph with no \wpprot1 tag defined), it still don't delete that paragraph, because it only checks for the previous non-empty paragraph, and .HasStyle doesn't return true.
I guess that this problem happens because when a paragraph is empty, you don't store this kind of information in it.
How could I solve it?
Thanks for your help
Thanks in advance
So, with this update it is now oficially impossible to delete this empty paragraphs, and the users will not be able to edit the text? Or the protection is only about 'inserting text'?
Thanks for your help.
Alessandro
Hi,
I don't know why or how, but some of my users reported failed RTF to PDF conversion, but when I tried to execute it by myself, it worked fine. The RTF contains a BMP (on the header) of about 750Kb (ok, I know, it's suicide, but I already asked the user to replace it by external file). When they converted the file, the result was something like this (PDF code):
/CreationDate(D:20080903120214)/ModDate(D:20080903120214)/Producer(wPDF3 by WPCubed GmbH)>> endobj3 0 obj <</Length 6265 >>streamq q 0.120000 0 0 0.120000 0 792.000000 cm BT 1 0 0 1 0 0 Tm/F1 100.000 Tf 0 Ts 0 g -0.029 Tc 783 -389 Td(280000000
But when I converted the RTF file it becomes:
/CreationDate(D:20080905143313)
/ModDate(D:20080905143313)
/Producer(wPDF3 by WPCubed GmbH)
>>
endobj
2 0 obj
<<
/Type/XObject
/Subtype/Image
/Name/wpt1
/Width 776
/Height 173
/BitsPerComponent 8
/ColorSpace/DeviceRGB
/Length 66941
/Filter [/FlateDecode] >>
stream
XXXXXX (it started the binary code)
Alles anzeigen
Is there anything that could raise this problem. OS Version, DLL version, Installed ServicePack, or something like this?
Thanks in advance
Alessandro