|
Class: Item (private in MenuPanel
This class is only visible from within
MenuPanel.
Object
|
+--MenuPanel::Item
- Package:
- stx:libwidg2
- Category:
- Views-Menus
- Owner:
- MenuPanel
- Author:
- ca
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:]
accessing
-
horizontalInset
-
-
labelRightOffset
-
-
verticalInset
-
-
verticalPopUpInset
-
defaults
-
halfSeparatorSize
-
returns the size of a space-separator
-
separatorSize
-
returns the size of a separator
-
updateStyleCache
-
extract values from the styleSheet and cache them in class variables
Usage example(s):
instance creation
-
in: aSuperMenu
-
(comment from inherited method)
evaluate aBlock, passing the receiver as arg
-
in: aSuperMenu label: aLabel
-
-
in: aSuperMenu menuItem: aMenuItem
-
-
new
-
(comment from inherited method)
return an instance of myself without indexed variables
accepting
-
canAccept
-
returns true if item is acceptable
-
toggleIndication
-
toggle indication or choice;
return value is suspect if this is neither an indication nor a choice
accessing
-
accessCharacter
-
returns my accessCharacter or nil
-
accessCharacterPosition
-
get the access character position or nil
-
accessCharacterPosition: anIndex
-
set the access character position or nil
-
argument
-
gets the argument
-
argument: anArgument
-
sets the argument
-
displayLabel
-
returns my printable Label
-
displayLabelExtent
-
returns the label's extent
-
font
-
returns the user configured font or nil (default menu font)
-
font: aFont
-
returns the user configured font or nil (default menu font)
-
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
-
ignoreMnemonicKeys: aBoolean
-
if true, mnemonic (access character) in the submenus under the item are ignored
-
ignoreShortcutKeys
-
if true, shortcutKeys (accelerators) in the submenus under the item are ignored
-
ignoreShortcutKeys: aBoolean
-
if true, shortcutKeys (accelerators) in the submenus under the item are ignored
-
itemValue
-
gets the item's value
-
itemValue: aValue
-
argument could be a value holder, an action or selector
-
label
-
returns the label
-
label: aLabel
-
set a new label; if the label changed, a redraw is performed;
handle characters $& (ST-80 compatibility)
-
menuPanel
-
returns my menuPanel
-
nameKey
-
gets the nameKey
-
nameKey: aNameKey
-
sets the nameKey
-
rawLabel
-
returns my raw, unprocessed label
-
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).
-
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).
-
startGroup
-
start group #left #right #conditionalRight ... or nil
at the moment only #right and #conditionalRight are implemented
-
startGroup: aSymbol
-
start group #left #right #conditionalRight ...
at the moment only #right and #conditionalRight are implemented
-
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
-
submenu: aSubMenu
-
set a new submenu; an existing submenu will be destroyed.
This might lead to a redraw if 'hasSubmenu' changed
-
submenuOrNil
-
returns my submenu or nil if there is none or its defined via a channel or selector
-
textLabel
-
returns my textLabel or nil.
Used internally to select items via initial-character, for example.
-
triggerOnDown
-
return true if triggering the action if pressed
-
triggerOnDown: aBool
-
setup to trigger the action if pressed
-
value
-
gets the item's value
Left here for ST80 compatibility - value is a bad name
-
value: aValue
-
could be a value holder, an action or selector
Left here for ST80 compatibility - value: is a bad name
-
value: aValue argument: anArgument
-
set the value and an argument
accessing-behavior
-
choice
-
implements a radio group; the field
-
choice: something
-
set choice indication
-
choiceValue
-
implements a radio group; the value written to the choice if selected
-
choiceValue: something
-
implements a radio group; the value written to the choice if selected
-
enabled
-
returns the enabled state
-
enabled: aBooleanOrBooleanHolderOrBlock
-
change the enabled state to either a constant boolean
or a boolean holder;
if the state changed, redraw the item
-
hideMenuOnActivated
-
hide the menu when the item was activated; the default is true
-
hideMenuOnActivated: aBool
-
hide the menu when the item was activated; the default is true
-
ifNotInUIBuilderEvaluate: aBlock
-
q&d hack to suppress info-messages in UIBuilder
-
indication
-
get on/off indication
-
indication: aValueHolder
-
set on/off indication
-
keepLinkedMenu
-
get the keepLinkedMenu flag
-
keepLinkedMenu: aBool
-
get the keepLinkedMenu flag
-
sendToOriginator
-
if true, the message is sent to the originating widget;
otherwise (the default), it it sent to the receiver/application.
-
sendToOriginator: aBoolean
-
if true, the message is sent to the originating widget;
otherwise (the default), it it sent to the receiver/application.
-
submenuChannel
-
get the submenu channel
-
submenuChannel: aSelectorOrNil
-
returns the submenu channel
accessing-dimension
-
computedPreferredExtent
-
answer the computedPreferredExtent or nil
-
computedPreferredExtent: anExtentOrNil
-
set the computedPreferredExtent or nil (see: preferredExtent)
-
moveBy: aPoint
-
move the layouts origin
-
preferredExtent
-
compute my preferred extent excluding the shortCutKey and the menu identifier
-
preferredHeight
-
-
preferredWidth
-
accessing-help
-
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.
-
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.
-
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.
-
activeHelpText: aText
-
set the active helpText
-
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) **
-
helpText
-
get the tooltip helpText or nil.
-
helpText: aText
-
explicitly set the tooltip helpText.
For example, to dynamically change it.
accessing-look
-
activeBackgroundColor
-
returns the active background color derived from menuPanel
-
activeForegroundColor
-
returns the active foreground color derived from menuPanel
-
backgroundColor
-
returns the background color derived from menuPanel
-
backgroundColorFromLabel
-
returns the background color derived from label or nil
-
buttonEnteredBackgroundColor
-
returns the background color to use when the mouse has entered
derived from menuPanel
-
buttonEnteredFrameColor
-
returns the frame color to use when the mouse has entered
derived from menuPanel
-
horizontalLayout
-
By default, submenus have a vertical layout;
if true, the submenu has a horizontal layout.
-
horizontalLayout: aBoolean
-
by default submenus hava a vertical layout;
if true, the submenu has a horizontal layout.
-
isButton
-
returns whether the item looks like a Button
-
isButton: aBool
-
set/clear the item to look like a Button
-
layout
-
returns my layout ( Rectangle )
-
layout: newLayout
-
set a new layout ( Rectangle )
-
setLayout: aLayout
-
set a new layout ( Rectangle ); no invalidate as done in layout:
-
showBusyCursorWhilePerforming
-
get the flag which controls if a busy cursor is to be shown
while performing the menu action. Defaults to false.
-
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
-
currentSubmenu
-
returns the current submenu or nil
-
hideSubmenu
-
hide submenu
-
hideSubmenu: aSubmenu
-
hide submenu
-
openDelayedSubmenu
-
called to open my delayed submenu now
-
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.
-
toggleSubmenuVisibility
-
toggle the visibility of the submenu
-
visibleSubmenu
-
returns the current visible submenu or nil
building
-
aspectAt: aKey
-
returns the value assigned to key or nil
change & update
-
fontChanged
-
called whenever the font changed
-
update: something with: aParameter from: changedObject
-
not yet realized or computed
-
updateIndicators
-
update indicators
converting
-
asMenuItem
-
convert to a MenuItem
-
menuItem
-
-
menuItem: aMenuItem
-
setup attributes from a MenuItem (which is a spec)
dependents access
-
addDependencies
-
add all dependencies
-
removeDependencies
-
remove all dependencies
drawing
-
choiceForm
-
returns choice form or nil
-
draw
-
redraw this item
-
drawButton
-
draw as button
-
drawLabel
-
draw a labeled entry; no button, no separator.
-
drawMenuIndicator
-
draw a menu indicator if the item has a menu or delayed menu.
-
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) **
-
drawRawLabel: aLabel atX: x yOffset: yOffset paint: fg on: bg
-
draw a labeled entry; no button, no separator.
-
drawSeparatingLines
-
draw separating lines
-
drawSeparator
-
draw as separator
-
indicatorForm
-
returns indication form or nil
-
invalidate
-
-
menuIndicatorIcon
-
return a menu indicator icon used if the item has a menu or delayed menu.
initialization
-
destroy
-
destroy submenus, remove dependencies
-
in: aPanel
-
create item in a menuPanel
-
initialize
-
(comment from inherited method)
just to ignore initialize to objects which do not need it
-
reinitStyle
-
label basics
-
disabledRawLabel
-
returns the label used if the item is disabled
-
fetchDeviceResources
-
-
fetchImages
-
fetch my icon images
-
updateAccessCharacterFor: aLabel
-
replace &x by the short-key attribute (i.e. remove & and underline x)
printing & storing
-
printOn: aGCOrStream
-
isKindOf:CharacterArray
private
-
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)
-
indicationValue
-
returns indication value or nil in case of no indication
-
indicationValue: aValue
-
set the indication value
-
isEntered
-
returns true if the mouse pointer is over the item
-
separatorType
-
returns type of separator line or nil
-
setupSubmenu
-
submenu is specified by a selector in submenuChannel.
-
spaceBetweenEmptyLines
-
queries
-
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
-
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
-
containsPoint: aPoint
-
returns true if aPoint is contained in my layout
-
containsPointX: x y: y
-
returns true if point is contained in my layout
-
hasDelayedMenu
-
returns true if a delayed menu exists
-
hasDelayedMenuIndicator
-
returns true if the item has a delayed menu
and is in the topMenuPanel (because submenuIndicator is already drawn in popUpViews)
-
hasIndication
-
returns true if on/off indication exists
-
hasMenuIndicator
-
returns true if the item has a delayed menu
and is in the topMenuPanel (because submenuIndicator is already drawn in popUpViews)
-
hasSubmenu
-
returns true if the item is configured as an subMenu entry
-
isEnabled
-
returns the enabled state
-
isSeparator
-
returns true if item is a separator
-
isToggle
-
returns true if on/off indication exists
-
isVisible
-
returns the visibility state
-
isVisible: something
-
change the visibility state; if the state changed, a redraw is performed
-
menuIndicatorContains: aPoint
-
returns true if the items delayed menu is hit by a button-press
-
needsItemSpaceWhenDrawing
-
-
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
-
isSelected
-
returns true if item is selected
-
isSelected: isSelected
-
change selection to a state. Depending on the state open or hide an existing
submenu and perform a redraw
testing
-
isMenuItem
-
return true, if the receiver is a menu item inside a MenuPanel, Menu or PopUpmenu.
true is returned here - I am a menuitem
Adornment
|