Hook for "Go to Page" on Multi-Monitor Setup

GoToPageShowPageHook is a custom hook created to display pages on a specified monitor when the Go To Page operation is performed. It calls its own ShowPage2 by specifying the index number of the monitor to display pages on when Go To Page operation is performed.

Procedure

Create a module within your application and name it as GoToPageShowPageHook.

When declaring this module in AppRoot.SRC, do not add it to any class. The declaration should immediately follow the list of constant declarations:

GoToPageShowPageHook Module "GoToPageShowPageHook.SRC";

The module takes below 4 parameters: PageName, Popup, PageParms, DisplayRoot.

  • PageName - Required. Name of page to be displayed.

  • Popup - Optional Boolean. If TRUE, it requests the page be opened as a pop-up if allowed. Defaults to FALSE.

  • PageParms - Optional. Array of parameters for the Page.

  • DisplayRoot - Optional. Represents the display device instance.

The module must have a return value. Return TRUE if the standard ShowPage2 needs to be called without specifying any DisplayIndex value(means it displays the page on the current display instance or monitor which performs the Go To Page operation). Return FALSE to suppress the standard ShowPage2 call and to make your own ShowPage2 call by specifying DisplayIndex value to display page on specific monitor in a multi-monitor setup.

Examples

  1. A hook to always display page on 3rd monitor when Go To Page operation is performed from any monitor in a multi-monitor setup:

( 

  PageName                 { Name of page to be displayed      }; 

  Popup                        { True, to open page as a popup      }; 

  PageParms                 { Array of parameters for the Page }; 

  DisplayRoot               { Display device instance               }; 

) 

Main [ 

  If 1; 

  [ 

     { Displaying on 3rd monitor by specifying ShowPage2's DisplayIndex paramater value as 3} 

    \DisplayManager.ShowPage2(PageName, Popup, PageParms, DisplayRoot, FALSE, 3) ; 

    Return(FALSE); 

  ] 

]  
  1. A hook to display page on 3rd monitor only if Go To Page operation is performed from 1st monitor. In all the other cases, it will just return TRUE so that the standard ShowPage2 call will be executed thereby displaying page on the respective monitor on which Go To Page operation is performed in a multi monitor setup.

( 

  PageName                 { Name of page to be displayed      }; 

  Popup                        { True, to open page as a popup      }; 

  PageParms                 { Array of parameters for the Page }; 

  DisplayRoot               { Display device instance               }; 

) 

[ 

  Index                       { Index value of current display instance }; 

] 

Main [ 

  If 1; 

  [ 

     { Gets the index of the current monitor(root-level display instance) } 

    Index = \DisplayManager.GetDisplayIndex(); 

    IfElse(Index == 1, Execute( 

       { Choosing to display page on 3rd monitor only if GoToPage is being called from 1st monitor. 

         In all other cases, the page will be displayed on the respective monitor itself } 

      \DisplayManager.ShowPage2(PageName, Popup, PageParms, DisplayRoot, FALSE, 3) ; 

      Return(FALSE); 

    ); 

    { Else } 

      Return(TRUE); 

    ); 

  ] 

]