Jump to content

Search the Community

Showing results for tags 'click'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. I have a situation that occurs on low-end Android devices. Short version: When the user double-taps a button, the event is being executed on the button that hasn't been created on the screen yet. What happens is, I have a list of frames created on my screen, which represent the product categories. When I tap on a category frame, the application destroys the category frames on the screen and creates a new set of product frames. The problem is, when my user double-taps very quickly on the category frame, the second click is executed on the product frame that hasn't even appeared on the screen yet. I'm using delphi 12.2 My code is something like this: procedure CreateCategory; var frm: TFrameCategory; category: TObjCategory; begin for category in listCategory do begin frm := TFrameCategory.Create(nil, category); frm.OnClick := OnClickCategory; rectangleFrames.AddObject(frm); end; end; procedure OnClickCategory(Sender: TObject); var frm: TFrameProduct; prod: TObjProduct; i: Integer; begin for i := rectangleFrames.ControlsCount - 1 downto 0 do begin rectangleFrames.Controls.DisposeOf; end; rectangleFrames.ControlCollection.Clear; for prod in listProduct do begin frm := TFrameProduct.Create(nil, prod); frm.OnClick := OnClickProduct; rectangleFrames.AddObject(frm); end; end So, the second tap is executed in OnClickProduct instead of being executed twice in OnClickCategory. How can I prevent this? i've alredy tryed a lot of things like calling this procedure on the OnClickCategory event but it doesn't seems ideal procedure disableRecTemp; begin rectangleFrames.Enabled:= False; TThread.CreateAnonymousThread(procedure begin Sleep(1500); TThread.Synchronize(nil, procedure begin rectangleFrames.Enabled := True; end); end).Start; end
×