Recent

Author Topic: [SOLVED] Timer - Blinking Menu Text Issue  (Read 960 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1260
[SOLVED] Timer - Blinking Menu Text Issue
« on: December 04, 2019, 12:34:11 am »
I have 1 timer set to "100" interval

All the code handles enabling/disabling buttons and menus based on text in the SynEdit text editor
Most all button/menus handle file saving, cut, copy, past etc

Does anyone know why the menus blink every time the timer fires off?
« Last Edit: December 04, 2019, 01:34:15 am by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

jamie

  • Hero Member
  • *****
  • Posts: 6128
Re: Timer - Blinking Menu Text Issue
« Reply #1 on: December 04, 2019, 12:45:50 am »
Not sure but my guess is you are doing something to force a redraw every 100ms …

is that really needed ?
The only true wisdom is knowing you know nothing

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: Timer - Blinking Menu Text Issue
« Reply #2 on: December 04, 2019, 12:59:08 am »
Well probably you change the state in every OnTimer. That is you set it to the opposite, and then back to what it was.

Off course there is a small chance, that there is an lcl bug, where setting a disabled menu to disabled, will force a redraw....

But why a timer at all?

For copy/paste synedit supports TAction.

But also SynEdit has events, that you can use, and in which you can make the change.
Or if you do not want to make it while the user types, then in the event fire a timer (and reset / re-fire in each further event).

SynEdit.OnStatusChange can tell you when selection is made/lost

SynEdit.OnChange  and the ChangeStamp or Modified flag are good for enabling Save.

----------
All else: Show the code in the timer. And mention OS.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: Timer - Blinking Menu Text Issue
« Reply #3 on: December 04, 2019, 01:33:57 am »
Well.... it shouldn't be doing it at all.

Anyways... I had to move all my events to other events.

Its a little more complex, but, it did stop it.

Thanks
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

 

TinyPortal © 2005-2018