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

How to achieve hit testing on adornment added in hidden text plugin ?

Community Beginner ,
Apr 03, 2023 Apr 03, 2023

Copy link to clipboard

Copied

I want to get event on click on adornment added in hidden text frame . Please help out , how can i achieve this ?

 

May be we can achieve it by using "IBaseHandler" interface . But how to use this interface is not provided in sdk.  

TOPICS
How to , SDK

Views

248

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

correct answers 1 Correct answer

Guide , Apr 07, 2023 Apr 07, 2023

Mouse gestures such as click or drag are implemented by trackers.

 

Let's say your active tool is kPointerToolBoss, you're on top of a layout window's kLayoutWidgetBoss, then the tracker factory is queried with these parameters to produce a kPointerTrackerBoss.

The pointer tracker uses a bunch of draw events to perform a hit test, to narrow down the actually hit object following layout, spread, layer, page item, nested other page items. The temporary object used across this process is the kBaseVisi

...

Votes

Translate

Translate
Guide ,
Apr 07, 2023 Apr 07, 2023

Copy link to clipboard

Copied

Mouse gestures such as click or drag are implemented by trackers.

 

Let's say your active tool is kPointerToolBoss, you're on top of a layout window's kLayoutWidgetBoss, then the tracker factory is queried with these parameters to produce a kPointerTrackerBoss.

The pointer tracker uses a bunch of draw events to perform a hit test, to narrow down the actually hit object following layout, spread, layer, page item, nested other page items. The temporary object used across this process is the kBaseVisitorBoss, and on the way it creates appropriate handlers such as kSelectionHitTestHandlerBoss which implement IBaseHandler. Not really of your business.

 

When the pointer tracker has narrowed down on a particular page item, it uses the hit test suite (suite = considering the selection) to iterate the page item's adornment list and query a tracker. With luck (matching coordinates) this ends up in your adornment's QueryTracker. Therein you'd use the tracker factory to query for your very own tracker (a gesture object, event handler and temporary data) - which can basically do everything: open and track a popup menu like the OpenType adornment, perform dynamic resizing of the frame etc.

 

So you'd first implement a tracker: own boss and ITracker implementation, IEventHandler=kCTrackerEventHandlerImpl, plus your choice of I***TrackerData. Some recently added trackers unrelated to resize still use IResizeTrackerData, maybe take it as example.

Create a startup service to register the tracker at kSessionBoss / ITrackerFactory.

Tweak your IAdornmentHandleShape (appropriate bounds) so that its QueryTracker is reached.

As said above, create the tracker using the factory. If you have different trackers for text frame vs. image, you'd use the class of the selected page item as parameter.

Within the tracker's begin tracking, do your onClick thing, or turn it into a new gesture with dynamic redraw, drawing a sprite wireshape, scrolling, target highlights and so forth.

Votes

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
Community Beginner ,
Apr 07, 2023 Apr 07, 2023

Copy link to clipboard

Copied

is it available in any sample plugin ?

Votes

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
Guide ,
Apr 07, 2023 Apr 07, 2023

Copy link to clipboard

Copied

LATEST

I don't know. Just search the SDK yourself, with a good text editor.

Votes

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