#1070 Autocomplete tooltip, and/or Autocomplete "selection" change notification, and get autocomplete list coordinates

Completed
open
5
2014-09-01
2014-08-28
Iain Clarke
No

My application has many similarities to the code editor in many programming IDE's. As you type a function name, the autocomplete listbox is filled up with all the function beginning with (eg) "p". Not rocket science, and made very easy with Scintilla.

What I would like to do it to add a tooltip next to the autocomplete listbox. I would love a SCN_AUTOCGETTOOLTIP notification, and this would get handled automatically, but I'm not that lazy if that would be getting into host application territory, rather than core Scintilla activity.

Alternative, a SCN_AUTOCSELCHANGING notification when the selection changes would help. There's a very handy AutoCompleteMove function already in place, where the notification can be initiated.

I would also need some SCI_AUTOCGETRECT equivalents passing in a rectangle structure to be filled in with the autocomplete listbox bounding coordinates, and which item is currently selected.

I could write all this myself for MS Windows, but I'd be less sure for other OS's unfortunately.

As a last resort, some way of getting the window handle of the listbox would also work. I could hook the window messages myself too, but that would be less nice for others.

Thoughts?

Iain.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2014-08-31
    • labels: --> scintilla, autocomplete
    • assigned_to: Neil Hodgson
     
  • Iain Clarke

    Iain Clarke - 2014-08-31

    I'll have to make sure I subscribe to that mailing lest too then. Duplicate requests must get annoying.

    I have some sympathy for your points against in those conversations. I've actually got something working in my application now, but it's VERY hacky, with hooks monitoring window creation, and all sorts. And fragile - it will break if Scintilla makes changes in how it shows the autocomplete.

    At the moment, you have a notification of autocomplete success / cancel. Surely it's platform independent to add one called from AutoCompleteMove? That's not platform dependent.

    Even better woould be a "SCN_AUTOCOMPLETESTARTING" with the listbox window handle as a parameter. That would be platform dependent, but barely. I know MS windows and X Windows have the window handle concept. I'd be shocked if it's not universal.

    Displaying a tooltip is a good thing to be in the application domain. But it's rather hard without knowledge internal to scintilla, like which item is active, and where it is.

    Iain.

     
    • Neil Hodgson

      Neil Hodgson - 2014-09-01

      AutoCompleteMove is not called when the user clicks on an item in the list box or in several other cases.

      Toolkits built over X try to hide any use of X handles, partly because they also attempt to avoid platform dependence.

      I'm not against a good portable implementation of a selection changed notification but there would be quite a bit of work ensuring that any design is viable on all 4 core platforms.

       
  • Iain Clarke

    Iain Clarke - 2014-09-01

    Fair enough - looks like I'll have to stick with my ugly win32 CBT hook hack.

    I suppose the good news is that if the internal autocomplete details change, my code won't crash, it will just silently stop working.

    Thanks, Iain.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks