1424 ! |
1424 ! |
1425 |
1425 |
1426 submenuInspector:aMenu |
1426 submenuInspector:aMenu |
1427 "builds and returns the inspector submenu" |
1427 "builds and returns the inspector submenu" |
1428 |
1428 |
1429 |view list n names label value| |
1429 |view list n names label value indices| |
1430 |
1430 |
1431 view := self selectedView. |
1431 view := self selectedView. |
1432 view isNil ifTrue:[^ nil]. |
1432 view isNil ifTrue:[^ nil]. |
1433 |
1433 |
1434 n := view class instSize. |
1434 n := view class instSize. |
1435 n > 0 ifFalse:[^ nil ]. |
1435 n > 0 ifFalse:[^ nil ]. |
1436 |
1436 |
1437 list := OrderedCollection new:n. |
1437 list := OrderedCollection new:n. |
1438 names := view class allInstVarNames. |
1438 names := view class allInstVarNames. |
|
1439 indices := (1 to:names size) asArray. |
|
1440 names sortWith:indices. |
1439 |
1441 |
1440 1 to:n do:[:i| |action| |
1442 1 to:n do:[:i| |action| |
1441 label := (names at:i) printString. |
1443 label := (names at:i) printString. |
1442 value := view instVarAt:i. |
1444 value := view instVarAt:(indices at:i). |
1443 value isNil ifTrue:[ |
1445 value isNil ifTrue:[ |
1444 value := '------'. |
1446 value := '------'. |
1445 action := nil. |
1447 action := nil. |
1446 ] ifFalse:[ |
1448 ] ifFalse:[ |
1447 value := value displayString contractAtEndTo:40. |
1449 value := value displayString contractAtEndTo:40. |
1540 ifTrue:[ label := value := nil ] |
1544 ifTrue:[ label := value := nil ] |
1541 ifFalse:[ label := inst displayString. |
1545 ifFalse:[ label := inst displayString. |
1542 value := [ (view perform:actionSelector) inspect ]. |
1546 value := [ (view perform:actionSelector) inspect ]. |
1543 ]. |
1547 ]. |
1544 |
1548 |
1545 list add:(MenuDesc title:'action' value:label action:value). |
1549 list add:(MenuDesc title:actionSelector"'action'" value:label action:value). |
1546 ]. |
1550 ]. |
1547 ]. |
1551 ]. |
1548 |
1552 |
1549 list last isSeparator ifFalse:[ list add:(MenuDesc separator) ]. |
1553 list last isSeparator ifFalse:[ list add:(MenuDesc separator) ]. |
1550 |
1554 |
1572 ]. |
1576 ]. |
1573 |
1577 |
1574 list last isSeparator ifTrue:[ list removeLast ]. |
1578 list last isSeparator ifTrue:[ list removeLast ]. |
1575 ^ MenuDesc buildFromList:list onGC:aMenu |
1579 ^ MenuDesc buildFromList:list onGC:aMenu |
1576 |
1580 |
1577 "Modified: / 27-04-2012 / 14:22:34 / cg" |
1581 "Modified: / 31-07-2013 / 13:09:55 / cg" |
1578 ! |
1582 ! |
1579 |
1583 |
1580 submenuVisibility:aMenu |
1584 submenuVisibility:aMenu |
1581 "builds and returns the geometry submenu" |
1585 "builds and returns the geometry submenu" |
1582 |
1586 |