Elipse Knowledgebase

Employing GetScreen and ShowScreen methods.


How can I use the Viewer's GetScreen and the Frame's ShowScreen methods? What are they for?


The GetScreen(ScreenName) method returns a Screen object, whose name must be set up at ScreenName parameter. This method's return value can be used at the Frame's ShowScreen method.

The ShowScreen(Screen, Zoom, Scrollbars[, Arg]) method loads a screen at the Frame, closing any screen or frame previously loaded on it. The Screen parameter only accepts objects returned by the Viewer's GetScreen method, and will fail if a screen object returned by another method or property is used.

To illustrate these methods' usefulness, imagine a situation where you need to open a screen and run a few scripts. Before these methods were developed, you needed a script to open the screen, and in this screen you needed another script (usually on OnPreShow event) to access its child objects.

The problem with this approach came when, for example, you needed to create libraries that depended on this script in the application, and which didn't allow developing a library that could reduce coupling issues. With GetScreen and ShowScreen methods, you can open the screen via scripts, and before the screen opens, you can retrieve the Screen object and access its desired child objects.

The attached demo application illustrates how to use an indexed windowed screen, which attributes the path of the XObject linked to the XControl directly to the script in the object's Click event, requiring no sending/receiving of the parameter on OnPreShow event.

Script employed in this example:

Sub Picture1_Click()

Arg = XCMotor.Source.PathName
Set newScreen = Application.GetFrame("virtualFrame")
newScreen.MoveFrame , , 250, 300
newScreen.SetFrameOptions XCMotor.Source.Name, 15+64+256+2048

Set screenObj = Application.GetScreen("CommandScreen")
newScreen.ShowScreen screenObj, 100, 0
screenObj.Item("IndexedScreen1").Source = Arg    

End Sub

NOTE: The attached demo application was developed with Elipse E3 version 4.8 239.

Artigos Relacionados

Este artigo não possui outros artigos relacionados.


Comentários de Usuários

Nenhum comentário de usuário. Adicionar um comentário

Comentários do artigo 'Employing GetScreen and ShowScreen methods.'

Para adicionar um comentário neste artigo, preencha os campos abaixo. Os campos marcados com asterisco são obrigatórios.

* Comentário:
* Digite o código abaixo:


Detalhes do Artigo

Última Atualização
23rd of May, 2017

Délio Damin

Você gostaria de...

Imprimir esta página  Imprimir esta página

Enviar por e-mail esta página  Enviar por e-mail esta página

Adicionar um comentário  Adicionar um comentário


Avise-me  Adicionar aos favoritos

Remover Marcação Remover Marcação

Editar este Artigo

Edição Rápida

Opinião dos Usuários

Nenhum usuário votou ainda.

Como você classifica este artigo?

Obrigado pelo seu voto.