Interface subsystem

The Interface Subsystem displays relevant model data in the view. It also handles user interactions (such as button clicks) inside the main view and displays the dialog that users employ to join a Taligent Chat discussion.

To join a Taligent Chat discussion, a user specifies a topic, host name, and user name. This program stores this information with the document.


TChatPresenter implements routines to create the view and to create and destroy extended menus. In the current implementation of this program, the editable text menu (associated with the TSimpleTextView input view) is the only extended menu needed.

MChatView defines the minimum protocol that a Taligent Chat view should implement. It works in conjunction with MChatHandler for processing incoming and outgoing protocol messages. When a view sends a message in the Taligent Chat protocol, it gets the MChatHandler from the model and calls a MChatHandler function to perform the appropriate action.

TChatView is a concrete MChatView. It is the main view created in the program. It creates all the subviews that present the visual aspect of the sample. This view is retrieved from an archive created by Taligent's UI Builder. In addition, TChatView inherits from a mixin class (MKeyEventHandler) which overrides TChatView::KeyDown to catch the enter key and simulate the Send. TChatView defines a connection for receiving text from MChatHandler. When it receives the notification, it updates it's text in this program's window pane and refreshes the view.

User-generated events from the main document window are caught by the TChatView::HandleViewAction functions. For example, if the user clicks on the Join button in the document window, this program displays a dialog that allows a user to provide user information (such as a name) and to join an existing Taligent Chat discussion. If the user clicks on the Leave or Send buttons in the document window, this program sends protocol messages through the TChatHandler object in TChatModel. TChatGUIDialogController handles user-generated events that occur in the Taligent Chat dialog that allows users to join an existing Taligent Chat discussion.

When a user adds to a discussion, TChatSimpleTextView autoscrolls the appended text into the visible area of the scrolling view. Not all text is displayed--this program deletes characters off the top of the view when it is necessary to clear space for additional text input.

In addition, TChatSimpleTextView creates a typing interactor (TChatSimpleTypingInteractor) to process incoming keyboard events. TChatSimpleTypingInteractor::KeyDown catches the enter key and simulates the Send.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker