• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Cursor coordinates in a treeview with a scrollbar

New Here ,
Jan 12, 2018 Jan 12, 2018

Copy link to clipboard

Copied

Greetings good Sir,

I am trying to select an item just by hovering over one in a treeview. In order to do so, I create an addEventListener associated to the treeview and recover the cursor position using the clientX / clientY values.

Please find below an example but with a click event instead (to simplify the code):

     Palette.Treeview.size = [200, 100];

     myOnClick = function(p)

    {

        alert(p.clientY);

    };

    Palette.Treeview.addEventListener('click', myOnClick); 

The problem: clientY gives the position of the cursor relative to the position of the treeview within the window and so, does not take into account the scrolling.

Adobe's Javascript Tool Guide and "Script UI for dummies" make it seems like the scrollbar is inaccessible inside a treeview. True enough, I was unable to add a scrollbar to a treeview.

So here come my questions:

Can the cursor position within the "virtual" treeview space be obtained?

Otherwise, is there a way to obtain the scrolling value of scrollbars naturally occurring in treeviews?

TOPICS
Scripting

Views

231

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation