Beiträge von timk5020

    Guten Tag,
    I am parsing through the WPRichText editor and using Par.GetNumberText to get the outline/numbering text on each line. This works perfectly with content created in the WP editor but if I paste in from Microsoft Word the GetNumberText function returns values that are not what we are seeing in the editor.

    Is there a way for me to get the Number Text from the pasted MS word text or does this fall in the category of "We don't support MS Word"?

    Thank you very much for your time,


    P.S.
    This is likely my last post as I am moving to a new position at another company so I wanted thank you for all of your support throughout the last two years and for a great product!

    I am attempting to print two pages on one piece of paper and I discovered I should use the WPSuperPrint object.

    However, when I run the Demo/Tasks/SuperPrint.exe and try to print I get a ZIMFDRV.DLL access violation error : addr (0000006C).

    I have since downloaded the DLL and put it both executable folder and in System32 (running windows 7) and the error is still the same.

    What am I missing?

    To discuss the OnInternPaintPar...

    NOTE ON THE FORUMS: I have images linked here in this post and while they work when I preview the post, I am unable to see them on the submitted post. The pictures are vital to demonstrating the issue.

    if I run this code

    Code
    Canvas.RoundRect(LineData.x-79, Linedata.Y,Trunc(Par.TextAreaWidth / 1.965)+44,Linedata.Y+Par.Height,30,30);        Canvas.Brush.Style := bsClear;        Canvas.Font.Color := Darken(FSlideColor,64);        Canvas.Font.Name := 'Arial';        Canvas.TextOut(LineData.x,LineData.y+trunc(LineData.h / 1.25)+OffSet,'SLIDE ' + inttostr(Par.HotParID)+' : ');        iLeft := Trunc(Canvas.TextWidth(Par.Name)/2);        Canvas.TextOut(LineData.x+(LineData.w div 2)-iLeft,LineData.y+trunc(LineData.h / 1.25)+OffSet,Par.Name);

    And I do not change the canvas.font.size then it renders it once.

    [Blockierte Grafik: http://www.oilcreekoriginals.com/OverAwe/LinkedImages/One.PNG]
    http://www.oilcreekoriginals.com/OverAwe/LinkedImages/One.PNG

    if I run this code

    And I do change the canvas.font.size and restore it when done then it renders it twice, the second time just below.

    Interesting and possible important point: The second duplicate line of text if it is up close enough to the blue rectangle we draw, then it will appear behind it.

    [Blockierte Grafik: http://www.oilcreekoriginals.com/OverAwe/LinkedImages/Two.PNG]
    http://www.oilcreekoriginals.com/OverAwe/LinkedImages/Two.PNG

    Hi Julian,

    What I have setup:
    I have access to a single Paragraph called Par.
    Par is an empty paragraph and contains no text.

    Question 1:
    How do I go about setting up the font size for this paragraph?

    Question 2:
    How do I go about protecting the Par to make sure the user cannot alter it in anyway: Font size, Text, etc?

    Question 3:
    How does the font size on the canvas work when in the OnInternPaintPar.

    When using the canvas to draw in the OnInternPaintPar the default font size seems to be related to the font size of the paragraph. This is why I am trying to set the size of the paragraph in question 1.

    I noticed that if the text font around the empty paragraph is large the font of Canvas.Font.Size is large and if small then the font is small. However if I change the size of the font any text I render using TextOut gets drawn twice, once where I planned and one just below. What is the best way to control the text size here?

    I am on my way to figuring it out.

    I did not know that it was calling this per line and the multiple draws I made each time covered more than the area that just the line being drawn (since each draw started at the top of the paragraph) and this caused it to overwrite the text.

    I know I could draw just the outline and set the ParColorOverride to the color I want, but I need to have the rounded corners that the roundrect function provides.

    So its imperative that I am able to draw anything behind the text.

    Danke,
    Tim

    Update

    I check the value of "Stage" and only draw when its equal to wpBeforeLineText but it is still drawing in front of the text.

    Here is the code within the InternPaintPar Event

    Code
    if Stage = wpBeforeLineText then
          begin
            Canvas.Pen.Color := $4d4dec;
            Canvas.Brush.Color := $c2c2eb;
            Canvas.RoundRect(LineData.x,Linedata.Y,Trunc(Par.TextAreaWidth / 1.95),Par.Height,30,30);
          end;

    Guten Tag,
    I have been using the OnTextObjectPaint method to draw these nice looking rounded corner boxes that appear in the background with the text of the editor appearing on top of them.

    I would like to do the same thing with the OnInterPaintPar but anything I draw on the canvas appears in front of the editors text. Is there someway I can get item I draw on this canvas to appear behind the text? Either some variable to set or even re-working some code?

    Danke,
    Tim

    My workaround.

    In the code where I decrease the indent I did this

    Code
    OldIndent := Editor.CurrAttr.IndentLeft;
        Editor.CurrAttr.DecOutlineLevel;
        Editor.CurrAttr.DecIndent;
        if ((Editor.CurrAttr.IndentLeft = OldIndent) and (OldIndent = 720)) or
           ((Editor.CurrAttr.IndentLeft = 720) and (OldIndent = 0)) then
          begin
            Editor.CurrAttr.IndentLeft := 0;
            Editor.CurrAttr.IndentFirst := 0;
          end;

    720 is the indent where it is all the way to the left.

    Now even though when its there I had to check to make sure that if it was attempted to be decreased again that we didn't let it reset to a position where the text of the bullet was a tabs width indented to the right as in the second step of my first post.

    I don't know if this will help determine what I was doing wrong or help someone else out in the future but I hope so.

    I am using the code

    Code
    Editor.CurrAttr.IncIndent

    to indent a bulleted item. And this works great. However when I call

    Code
    Editor.CurrAttr.DecIndent

    The Numbered part moves back where it started but the content does not.

    Is there a more correct way to manipulate the indents than this way or is this a bug?


    Example ( _ = spaces )

    Before:

    Zitat

    1. Apple

    After Indent +:

    Zitat

    _____1. Apple

    After Indent -:

    Zitat

    1._____ Apple

    I am on my way to figuring this out. I have found the data member "Number" in the paragraph class. I am using it to set everything and it seems to be working for the majority of cases. I'll post back here if I do have any more questions on this topic.

    Thank you

    Hello Julian,
    I have a project that has a main WPRichText with bulleted and numberd (outline) text and There are three or more WPRichTexts beside the main one. I parse through the main one and at certain points I parse the text from the main RichText into the other three RichTexts. This is working great so far however I have found out that with the numbered text the numbering is done by an object on the RichText so when i break up this

    note: ------------------------- is where the parser would break it up

    1. apple
    2. pear
    ------------------------
    3. dog
    4. cat
    ------------------------
    5. cow

    it turns into this

    Parse 1:
    1. apple
    2. pear

    Parse 2:
    1. dog
    2. cat

    Parse 3:
    1. cow


    Is my understanding of how the numbering is done correct? And my main questions is: Is there a way to setwhat number the numbered text starts at so I can set it in the parsed richtexts as well as is there a simple way to get the number a certain numbered line is?
    as in the example 1,2,3,4, or 5.

    Thank you,
    TimK

    Hello again,
    I am working on a section of code a coworker had worked on and he was setting the page of the document to be viewed using the property pagenumber. However this does not move the scrollbar down to where the page is. How can I move the scroll bar down? I have tried to find a way to get the first par on the page so I could go the route of setting the CPPosition to par.position but I haven't found anything.

    Thank you.

    Hello Julian,
    I am drawing on the canvas of my wpRichText. I am drawing sound rounded rectangles and using TextOut to put some words within these boxes. I am setting the font size and I have to set it rather large to get it to look right on my monitor (on the computer). 50. But thats fine and doesn't hurt anything. But when I print the document out while my rectangles appear correctly my textout is huge. I have countered this issue with changing the font of the textout down to 8 just before I print.

    I was wondering if there was a simpler way to do this or even just an explanation of why it is this way.

    Thank you Julian,
    Timk

    Hi Julian,
    I did try using the params property but it has the side effect of having the data I put in there presented on the screen. I need this information to be hidden.

    So I instead tried to add another field to the TwpTextObj. It works great why the application is running as it maintains the information, however it does not save into the RFT. What functions would I need to alter to get the editor to read and write this extra field into the RTF data.

    Thank you.

    P.S. I would really like to solve this issues using the string field I added but if it is not possible then if there is a way to get the params property to not show that would suffice too.

    Hi Julian,

    Where would be the best place to store a string inside a TWPTextObj?

    I looked into TStrings "extras" but I could not get them to work.

    I was thinking I could put a string into the embedded string but I cannot get the string data back out.

    Is there a way?

    Thankyou
    Tim

    Hi,
    I am redefining the paint procedure in an extended WPRichTextLabel Component

    here is the code within the paint procedure

    I am drawing 4 versions of it in red offset to make a larger images of the text then placing a different color font right in the center of the other 4. This works great and looks nice however it doesn't scale the same as the text drawn in the original paint procedure.

    Thankyou