IServerView interface

Created: May 20, 2013 | Updated: October 23, 2018

Overview 
The IServerView interface is the ancestor interface for a document or panel view object interface. 
This IServerView interface also represents a global panel in Altium Designer, for example the Messages or ToDo panels.

The IServerView interface hierarchy is as follows;
IExternalForm
IServerView interface
IServerView Methods and Properties Table

IServerView 
Methods 
GetViewState
SetViewState
ReceiveNotification

IServerView 
Properties 
IsPanel
ViewName

See also 
IExternalForm interface
IServerDocumentView interface
IServerDocument interface

IServerView GetState and SetState methods

GetIsPanel method

(IServerView interface)
Syntax 
Function GetIsPanel : LongBool;
Description 
The IsPanel property determines whether the IServerDocumentView object is a panel or not. A IServerDocument container stores IServerDocumentView objects and they are can be a panel view or a document view.
This property is supported by the GetIsPanel method.
Example 
Var
ServerDocumentView : IServerDocumentView;
Begin
ServerDocumentView := ServerDocument.View;
If Not(ServerDocumentView.IsPanel) Then 
ShowMessage('Document Name ' + ServerDocument.FileName);
End;
See also 
IClient interface
IExternalForm interface

GetViewName method

(IServerView interface)
Syntax 
Function GetViewName : Widestring;
Description 
The ViewName property represents the view name and is not the same as the document filename. A view can be a global panel that can be seen globally within Altium Designer, as a document view or as a panel view.
This read only property is supported by the GetViewName method.
For example a library document open in Altium Designer yields the following information:
View Name: PCBEditor
Document Name: C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib
Caption: PCBView_GraphicalForm

ViewName example

 

If  StrPas(Client.CurrentView.GetViewName)  <>  UpperCase('PCBLib')  Then  Exit;

 

This code snippet uses the Client.CurrentView.ViewName method to find out the current document's type name.
See also 
IClient interface
IServerView interface
IExternalForm interface

IServerView Methods

GetViewState method

(IServerView interface)
Syntax 
Function GetViewState : Widestring;
Description

Example

See also 
IClient interface
IServerView interface
SetViewState method

ReceiveNotification method

(IServerView interface)
Syntax 
Procedure ReceiveNotification (Const ANotification : INotification);
Description 
The ReceiveNotification procedure captures the notification generated by Altium Designer. A global panel, a document view or a panel view has the ability to intercept a notification and take action accordingly.
Example

See also 
IClient interface
IServerView interface
INotification interface

SetViewState method

(IServerView interface)
Syntax 
Procedure SetViewState(Const Astate : Widestring);
Description

Example

See also 
IClient interface
IExternalForm interface
GetViewState method

IServerView Properties

IsPanel property

(IServerView interface)
Syntax 
Property IsPanel : LongBool Read GetIsPanel;
Description 
The IsPanel property returns a boolean value denoting whether the view is a panel or a document view.
A document consists of a document view and at least one panel view. There also can be global or system views such as Message panel which is a global panel view.
This read only property is supported by the GetIsPanel method.
Example

 

Var
ServerDocumentView  :  IServerDocumentView;
Begin
ServerDocumentView  :=  ServerDocument.View[j];
If  Not(ServerDocumentView.IsPanel)  Then 
  ShowMessage('Document  Name  '  +  ServerDocument.FileName);
End;

 

See also 
IServerView interface

ViewName property

(IServerView interface)
Syntax 
Property ViewName : Widestring Read GetViewName;
Description 
The ViewName property represents the view name and is not the same as the document filename. A view can be a global panel that can be seen globally within Altium Designer, as a document view or as a panel view.
This read only property is supported by the GetViewName method.
For example a library document open in Altium Designer yields the following information:
View Name: PCBEditor
Document Name: C:\Program Files\Altium Designer\Examples\Reference Designs\4 Port Serial Interface\Libraries\4 Port Serial Interface.PcbLib
Caption: PCBView_GraphicalForm
ViewName example 
If StrPas(Client.CurrentView.ViewName) <> UpperCase('PCBLib') Then Exit;
This code snippet uses the Client.CurrentView.ViewName method to find out the current document's type.
See also 
IClient interface
IServerView interface

Found an issue with this document? Highlight the area, then use Ctrl+Enter to report it.

Contact Us

Contact our corporate or local offices directly.

We're sorry to hear the article wasn't helpful to you.
Could you take a moment to tell us why?
200 characters remaining
You are reporting an issue with the following selected text
and/or image within the active document: