Beiträge von JayM

    Delphi 5, WPTools v5.39.

    In our app, user can type or dictate text or copy text from other parts of app. Sometimes, the text is not indented properly or user wants to changed indentation. Thus user needs ability to selected certain lines (e.g., 10 lines in middle of a page) and increase or decrease INDENT for EACH LINE WITH SPACES (e.g., by 4 SPACES). Please note that I am NOT interested in indentation using paragraph indent.

    This (requested) functionality is EXACTLY like Dephi IDE where user can select a block of text and press Control-K-I to increase indent or Control-K-U to decrease indent (my IDE editor is set to 4 spaces).

    (If we indent with PARAGRAPH INDENT, indentation is lost when text is saved as plain text in DB field. Therefore, we need to indent each line with spaces).

    Related issue: I also need to limit length of each line to 72 char or less due to legacy storage and display reasons. Text is stored in DB as plain text with max line length limited to 72 char. When text is read back from DB, any line that was longer than 72 char creates ugly display because any characters after 72nd character appear as a "new" line with no indent.

    Obviously, when we add spaces to indent lines, some lines will become longer than desired width of 72 char. How do I handle issue?

    I have searched forums and did not find any solution. I am returning to WPTools after a few years so a clear reply with some example code is highly appreciated.
    Thank you in advance.

    JayM

    Solved with following in OnMouseDown:

    If there is a better way, please elaborate on that.

    Thanks

    JayM

    Delphi 5, WPTools 5.39, Windows XP

    I am using code similar to Demo project "HyperMenu" - this part works fine.

    Problem: Let us say Keyboard cursor is on first line of the first page in a 2 page document. User scrolls down using scroll bar and clicks on a Hyperlink on the second page. Hyperlink behaves as expected but suddently, WPTools edior moves to CPPosition on top of first page - which is totally confusing to user.

    I thought following will work: It does not
    -----------------------------------------------

    Following code is in: wp_NoteEditorMouseDown() ;


    ----------------------------------------------

    Above code moves keyboard cursor to same column as the hyperlink click location but to the first line of document. I need it on the same line where the Hyperlink is.


    Tried various ways but none works. I believe the reason is that on Hyperlink click, the ActiveParagraph is never set to the Hyperlink's paragraph.

    You can try what I am talking about using "HyperMenu" demo --> Add a Hyperlink to document, then add a large number of text lines. Put your keyboard cursor near the end of document. Now, scroll up and click on the Hyperlink.

    The keyboard cursor remains near the end of document - the page will change from first page to 2nd page assuming you added enough text to put your keyboard cursor (CPPosition) on the second page.

    We need something simple like: GetCPFromXY that we can use in MouseDown event. You have something like that in TextDynamic (I don't use it but found reference to such a function on searching forums).

    Until then, I really need a solution for this ASAP. As always, I greatly appreciate the top quality products you provide.

    Thanks

    JayM

    Delphi 5 , WPTools v - 5.23.3

    I have a user request to provide option of Font Size of 6 points in WP Toolbar. The Font Size combo in WP Toolbar offers "fixed" choices (i.e., we can ONLY choose from the included items in the TCombo but can not add new size (at least I don't know how to). The smallest size is 8 points (I can't read 6 point font but obviously some can!).

    Most modern font size selection combos allow user to either select a font size or type in a number.

    How do I (or better you) accomplish that. Though my immediate need is to have 6 point font size choice, in the long-run, others will want the flexibility of typing in any font size.

    Please help and be explicit as I use WP only for limited needs thus have limited knowledge of its nuts and bolts.

    Thanks

    JayM

    Hi,

    Using WPTools 5.20.8 (Yes, I do need to update).

    How do I find and select a sentence (the text between two periods/full stops) in code ? The simples would be a build-in function such as CPWord.

    1. In INTERACTIVE mode, a tripple click does the job. I am looking for a way to do the same in code. I need this to provide functionality to select (and process) and optionally, delete a whole sentence at a time with a click.

    2. What would be the best way to delete the SENTENCE on which user clicks on ?

    I looked through help and forums - but could not find an answer.

    Thank you

    JayM[/list]

    Delphi 5, Win XP Pro, WPT 5, version: 5.208

    I have a similar issue - Access Violation while user is editing text (primarily when deleting text) in WPRichText control. This is a simple text document - NOT using tables, bookmarks, URLs or any other fancy stuff.

    I have a "EurekaLog" exception log file which has logged many of these errors with detailed info. If YOU WISH, I will send that to you (Please tell me how to send file if you want the "EurekaLog" file which can be opened in Notepad / Wordpad).

    Similar to ehimmer's experience, these errors are difficult to reproduce though Eurekalog capture documents these AVs are happening.

    Most of these are happening while user is deleting text. In one particular instance, we had a number of AVs when user was deleting a few words in BULLETED TEXT THAT WAS INDENTED ONE LEVEL (user was deleting part of line, generally at end of line, [mostly] using BackSpace key).

    As a test, we removed bullets from that part of the template and the user has NOT encountered error in that template in last one week. May be this gives you some hint about where to look

    Occasionally, I have had an AV simply by selecting a few lines of text (in same para or accross paragraphs) and pressing Delete key.

    I have not heard of any AVs with Shift-Enter but our users are NOT using that key (they mostly work with templated text which just needs changing a few words here and there, thus the frequent delete operations).

    Thank you for looking into this issue.

    JayM

    Thanks for your prompt reply.

    "Next Release" -- is that WPT 6.x OR WPT 5.n.next ?

    Possible solution:
    If WP can detect a block deletion by user (as opposed to a character or word deletion), then it scan for bookmarks in the selected/about to be deleted text (something in an event like "BeforeDelete." Then, it is a simple matter to replace them. Provide a property: bmReplaceDeletedBookmarks: boolean; to control if WP wants to do this extra work of scanning for bookmarks and replacing them.

    Thanks again,

    JayM

    Hi,

    I am a registered user of WP 3x. I am thinking of upgrading to WP 5.x assuming it addresses my need noted below.

    Following is a key requirement for our current project:

    Each document will have HIDDEN *AND* PROTECTED Markers in the body so that paragraphs/text can be inserted at proper place in the document no matter in which order user inserts them. Idea is to build a structured document from smaller fragments of text that are supplied by user in no particular order (yes, there are weird people like that out there. )

    Normally, this is what we use bookmarks for.

    Here is the question: Can bookmarks be protected from deletion ?
    For example, let us say there is a bookmark on Line 4 and another one on line 6. User selects from Line 2 to 8 and deletes text.

    In the situation like above, we need to keep the bookmarks as user may want to insert NEW text fragments which MUST go at proper place marked by the above bookmarks. It is NOT important that they must be on line 4 and 6 (since that will change with text deletion); only that they continue to exist in proper order.

    I hope the answer is YES. If not, is there a simple work-around for this ?

    BTW - I did not find an upgrade price from WPT 3x to 5x. Where can I find this info ?

    Sincerely,

    JayM