|
|
Class: Menu
Object
|
+--Menu
- Package:
- stx:libview2
- Category:
- Views-Support
- Version:
- rev:
1.74
date: 2009/12/04 13:38:27
- user: cg
- file: Menu.st directory: libview2
- module: stx stc-classLibrary: libview2
- Author:
- Claus Gittinger
not yet finished Menu class - this will eventually replace
most of the MenuView and PopUpMenu stuff.
(and hopefully be ST-80 compatible ...)
For now, only a subset of the full protocol is implemented.
MenuItem
PopUpMenu
instance creation
-
labelArray: arrayOfString lines: linesArray values: valueArrayOrNil
-
return a menu with menu items built with labels from arrayOfString (not Symbols).
The linesArray describes which menu items are the last menu item in their group.
The valueArray contains value objects for each menu item
(or is nil if no value objects are specified).
-
labelArray: arrayOfString values: valueArrayOrNil
-
return a menu with menu items built with labels from arrayOfString (not Symbols).
The valueArray contains value objects for each menu item
(or is nil if no value objects are specified).
-
labelList: arrayOfGroupStrings values: valueArrayOrNil
-
-
labels: aString lines: linesArray values: valueArrayOrNil
-
-
labels: aString values: valueArrayOrNil
-
Compatibility-ST80
-
addLine
-
-
indexOfMenuItem: anItem
-
-
indexOfMenuItemForWhich: aBlock
-
-
menuButtons
-
ST-80 seems to use a special menuButton class here.
Here, kludge a collection of menuItems.
Compatibility-Squeak
-
add: label target: target selector: selector
-
-
balloonTextForLastItem: aString
-
-
labels: labels lines: lines selections: selections
-
accessing
-
atNameKey: aNameKey
-
return the menuItem for the given nameKey; nil if no such item is in the menu.
Searches in allItems (i.e. also in subMenus)
-
groupSizes
-
-
groupSizes: something
-
-
items
-
-
labelAt: anIndex
-
gets the label of the menu item at the given index or nil
-
labelAtValue: aValue
-
gets the label of the menu item assigned to value
-
labels
-
return a collection of labels from my items
-
lastItem
-
returns the last item or nil, if there are none
-
lines
-
return the indexes of the menu items that are the last menu item in their group (except the very last).
-
menuItemAt: index
-
gets the menu item at the given index. When the index is out of bounds
nil is returned
-
menuItemLabeled: anItemLabel
-
return the menuItem for the given nameKey; nil if no such item is in the menu.
Searches all items (i.e. also submenu items)
-
menuItemWithValue: aValue
-
return the menuItem for the given value; nil if no such item is in the menu.
Searches all items (i.e. also submenu items)
-
menuItems
-
-
menuItems: aCollectionOfMenuItems menuItemGroups: sizes values: values
-
-
menuPerformer: something
-
set the receiver of the menu messages
-
numberOfItems
-
return the number of items in this menu
-
receiver
-
return the receiver of the menu messages
-
receiver: something
-
set the receiver of the menu messages
-
valueAt: index
-
return a collection of values from my items
-
valueAt: anIndex put: aValue
-
put value an an index
-
values
-
return a collection of values from my items
-
values: aCollectionOfValues
-
return a collection of values from my items
-
visibleMenuItemGroups
-
accessing-resource
-
findGuiResourcesIn: aResourceContainerOrApplication
-
setup a resource owner
-
findGuiResourcesIn: aResourceContainerOrApplication rememberResourcesIn: aValueHolderOrNil
-
setup a resource owner
adding & removing
-
addItem: aMenuItem
-
add a menuItem at the end;
useful to build a menu programmatically (or, to add more items dynamically)
-
addItem: aMenuItem beforeIndex: anIndex
-
add a menuItem at some position;
useful to build a menu programmatically (or, to add more items dynamically)
-
addItem: aMenuItem value: aValue
-
-
addItemGroup: aGroup
-
add a group of items at the end;
useful to build a menu programmatically (or, to add more items dynamically)
-
addItemGroup: aGroup values: values
-
add a group of items at the end;
useful to build a menu programmatically (or, to add more items dynamically)
-
addItemGroupLabels: labels values: values
-
add a group of items at the end;
useful to build a menu programmatically (or, to add more items dynamically)
-
addItemLabel: label value: value
-
add an item at the end;
useful to build a menu programmatically (or, to add more items dynamically)
-
addSeparator
-
add a separating line item at the end;
useful to build a menu programmatically (or, to add more items dynamically)
-
removeItem: aMenuItem
-
remove an item from the menu
-
removeItemAt: anIndex
-
remove item at an index
converting
-
asOldStylePopUpMenuFor: anApplicationOrNil
-
a temporary kludge - will vanish, when oldStyle MenuView and PopUpMenu are gone
-
fromLiteralArrayEncoding: aLiteralEncodedArray
-
read my contents from a aLiteralEncodedArray
-
literalArrayEncoding
-
return myself encoded as a literal array
enumerating
-
allItemsDetect: aOneArgBlock ifNone: exceptionalValue
-
find an element amongst each item and submenu items
-
allItemsDo: aOneArgBlock
-
evaluate block on each item and submenu items
-
detectItem: aBlock
-
evaluate the argument, aBlock for each item in the menu until the
block returns true; in this case return the item which caused the
true evaluation.
If none of the evaluations returns true, return the result of the
evaluation of the exceptionBlock
-
detectItem: aBlock ifNone: exceptionBlock
-
evaluate the argument, aBlock for each item in the menu until the
block returns true; in this case return the item which caused the
true evaluation.
If none of the evaluations returns true, return the result of the
evaluation of the exceptionBlock
-
itemsDo: aOneArgBlock
-
evaluate the block for each item in the current menu
-
menuAndSubmenusDetectItem: aOneArgBlock
-
evaluate the block for each item in the current menu and all
submenus. In case that the block returns a non nil argument,
the item will be returned
kludged fixes
-
destroy
-
dummy to allow a menu to be used where a MenuView used to be
menu items
-
removeAllAccelerators
-
-
someMenuItemLabeled: aLabel
-
get the menu item with that label; in case that the label
is not found, nil is returned
-
someMenuItemLabeled: aLabel ifNone: exceptionBlock
-
get the menu item labeled aLabel; in case that the value
is not found, the given exceptionBlock is executed and its value returned
-
someMenuItemWithValue: aValue
-
get the menu item assigned with the value; in case that the value
is not found nil is returned
-
someMenuItemWithValue: aValue ifNone: exceptionBlock
-
get the menu item assigned with the value; in case that the value
is not found, the given exceptionBlock is executed and returned
queries
-
hasHiddenItems
-
test whether any item is hidden
-
hasItems
-
test whether there are any menu-items
-
hasSubMenuAt: anIndex
-
test whether the menu item at the given index has a submenu
startup
-
show
-
realize the menu at its last position; returns the value associated with the
selected item, 0 if none was selected
-
showAt: aPoint
-
realize the menu at aPoint; returns the value associated with the
selected item, 0 if none was selected
-
showAt: aPoint resizing: aBoolean
-
realize the menu at aPoint; returns the value associated with the
selected item, 0 if none was selected
-
showAtPointer
-
realize the menu at the current pointer position; returns the value associated with the
selected item, 0 if none was selected
-
showCenteredIn: aView
-
realize the menu visible at the aView center; returns the value associated with the
selected item, 0 if none was selected
-
startUp
-
display the menu as a popUp; returns the value associated with the
selected item, nil if none was selected.
(should we return 0 form ST-80 compatibility ?)
-
startUpAt: aPoint
-
display the menu as a popUp at aPoint; returns the value associated with the
selected item, 0 if none was selected
-
startUpFor: originatingWidget
-
display the menu as a popUp; returns the value associated with the
selected item, nil if none was selected.
(should we return 0 for ST-80 compatibility ?)
-
startUpOrNil
-
display the menu as a popUp; returns the value associated with the
selected item, nil if none was selected
|