!********************************************************************** ! 4-apr-88 Chuck Beckett !********************************************************************** ! TPU Declarations for DECWindows Toolkit constants constant Dwtstextwidgetclass := "stextwidgetclassrec"; constant Dwttextwidgetclass := "textwidgetclassrec"; constant Dwtlabelwidgetclass := "labelwidgetclassrec"; constant Dwtpushbuttonwidgetclass := "pushbuttonwidgetclassrec"; constant Dwttogglebuttonwidgetclass := "togglebuttonwidgetclassrec"; constant Dwthiddenshellwidgetclass := "hiddenshellwidgetclassrec"; constant Dwtdialogwidgetclass := "dialogwidgetclassrec"; constant Dwtpopupwidgetclass := "popupWidgetClassrec"; constant Dwtmenuwidgetclass := "menuwidgetclassrec"; constant Dwtpulldownwidgetclass := "pulldownwidgetclassrec"; constant Dwtscrollwidgetclass := "scrollwidgetclassrec"; constant Dwtpulldownwidgetclass := "pulldownwidgetclassrec"; constant Dwtscrollwidgetclass := "scrollwidgetclassrec"; constant Dwtmainwindowwidgetclass := "mainwindowwidgetclassrec"; constant Dwtmessagewidgetclass := "messagewidgetclassrec"; constant Dwtwindowwidgetclass := "windowwidgetclassrec"; constant Dwtscrollwindowwidgetclass := "scrollwindowwidgetclassrec"; constant Dwtlistboxwidgetclass := "listboxwidgetclassrec"; constant Dwtscalewidgetclass := "scalewidgetclassrec"; constant Dwtcommandwidgetclass := "commandwidgetclassrec"; constant Dwtfileselectionwidgetclass := "fileselectionwidgetclassrec"; constant Dwtradiowidgetclass := "radiowidgetclassrec"; ! Bindings for arguments, values, etc. ! alignments constant DwtRAlignment := "Alignment" constant DwtCAlignment := "Alignment" constant DwtAlignmentCenter := 1 constant DwtAlignmentBeginning := 2 constant DwtAlignmentEnd := 3 ! label type constant DwtRLabelType := "LabelType" constant DwtCLabelType := "LabelType" constant DwtText := 1 constant DwtPixmap := 2 constant DwtText16 := 3 constant DwtTextWithAccelerator := 4 constant DwtText16WithAccelerator := 5 constant DwtRLabelArray := "LabelArray" ! togglebutton shapes constant DwtRectangular := 1 constant DwtOval := 2 ! orientations constant DwtROrientation := "orientation" constant DwtCOrientation := "orientation" constant DwtOrientationVertical := 1 constant DwtOrientationHorizontal := 2 ! dialog styles constant DwtRStyle := "Style" constant DwtCStyle := "Style" constant DwtModal := 1 constant DwtModeless := 2 constant DwtWorkarea := 3 ! menu types constant DwtRMenuType := "MenuType" constant DwtCMenuType := "MenuType" constant DwtMenuBarType := 0 constant DwtMenuWorkArea := 1 constant DwtMenuPulldown := 2 constant DwtMenuPopup := 3 constant DwtMenuOption := 5 ! menu packing styles constant DwtNmenuPacking := "menuPacking" constant DwtCMenuPacking := "MenuPacking" constant DwtRMenuPacking := "MenuPacking" constant DwtMenuPackingTight := 0 constant DwtMenuPackingColumn := 1 constant DwtMenuPackingNone := 2 ! file selection constant DwtVMS := 1 constant DwtUNIX := 2 constant DwtMSDOS := 3 ! caution box constant DwtNdefaultPushbutton := "defaultPushbutton" constant DwtCDefaultPushbutton := "DefaultPushbutton" constant DwtYesButton := 0 constant DwtNoButton := 1 constant DwtCancelButton := 2 ! font unit positioning constant DwtNunits := "units" constant DwtNfontX := "fontX" constant DwtNfontY := "fontY" constant DwtFontUnits := 0 constant DwtPixelUnits := 1 constant DwtCUnits := "Units" constant DwtCFontX := "FontX" constant DwtCFontY := "FontY" ! cut and paste constant ClipboardSuccess := 1 constant ClipboardTruncate := 2 constant ClipboardFail := 3 constant ClipboardLocked := 4 constant ClipboardNoData := 5 ! resource names constant DwtNmenuAlignment := "menuAlignment" constant DwtNradioAlwaysOne := "radioAlwaysOne" constant DwtNconformToText := "conformToText" constant DwtNentryAlignment := "entryAlignment" constant DwtNadjustMargin := "adjustMargin" constant DwtNmenuRadio := "menuRadio" constant DwtNmenuIsHomogeneous := "menuIsHomogeneous" constant DwtNmenuEntryClass := "menuEntryClass" constant DwtNmenuNumColumns := "menuNumColumns" constant DwtNmenuType := "menuType" constant DwtNallowtopresize := "allowTopResizeRequest" constant DwtNalignment := "alignment" constant DwtNfont := "font" constant DwtNforeground := "foreground" constant DwtNlabel := "label" constant DwtNlabelType := "labelType" constant DwtNmarginHeight := "marginHeight" constant DwtNmarginWidth := "marginWidth" constant DwtNmarginLeft := "marginLeft" constant DwtNmarginRight := "marginRight" constant DwtNmarginTop := "marginTop" constant DwtNmarginBottom := "marginBottom" constant DwtNpixmap := "pixmap" constant DwtNstyle := "style" constant DwtNselection := "selection" constant DwtNspacing := "spacing" constant DwtNtranslations := "translations" constant DwtNoverrideRedirect := "overrideRedirect" ! remove ?? constant DwtNcallback := "callback" constant DwtNexposeCallback := "exposeCallback" constant DwtNentryCallback := "entryCallback" constant DwtNselectCallback := "selectCallback" constant DwtNmapCallback := "mapCallback" constant DwtNunmapCallback := "unmapCallback" constant DwtNhelpCallback := "helpCallback" constant DwtNarmCallback := "armCallback" constant DwtNdisarmCallback := "disarmCallback" constant DwtNvalueChangedCallback := "valueChangedCallback" constant DwtNactivateCallback := "activateCallback" constant DwtNfocusCallback := "focusCallback" constant DwtNunitINCCallback := "unitIncCallback" constant DwtNunitDecCallback := "unitDecCallback" constant DwtNpageIncCallback := "pageIncCallback" constant DwtNpageDecCallback := "pageDecCallback" constant DwtNdragCallback := "dragCallback" constant DwtNtoTopCallback := "toTopCallback" constant DwtNtoBottomCallback := "toBottomCallback" constant DwtNtoPositionCallback := "toPositionCallback" constant DwtNyesCallback := "yesCallback" constant DwtNnoCallback := "noCallback" constant DwtNcancelCallback := "cancelCallback" constant DwtNhelpIcon := "helpIcon" constant DwtNtitle := "title" constant DwtNtitleType := "titleType" constant DwtNorientation := "orientation" constant DwtNentryBorder := "entryBorder" constant DwtNstate := "state" constant DwtNvisibleWhenOff := "visibleWhenOff" constant DwtNshape := "shape" constant DwtNbackgroundPixmap := "backgroundPixmap" constant DwtNborderPixmap := "borderPixmap" constant DwtNpullingCallback := "pullingCallback" constant DwtNsubMenuId := "subMenuId" constant DwtNcommandWindow := "commandWindow" constant DwtNworkWindow := "workWindow" constant DwtNmenuBar := "menuBar" constant DwtNhorizontalScrollBar := "horizontalScrollBar" constant DwtNverticalScrollBar := "verticalScrollBar" constant DwtNshown := "shown" constant DwtNinc := "inc" constant DwtNpageInc := "pageInc" constant DwtNmaxValue := "maxValue" constant DwtNminValue := "minValue" constant DwtNtranslations1 := "translations1" constant DwtNtranslations2 := "translations2" constant DwtNtext16 := "text16" constant DwtNyesLabel := "yesLabel" constant DwtNyesLabelType := "yesLabelType" constant DwtNnoLabel := "noLabel" constant DwtNnoLabelType := "noLabelType" constant DwtNcancelLabel := "cancelLabel" constant DwtNcancelLabelType := "cancelLabelType" constant DwtNokLabel := "okLabel" constant DwtNokLabelType := "okLabelType" constant DwtNdefaultposition := "defaultposition" constant DwtNtextMergeTranslations := "textMergeTranslations" constant DwtNbackground := "background" constant DwtNmaxLabel := "maxLabel" constant DwtNminLabel := "minLabel" constant DwtNmaxLabelType := "maxLabelType" constant DwtNminLabelType := "minLabelType" constant DwtNsliderLabel := "sliderLabel" constant DwtNsliderLabelType := "sliderLabelType" constant DwtNscaleWidth := "scaleWidth" constant DwtNscaleHeight := "scaleHeight" constant DwtNdecimalPoints := "decimalPoints" constant DwtNshowValue := "showValue" constant DwtNshowValueAutomatic := "showValueAutomatic" constant DwtNslider := "slider" constant DwtNsliderPixmap := "sliderPixmap" constant DwtNcompressExposure := "compressExposure" constant DwtNcompressMotion := "compressMotion" constant DwtNdefaultButton := "defaultButton" constant DwtNcancelButton := "cancelButton" constant DwtNpropagateColors := "propagateColors" constant DwtNhighlight := "highlight" constant DwtNhighlightPixmap := "highlightPixmap" constant DwtNx := "x" constant DwtNy := "y" constant DwtNheight := "height" constant DwtNwidth := "width" constant DwtNdepth := "depth" constant DwtNborderWidth := "borderWidth" constant DwtNborder := "border" constant DwtNsensitive := "sensitive" constant DwtNvalue := "value" constant DwtNmappedWhenManaged := "mappedWhenManaged" constant DwtNeditable := "editable" constant DwtNmaxLength := "maxLength" constant DwtNwordWrap := "wordWrap" constant DwtNblinkRate := "blinkRate" constant DwtNcols := "cols" constant DwtNrows := "rows" constant DwtNresizeWidth := "resizeWidth" constant DwtNresizeHeight := "resizeHeight" constant DwtNtopPosition := "topPosition" constant DwtNoutput := "output" constant DwtNinput := "input" constant DwtNsource := "source" constant DwtNautoShowInsertPoint := "autoShowInsertPoint" constant DwtNinsertionPosition := "insertionPosition" constant DwtNitems := "items" constant DwtNitemsCount := "itemsCount" constant DwtNselectedItems := "selectedItems" constant DwtNselectedItemsCount := "selectedItemsCount" constant DwtNvisibleItemsCount := "visibleItemsCount" constant DwtNresize := "resize" constant DwtNsingleSelection := "singleSelection" constant DwtNsingleCallback := "singleCallback" constant DwtNsingleConfirmCallback := "singleConfirmCallback" constant DwtNextendCallback := "extendCallback" constant DwtNextendConfirmCallback := "extendConfirmCallback" constant DwtNbordHighlight := "bordHighlight" constant DwtNfillHighlight := "fillHighlight" constant DwtNsystemPreference := "systemPreference" constant DwtNdirMask := "dirMask" constant DwtNread := "read" constant DwtNwrite := "write" constant DwtNexecute := "execute" constant DwtNdelete := "delete" constant DwtNfileSearchProc := "fileSearchProc" constant DwtNdone := "done" constant DwtNlistUpdated := "listUpdated" constant DwtNfiles := "files" constant DwtNfileCount := "fileCount" constant DwtNprompt := "prompt" constant DwtNlines := "lines" constant DwtNhistory := "history" constant DwtNpromptType := "promptType" constant DwtNhistoryType := "historyType" constant DwtNttranslation := "ttranslation" constant DwtNcommandEnteredCallback := "commandEnteredCallback" ! resource classes constant DwtCHighlight := "Highlight" constant DwtCHighlightPixmap := "HighlightPixmap" constant DwtCPropagateColors := "PropagateColors" constant DwtCMenuAlignment := "MenuAlignment" constant DwtCRadioAlwaysOne := "RadioAlwaysOne" constant DwtCConformToText := "ConformToText" constant DwtCEntryBorder := "EntryBorder" constant DwtCAdjustMargin := "AdjustMargin" constant DwtCMenuWidget := "MenuWidget" constant DwtCMenuRadio := "MenuRadio" constant DwtCMenuIsHomogeneous := "MenuIsHomogeneous" constant DwtCMenuEntryClass := "MenuEntryClass" constant DwtCMenuNumColumns := "MenuNumColumns" constant DwtCTextPosition := "TextPosition" constant DwtCOutput := "Output" constant DwtCInput := "Input" constant DwtCSource := "Source" constant DwtCAutoShowInsertPoint := "AutoShowInsertPoint" constant DwtCTranslations := "Translations" constant DwtCInsertionPosition := "InsertionPosition" constant DwtCCompress := "Compress" constant DwtCFont := "Font" constant DwtCWordWrap := "WordWrap" constant DwtCBlinkRate := "BlinkRate" constant DwtCForeground := "Foreground" constant DwtCMarginWidth := "MarginWidth" constant DwtCMarginHeight := "MarginHeight" constant DwtCMarginLeft := "MarginLeft" constant DwtCMarginRight := "MarginRight" constant DwtCMarginTop := "MarginTop" constant DwtCMarginBottom := "MarginBottom" constant DwtCCols := "Cols" constant DwtCRows := "Rows" constant DwtCResizeWidth := "ResizeWidth" constant DwtCResizeHeight := "ResizeHeight" constant DwtCValue := "Value" constant DwtCEditable := "Editable" constant DwtCMaxLength := "MaxLength" constant DwtCText16 := "Text16" constant DwtCSelection := "Selection" constant DwtCState := "State" constant DwtCShown := "Shown" constant DwtCInc := "Inc" constant DwtCPageInc := "PageInc" constant DwtCMaxValue := "MaxValue" constant DwtCMinValue := "MinValue" constant DwtCTranslations1 := "Translations1" constant DwtCTranslations2 := "Translations2" constant DwtCDefaultPosition := "DefaultPosition" constant DwtCItems := "Items" constant DwtCSelectedItems := "SelectedItems" constant DwtCItemsCount := "ItemsCount" constant DwtCSelectedItemsCount := "SelectedItemsCount" constant DwtCVisibleItemsCount := "VisibleItemsCount" constant DwtCResize := "Resize" constant DwtCSingleSelection := "SingleSelection" constant DwtCScaleWidth := "ScaleWidth" constant DwtCScaleHeight := "ScaleHeight" constant DwtCDecimalPoints := "DecimalPoints" constant DwtCShowValue := "ShowValue" constant DwtCShowValueAutomatic := "ShowValueAutomatic" constant DwtCSlider := "Slider" constant DwtCSliderPixmap := "SliderPixmap" constant DwtCBordHighlight := "BordHighlight" constant DwtCFillHighlight := "FillHighlight" constant DwtCSpacing := "Spacing" constant DwtCVisibleWhenOff := "VisibleWhenOff" constant DwtCShape := "Shape" ! ------> Additonal classes for File Selection Widget constant DwtCSystemPreference := "SystemPreference" constant DwtCDirMask := "DirMask" constant DwtCRead := "Read" constant DwtCWrite := "Write" constant DwtCExecute := "Execute" constant DwtCDelete := "Delete" constant DwtCLabel := "Label" constant DwtCTitle := "Title" constant DwtCFileSearchProc := "FileSearchProc" constant DwtCDone := "Done" constant DwtCListUpdated := "ListUpdated" constant DwtCFiles := "Files" constant DwtCFileCount := "FileCount" ! ------> Additonal classes for Command Box Widget constant DwtCPrompt := "Prompt" constant DwtCLines := "Lines" constant DwtCHistory := "History" constant DwtCPromptType := "PromptType" constant DwtCHistoryType := "HistoryType" ! resource representation types constant DwtRMenuWidget := "MenuWidget" constant DwtRFunction := "Function" constant DwtRTranslationTable := "TranslationTable" constant DwtRItems := "Items" constant DwtRSelectedItems := "SelectedItems" constant DwtRInt := "Int" constant DwtRCompress := "Compress" ! callback reasons constant DwtCRUnitInc := 0 constant DwtCRUnitDec := 1 constant DwtCRPageInc := 2 constant DwtCRPageDec := 3 constant DwtCRScrollStart := 4 constant DwtCRDrag := 5 constant DwtCRScrollEnd := 6 constant DwtCRToTop := 7 constant DwtCRToBottom := 8 constant DwtCRCancel := 9 constant DwtCRActivate := 10 constant DwtCRArm := 11 constant DwtCRDisarm := 12 constant DwtCRValueChanged := 13 constant DwtCRNo := 14 constant DwtCRToPosition := 15 constant DwtCRMap := 16 constant DwtCRUnmap := 17 constant DwtCRPullDown := 18 constant DwtCRFocus := 19 constant DwtCRSingle := 20 constant DwtCRSingleConfirm := 21 constant DwtCRExtend := 22 constant DwtCRExtendConfirm := 23 constant DwtCRCommandEntered := 24 constant DwtCRCreate := 25 constant DwtCRHelpRequested := 26 constant DwtCRHelp := 26 constant DwtCRSelection := 27 constant DwtCRClipboardDataRequest := 28 constant DwtCRClipboardDataDelete := 29 constant DwtCRYes := 30 constant DwtCRExpose := 31 procedure eve_test_dialog $define_classes; $testit := create_widget ($dialog_class, "Testit", SCREEN, "message('callback activated')", "closure"); $describe_widget($testit); $testit := create_widget ($label_class, "Testit", SCREEN, "message('callback activated')", "closure"); $describe_widget($testit); $testit := create_widget ($pushbutton_class, "Testit", SCREEN, "message('callback activated')", "closure"); $describe_widget($testit); $testit := create_widget ($stext_class, "Testit", SCREEN, "message('callback activated')", "closure"); $describe_widget($testit); $testit := create_widget ($listbox_class, "Testit", SCREEN, "message('callback activated')", "closure"); $describe_widget($testit); $testit := create_widget ($scrollbar_class, "Testit", SCREEN, "message('callback activated')", "closure"); $describe_widget($testit); endprocedure !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! !! !! Support - misc. support items !! !! !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! procedure $describe_widget (the_widget) local temp_string, status, a_type, a_class, resource_array, values_array; if get_info (the_widget, 'type') <> widget then my_message ("From describe_widget: this is not a widget"); return; endif; my_message ("WIDGET Name: " + get_info (the_widget, 'name') + ' Class: ' + get_info (the_widget, 'object_type')); resource_array := create_array; values_array := create_array; resource_array := get_info (the_widget, "informational"); temp_string := get_info (resource_array, "first"); my_message ("BEGIN All legal attributes"); loop exitif get_info (temp_string, 'type') = UNSPECIFIED; a_type := substr (resource_array {temp_string}, 1, index (resource_array {temp_string}, ascii (10)) - 1); a_class := substr (resource_array {temp_string}, index (resource_array {temp_string}, ascii (10)) + 1, 999); my_message (temp_string + fao ("!#* ", 25 - length (temp_string)) + a_type + fao ("!#* ", 25 - length (a_type)) + a_class); if (a_type = "Int") or (a_type = "CompString") or (a_type = "Callback") or (a_type = "String") or (a_type = "Short") or (a_type = "Boolean") or (a_type = "UnsignedChar") then values_array {temp_string} := 0; endif; temp_string := get_info (resource_array, "next"); endloop; my_message ("END All legal attributes"); status := get_info (the_widget, "WIDGET_INFO", values_array); temp_string := get_info (values_array, "first"); my_message ("BEGIN All supported attributes"); loop exitif get_info (temp_string, 'type') = UNSPECIFIED; if get_info (values_array {temp_string}, 'type') = STRING then my_message (temp_string + ": " + values_array {temp_string}); else my_message (temp_string + ": " + str (values_array {temp_string})); endif; temp_string := get_info (values_array, "next"); endloop; my_message ("END All supported attributes"); endprocedure ! describe_widget procedure $define_classes $dialog_class := define_widget_class (dwtdialogwidgetclass, "dwt$dialog_box_popup_create"); $label_class := define_widget_class (dwtlabelwidgetclass, "dwt$label_create"); $pushbutton_class := define_widget_class (dwtpushbuttonwidgetclass, "dwt$push_button_create"); $stext_class := define_widget_class (dwtstextwidgetclass, "DWT$S_TEXT_CREATE"); $listbox_class := define_widget_class (dwtlistboxwidgetclass, "DWT$LIST_BOX_CREATE"); $scrollbar_class := define_widget_class (dwtscrollwidgetclass, "DWT$SCROLL_BAR_CREATE"); endprocedure ! $define_classes procedure my_message (mess_str); ! Debuging aide2message (mess_str); message(mess_str); endprocedure procedure eve$callback_dispatch local an_array, the_program, status, the_topic, temp_array; on_error [TPU$_CONTROLC]: eve$$x_state_array {eve$$k_command_line_flag} := eve$k_invoked_by_key; eve$learn_abort; abort; [OTHERWISE]: eve$$x_state_array {eve$$k_command_line_flag} := eve$k_invoked_by_key; endon_error if not eve$x_decwindows_active then return (FALSE); endif; eve$$x_state_array {eve$$k_command_line_flag} := eve$k_invoked_by_menu; status := get_info (WIDGET, "callback_parameters", temp_array); ! make the following available to all the eve$$widget_xxx procedures eve$x_widget := temp_array {eve$k_widget}; ! widget (from CREATE_WIDGET) $describe_widget(eve$x_widget); eve$x_widget_tag := temp_array {eve$k_closure}; ! widget tag (see UIL file) eve$x_widget_reason := temp_array {eve$k_call_data};! reason code case eve$x_widget_reason [eve$dwt$c_crhelp_callback]: an_array := get_info (eve$$x_facility_widget_help_array, "first"); loop exitif an_array = tpu$k_unspecified; ! silence if no widget matches an_array := eve$$x_facility_widget_help_array {an_array}; the_topic := an_array {eve$x_widget_tag}; if the_topic <> tpu$k_unspecified then if get_info (the_topic, "type") = STRING then eve_help (the_topic); exitif; endif; endif; an_array := get_info (eve$$x_facility_widget_help_array, "next"); endloop [otherwise]: an_array := get_info (eve$$x_facility_widget_array, "first"); loop exitif an_array = tpu$k_unspecified; ! silence if no widget matches an_array := eve$$x_facility_widget_array {an_array}; the_program := an_array {eve$x_widget_tag}; if the_program <> tpu$k_unspecified then !** FOR DEBUGGING IF EVE$X_DEBUG THEN MESSAGE('WIDGET='+EVE$$X_WIDGET_HELP_ARRAY{EVE$X_WIDGET_TAG}+', REASON='+ STR(EVE$X_WIDGET_REASON)+', widget id='+str(eve$x_widget_tag)); ENDIF; if the_program <> 0 then ! not all widgets expect a callback execute (the_program); endif; exitif; endif; an_array := get_info (eve$$x_facility_widget_array, "next"); endloop endcase; eve$$found_post_filter; ! in case menu function moved cursor eve$$x_state_array {eve$$k_command_line_flag} := eve$k_invoked_by_key; return; endprocedure;