module TestTList /* TestTList MOTIF module */ names = case_sensitive objects = { XmToggleButton = gadget; XmPushButton = gadget; XmLabel = gadget; XmSeparator = gadget; } /* ******************************************************************************* * VToolkit (1995) "If it doesn't use VToolkit, it isn't cool!" * * (c) Steve Klein * * Unpublished rights reserved under the copyright laws of the United States. * ******************************************************************************* This module contains the UIL description of the TestTList program. It is an example of how to use the TList widget from UIL. MODIFICATION HISTORY: 03-Sep-1993 (sjk) V2. 14-Nov-1991 (sjk) Use VtkCreateCallback. 03-Apr-1991 (sjk) New entry for latest, MOTIF-compatible, TList widget. This version of the TList widget uses standard toolkit scrollbar widgets and needs a container VFrame widget to handle geometry management. Also, add customize menu to exercise new TList widget features. */ include file 'XmAppl.uil'; /* MOTIF definitions */ include file 'vtoolkit.uil'; /* VToolkit definitions */ value MAIN_I : 1; TLIST_I : 2; procedure QuitCallback; ResetCallback; ScrollDelayCallback; WordWrapCallback; /* Define the font table for the TList widget. When a line is added to the widget, its font index is * used to index into this table. All the fonts in this list must have the same character height in pixels. */ value font0 : font ('-*-Times-Bold-*-Normal--*-140-*-*-*-*-*-*'); /* fontidx 0 */ value font1 : font ('-*-Times-Medium-*-Normal--*-140-*-*-*-*-*-*'); /* fontidx 1 */ value font2 : font ('-*-Courier-Bold-*-Normal--*-140-*-*-*-*-*-*'); /* fontidx 2 */ value font3 : font ('-*-Times-Medium-*-Normal--*-140-*-*-*-*-*-*'); /* fontidx 3 */ value font4 : font ('-*-Courier-Medium-*-Normal--*-140-*-*-*-*-*-*'); /* fontidx 4 */ value tListFontTable : font_table (font0, font1, font2, font3, font4); /* Define the color list pixmap for the TList widget. When a line is added to * the widget, its color index is used to index into this list. If a color * list is not supplied, all lines will be drawn using the foreground color. */ value tListColor1 : color ('red', foreground); /* coloridx 1 */ value tListColor2 : color ('orange', foreground); /* coloridx 2 */ value tListColor3 : color ('yellow', foreground); /* coloridx 3 */ value tListColor4 : color ('green', foreground); /* coloridx 4 */ value tListColor5 : color ('blue', foreground); /* coloridx 5 */ value tListColor6 : color ('magenta', foreground); /* coloridx 6 */ value tListColorList : icon (color_table = color_table ( foreground color = '0', /* coloridx 0 */ tListColor1 = '1', /* coloridx 1 */ tListColor2 = '2', /* coloridx 2 */ tListColor3 = '3', /* coloridx 3 */ tListColor4 = '4', /* coloridx 4 */ tListColor5 = '5', /* coloridx 5 */ tListColor6 = '6'), /* coloridx 6 */ '0123456'); /* tiny pixmap containing one pixel of each color */ object tList : user_defined procedure TListCreate { callbacks {MrmNcreateCallback = procedure VtkCreateCallback (TLIST_I);}; arguments { tlist_color_list = tListColorList; tlist_font_table = tListFontTable; tlist_max_line_cnt = 100;};}; /* Define vertical and horizontal scrollbars for use by the TList widget. */ object tListVScrollBar : XmScrollBar {arguments {XmNorientation = XmVERTICAL; XmNheight = 1;};}; object tListHScrollBar : XmScrollBar {arguments {XmNorientation = XmHORIZONTAL; XmNwidth = 1;};}; /* Define a VFrame widget to hold the TList widget and the two scrollbars. The order of children in * the controls list is important to get the proper widget stacking. */ object tListVFrame : user_defined procedure VFrameCreate { controls { XmScrollBar tListHScrollBar; XmScrollBar tListVScrollBar; user_defined tList;}; arguments { XmNborderWidth = 2; XmNbackgroundPixmap = icon ('* *', ' * ', ' ** ', ' *'); /* pattern in lower right corner */ XmNleftAttachment = XmATTACH_FORM; XmNleftOffset = 10; XmNrightAttachment = XmATTACH_FORM; XmNrightOffset = 10; XmNtopAttachment = XmATTACH_FORM; XmNtopOffset = 10; XmNbottomAttachment = XmATTACH_FORM; XmNbottomOffset = 10;};}; /* The main window controls a menubar and the VFrame widget. */ object testTListMain : XmMainWindow { callbacks {MrmNcreateCallback = procedure VtkCreateCallback (MAIN_I);}; arguments {XmNx = 300; XmNy = 300; XmNwidth = 400; XmNheight = 250;}; controls { XmMenuBar {controls { XmCascadeButton {arguments {XmNlabelString = 'Control';}; controls {XmPulldownMenu {controls { XmPushButton { arguments {XmNlabelString = 'Reset';}; callbacks {XmNactivateCallback = procedure ResetCallback;};}; XmPushButton { arguments {XmNlabelString = 'Quit';}; callbacks {XmNactivateCallback = procedure QuitCallback;};}; };};};}; XmCascadeButton {arguments {XmNlabelString = 'Customize';}; controls {XmPulldownMenu {controls { XmPushButton { arguments {XmNlabelString = 'Word Wrap (On/Off)';}; callbacks {XmNactivateCallback = procedure WordWrapCallback;};}; XmPushButton { arguments {XmNlabelString = 'Scroll Delay (On/Off)';}; callbacks {XmNactivateCallback = procedure ScrollDelayCallback;};}; };};};};};}; XmForm {controls {user_defined tListVFrame;};}; };}; end module;