[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Supress TextEditor Change event


Le 10/09/2024 à 03:36, Bruce Steers a écrit :


On Mon, 9 Sept 2024 at 18:07, Bruce Steers <bsteers4@xxxxxxxxx <mailto:bsteers4@xxxxxxxxx>> wrote:

    On Mon, 9 Sept 2024 at 17:42, Bruce Steers <bsteers4@xxxxxxxxx
    <mailto:bsteers4@xxxxxxxxx>> wrote:

        I have the following code..

        I'm currently working around it by using my own lock variable so
        i set like this.
        $bFreezeEditor = True
        SetProp(TextEditor1, "Text", sText)  ' SetProp Locks object,
        sets prop, then unlocks
        Wait  ' let that timer trigger
        $bFreezeEditor = True  ' OOPS

    of course i meant False in that last line :-\
    BruceS


I've now fixed it by saving this as TextEditor.class in my .src

' Gambas class file

Export

Public Sub _RaiseChange()

   If Object.IsLocked(Me) Then Return
   Super._RaiseChange

End

Now it does not trigger Change event if locked

Respects


Yes, it's because 'Change' event is postponed, to avoid raising it for each single change.

Regards,


--
Benoît Minisini.


Follow-Ups:
Re: Supress TextEditor Change eventBruce Steers <bsteers4@xxxxxxxxx>
References:
Supress TextEditor Change eventBruce Steers <bsteers4@xxxxxxxxx>
Re: Supress TextEditor Change eventBruce Steers <bsteers4@xxxxxxxxx>
Re: Supress TextEditor Change eventBruce Steers <bsteers4@xxxxxxxxx>