Beiträge von Dakota

    Hello:

    I want to add a menu command where the user can select text with the mouse and then remove the formatting from it (both character attributes and paragraph styles). In particular, if the selection contains several paragraphs, I need to be able to either remove or change the parstyle that is assigned to them.

    I was thinking that if there was a .IsSelected property I could do something like this:

    Code
    {Clear text attributes}
      WPRichText1.SelectedTextAttr.ClearAttr(True, True);
    
      {Clear paragraph styles}
      par := WPRichText1.ActiveParagraph;
      while par.IsSelected do begin
        par.ABaseStyleName := '';   {or perhaps set it back to my default style}
        par.next;
      end;

    Is there some other way to do this?

    Thanks,

    Dale

    Hi:

    Is there a way to merge the settings from one TWPRTFProps component into another one?

    I don't want to share them.

    I need to keep the styles in my multiple TWPRichEdit's separate except when I need to do a merge. Then I need to combine them so that the bullets and other stuff is formatted correctly in the final merged document.

    I was going to look in the code to see if there maybe was an .Assign method that I could learn from, but I can't find it.

    Thanks,

    Dale

    As a follow up in case anyone else is interested in my solution. When using the code above, the merged RTF text would get merged correctly, however if the original merge template contained any bullets, they would be lost.

    I dropped an TWPRTFProps component on the main form, and then assigned it to each of the TWPRichTexts (TWPRichText.WPRTFPropsCompoent) in the application and that seemed to be the best solution.

    I think I've found the problem. The issue was with .FastAppendText and not with the actual merge itself. I called .FastAppendText to append each new merged paged to another document and that is where the bullets got stripped off.

    I used the solution below but I'm also going try sharing the RTFProps too, if I can figure out how to make that work.

    Hi:

    I've just upgraded to WPTool 7 and am now converting the memo in our database from plain text to RTF using TWPRichText. If I create text with bullets or numbered lists, and then merge them into a document, the lists are merged as just text (no bullets or numbers).

    Any ideas on how I can fix this?

    Thanks,

    Dale

    Hello:

    Can someone please try this quickly to see if this is really a bug? It will only take a minute or so.

    1. Create a new Delphi project. (I'm using Delphi 2006)

    2. Drop a TWPRichText on the form.

    3. Double-click the OnPaint event for the TWPRichText. (just put a comment in it so that Delphi does not remove it).

    4. Run the program and try to type in the TWPRichText.


    When I do this I get an EConvert exception 'TWPFont cannot be assigned to a TFont".


    Any ideas?

    Thanks,

    Dale

    Hi:

    I'm using a TDBWPRichText. I'm using the code below connected to a button to toggle bold text. When I change bold text this way and then post the changes, they do not stick.


    Code
    procedure TEditContactDlg.DoBold;
    begin
      if afsBold in DBWPRichText1.CurrAttr.Style then begin
        DBWPRichText1.CurrAttr.DeleteStyle([afsBold]);
      end else begin
        DBWPRichText1.CurrAttr.AddStyle([afsBold]);
      end;
      DBWPRichText1.SetFocusValues(True);
    end;


    It works fine if I actually enter a keystroke into the TDBWPRichText control, but if I only change the bold qualities it does not.

    Any ideas why, or how to make this happen?

    Thanks,
    Dale

    When I create a new document, how can I "force" the toolbar to connect to the memo and acknowledge the font at the cursor? I have tried setting the focus to the memo in the AfterTextLoaded event (I saw this suggestion somewhere else in the forum), but is does not help.

    If WPTools can't do this, are they any Windows "tricks" I can do..... maybe simulating a mouse click or keypress?

    I really need to get this addressed as it is generating support calls and lack of confidence in our product.

    Many Thanks,

    Dale

    In my code code to create a new document, I have wp.Clear. But when this happens, the entire TWPRichTextt control disappears.

    However, if I add a ShowMessage() right after it, it works just fine.

    like this....

    wp.Clear;
    ShowMessage('dazed and confused');

    Any idea what's going on? And how I can make the TWPRichText control not dissappear when I close it? (btw this code worked fine in v4)

    Thanks

    Dale

    Hello:

    I load a few RTFVariables into a dialog box for my users to edit, then store them back into the document, however, the contents of the last one 'Company' actually shows up on the 1st page of the document!

    Any Ideas?

    Dale

    A code snippet is below:

    Hello:

    Is there a way to display the line number relative to a page? I know that this was missing at one time, but was wondering if it has since been added.

    Also, What is the difference betwee CPLineNr and CPLineNrLog? They both seem to do the same thing to me.

    Thanks