Beiträge von pmanderson

    Hello.
    Delphi 2007.
    Please excuse my ignorance on this subject.

    These works perfectly fine:

    Code
    RTF.InputStringW(#947);   // gamma lower   RTF.InputStringW(#1043);  // gamma upper

    In the RTF file producing:
    \u947 ?
    \u1043 ?

    As expected and displayed nicely.

    However, these do nothing:

    Code
    RTF.InputStringW(#8805);  // greater than or equal
     RTF.InputStringW(#8804);  // less than or equal

    I expected to see the following in the RTF file.
    \u8805 ?
    \u8804 ?

    But there is nothing.

    Using SymbolDialogEx does in fact produce the correct results after selecting the characters.

    Can someone enlighten me?

    Regards.

    Hello
    Please excuse my ignorance on this topic. Does WPTools6 have a mode to automatically manage the handling of inverted quotes used in German text, much like MSWord, like so:

    „Guten Tag!“

    Currently, despite the keyboard mode, English quotes are displayed "Guten Tag!". Users have to use ALT code to do so.

    Thank you!

    Hello
    The version is 6.29.

    I am unsuccessful loading a stream of a one line paragraph with tab stops at the top of my document.

    The code below works perfectly fine as long as the TemplateRTFString below contains more than one line of text; The template is placed at the top of the current document along with the templates tab stops.

    However, if TemplateRTFString only contains one line of text (one paragraph \par at the end), the template placed at the top of the current document is without its original tab stops, instead its assuming the tab stops of the current document.

    Code
    CPPosition := 0;	InputString(#13);	CPPosition := 0;	s := TStringStream.Create (TemplateRTFString);  	myCustRtfEdit.LoadFromStream( s, 'RTF' );

    The resulting output would look like this:

    Code
    \pard\plain\wpparid0\plain\f1\fs24\cf0\tab A one line, one paragraph template\par\plain\f0\fs22\cf0 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \par


    If the template contained more than one line, the resulting output would look similar to this, correctly with the tab stops:

    Code
    \pard\plain\tx2895\plain\f1\fs24\cf0\tab A two line, two paragraph template\par\tx2895\plain\f1\fs24\cf0 This is the second template line and paragraph\par\pard\plain\f0\fs22\cf0 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \par

    Would I am trying to achieve with 1 line, 1 paragraph templates would look similar to this containing the tab stop information on the 1st line:

    Code
    \pard\plain\tx2895\plain\f1\fs24\cf0\tab A one line, one paragraph template\par\pard\plain\f0\fs22\cf0 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \par


    I have tried variations of LoadFromString and LoadFromStream, for example:

    Code
    CPPosition := 0;
    	s := TStringStream.Create (Template.MemoLines.Text);
    
    	Memo.LoadFromStream ( s,      // the stream
    						  true,   // insert the text, don't clear existing text
    						  'RTF',
    						  true    // don't split par
    						  );



    The result worked in regards to the tab stops carrying over to the current document
    but an extra empty paragragraph is left at the top of the current document.

    Can you provide assistance?

    Also, I am very near complete with the migration from v3 to v6 and am extremely happy with the results. The formatting and printouts of the documents, especially with tables, borders indents, tabs is working much better than the older version. Thank you.

    Hello
    The version is 6.29.

    When the RTF contains \caps, eg.
    \wpparflg32\plain\f1\fs24\b\caps1 section 1\f1\b0 : \f1\caps0 \par

    It paints the paragraph in CAPS. However when I save as 'ANSI' it saves it in its original case 'section 1'.

    I wanted to know if there was a way to load RTF and save RTF with the caps transform applied. Or apply the caps when saving to ANSI.

    I am currently working around it like this:

    When loading RTF that contains:
    \wpparflg32\plain\fs24\b\caps1 this line was typed in lowercase

    when its displayed in an editor its in upper case as expected.
    'THIS LINE WAS TYPED IN LOWERCASE'

    I would like to save the RTF file with the case rendered as it was displayed like this:
    \wpparflg32\plain\fs24\b\ THIS LINE WAS TYPED IN LOWERCASE

    Is this already an option available in formatstrings? I've been unsuccessful with what is documented.

    Regards,

    To add more to the original post:

    I'm are upgrading WPTools v3 to v6.x.

    v3 worked fine since (according to another post) it simply converted the lists to text and ignored the styles).

    In v6 I have to explicitly use '-NoNumStyles' when loading.

    This appears to emulate the behavior in the older version.

    I've noticed when creating simple outline styles in word, WPTools v6 appears to load and handle them fine in regards to the outline level.

    If the oultline style is produced by a 3rd party template component, WPTools v6 misreads it and the outline level is off by 1.

    When loading a RTF file created by Word 2007. The outline level on a one level list is on the second level when opened in WPTools v.6.29 or the WPTools mini demo.

    For example: When the file is opened in MSWord 2007

    Paragraph text

    1. List item one
    2. List item two
    3. List item three


    When the file is opened in WPTools v6.29 or the WPTools mini demo it looks like this:

    Paragraph text

    a. List item one
    b. List item two
    c. List item three


    If I save the file in the WPTools demo and later re-open it it Word, the list is lettered, not numbered and MSWord reports the list level for each item is on the second level where it was originally on the first.


    The list that was originally created in word, it not the default list style.
    Creating a document using the default list style appears to work fine in WPTools.

    Can you please offer a suggestion?

    Regards,

    Hello, I've researched this issue and appears that the change mentioned in the following post may have something to do with the CPWord issue during AfterCompleteWordEvent.


    Once I commented out the following line from WPCTRMemo.pas function TWPCustomRtfEdit.GetCPWord, CPWord is now working as expected... CPWord is blank after the second delimiter when in AfterCompleteWordEvent.

    Code
    if active_paragraph = nil then exit;
          pc := active_posinpar;
    
    
    //    fix CPWord issue in AfterCompleteWordEvents
    //    if FInAfterCompleteWordEvent then dec(pc);

    However, I was unable to see how commenting this line out would negatively impact other aspects of the component.

    AfterWordComplete event is being used for the obvious reasons. I wanted to share some unexpected behavior relating to CPWord.

    Comparing the the behavior in version 3, after you complete a word using [space], [periods], ?'s etc, CPWord would reflect the previously completed word, for example typing:

    Apple.

    editor.CPWord = 'Apple'

    Adding an additional period after the first period like so:

    Apple..

    editor.CPWord equals nothing.

    However in v6.29, typing the second period after the first period leaves CPWord = 'Apple'
    A third period CPWord equals nothing as expected.

    Is this expected behavior?

    Regards,

    Hello. I am currently converting an app using WPTools v3 to v6 and the conversion is going nicely.

    We previously used visible bookmarks to mark places in the document editor. The user could hotkey from bookmark to bookmark, entering text next to the bookmark. Bookmarks typically remained in the document but only visible while editing.The new text typed adjacent the the bookmarks would be normal text leaving the bookmark as it was.

    The bookmarks could be deleted (with backspace), But only inserted via menu command.
    The bookmarks contain one visible character ‘^’ and are surrounded with the usual bkmkstart\bkmkend tags in the file.

    However, in the new WPTools v6 We’re having difficulty keeping new text from writing inside the start\end tags. The contents of the bookmarks ‘^’ expand with the new text.
    We want the Bookmarks ‘^’ to be deleted like any other character. But don’t want thee bookmark text expanded when new normal text is typed adjacent to them.

    Our previous methods worked well in this regard but the changes have made it difficult to refactor.

    Can you provide any guidance?

    Here is how we achieved this behavior in WPTools 3.

    Code
    procedure TRTFEditor.OnKeyPressEvent(Sender: TObject; var Key: char);
    begin
        if afsBookmark in CurrAttr.Style then // prevent bookmark attribute from continuing beyond bookmark
        begin
          BeginUpdate;
          CurrAttr.DeleteStyle([afsBookmark]);
          EndUpdate;
        end;
    end;


    Regards,