Scroll and Zoom events

SyntaxEditor for WPF Forum

Posted 7 years ago by Xinen Lee
Avatar

Hi Actipro,

I am using intra text adornments to add edit boxes on top of the edit. When I scroll or zoom the editor, I want to remove the edit box. However I am unable to find a corresponding event for scrolling or zooming. Is there any? If not, would you be able to add it in please?

Comments (5)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Xinen,

Can you go into some more detail about what the edit boxes are for, how they get originally added, and why you want to remove them in those circumstances.  A link to a screenshot would be helpful too.  Thanks!


Actipro Software Support

Posted 7 years ago by Xinen Lee
Avatar

I have intra text adornments displaying certain values. When I click on each of them I have the edit box appear on top of the intra text adornment. I implemented the edit box in a popup within the intra text adornment's xaml. I want this popup to disappear upon scrolling/zooming, if not the popup will be left dangling there on top of my text. I need to put the popup's StaysOpen as true as I need some other specific behavior that I need to control. Hence I need to be able to know when there is a scroll/zom so that I can close the popup manually.

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Xinen,

The IEditorView.TextAreaLayout event fires any time a layout occurs, which could be due to scrolling, editor resizing, zooming, or just changes in the document that require a repaint.  You may just want to close your popup in response to that event firing since it would handle scrolling/zooming and more.


Actipro Software Support

Posted 7 years ago by Xinen Lee
Avatar

Hi

I tried that but it's not suitable for my case, as I need the edit box to remain even with repainting of other intra text adornments on the editor. I also could not differentiate if the TextAreaLayout event was due to scrolling/zooming from its event args. 

Hence I still need uniquely scrolling / zooming events to achieve more control over how my popup closes.

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Xinen,

You could track the view's FirstVisibleX and FirstVisiblePosition properties between the instantiation of the TextAreaLayout events.  And also track the SyntaxEditor.ZoomLevel between events.  If any of those properties change between the TextAreaLayout events, there was either a scroll or zoom that occurred.  That effectively would mimic any sort of scroll/zoom event.


Actipro Software Support

The latest build of this product (v24.1.1) was released 21 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.