Beiträge von aolson

    I have a toolbar w/ 4 buttons on it - left/center/right/block justification.

    The following code works for the first three buttons, but the final button for "full" justification does nothing. My question is why?

    Alternatively, is there any other built-in way to take a line of text and format it with 'equal spacing between words' so that it fills the page margins?

    case _Tag of
    0:
    WPRichTExt1.CurrAttr.Alignment := paralLeft;
    1:
    WPRichTExt1.CurrAttr.Alignment := paralCenter;
    2:
    WPRichTExt1.CurrAttr.Alignment := paralRight;
    3:
    WPRichText1.CurrAttr.Alignment := paralBlock;
    end;

    Thanks,

    alan

    I have a toolbar w/ 4 buttons on it - left/center/right/block justification.

    The following code works for the first three buttons, but the final button for "full" justification does nothing. My question is why?

    case _Tag of
    0:
    WPRichTExt1.CurrAttr.Alignment := paralLeft;
    1:
    WPRichTExt1.CurrAttr.Alignment := paralCenter;
    2:
    WPRichTExt1.CurrAttr.Alignment := paralRight;
    3:
    WPRichText1.CurrAttr.Alignment := paralBlock;
    end;

    Thanks,

    alan

    I would like to add a feature where the user can select a menu item and WPTools selects a given # of words automatically from the start of the current line/paragraph.

    Are there any built-in functions to traverse x # of words? Or better yet - to select x # of words?

    Any help appreciated.

    Alan

    I have code written for a simple text editor, specifically for creating small documents. By small, i mean page sizes of less than 2" square.

    One thing i wanted to do was to export these documents as either JPGs or PDF documents. I found the PaintPageToCanvas method which makes this process very easy.

    There is only one issue i've found with this method. One of the options i've given my users is to have a tab stop with leader dots. This result in text like this

    text here..................text at right margin

    In the actual editor itself this works as expected. But when i use PaintPageToCanvas i get something like this:

    text here ............ text at right margin

    i'm not sure if this will format properly on the forum, but there are distinct whitespage 'gaps' before and after the dot fill, unlike in the editor.

    What can i do to fix/work around this issue?

    Thanks,

    Alan

    Right now, i have WPTools v5 set up to use the splayExtendedPageGap layout so that my users can see how many 'lines' they've entered and get a 'feel' for the approximate size of the text they've entered.

    We're not using 'standard' page sizes in this application, its moreso a tool to enter small snippets of text.

    Is there any built in method or function call which will return to me the height of the text that's been entered? Ideally this would return the 'entered page height' in pixels/points/twips whatever, and allow me to have a dynamic page height?

    If not, what would be the easiest way to calculate this?

    thanks,

    alan

    I've written some code to load a custom XML format into a TWPRichText editor. this code is working well, with one exception.

    Prior to loading any text, i call the ClearBody method to clear out the TWPRichText control.

    I then have a loop which adds paragraphs via the FastAddText() method. This works, but for some reason each time i load the text, i get a blank line as the first line in the control. What could possibly be causing this? Is there a better method to clear out the TWPRichText?

    alan

    Is there an easy way, similar to CurrAttr or TextCursor, to access the TFont for the current paragraph or CP/position?

    or perhaps there could be an event that is fired when the currnt font is about to change?

    Alan

    How best would i implement full/block justification of a single line of text? If i select it and set the alignment to paralBlock, it doesn't change. if the line flows to a 2nd line, the first line gets justified properly.

    but, for example, if i have a single line that doens't fill the page width, i still want to fully block justify it. how can I do this?

    Alan

    I'm not sure if this is a common question or not.

    The application i'm writing involves me doing a markup-conversion on a line by line basis. I have alot of this implemented, and now i'm implementing the custom bold markup.

    What i'm having trouble with is the code to test the current line to see if any characters/words are bolded. What is the best way to do this ?

    Currently, my code has this main loop when doing my markup conversion:

    for _line := 1 to WPRichText1.Lines.Count do

    This allows me to loop through each line. Now, for each line, i need to determine if it has any bold characters/words. What is the best way to do this?

    Alan

    Hi Julian -

    Thanks for the reply, but are you saying this is not possible w/ WPTools 5? Or, it would require a bit of coding on my end?

    Will this be a part of WPTools6? And if so, is there any forecasted timeframe as to when WPTools 6 will arrive?

    Let me know.

    Thanks!

    alan

    I did a search in the help, and i see you can set the horizontal font scaling using the SetCanvasAttr method, and the field in the TWPPaintExtraParams parameter. Is there any demo that utilizes this? I'd like to see how it can be actually implemented.

    Thanks,

    Alan

    Hi all -

    I asked this question a month or two ago, then quickly got pulled away to a new project. I'm sure you've all had similar experiences.

    What i need to figure out how to do is to take a document (small) entered into WPTools with justification, markup, etc - and save it to a very custom XML document format. The XML format is line based, and its pretty easy to read and parse..but my question is how best to do this. I know WPTools supports custom IO reading/writing, but would it be just as easy to parse the XML myself and build the document via code?

    I'm looking for input here. If you think the custom IO routines would be best, I would LOVE to see a very simple sample as to how to do this.

    Any help appeciated.

    thanks!

    Alan

    Just out of curiosity, do you have any plans to support the generation of user-defined/custom document formats? Lets say Company X has a specific XML format for documents. Do you foresee any possibility that hooks into your file saving routines could be made so we could essentially write code to support these formats?

    Thanks,

    Alan

    After my program generates a report, the WPRichText component shows the last page of the report. How can i easily set the component to go to the top of page 1 after generating the report? Setting CPPage or PageNumber to 1 doesn't do this.

    I'm using TWPRichText from WPTools v5.19 in Delphi 7.

    Alan