; $Id: xdemo.pro,v 1.1 1993/04/02 19:57:52 idl Exp $ ; Copyright (c) 1991-1993, Research Systems, Inc. All rights reserved. ; Unauthorized reproduction prohibited. ; XDemo ; ; This program can be run from anywhere as long as the ; IDL_DIR environmental variable has been set. This program is ; intended to provide the user with a demonstration of IDL using ; widgets as well as some simple examples to get the user started ; in programming in widgets. ; While XDemo can be called from anywhere, the examples ; that it calls can only be called from the directory that they ; are found in. ; To run the XDemo, just type XDemo at the IDL prompt. ; PRO xdemo_event, event ; This is the event processing routine that takes care of the events being ; sent to it from the XManager. WIDGET_CONTROL, GET_UVALUE=uvalue, event.id CASE uvalue OF "CONTINUE": BEGIN ;Remove message & show normal demo WIDGET_CONTROL, event.top, GET_UVALUE=w for i=0,1 do widget_control, w(i), map=i endcase "MAINHELP": xdisplayfile, filepath('xdemo.txt', subdir='help'), $ title = "main demo help", $ height = 16, $ width = 55, $ group = event.top "IDL_TOUR": IDL_TOUR "EXIT": widget_control, event.top, /destroy else: q = execute(uvalue + ',group = event.top') ;other procs endcase end pro xdemo ; this is the main program that creates the widget for the xdemo and then ; registers it with the xmanager. message, 'Entering the xdemo.', /info main_base = WIDGET_BASE(title="idl demo") message = WIDGET_BASE(main_base, title='note:', /column) base = WIDGET_BASE(main_base, title = "idl demo", /column) XPdMenu, [ '"Quit" EXIT', $ '"IDL Tour" IDL_TOUR', $ '"Examples" {', $ '"Animation" ANIMATEDEMO', $ '"Fourier Filtering" FOURIERDEMO', $ ;;;*** '"Knee Xray" KNEEDEMO', $ '"Map Projections" MAP_DEMO', $ '"Mountain" MAKEMOUNTAINS', $ '"People of RSI" PEOPLE_DEMO', $ '"Slicer Demo" SLICER_DEMO', $ '"Spirograph" XSPIRO', $ '"Spring Demo" SPRING_DEMO', $ '"Sun Image" SUNDEMO', $ '"Widget Types" XEXAMPLE', $ '"Widget Examples" WEXMASTER', $ '"XLoadCt Color Table Chooser" XLOADCT', $ '"XManager Tool" XMTOOL', $ '"XPalette Color Editor" XPALETTE', $ '}', $ '"Help" MAINHELP'], $ base draw = WIDGET_DRAW(base, XSIZE = 512, YSIZE = 340, RETAIN = 2) logo = bytarr(512,340) openr, unit, filepath("xdemo.dat", subdirectory = "images"), /get_lun readu, unit, logo free_lun, unit version = widget_info(/version) if version.style EQ 'Motif' OR version.style EQ 'OPEN LOOK' THEN $ font = '*times-medium-r-*180*' $ else $ font = '' junk = WIDGET_TEXT(message, ysize = 8, xsize=40, /FRAME, $ FONT = font, value= $ ['All computations are performed', $ 'on your workstation as you watch.', $ ' ', $ 'No displays or visualizations are pre-stored.', $ ' ', $ 'Everything shown here is accomplished', $ 'using only the standard version of IDL.' ]) junk = WIDGET_BUTTON(message, value='Continue', uvalue='CONTINUE', /NO_REL) WIDGET_CONTROL, base, map=0 ;Only show message first DEVICE, DECOMPOSED=0, BYPASS_TRANSLATION=0 ;Put TrueColor and DirectColor ;visuals into psueudo-color graphics mode WIDGET_CONTROL, /REALIZE, main_base WIDGET_CONTROL, main_base, SET_UVAL=[message, base] ;Save id' ; Set up colors for logo image black = 0B white = 255B white1 = 215B aqua = 200B purple = 70B lt_gray = 180B green = 110B dk_gray = 40B Loadct, 3 Tvlct, 0, 0, 0, black Tvlct, 255, 255, 255, white Tvlct, 255, 255, 255, white1 Tvlct, 80, 255, 255, aqua Tvlct, 130, 0, 120, purple Tvlct, 180, 180, 180, lt_gray Tvlct, 0, 150, 130, green Tvlct, 100, 100, 100, dk_gray TV, logo XManager, "xdemo", main_base END