Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Event ZoomChanged #253

Closed
AndreySakun opened this issue Jun 17, 2016 · 2 comments
Closed

Event ZoomChanged #253

AndreySakun opened this issue Jun 17, 2016 · 2 comments

Comments

@AndreySakun
Copy link

In my application I show line numbers. But ScintillaNet allows to change zoom with Ctrl+scroll. After this a part of line number could be hidden. With ScintillaNet 2.x I can receive ZoomFactorChanged event, calculate new margin width and update it. With ScintillaNet 3.x I do not have this possibility.

Is it possible to add additional event ZoomChanged like in previous version 2.x?

@AndreySakun
Copy link
Author

This is no longer necessary. I found a solution:

private void init()
{
    ...
    scintilla.MouseWheel += new MouseEventHandler(scintilla_MouseWheel);
    ...
}
private void scintilla_MouseWheel(object sender, MouseEventArgs e)
{
    if (_ctrlPushed)
         updateMarginForNumbers();
}
private void scintilla_KeyDown(object sender, KeyEventArgs e)
{
    if (e.Control == true)
        _ctrlPushed = true;
}
private void scintilla_KeyUp(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Control)
        _ctrlPushed = false;
}

@jacobslusser
Copy link
Owner

Glad you got something worked out. For good measure I also added the ZoomChanged event.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants