ITT Rule IDL Version 7.0 User Manual Page 315

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 314
Chapter 14: Creating a User Interface Panel 315
iTool Developer’s Guide Creating a UI Panel Interface
Adding Observers
For notification messages to be passed to the correct callback routine, an
OnNotifyObserver must be established by calling the AddOnNotifyObserver method
of the IDLitUI object. The AddOnNotifyObserver method takes as its arguments the
ID created by the call to the RegisterWidget method (as discussed in the previous
section) and the component object identifier of the iTool component to observe. Once
the observer is created, each time the specified iTool component generates a message
(that is, when the component itself calls the DoOnNotify method), the registered
widget callback routine is called with the message as one of its arguments. The call to
the AddOnNotifyObserver method looks like:
oUI->AddOnNotifyObserver,
idObserver
,
idSubject
where idObserver is an identifier created by a call to the RegisterWidget method, and
idSubject is usually the component object identifier of the iTool component being
observed. See “IDLitUI::AddOnNotifyObserver” (IDL Reference Guide) for
additional details.
The idSubject argument to the AddOnNotifyObserver method is normally the object
identifier of an iTool component object, but it can be any string value. For example,
any time the selection within an iTool window changes, the DoOnNotify method is
called with its first parameter (idOriginator) set to the string value
'Visualization' rather than to the object identifier of a component. An observer
whose idSubject argument is set to the string
'Visualization' will be notified
each time the selection changes in the iTool window. For example, the following
statement specifies that the panel widget (as registered via the RegisterWidget
method) will receive notifications whenever a visualization changes in the iTool
window.
oUI->AddOnNotifyObserver, idObserver, 'Visualization'
Here, idObserver is the identifier created in the previous section. The second
argument (
'Visualization') specifies that messages will be generated whenever
a visualization is modified.
“Example: A Simple UI Panel” on page 322 provides examples of observers of both
types. See “iTool Messaging System” on page 41 for background information on
observers and messages.
Create the Widget Hierarchy
The widget hierarchy of a user interface panel looks like the following:
Panel widget
Page view 314
1 2 ... 310 311 312 313 314 315 316 317 318 319 320 ... 429 430

Comments to this Manuals

No comments