module TestVHist /* TestVHist MOTIF/UIL 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 MOTIF UIL description of the TestVHist program. It is an example of how to use the VHist widget from UIL under MOTIF. MODIFICATION HISTORY: 05-Sep-1993 (sjk/nfc) Run throuhg the MOTIF porting tools. 14-Nov-1991 (sjk) Use VtkCreateCallback. 07-Nov-1991 (sjk) Change VHist margins, etc, to adjust for MOTIF font units. 16-Jul-1991 (sjk) Workaround MOTIF UIL color table bug. 01-Jun-1990 (sjk) Add support for colored bars. 09-Apr-1990 (sjk) Port to MOTIF. 05-Apr-1990 (sjk) Add support for VHistOrientationBestFit. 22-Feb-1990 (sjk) Clean up packaging. */ include file 'XmAppl.uil'; /* MOTIF definitions */ include file 'vtoolkit.uil'; /* VToolkit definitions */ value MAIN_I : 1; VHIST_I : 2; procedure TestAddBarCallback; TestRemoveBarCallback; TestSelectCallback; TestSelectConfirmCallback; TestShiftGridCallback; TestOrientationCallback; TestLabelsCallback; TestQuitCallback; value vHistColor1 : color ('red', foreground); /* coloridx 1 */ value vHistColor2 : color ('orange', foreground); /* coloridx 2 */ value vHistColor3 : color ('yellow', foreground); /* coloridx 3 */ value vHistColor4 : color ('green', foreground); /* coloridx 4 */ value vHistColor5 : color ('blue', foreground); /* coloridx 5 */ value vHistColor6 : color ('magenta', foreground); /* coloridx 6 */ value vHistColorList : icon (color_table = color_table ( foreground color = '0', /* coloridx 0 */ vHistColor1 = '1', /* coloridx 1 */ vHistColor2 = '2', /* coloridx 2 */ vHistColor3 = '3', /* coloridx 3 */ vHistColor4 = '4', /* coloridx 4 */ vHistColor5 = '5', /* coloridx 5 */ vHistColor6 = '6'), /* coloridx 6 */ '0123456'); /* tiny pixmap containing one pixel of each color */ object testVHist : user_defined procedure VHistCreate { callbacks { MrmNcreateCallback = procedure VtkCreateCallback (VHIST_I); vhist_select = procedure TestSelectCallback; vhist_select_confirm = procedure TestSelectConfirmCallback; }; arguments { XmNleftAttachment = XmATTACH_FORM; XmNleftOffset = 10; XmNrightAttachment = XmATTACH_FORM; XmNrightOffset = 10; XmNtopAttachment = XmATTACH_FORM; XmNtopOffset = 10; XmNbottomAttachment = XmATTACH_FORM; XmNbottomOffset = 10; XmNborderWidth = 1; vhist_bar_color = vHistColor1; vhist_unit_type = Xm100TH_FONT_UNITS; vhist_spacing_numerator = 1; vhist_spacing_denominator = 10; vhist_left_axis_thickness = 2; vhist_left_label_width = 300; vhist_left_margin_width = 30; vhist_left_axis_margin_width = 30; vhist_right_axis_thickness = 2; vhist_right_label_width = 300; vhist_right_margin_width = 30; vhist_right_axis_margin_width = 30; vhist_top_axis_thickness = 2; vhist_top_label_height = 150; vhist_top_margin_height = 0; vhist_top_axis_margin_height = 10; vhist_bottom_axis_thickness = 2; vhist_bottom_label_height = 150; vhist_bottom_margin_height = 0; vhist_bottom_axis_margin_height = 10; vhist_color_list = vHistColorList; };}; object testVHistMain : 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 = 'Add Bar';}; callbacks {XmNactivateCallback = procedure TestAddBarCallback;};}; XmPushButton { arguments {XmNlabelString = 'Remove Bar';}; callbacks {XmNactivateCallback = procedure TestRemoveBarCallback;};}; XmPushButton { arguments {XmNlabelString = 'Shift Grid';}; callbacks {XmNactivateCallback = procedure TestShiftGridCallback;};}; XmCascadeButton { arguments {XmNlabelString = 'Orientation';}; controls { XmPulldownMenu { arguments {XmNradioBehavior = true;}; controls { XmToggleButton { arguments {XmNindicatorType = XmONE_OF_MANY; XmNlabelString = 'Vertical'; XmNset = true;}; callbacks {XmNvalueChangedCallback = procedure TestOrientationCallback (VHistOrientationVertical);};}; XmToggleButton { arguments {XmNindicatorType = XmONE_OF_MANY; XmNlabelString = 'Horizontal';}; callbacks {XmNvalueChangedCallback = procedure TestOrientationCallback (VHistOrientationHorizontal);};}; XmToggleButton { arguments {XmNindicatorType = XmONE_OF_MANY; XmNlabelString = 'BestFit';}; callbacks {XmNvalueChangedCallback = procedure TestOrientationCallback ( VHistOrientationBestFit);};}; };};};}; XmPushButton {arguments {XmNlabelString = 'Show/Hide Labels';}; callbacks {XmNactivateCallback = procedure TestLabelsCallback;};}; XmPushButton {arguments {XmNlabelString = 'Quit';}; callbacks {XmNactivateCallback = procedure TestQuitCallback;};}; };};};};};}; XmForm { arguments {XmNx = 300; XmNy = 300; XmNwidth = 400; XmNheight = 250; XmNunitType = XmPIXELS;}; controls {user_defined testVHist;}; };};}; end module;