ScrollWnd Method

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:18

Description

Scroll the main window

Syntax

Main.ScrollWnd

Example

Call in UTILS.VB IN FRED4SYSTEMADDIN

  Public Shared Sub MouseWheel(ByVal App As IShellApp, ByVal Page As IPageDisp, ByVal Main As IMainDisp)

    Dim delta As Double = App.GetWheelDelta()

    If AddInUtils.IsControlKeyPressed Then

      Page.ViewZoomWheel(delta)

    ElseIf AddInUtils.IsShiftKeyPressed Then

      Page.ViewZoomImage(delta)

    Else

      Main.ScrollWnd()

    End If

  End Sub

End Class

Call in TXTDESIGNERADDIN.VB

  <ShellCommand(CanExecute:="Ena_TxtEdit")> _

  Public Sub MouseWheel()

    If AddInUtils.IsControlKeyPressed Then

      Dim Delta As Double = App.GetWheelDelta()

      If (Text.Type = eTxtDispType.Just) Then

        m_TxtJust = TedApp.ActiveTxtDispatcher

        m_TxtJust.ViewZoomWheel(Delta)

      End If

    Else

      Main.ScrollWnd()

    End If

  End Sub

Call in PAGETXTDESIGNER.VB

  <ShellCommand(CanExecute:="Ena_IsEditingText")> _

  Public Sub MouseWheel()

    Dim shell As IShellApp = DirectCast(Designer, IPageDesigner).App

    Dim page As IPageDisp = DirectCast(Designer, IPageDesigner).PageDisp

    Dim main As IMainDisp = DirectCast(DirectCast(shell, ILegacyShellApp).LegacyApp, IMainDisp)

    If (Designer.TxtSrc Is Nothing Or Designer.View Is Nothing) Then

      Utils.MouseWheel(shell, page, main)

    Else

      Designer.View.ScrollWnd(FredApp.AppBase.m_MouseWheelDelta)

    End If

  End Sub

Call In PAGEDESIGNERADDIN.VB

  <ShellCommand(CanExecute:="Ena_IsWindowActive")> _

   Public Sub MouseWheel()

    Dim delta As Double = m_App.GetWheelDelta()

    If AddInUtils.IsControlKeyPressed Then

      Page.ViewZoomWheel(delta)

    ElseIf AddInUtils.IsShiftKeyPressed Then

      Page.ViewZoomImage(delta)

    Else

      MainDisp.ScrollWnd()

    End If

  End Sub

Context

Main application common dispatcher commands