acess scroll bar location

6 ビュー (過去 30 日間)
Nathan Bblanc
Nathan Bblanc 2021 年 4 月 11 日
回答済み: Nathan Bblanc 2021 年 4 月 12 日
Hello.
In a nutshell, I want to be able to access the current location of the scrollbar in a scrollable uipanel. I know that I can set it by using the "scroll" function but not sure how to "get" it. I also assume this can be done by adding a scroll callback function but i dont think this is possible in a panel. would be thankful for any assistance. details follow in the first comment
  1 件のコメント
Nathan Bblanc
Nathan Bblanc 2021 年 4 月 11 日
編集済み: Nathan Bblanc 2021 年 4 月 11 日
Details: I am working on an app with several panels, with a drag and drop functionality. For example, if you drag on the right side of this panel it should do this and that, if you drag in the left side of this panel you should do this, etc.
the problem is that one of the panels is scrollable, and the location of the mouse is known relatively to the screen or window, not the panel itself. so now if I drag into a location on the scrollable panel I get wrong coordinates. this could be solved by subtracting the location of the scrollbar from my calculation but I don't know how to access it.
Nathan

サインインしてコメントする。

採用された回答

Nathan Bblanc
Nathan Bblanc 2021 年 4 月 12 日
I found the answer :) each panel has a hidden property "ScrollableViewportLocation" that gives the location of the scrollbar

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by