Recent

Author Topic: [SOLVED] TSynCompletion: invoke autocomplete popup programmatically?  (Read 2396 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Hi,

Looking at lazsqlx code. That code uses a Windows specific unit in a OnKeyPress handler to rewrite various key combinations to Ctrl-Space.
http://forum.lazarus.freepascal.org/index.php/topic,22041.msg160592.html#msg160592

Net result: instead of just Ctrl-Space, more keyboard shortcuts invoke autocomplete.

I'm looking into removing this dependency and wondering whether it is possible to directly invoke the autocomplete popup. Looking at the tsyncompletion code in trunk there doesn't seem to be a way... but I'm well known for missing things.

Any suggestions?

Thanks!
« Last Edit: October 23, 2014, 03:08:55 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9912
  • Debugger - SynEdit - and more
    • wiki
Re: TSynCompletion: invoke autocomplete popup programmatically?
« Reply #1 on: October 23, 2014, 02:42:20 pm »
Code: [Select]
SynEdit.CommandProcessor(TheSynCompletion.ExecCommandID, '', nil)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TSynCompletion: invoke autocomplete popup programmatically?
« Reply #2 on: October 23, 2014, 03:08:44 pm »
Thank you Martin, that works perfectly!

Edit: updated synedit wiki article with your snippet...
« Last Edit: October 23, 2014, 03:33:11 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018