ITT Rule IDL Version 7.0 User Manual Page 306

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 305
306 Chapter 13: Creating a User Interface Service
Example: Changing a Property Value iTool Developers Guide
; a new name.
newName = wdSrvExample(NAME = origName, $
GROUP_LEADER = groupLeader)
; Set the property value.
oRequester->SetProperty, NAME = newName
; Return success
RETURN, 1
END
Discussion
The function that implements this example service follows the pattern outlined in
“Creating the UI Service Routine” on page 297. It uses the object reference to the
IDLitUI object to retrieve the widget ID of the top-level base of the iTool user
interface, and later uses the retrieved value to set the GROUP_LEADER keyword to
the user interface routine. It uses the object reference to the “requester” object (in this
case, the iTool component that is selected in the current iTool) to retrieve the NAME
property. It then calls a routine (
wdSrvExample) that displays a user interface
allowing the user to select a new value for the NAME property.
The string returned by the
wdSrvExample routine is used to set the NAME property
of the selected iTool component, and the routine returns 1 for success.
Creating the SrvExample Interface
The interface presented by the SrvExample user interface service consists of a set of
routines that create an IDL widget interface. The creation routine and two simple
event-handling routines are stored in a file named
wdsrvexample.pro that is
located in a directory that is included in the IDL !PATH system variable.
Widget Creation Function
The following function creates the widget interface that is displayed when the
SrvExample user interface service is called. The widget creation routine should be
the last routine in the file.
FUNCTION wdSrvExample, NAME = origName, TITLE = dialogTitle, $
GROUP_LEADER = groupLeader
; Check to see if a title for the dialog was supplied.
; If not, set a default title.
IF (N_ELEMENTS(dialogTitle) EQ 0) THEN $
dialogTitle='Choose a Name'
Page view 305
1 2 ... 301 302 303 304 305 306 307 308 309 310 311 ... 429 430

Comments to this Manuals

No comments