Beiträge von wpsupport

    The width of the text cursor changes to full character width if in overwrite mode, otherwise it uses the width assigned to the global variable WPMINCursorWidth which defaults to 1.

    The blinking is controlled by WPRichText.Caret.blink

    Die Auflösung des Canvas ändert sich nicht zwangsläufig trotz der Übergabe an StartWatermark, je nach CanvasReferenz.

    Ich empfehle die Graphic aber hiermit einzubetten

    function DrawGraphicFile(x, y, w, h: Integer; const FileName: string): Integer;


    Hier könnte man aber auch auf die Wasserzeichenfunktion verzichten, da der Rückgabe wert der Funktion auch in mehrfachen Aufrufen von

    function DrawBitmapClone(x, y, w, h: Integer; LastBitmapID: Integer): Integer;

    verwenden kann, ohne dass dabei Daten dupliziert werden.

    Zitat

    One last thing for future consideration in your dialogs...

    As I've mention in the past, it would be nice if you allow the programmer to decide where the dialog should show up. Currently it always shows up in the top left corner, which is not nice on a 4K 40" monitor when my app is a relatively small form in the middle of the monitor. Like the old baseball reference "out in left field" in the literal sense. ;)

    There are a few dialogs which are non-modal. They are supposed to stay at their last position. This is why they don't use auto - screen center.

    You can easily modify their position (and other things) before they are showed by using the event OnShowDialog:

    Code
    procedure TForm.WPSearchReplaceDlg1ShowDialog(Sender: TObject);
    begin
       with Sender as TForm do
       begin
         Left := (Screen.Width-Width) div 2;
         Top := (Screen.Height-Height) div 2;
       end;
    end;
    Zitat

    What is happening is that it works up until it finds a match, i.e. loops loading each WPRichText out of the database just fine. Once it finds a WPRichText with a match, it highlights it, but clicking on find next just displays its own "text not found" msg even if there are more matches in the current WPRichText and does not invoke the OnSearchReplaceMessage event in order for me to move on to the next WPRichText.

    I assume the focus changes during loading and the OnSearchReplaceMessage is checked for a different TWPRichText (which does not have one). So this is very specific to your program. Using breakpoints it is usually quick to find the problem. You should assign the SearchReplaceMessage() to all instances.

    I don't think it has to do with WPTools V5 vs V9 - there is an event interfering if the find dialog looses focus.

    The active WPRichText is provided by the global function

    function ActiveRTFEdit(p: TWPCustomRtfEdit): TWPCustomRtfEdit;

    which checks the global variable WPLastActiveRTFEdit if p is nil.

    WPLastActiveRTFEdit is set procedure TWPCustomRtfEdit.GetFocus;

    So if I would have a focus problem in a project I would place a break point in procedure TWPCustomRtfEdit.GetFocus and check when it is called while the search goes on.

    I don't understand why you not build your own Search and Replace dialog which works for your project as you need. My dialogs are more for a Word style program, not for one which works on multiple records.


    Use WPRichText.OpenDialog( wpdiaFind, '@SELECTED@' )

    or

    Use WPRichText.OpenDialog( wpdiaReplace, '@SELECTED@')

    to start the search and replace dialog with the selected text if you do not use the standard actions.

    The WPTools dialogs use functions FindTextMethod and ReplaceTextMethod which can be also called by custom made search&replace dialogs for more control.

    Zitat

    I did use Finder in WPT5 and it worked well. For WPT9 I even tried setting focus in code on the newly loaded WPRichText, but had the issue I mentioned in my previous post where I had to manually focus the WPRichText to get it to find next.

    I don't understand. If you use the Finder the focus does not matter at all. It works on the TWPRichText which is the parent of the Finder object.

    WPTools 9.1 includes a new find dialog which also supports style replacement and can assign attributes.

    WPTools 5, which was last serviced on 14.12.2010 used the old standard dialogs.

    But the old handling is still there, see $DEFINE STANDARD_FINDDIALOG in WPCtrRich.pas and will be used if you do not use the new component on your form.

    For custom find operation as outlined above you need to use the "Finder", i.e. you want to loop through multiple database records. The standard dialog cannot do that for you since database navigation is required.

    It has a next function which locates text.

    If you replace text in a TDBWPRichText make sure to call Changing before you do so, because the database must be in edit mode.

    The not modal dialogs are ment to work with the active TWPRichText - that's the last editor which receives the focus by mouse click or a call to SetFocus.

    a) linked images are blocked because of data protection considerations. It is possible to click the link though.

    b) the code I suggested to modified was the following. I introduced wpUseAttributeEvenIfSingleParagraph for future versions.

    if wpUseAttributeEvenIfSingleParagraph in Options then

    LoadFromStream(mem, 'WPTOOLS', TRUE)

    else LoadFromStream(mem, 'WPTOOLS-overwriteparattr', TRUE);

    c) You can use

    LoadFromString( src.AsANSIString('WPTOOLS'), 'WPTOOLS,-nodefaultfont', false )

    instead of SelectionAsString to avoid conversion to unicode strings.