PCE version 4C man_modulenamespaceid_tablemodified current_idOIxN class/menuN referenceC hash_tablerefersizeOIxNbothI?sN V.menu.kindCman_variable_card identifiermodule last_modifiednamesummary descriptionsee_alsoinheritdefaultsOIxN V.menu.kindRICdateOIx)¨ÅµNkindnCstringOIxThe kind attribute is a shorthand for setting various style attributes to some predefined value. The variable `Menu <-kind' provides the argument of the latest `Menu ->kind' invocation. Note that the menu may look very different due to subsequent style-parameters changed.CchainsizeOIxIeNM.menu.S.initialiseeN M.menu.S.kindeNV.menu.feedbackXnnsNV.menu.label_areaOIxNV.menu.label_areaRIOIx)¨ÆN label_areanOI x{Pixel area relative to the origin of the menu for formatting the label. Only applicable if `Menu <->show_label' equals @on.OI xIeNV.menu.item_sizeENV.menu.item_offsetXnnsNM.menu.S.statusCman_method_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherit diagnosticsdefaultsbugsOI xNM.menu.S.statusRIOI x,B¨NstatusnOI x#The <-status of a menu is not used.nnnnnsNM.menu.S.borderOIxNM.menu.S.borderRIOIx)¨ÑûNbordernnOIxIEN V.menu.borderXnnnnsNV.menu.on_imageOIxNV.menu.on_imageRIOIx)¨Ì¬Non_imagenOIxvImage painted in front of items that have `MenuItem <->selected': @on. When @nil, no image is painted before the item.OIxIENV.menu.off_imageXnnsNC.menuCman_class_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherituser_interfacebugsOIxNC.menuRIOIx0¾¯“NmenunOIx A Menu is a dialog item that allows the user the select one or more values from a list. In its functionality it is similar to a list_browser object. However, a list_browser is meant to select from a dynamically generated list that may be large, while a menu is meant to select from a small number of alternatives that is generally static. Class menu defines a large number of options that determine both the layout of the items, the feedback provided for the selected item, and whether or not one or more items may be selected at the same time. For convenience, there is a method called `Menu ->kind' that allows you to select some common configurations with a single message. MESSAGE FORWARDING ** <- multiple_selection = @on If the `toggled' menu_item has <->message not equal to @default, this message is executed with: @receiver The menu @arg1 The menu_item @arg2 New value of `menu_item <-selected' @arg3 Equivalent to @event If the message of the menu_item is @default, the message associated with the menu is executed. The arguments are: @receiver The menu @arg1 `menu_item <-value' @arg2 New value of `menu_item <-selected' @arg3 Equivalent to @event ** <- multiple_selection = @off If the `toggled' menu_item has <->message not equal to @default, this message is executed with: @receiver The menu @arg1 `menu_item <-value' @arg2 Equivalent to @event If the message of the menu_item is @default, the message associated with the menu is executed. The arguments are: @receiver The menu @arg1 The <-selection @arg2 Equivalent to @event MENU LAYOUT A menu consists of a label and a list of items. The label is placed in a box described by the area `Menu <-label_area'. The items are placed in a two-dimensional array, each in its own box. These item boxes all have the same size (`Menu <-item_size'). The top-left-corner of the first item is at `Menu <-item_offset'. If `Menu <->layout' equals horizontal, the items are placed left-to-right. If `Menu <->layout' equals vertical, the items are placed top-to-bottom. The items are spread over `Menu <-columns' columns. The following illustrates the placement of a menu with horizontal layout, 2 columns and 5 items: label item-1 item-2 item-3 item-4 item-5 Various parameters influence the final layout. `Menu<->gap' defines the horizontal and vertical space between the items. `Menu<->pen' defines the thickness of the lines for the boxes drawn around the items. `Menu<->border' defines the white space between the item and the box around it.OIxIeNM.menu.S.initialiseeN$$class/menu_item$V.menu_item.messageeNV.menu.columnseN M.menu.S.kindeN1$class/dialog_item$V.dialog_item.auto_value_aligneN$class/menu_item$C.menu_itemeN$class/popup$C.popupXnnnsNM.menu.S.updateOIxNM.menu.S.updateRIOIx*Ü·NupdatenOIxwUpdate the activation of the menu_items in this menu. For each menu_item that has a <->condition not equal to @nil, it invokes the `menu_item <->condition' attribute, providing the following context information: @receiver The menu_item @arg1 The argument (i.e. the context) If the message evaluates successfully, the menu_item is activated, otherwise it is deactivated.OIxIeNM.menu.S.active_itemeNM.menu.S.active_all_itemsEN$class/popup$M.popup.S.updateXnnnnsNV.menu.left_offsetOIxNV.menu.left_offsetRIOIx)¨ÈcN left_offsetnOIxLeft margin between the item-box and the item itself. Used to reserve space for placing the selection markers if present. Its value is 0 if both `Menu <-on_image' and `Menu <-off_image' equal @nil and the maximum width plus `Menu <-border' if one or both of the markers are defined.nnnsNV.menu.value_widthOI xNV.menu.value_widthRIOI!x0µ¨N value_widthnOI"xXMinimum width used for the value. It is used for two purposes: # popup menu's It is defined for popup-menu's to avoid very small windows when only short options are provided. # Alignment of menu's The automatic layout mechanism of dialog window will align the values of menu's displayed below each other if their layout is horizontal.OI#xIEN1$class/dialog_item$V.dialog_item.auto_value_alignXnnsN M.menu.S.offOI$xN M.menu.S.offRIOI%x*¼NoffnOI&xjInvokes `menu_item ->active: @off' on the indicated menu-item, making the indicated menu-item insensitive.OI'xIeN&$class/menu_item$V.menu_item.conditioneN#$class/menu_item$V.menu_item.activeeN M.menu.S.onENM.menu.G.memberXnnnnsNV.menu.item_sizeOI(xNV.menu.item_sizeRIOI)x,B§N item_sizenOI*xÒSize of the box in which each item is formatted. An item at location (X,Y) is located at x-pixel location: Menu?x + Menu?item_offset?x + X*(Menu?item_size?w + Menu?gap?w). and similar for the y-coordinate.OI+xIeNV.menu.label_areaENV.menu.item_offsetXnnsNM.menu.S.modifiedOI,xNM.menu.S.modifiedRIOI-x,3 NmodifiednnnOI.xIENM.menu.G.modifiedXnnnsNM.menu.S.computeOI/xNM.menu.S.computeRIOI0x,B§XNcomputenOI1x™`Menu ->compute' recalculates various variables to speed-up redraw. These are <-label_area, <-item_offset, <-item_size, <-left_offset and <-right_offset.nnnnnsNM.menu.S._changed_itemOI2xNM.menu.S._changed_itemRIOI3x)¨Ð6N _changed_itemnOI4x|Internal method to deal with changed items. When a menu-item is changed directly, it will send `_changed_item' to its menu.nnnnnsNV.menu.right_offsetOI5xNV.menu.right_offsetRIOI6x)¨Î„N right_offsetnOI7xèRight-margin between the item and its surrounding box. Its value is 0 if `Menu <-popup_image' equals @nil or there is no item in the menu that has a <->popup. Otherwise it is the width of `Menu <-popup_image' plus `Menu <-border'.nnnsNV.menu.value_fontOI8xNV.menu.value_fontRIOI9x0µªhN value_fontnOI:xæDefault font used to display the text of the items. This font may be overruled for an individual item using `menu_item <->font'. The latter is often used for font-selectors to display each item in the font that will be selected.OI;xIeN!$class/menu_item$V.menu_item.fontEN#$class/menu_item$M.menu_item.S.fontXnnsNM.menu.S.selectedOIxÁSet `menu_item <-selected' of `item'. Equivalent to sending the message directly to the menu_item object, but type-conversion will convert a `menu_item <-value' to the corresponding menu_item.nnnnnsN V.menu.formatOI?xN V.menu.formatRIOI@x0µžONformatnOIAxàThe layout of menu_items in a menu is a 1 or 2 dimensional table. The menu will first determine the number and size of the rectangular cells in this table. This parameter determines how the items are aligned in their cell.OIBxIEN$class/text$V.text.formatXnnsNM.menu.G.active_itemOICxNM.menu.G.active_itemRIOIDx0µ¬KN active_itemnOIExMReturns a boolean, indicating the active status of the referred to menu_item.OIFxIENM.menu.S.active_itemXnnnnsNV.menu.item_offsetOIGxNV.menu.item_offsetRIOIHx)¨ÄN item_offsetnOIIxxOffset in pixels of the first item, relative to the origin of the menu. Normally not useful for application programmers.OIJxIeNV.menu.label_areaENV.menu.item_sizeXnnsNV.menu.membersOIKxNV.menu.membersRIOILx)¨ÌNmembersnOIMx.Chain of menu-items that are part of the menu.OINxIeN!$class/menu_item$V.menu_item.menuENM.menu.S.appendXnnsNV.menu.off_imageOIOxNV.menu.off_imageRIOIPx)¨ÌžN off_imagenOIQxwImage painted in front of items that have `MenuItem <->selected': @off. When @nil, no image is painted before the item.OIRxIENV.menu.on_imageXnnsNM.menu.S.applyOISxNM.menu.S.applyRIOITx0½×&NapplynOIUxÇIf <-modified yields @on or `always' equals @on *and* <-selection succeeds, <-message is forwarded with the following arguments: @receiver the menu @arg1 <-selection. See also `dialog ->apply'.nnnnnsNM.menu.S.insert_beforeOIVxNM.menu.S.insert_beforeRIOIWx<Ù®N insert_beforenOIXxÖInsert item before another one. If `before' is a name, <-member is used to translate it into a menu_item. If `before' is not in the menu, the new item is ->append'ed to the menu. See also ->append and ->prepend.nnnnnsNV.menu.accelerator_fontOIYxNV.menu.accelerator_fontRIOIZx0´gNaccelerator_fontnOI[x}Font in which keyboard accelerators are annotated. When @nil, possible accelerators are not annotated. Used by class popup.nnnsNM.menu.S.eventOI\xNM.menu.S.eventRIOI]x,B§ÎNeventnOI^x”First tries `dialog_item ->event'. On failure it passes the event of @_button_gesture if <-active equals @on. The real work is done by ->execute.OI_xIeNM.menu.G.item_from_eventENM.menu.S.executeXnnnnsNM.menu.G.modifiedOI`xNM.menu.G.modifiedRIOIax0µ¤5NmodifiednOIbxóYields @on if the user has modified the menu since the last ->selection, ->modified: @off or ->default. See also ->apply. If ->modified is set to @on the <-device will be informed using `dialog ->modified_item'. See `dialog_item ->modified'.nnnnnsNM.menu.S.deleteOIcxNM.menu.S.deleteRIOIdx)¨ÓtNdeletenOIexôDelete a menu_item or the menu_item that has the same <->value as the argument from the menu. Note that it is generally bad style to change the contents of menu's. Normally items that should not be activated in some context are made inactive.nnnnnsN M.menu.S.onOIfxN M.menu.S.onRIOIgx*¼@NonnOIhx-As `menu ->off', but activates the menu_item.OIixIEN M.menu.S.offXnnnnsNM.menu.G.item_from_eventOIjxNM.menu.G.item_from_eventRIOIkx*¼†‡Nitem_from_eventnOIlx•When `event' is an event that occurred on the menu, return the menu_item on which are it occurred. May be used to redefine event-handling of menu's.OImxIENM.menu.S.eventXnOInxBFails silently when the event did not occur on a menu_item's area.nnsNV.menu.show_labelOIoxNV.menu.show_labelRIOIpx)¨Î·N show_labelnOIqx†If @on, the label is formatted in `Menu <-label_font' in the box determined by `Menu <-label_area'. Otherwise the label is invisible.nnnsNV.menu.multiple_selectionOIrxNV.menu.multiple_selectionRIOIsx,«Nmultiple_selectionnOItxzIf @on, any item can be either selected or deselected. It @off, exactly one item has status `menu_item <->selected: @on'.OIuxIEN%$class/menu_item$V.menu_item.selectedXnnsNM.menu.S.is_offOIvxNM.menu.S.is_offRIOIwx)¨Õ!Nis_offnOIxxBFind menu-item from object and test whether <->active equals @off.OIyxIENM.menu.S.is_onXnnnnsN M.menu.S.kindOIzxN M.menu.S.kindRIOI{x,B¦rNkindnOI|xDThe `Menu ->kind' method allows for the selection of some commonly occurring combinations of menu parameters with a single method. The available options are: # cycle Only display the selection. Clicking on the menu selects the next right-item. The menu has a popup-menu associated that allows for an overview of all available items. Useful for not very commonly used menu's as it uses much less space on the screen. # marked Single selection menu with markers (see `Menu <-on_image' and `Menu <-off_image') to indicate the selected item. # toggle As marked, but multiple items may be selected. # choice As marked, but the selection is indicated by inverting the it. # popup Used internally. Popup menus are implemented on top of class menu. # cycle_popup Used internally for the popup of <-kind cycle menus.OI}xIeN V.menu.kindENC.menuXnnnnsNV.menu.columnsOI~xNV.menu.columnsRIOIx)¨¼{NcolumnsnOI€xaNumber of columns over which the menu-items are spread. See the class documentation for details.OIxIeN V.menu.layoutENC.menuXnOI‚xThe default is 1sNM.menu.S.appendOIƒxNM.menu.S.appendRIOI„x<ÙßNappendnOI…x¦Append a menu-item to the menu. The appended item will always be the last. Note that class menu_item defines a conversion function that converts popups (for pullright menu's) and values into menu_items. For popup objects, if the argument is the name `gap', the last added item is sent `menu_item ->end_group: @on'. This inserts a group-separation line in the menu. See also ->members, ->insert_before and send_list/3.OI†xIeNM.menu.S.prependeN&$class/menu_item$M.menu_item.G.convertENV.menu.membersXnnnnsNV.menu.preview_feedbackOI‡xNV.menu.preview_feedbackRIOIˆx)¨ÎNpreview_feedbacknOI‰x#Visual feedback used to indicate the item that is in the preview state. Possible values: # box Draw a box around the item (like `Menu ->feedback: box') #invert Invert the box in which the item is formatted. Similar to `Menu ->feedback: invert', but the latter only inverts the item.OIŠxIENV.menu.previewXnnsN V.menu.gapOI‹xN V.menu.gapRIOIŒx0´’NgapnOIxéAmount of white space between the items in both X- and Y-direction. Note that the `Menu <->border' is between the item and its surrounding box, while `Menu <->gap' defines the distance between the surrounding boxes of adjacent items.OIŽxIEN V.menu.borderXnnsNM.menu.S.clearOIxNM.menu.S.clearRIOIx)¨ÒNclearnOI‘xDelete all items from the menu.nnnnnsNM.menu.S.all_offOI’xNM.menu.S.all_offRIOI“x)¨ÑNall_offnOI”xZEquivalent to send(Menu, active_all_items, @off). Available for backward compatibility.OI•xIeNM.menu.S.all_onENM.menu.S.active_all_itemsXnnnnsNM.menu.S.membersOI–xNM.menu.S.membersRIOI—x9¾2cNmembersnOI˜xË->clear the menu and then use ->append to add each member of the chain to the menu. This implies chain may contain both menu_item objects and plain names. See also `menu_item<-convert' and send_list/3.nnnnnsNM.menu.S.clear_selectionOI™xNM.menu.S.clear_selectionRIOIšx>ýJªNclear_selectionnOI›x*Deselect all items. See also ->selection.OIœxIENM.menu.S.selectionXnnnnsNM.menu.S.unlinkOIxNM.menu.S.unlinkRIOIžx*¼ˆÚNunlinknOIŸxnSets `menu_item <-menu' of all member items to @nil, clears ->members and invokes ->unlink on the super-class.OI xIEN)$class/dialog_item$M.dialog_item.S.unlinkXnnnnsNV.menu.label_fontOI¡xNV.menu.label_fontRIOI¢x)¨ÆN label_fontnOI£xRFont used to format the label. Only applicable if `Menu <-show_label' equals @on.nnnsN M.menu.S.nextOI¤xN M.menu.S.nextRIOI¥x*¼„:NnextnOI¦x!Selects the first item with `menu_item <-active: @on' after the currently selected menu_item. When the currently selected item is the last or there is no currently selected item, the first active item is selected. Used internally when <-show_selection_only equals @on (<->kind: `cycle').nnnnnsNV.menu.popup_imageOI§xNV.menu.popup_imageRIOI¨x)¨ÍlN popup_imagenOI©xŽImage painted to the right of items that have a popup associated with them. Only applicable to popup menu's with pullright submenu's in them.nnnsNV.menu.feedbackOIªxNV.menu.feedbackRIOI«x,B¦NfeedbacknOI¬xäStyle parameter that determines the visual feedback for the selection. The possible values are: # show_selection_only Only applicable when `Menu <->multiple_selection' equals @off. In this mode, only the selected item is displayed. Used to implement `Menu <->kind: cycle'. # box Draw a box around the selected item(s). The thickness of the line equals the pen of the menu plus 1. # invert Invert the selected item(s). Used to implement `Menu ->kind: choice'. Note that inverting images gives strange results on colour displays. # image Indicate the selection by painting `Menu <-off_image' left of not-selected items and `Menu <-on_image' left of selected items. Used to implement `Menu ->kind: `marked' or `toggle'.OI­xIeN%$class/menu_item$V.menu_item.selectedEN V.menu.kindXnnsNM.menu.S.initialiseOI®xNM.menu.S.initialiseRIOI¯x0½»ÕN initialisenOI°xLCreate from its ->label, ->kind and ->message. See class menu for details.OI±xIeN($class/dialog_item$V.dialog_item.messageeN V.menu.kindeN&$class/dialog_item$V.dialog_item.labelENC.menuXnnOI²x›The default ->label is the classname of the menu (`menu'). The default ->kind is determined by the resource `Menu.kind'. The default message is @default.nsN V.menu.borderOI³xN V.menu.borderRIOI´x)¨»áNbordernOIµxŠBorder (in pixels) between the item and its box if `Menu <-pen' is not zero. When `Menu<-pen' equals 0, border is only an additional gap.OI¶xIeNM.menu.S.borderEN V.menu.gapXnnsNM.menu.S.is_onOI·xNM.menu.S.is_onRIOI¸x)¨Õ*Nis_onnOI¹xAFind menu-item from object and test whether <->active equals @on.OIºxIENM.menu.S.is_offXnnnnsNM.menu.S.prependOI»xNM.menu.S.prependRIOI¼x<ÙÊNprependnOI½xuAssociate the argument menu_item as first rather than last item of the menu. See also ->append and ->insert_before.OI¾xIENM.menu.S.appendXnnnnsNM.menu.S.active_itemOI¿xNM.menu.S.active_itemRIOIÀx0´NøN active_itemnOIÁx+(De) activate a single item indicated by `object'. `Object' is either a menu_item or the value of a menu_item. Example: ?- new(M, menu(fill_pattern, marked)), send_list(M, append, [ @nil, @grey12_image, @grey25_image ]), send(M, active_item, @grey12_image, @off).OIÂxIeNM.menu.G.active_itemENM.menu.S.updateXnnnnsNM.menu.S.executeOIÃxNM.menu.S.executeRIOIÄx*ÀaÚNexecutenOIÅx×Execution of a menu implies setting the selection and -if there is a message to execute-, execute this message. The exact behaviour is determined by various style parameter: # `Menu <-feedback' equals show_selection_only Select the next item # `Menu <-multiple_selection' == @on Toggle the <->selected attribute of the item on which the event occurred. # `Menu <-multiple_selection' == @off Make the selection of the menu the item on which the event occurred.OIÆxIENM.menu.S.eventXnnnnsNV.menu.defaultOIÇxNV.menu.defaultRIOIÈx,2í6NdefaultnOIÉxNInitial value as well as the value to which the <-selection is restored by ->restore. If the menu has <-multiple_selection: @off this is a single value, otherwise it is a chain of values. The default value may also be a function object. In this case ->restore evaluates this function and uses the result to set the <-selection.nnnsNM.menu.G.containsOIÊxNM.menu.G.containsRIOIËx,B¨@NcontainsnOIÌx1Returns the <-members chain of menu_item objects.nnnnnsNM.menu.G.selectionOIÍxNM.menu.G.selectionRIOIÎx*¼‚üN selectionnOIÏxÉWhen <-multiple_selection equals @off, returns `menu_item <-value' of the selected menu_item. Otherwise it returns a new chain with the <-value for each of the selected items (the chain may be empty).OIÐxIENM.menu.S.selectionXnOIÑxFails if <-multiple_selection equals @off and no items are selected. This should only happen it there are no items in the menu.nnsNM.menu.S.all_onOIÒxNM.menu.S.all_onRIOIÓx)¨Ñ‘Nall_onnOIÔxYEquivalent to send(Menu, active_all_items, @on). Available for backward compatibility.OIÕxIENM.menu.S.all_offXnnnnsN V.menu.layoutOIÖxN V.menu.layoutRIOI×x)¨ÇÑNlayoutnOIØxDetermines whether subsequent items are places left-to-right (horizontal) or top-to-bottom (vertical). If `Menu <-columns' is greater than 1 and layout is `horizontal', the items are placed in horizontal rows. If layout is `vertical', the items are placed in vertical columns.OIÙxIENV.menu.columnsXnnsNV.menu.previewOIÚxNV.menu.previewRIOIÛx)¨Í˜NpreviewnOIÜxEMenu_item in the preview state. Currently only used for popup-menu's.OIÝxIENV.menu.preview_feedbackXnnsNM.menu.S.active_all_itemsOIÞxNM.menu.S.active_all_itemsRIOIßx)¨ÐkNactive_all_itemsnOIàxQIf @on, all items will be made active; otherwise all items will be made inactive.OIáxIeNM.menu.S.all_offeN#$class/menu_item$V.menu_item.activeENM.menu.S.updateXnnnnsNM.menu.S.selectionOIâxNM.menu.S.selectionRIOIãx,B¤9N selectionnOIäxõSelect the specified menu_item or chain of menu_items. All other menu_items are deselected. If the argument is @nil, this is equivalent to ->clear_selection, *unless* there is a menu_item with `menu_item <-value: @nil'. Backward compatibility.OIåxIeNM.menu.G.selectioneN%$class/menu_item$V.menu_item.selectedENM.menu.S.clear_selectionXnnnOIæx“Does not check <-multiple_selection, resulting in an inconsistent menu when multiple object are selected in a menu with <-multiple_selection: @off.sNM.menu.G.memberOIçxNM.menu.G.memberRIOIèx*¼…sNmembernOIéx±When the argument is a menu_item, return this menu_item if it is part of this menu. Otherwise, find the menu_item that has <->value equal to the provided value and return this.OIêxIeNM.menu.S.memberEN M.menu.S.offXnOIëxFails silently on failure.nOIìxçFor backward compatibility, if there is no item with `menu_item <-value' that matches the specification, it will return the first item for which the conversion of the argument and `menu_item <-value' to a name yield the same name.sNM.menu.S.memberOIíxNM.menu.S.memberRIOIîx*¼…ïNmembernOIïx/Succeeds if the argument is a member menu_item.OIðxIENM.menu.G.memberXnnnOIñx‹Used to set the notion of <->current in older versions. In its current definition it is not very useful. Use <-member to test membership.XaCnumber O Iòxx