eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'MenuPanel::Item':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: Item (private in MenuPanel

This class is only visible from within MenuPanel.

Inheritance:

   Object
   |
   +--MenuPanel::Item

Package:
stx:libwidg2
Category:
Views-Menus
Owner:
MenuPanel
Author:
ca

Description:


I hold th information needed by an item while the menuPanel is actually
instantiated.
The instVar menuItem (confusingly bad name) holds the info from the spec.
(should be named so - shouln't it?)


[instance variables:]

[class variables:]


Related information:



Class protocol:

accessing
o  horizontalInset

o  labelRightOffset

o  verticalInset

o  verticalPopUpInset

defaults
o  halfSeparatorSize
returns the size of a space-separator

o  separatorSize
returns the size of a separator

o  updateStyleCache
extract values from the styleSheet and cache them in class variables

Usage example(s):

     self updateStyleCache

instance creation
o  in: aSuperMenu
(comment from inherited method)
evaluate aBlock, passing the receiver as arg

o  in: aSuperMenu label: aLabel

o  in: aSuperMenu menuItem: aMenuItem

o  new
(comment from inherited method)
return an instance of myself without indexed variables


Instance protocol:

accepting
o  canAccept
returns true if item is acceptable

o  toggleIndication
toggle indication or choice;
return value is suspect if this is neither an indication nor a choice

accessing
o  accessCharacter
returns my accessCharacter or nil

o  accessCharacterPosition
get the access character position or nil

o  accessCharacterPosition: anIndex
set the access character position or nil

o  argument
gets the argument

o  argument: anArgument
sets the argument

o  displayLabel
returns my printable Label

o  displayLabelExtent
returns the label's extent

o  font
returns the user configured font or nil (default menu font)

o  font: aFont
returns the user configured font or nil (default menu font)

o  ignoreMnemonicKeys
if true, mnemonic (access character) in the submenus under the item are ignored.
Set this to speedup accelerator key processing for slow dynamci menus

o  ignoreMnemonicKeys: aBoolean
if true, mnemonic (access character) in the submenus under the item are ignored

o  ignoreShortcutKeys
if true, shortcutKeys (accelerators) in the submenus under the item are ignored

o  ignoreShortcutKeys: aBoolean
if true, shortcutKeys (accelerators) in the submenus under the item are ignored

o  itemValue
gets the item's value

o  itemValue: aValue
argument could be a value holder, an action or selector

o  label
returns the label

o  label: aLabel
set a new label; if the label changed, a redraw is performed;
handle characters $& (ST-80 compatibility)

o  menuPanel
returns my menuPanel

o  nameKey
gets the nameKey

o  nameKey: aNameKey
sets the nameKey

o  rawLabel
returns my raw, unprocessed label

o  shortcutKey
get the key to press to select the submenu from the keyboard or if
no submenu exists evaluate the action assigned to the item (accept).

o  shortcutKey: aKey
set the key to press to select the submenu from the keyboard or if
no submenu exists evaluate the action assigned to the item (accept).

o  startGroup
start group #left #right #conditionalRight ... or nil
at the moment only #right and #conditionalRight are implemented

o  startGroup: aSymbol
start group #left #right #conditionalRight ...
at the moment only #right and #conditionalRight are implemented

o  submenu
returns my submenu or creates it if it's defined via a selector or channel.
May return nil, if there is really no menu

o  submenu: aSubMenu
set a new submenu; an existing submenu will be destroyed.
This might lead to a redraw if 'hasSubmenu' changed

o  submenuOrNil
returns my submenu or nil if there is none or its defined via a channel or selector

o  textLabel
returns my textLabel or nil.
Used internally to select items via initial-character, for example.

o  triggerOnDown
return true if triggering the action if pressed

o  triggerOnDown: aBool
setup to trigger the action if pressed

o  value
gets the item's value
Left here for ST80 compatibility - value is a bad name

o  value: aValue
could be a value holder, an action or selector
Left here for ST80 compatibility - value: is a bad name

o  value: aValue argument: anArgument
set the value and an argument

accessing-behavior
o  choice
implements a radio group; the field

o  choice: something
set choice indication

o  choiceValue
implements a radio group; the value written to the choice if selected

o  choiceValue: something
implements a radio group; the value written to the choice if selected

o  enabled
returns the enabled state

o  enabled: aBooleanOrBooleanHolderOrBlock
change the enabled state to either a constant boolean
or a boolean holder;
if the state changed, redraw the item

o  hideMenuOnActivated
hide the menu when the item was activated; the default is true

o  hideMenuOnActivated: aBool
hide the menu when the item was activated; the default is true

o  ifNotInUIBuilderEvaluate: aBlock
q&d hack to suppress info-messages in UIBuilder

o  indication
get on/off indication

o  indication: aValueHolder
set on/off indication

o  keepLinkedMenu
get the keepLinkedMenu flag

o  keepLinkedMenu: aBool
get the keepLinkedMenu flag

o  sendToOriginator
if true, the message is sent to the originating widget;
otherwise (the default), it it sent to the receiver/application.

o  sendToOriginator: aBoolean
if true, the message is sent to the originating widget;
otherwise (the default), it it sent to the receiver/application.

o  submenuChannel
get the submenu channel

o  submenuChannel: aSelectorOrNil
returns the submenu channel

accessing-dimension
o  computedPreferredExtent
answer the computedPreferredExtent or nil

o  computedPreferredExtent: anExtentOrNil
set the computedPreferredExtent or nil (see: preferredExtent)

o  moveBy: aPoint
move the layouts origin

o  preferredExtent
compute my preferred extent excluding the shortCutKey and the menu identifier

o  preferredHeight

o  preferredWidth

accessing-help
o  activeHelpKey
get the active helpKey;
the key to retrieve the helpText from the application.
New: may also be an association; then the assoc's key is the help-text provider,
and the assoc's value is the key in that provider's helpspec.

o  activeHelpKey: aSymbolicKeyOrClassPlusSymbolAssoc
the key used as index (and argument) to the helpSpec.
New: may also be an association; then the assoc's key is the help-text provider,
and the assoc's value is the key in that provider's helpspec.

o  activeHelpText
get the active helpText or nil if not yet resolved.
Here, a few attributes are tried as fallback key,
in case no activeHelpKey was defined in the menuSpec.
As a last fallback, the raw label is returned,
iff the displayLabel is empty; this might help if the item is an iconic item.
This should actually be FIXED by adding an activeHelpKey,
and therefore, a warning is generated if running in the IDE.
Special for hooking (non-app menu entries added by extensions):
these require that their own helpSpec is used;
for those, the activeHelpKey can be an association providing helpSpec provider
and helpSpec key.

o  activeHelpText: aText
set the active helpText

o  flyByHelpText: aText
obsolete: provided for backward compatibility
explicitly set the flyBy helpText. For example, to dynamically change it.

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  helpText
get the tooltip helpText or nil.

o  helpText: aText
explicitly set the tooltip helpText.
For example, to dynamically change it.

accessing-look
o  activeBackgroundColor
returns the active background color derived from menuPanel

o  activeForegroundColor
returns the active foreground color derived from menuPanel

o  backgroundColor
returns the background color derived from menuPanel

o  backgroundColorFromLabel
returns the background color derived from label or nil

o  buttonEnteredBackgroundColor
returns the background color to use when the mouse has entered
derived from menuPanel

o  buttonEnteredFrameColor
returns the frame color to use when the mouse has entered
derived from menuPanel

o  horizontalLayout
By default, submenus have a vertical layout;
if true, the submenu has a horizontal layout.

o  horizontalLayout: aBoolean
by default submenus hava a vertical layout;
if true, the submenu has a horizontal layout.

o  isButton
returns whether the item looks like a Button

o  isButton: aBool
set/clear the item to look like a Button

o  layout
returns my layout ( Rectangle )

o  layout: newLayout
set a new layout ( Rectangle )

o  setLayout: aLayout
set a new layout ( Rectangle ); no invalidate as done in layout:

o  showBusyCursorWhilePerforming
get the flag which controls if a busy cursor is to be shown
while performing the menu action. Defaults to false.

o  showBusyCursorWhilePerforming: aBoolean
set/clear the flag which controls if a busy cursor is to be shown
while performing the menu action. Defaults to false.

activation & deactivation
o  currentSubmenu
returns the current submenu or nil

o  hideSubmenu
hide submenu

o  hideSubmenu: aSubmenu
hide submenu

o  openDelayedSubmenu
called to open my delayed submenu now

o  openSubmenu
opens the submenu; make sure that the submenu and the menuPanel
is fully visible by shifting it into the visible screen area if
necessary.

o  toggleSubmenuVisibility
toggle the visibility of the submenu

o  visibleSubmenu
returns the current visible submenu or nil

building
o  aspectAt: aKey
returns the value assigned to key or nil

change & update
o  fontChanged
called whenever the font changed

o  update: something with: aParameter from: changedObject
not yet realized or computed

o  updateIndicators
update indicators

converting
o  asMenuItem
convert to a MenuItem

o  menuItem

o  menuItem: aMenuItem
setup attributes from a MenuItem (which is a spec)

dependents access
o  addDependencies
add all dependencies

o  removeDependencies
remove all dependencies

drawing
o  choiceForm
returns choice form or nil

o  draw
redraw this item

o  drawButton
draw as button

o  drawLabel
draw a labeled entry; no button, no separator.

o  drawMenuIndicator
draw a menu indicator if the item has a menu or delayed menu.

o  drawRawLabel: aLabel atX: x yOffset: yOffset paint: fg
marked as obsolete by exept MBP at 06-04-2023

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  drawRawLabel: aLabel atX: x yOffset: yOffset paint: fg on: bg
draw a labeled entry; no button, no separator.

o  drawSeparatingLines
draw separating lines

o  drawSeparator
draw as separator

o  indicatorForm
returns indication form or nil

o  invalidate

o  menuIndicatorIcon
return a menu indicator icon used if the item has a menu or delayed menu.

initialization
o  destroy
destroy submenus, remove dependencies

o  in: aPanel
create item in a menuPanel

o  initialize
(comment from inherited method)
just to ignore initialize to objects which do not need it

o  reinitStyle

label basics
o  disabledRawLabel
returns the label used if the item is disabled

o  fetchDeviceResources

o  fetchImages
fetch my icon images

o  updateAccessCharacterFor: aLabel
replace &x by the short-key attribute (i.e. remove & and underline x)

printing & storing
o  printOn: aGCOrStream
isKindOf:CharacterArray

private
o  findSubMenuIn: aRecv
ask the receiver for a submenu aspect, sending it
#aspectFor: first; then trying the selector itself.
Ignore the error if that message is not understood
(but not other message-not-understoods)

o  indicationValue
returns indication value or nil in case of no indication

o  indicationValue: aValue
set the indication value

o  isEntered
returns true if the mouse pointer is over the item

o  separatorType
returns type of separator line or nil

o  setupSubmenu
submenu is specified by a selector in submenuChannel.

o  spaceBetweenEmptyLines

queries
o  canChangeVisibility
return true if I am not always visible; can only be changed by a selector
otherwise there is a change notification raised if the model changed

o  canSelect
returns true if item is selectable; no separator, visible and enabled.
in case of a choice (RadioButton) i have to check for the choiceValue

o  containsPoint: aPoint
returns true if aPoint is contained in my layout

o  containsPointX: x y: y
returns true if point is contained in my layout

o  hasDelayedMenu
returns true if a delayed menu exists

o  hasDelayedMenuIndicator
returns true if the item has a delayed menu
and is in the topMenuPanel (because submenuIndicator is already drawn in popUpViews)

o  hasIndication
returns true if on/off indication exists

o  hasMenuIndicator
returns true if the item has a delayed menu
and is in the topMenuPanel (because submenuIndicator is already drawn in popUpViews)

o  hasSubmenu
returns true if the item is configured as an subMenu entry

o  isEnabled
returns the enabled state

o  isSeparator
returns true if item is a separator

o  isToggle
returns true if on/off indication exists

o  isVisible
returns the visibility state

o  isVisible: something
change the visibility state; if the state changed, a redraw is performed

o  menuIndicatorContains: aPoint
returns true if the items delayed menu is hit by a button-press

o  needsItemSpaceWhenDrawing

o  shortcutKeyAsString
converts shortcutKey to a text object for the menu-label-hint.
I.e. translates the symbolic key (e.g. #Copy) to a string
of its assignment (e.g. 'Ctrl+c')
Returns nil, if the item has no assignmemt
or the symbolic, if it has no assignment,
or the user-friendly assigned key combination.

selection
o  isSelected
returns true if item is selected

o  isSelected: isSelected
change selection to a state. Depending on the state open or hide an existing
submenu and perform a redraw

testing
o  isMenuItem
return true, if the receiver is a menu item inside a MenuPanel, Menu or PopUpmenu.
true is returned here - I am a menuitem


Private classes:

    Adornment


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 23 Nov 2024 15:49:31 GMT