Richedit.Add()

ksihotaksihota Victoria, BC Canada
edited 12:49AM in FastReport 4.0
When I add text to a richedit of a TfrxRichview component using richedit.Add(some text) it is added as plain text. I can add RTF text if it has come from a Richtext component (a datafield)and it will be formatted.
What defines the initial formatting of the plain text that is displayed? I have seen this added text displayed in different sizes and different styles.
Are the Richedit properties in the TfrxRichview the same a the richedit properties in delphi? If not where can I find info on the properties?

Comments

  • ksihotaksihota Victoria, BC Canada
    edited February 2013
    ksihota wrote: »
    When I add text to a richedit of a TfrxRichview component using richedit.Add(some text) it is added as plain text. I can add RTF text if it has come from a Richtext component (a datafield)and it will be formatted.
    What defines the initial formatting of the plain text that is displayed? I have seen this added text displayed in different sizes and different styles.
    Are the Richedit properties in the TfrxRichview the same a the richedit properties in delphi? If not where can I find info on the properties?
    Found that I can define the font size etc. by setting this for the edit i am using to type into. The first time I did this it didn't work but i think that was due to another delphi error that has now been fixed.
    I would like to know where I can find the richedit properties I can use in the script directly.

    Correction______
    The font settings are the ones already set in the Richedit portion of the TfrxRichview. This information is lost when you do a richedit.lines.clear before you add new lines using richedit.lines.add()
    Is it possible to manipulate the richedit controls through code or do I have to use the editor interface?
  • ksihotaksihota Victoria, BC Canada
    edited 12:49AM
    austingrd wrote: »
    Hi ksihota, I would also recommend to create a support ticket on this. This issue might need to be duplicated.

    I don't think there is an issue with the richedit. I believe it is working as designed. The issue I had was actually a Delphi 2009 Win7 problem that required a fix.
    Since I applied the fix the other issue (the edit not displaying the selected font) disappeared. This may have just been a side effect as the real problem was the application not shutting down and an error being thrown...Assertion failure: "(!SetThreadContext failed")"

    My only issue now is trying to get the richedit to do what I want. If there is no way to add rtf formatted text in code, I may have to look at another approach.
    I just can't seem to find any answer as to where the richedit properties used in the TfrxRichview are published, although this may not help me at all since every post I have read seems to indicate that you cannot control the text.
  • gpigpi
    edited 12:49AM
    wrote:
    If there is no way to add rtf formatted text in code
    Try to use TfrxRichView.Richedit.Lines.LoadFromStream

Leave a Comment