UIPainter.st
changeset 2500 3e2feb544801
parent 2479 fda2e68c7cad
child 2507 42c9db715d33
equal deleted inserted replaced
2499:11be77599ca9 2500:3e2feb544801
    12 "{ Package: 'stx:libtool2' }"
    12 "{ Package: 'stx:libtool2' }"
    13 
    13 
    14 ResourceSpecEditor subclass:#UIPainter
    14 ResourceSpecEditor subclass:#UIPainter
    15 	instanceVariableNames:'specSuperclassName treeView selectionPanel specTool layoutTool
    15 	instanceVariableNames:'specSuperclassName treeView selectionPanel specTool layoutTool
    16 		helpTool painterView painter lastPort lastPage'
    16 		helpTool painterView painter lastPort lastPage'
    17 	classVariableNames:'SelectionPanelClass UseViewScroller LastPort LastPage'
    17 	classVariableNames:'SelectionPanelClass UseViewScroller LastPort LastPage
       
    18 		DefaultEditToolBarVisible DefaultToolBarVisible'
    18 	poolDictionaries:''
    19 	poolDictionaries:''
    19 	category:'Interface-UIPainter'
    20 	category:'Interface-UIPainter'
    20 !
    21 !
    21 
    22 
    22 SelectionInTreeView subclass:#TreeView
    23 SelectionInTreeView subclass:#TreeView
   126     "
   127     "
   127      UIPainter selectionPanelClass:UISelectionPanel
   128      UIPainter selectionPanelClass:UISelectionPanel
   128     "
   129     "
   129 ! !
   130 ! !
   130 
   131 
       
   132 !UIPainter class methodsFor:'defaults'!
       
   133 
       
   134 defaultEditToolbarVisible
       
   135     ^ DefaultEditToolBarVisible ? true
       
   136 !
       
   137 
       
   138 defaultToolbarVisible
       
   139     ^ DefaultToolBarVisible ? true
       
   140 ! !
       
   141 
   131 !UIPainter class methodsFor:'help specs'!
   142 !UIPainter class methodsFor:'help specs'!
   132 
   143 
   133 flyByHelpSpec
   144 flyByHelpSpec
   134     <resource: #help>
   145     <resource: #help>
   135 
   146 
   343 
   354 
   344 #historyMenuItem
   355 #historyMenuItem
   345 'Edit this windowSpec.'
   356 'Edit this windowSpec.'
   346 
   357 
   347 #moveWidgetDown
   358 #moveWidgetDown
   348 'Moves the selected widget one step down.'
   359 'Moves the selected widget down in the list (brings it to the front).'
   349 
   360 
   350 #moveWidgetInto
   361 #moveWidgetInto
   351 'Moves the selected widget into next widget as child widget.'
   362 'Moves the selected widget into next widget as child widget.'
   352 
   363 
   353 #moveWidgetOut
   364 #moveWidgetOut
   354 'Moves the selected widget out of its parent widget.'
   365 'Moves the selected widget out of its parent widget.'
   355 
   366 
   356 #moveWidgetUp
   367 #moveWidgetUp
   357 'Moves the selected widget one step up.'
   368 'Moves the selected widget up in the list (brings it to the back).'
   358 
   369 
   359 #pasteBuffer
   370 #pasteBuffer
   360 'Pastes the widgets of the clipboard at the current mouse position.'
   371 'Pastes the widgets of the clipboard at the current mouse position.'
   361 
   372 
   362 #pasteWithLayout
   373 #pasteWithLayout
   626 
   637 
   627 helpIcon
   638 helpIcon
   628     <resource: #programImage>
   639     <resource: #programImage>
   629 
   640 
   630     ^ Icon helpIcon
   641     ^ Icon helpIcon
       
   642 !
       
   643 
       
   644 hideToolBarIcon
       
   645     <resource: #programImage>
       
   646 
       
   647     ^ ToolbarIconLibrary hideToolBarIcon
   631 !
   648 !
   632 
   649 
   633 iconAlignB
   650 iconAlignB
   634     "This resource specification was automatically generated
   651     "This resource specification was automatically generated
   635      by the ImageEditor of ST/X."
   652      by the ImageEditor of ST/X."
  1334         window: 
  1351         window: 
  1335        (WindowSpec
  1352        (WindowSpec
  1336           label: 'GUI Painter'
  1353           label: 'GUI Painter'
  1337           name: 'GUI Painter'
  1354           name: 'GUI Painter'
  1338           min: (Point 560 460)
  1355           min: (Point 560 460)
  1339           bounds: (Rectangle 12 22 620 545)
  1356           bounds: (Rectangle 0 0 608 523)
       
  1357           menu: menu
  1340           icon: defaultIcon
  1358           icon: defaultIcon
  1341           menu: menu
       
  1342         )
  1359         )
  1343         component: 
  1360         component: 
  1344        (SpecCollection
  1361        (SpecCollection
  1345           collection: (
  1362           collection: (
  1346            (MenuPanelSpec
  1363             (ViewSpec
  1347               name: 'menuToolbarView'
  1364               name: 'ToolBar'
  1348               layout: (LayoutFrame 0 0.0 0 0 0 1.0 32 0)
  1365               layout: (LayoutFrame 0 0 0 0 0 1 32 0)
  1349               level: 1
  1366               visibilityChannel: toolBarVisibleHolder
  1350               tabable: true
  1367               component: 
  1351               menu: menuToolbar
  1368              (SpecCollection
       
  1369                 collection: (
       
  1370                  (ActionButtonSpec
       
  1371                     label: 'hideToolBarIcon'
       
  1372                     name: 'HideToolBarButton'
       
  1373                     layout: (LayoutFrame 0 0 0 0 13 0 0 1)
       
  1374                     activeHelpKey: hideToolBar
       
  1375                     hasCharacterOrientedLabel: false
       
  1376                     translateLabel: true
       
  1377                     model: hideToolbar
       
  1378                     postBuildCallback: hideToolBarButtonCreated:
       
  1379                   )
       
  1380                  (MenuPanelSpec
       
  1381                     name: 'menuToolbarView'
       
  1382                     layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0)
       
  1383                     visibilityChannel: toolBarVisibleHolder
       
  1384                     menu: menuToolbar
       
  1385                     textDefault: true
       
  1386                   )
       
  1387                  )
       
  1388               )
       
  1389             ) 
       
  1390 
       
  1391             (ViewSpec
       
  1392               name: 'EditToolBar'
       
  1393               layout: (LayoutFrame 0 0 32 0 0 1 64 0)
       
  1394               visibilityChannel: editToolBarVisibleHolder
       
  1395               component: 
       
  1396              (SpecCollection
       
  1397                 collection: (
       
  1398                  (ActionButtonSpec
       
  1399                     label: 'hideToolBarIcon'
       
  1400                     name: 'HideEditToolBarButton'
       
  1401                     layout: (LayoutFrame 0 0 0 0 13 0 0 1)
       
  1402                     activeHelpKey: hideToolBar
       
  1403                     hasCharacterOrientedLabel: false
       
  1404                     translateLabel: true
       
  1405                     model: hideEditToolbar
       
  1406                     postBuildCallback: hideToolBarButtonCreated:
       
  1407                   )
       
  1408                  (MenuPanelSpec
       
  1409                     name: 'EditToolBar1'
       
  1410                     layout: (LayoutFrame 13 0.0 0 0.0 0 1.0 0 1.0)
       
  1411                     visibilityChannel: editToolBarVisibleHolder
       
  1412                     menu: editToolbar
       
  1413                     textDefault: true
       
  1414                   )
       
  1415                  )
       
  1416 
       
  1417               )
  1352             )
  1418             )
       
  1419 
  1353            (VariableHorizontalPanelSpec
  1420            (VariableHorizontalPanelSpec
  1354               name: 'mainPanel'
  1421               name: 'Painter'
  1355               layout: (LayoutFrame 0 0.0 32 0.0 0 1.0 -24 1.0)
  1422               layout: (LayoutFrame 0 0.0 64 0.0 0 1.0 -24 1.0)
  1356               level: 1
  1423               level: 1
  1357               component: 
  1424               component: 
  1358              (SpecCollection
  1425              (SpecCollection
  1359                 collection: (
  1426                 collection: (
  1360                  (ArbitraryComponentSpec
  1427                  (ArbitraryComponentSpec
  1443               majorKey: ToolApplicationModel
  1510               majorKey: ToolApplicationModel
  1444               minorKey: windowSpecForInfoBar
  1511               minorKey: windowSpecForInfoBar
  1445             )
  1512             )
  1446            )
  1513            )
  1447          
  1514          
  1448         )
       
  1449       )
  1515       )
  1450 
  1516       )
  1451     "Modified: / 10-02-2007 / 14:45:31 / cg"
       
  1452 ! !
  1517 ! !
  1453 
  1518 
  1454 !UIPainter class methodsFor:'menu specs'!
  1519 !UIPainter class methodsFor:'menu specs'!
       
  1520 
       
  1521 cutCopyPasteMenuSlice
       
  1522     "This resource specification was automatically generated
       
  1523      by the MenuEditor of ST/X."
       
  1524 
       
  1525     "Do not manually edit this!! If it is corrupted,
       
  1526      the MenuEditor may not be able to read the specification."
       
  1527 
       
  1528     "
       
  1529      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar
       
  1530      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar)) startUp
       
  1531     "
       
  1532 
       
  1533     <resource: #menu>
       
  1534 
       
  1535     ^ 
       
  1536      #(Menu
       
  1537         (
       
  1538          (MenuItem
       
  1539             activeHelpKey: editCut
       
  1540             enabled: canCutHolder
       
  1541             label: 'Cut'
       
  1542             itemValue: deleteSelection
       
  1543             translateLabel: true
       
  1544             isButton: true
       
  1545             labelImage: (ResourceRetriever ToolbarIconLibrary cutWidgetIcon)
       
  1546           )
       
  1547          (MenuItem
       
  1548             activeHelpKey: editCopy
       
  1549             enabled: canCopyHolder
       
  1550             label: 'Copy'
       
  1551             itemValue: copySelection
       
  1552             translateLabel: true
       
  1553             isButton: true
       
  1554             labelImage: (ResourceRetriever ToolbarIconLibrary copyWidgetIcon)
       
  1555           )
       
  1556          (MenuItem
       
  1557             activeHelpKey: editPaste
       
  1558             enabled: canPasteKeepingLayoutHolder
       
  1559             label: 'Paste with Layout'
       
  1560             itemValue: pasteWithLayout
       
  1561             translateLabel: true
       
  1562             isButton: true
       
  1563             labelImage: (ResourceRetriever ToolbarIconLibrary pasteWidgetIcon)
       
  1564           )
       
  1565          (MenuItem
       
  1566             activeHelpKey: editDelete
       
  1567             enabled: canCutHolder
       
  1568             label: 'Delete'
       
  1569             itemValue: deleteTotalSelection
       
  1570             translateLabel: true
       
  1571             isButton: true
       
  1572             isVisible: false
       
  1573             labelImage: (ResourceRetriever ToolbarIconLibrary deleteWidgetIcon)
       
  1574           )
       
  1575          (MenuItem
       
  1576             label: '-'
       
  1577           )
       
  1578          (MenuItem
       
  1579             activeHelpKey: editUndo
       
  1580             enabled: hasUndoHistoryHolder
       
  1581             label: 'Undo'
       
  1582             itemValue: undoLast
       
  1583             translateLabel: true
       
  1584             isButton: true
       
  1585             labelImage: (ResourceRetriever ToolbarIconLibrary undoIcon)
       
  1586           )
       
  1587          )
       
  1588         nil
       
  1589         nil
       
  1590       )
       
  1591 !
       
  1592 
       
  1593 editToolbar
       
  1594     "This resource specification was automatically generated
       
  1595      by the MenuEditor of ST/X."
       
  1596 
       
  1597     "Do not manually edit this!! If it is corrupted,
       
  1598      the MenuEditor may not be able to read the specification."
       
  1599 
       
  1600     "
       
  1601      MenuEditor new openOnClass:UIPainter andSelector:#editToolbar
       
  1602      (Menu new fromLiteralArrayEncoding:(UIPainter editToolbar)) startUp
       
  1603     "
       
  1604 
       
  1605     <resource: #menu>
       
  1606 
       
  1607     ^ 
       
  1608      #(Menu
       
  1609         (
       
  1610          (MenuItem
       
  1611             label: 'moveItems'
       
  1612             translateLabel: true
       
  1613             submenuChannel: moveInListMenuSlice
       
  1614             isMenuSlice: true
       
  1615           )
       
  1616          (MenuItem
       
  1617             label: '-'
       
  1618           )
       
  1619          (MenuItem
       
  1620             label: 'gridItems'
       
  1621             translateLabel: true
       
  1622             submenuChannel: gridMenuSlice
       
  1623             isMenuSlice: true
       
  1624           )
       
  1625          )
       
  1626         nil
       
  1627         nil
       
  1628       )
       
  1629 !
       
  1630 
       
  1631 gridMenuSlice
       
  1632     "This resource specification was automatically generated
       
  1633      by the MenuEditor of ST/X."
       
  1634 
       
  1635     "Do not manually edit this!! If it is corrupted,
       
  1636      the MenuEditor may not be able to read the specification."
       
  1637 
       
  1638     "
       
  1639      MenuEditor new openOnClass:Workflow::WorksheetEditor andSelector:#zoomMenuSlice
       
  1640      (Menu new fromLiteralArrayEncoding:(Workflow::WorksheetEditor zoomMenuSlice)) startUp
       
  1641     "
       
  1642 
       
  1643     <resource: #menu>
       
  1644 
       
  1645     ^ 
       
  1646      #(Menu
       
  1647         (
       
  1648          (MenuItem
       
  1649             label: 'ShowGrid'
       
  1650             translateLabel: true
       
  1651             isButton: true
       
  1652             indication: gridShownHolder
       
  1653             labelImage: (ResourceRetriever #'Expecco::ExpeccoIconLibrary' showGridIcon)
       
  1654           )
       
  1655          (MenuItem
       
  1656             label: 'AlignToGrid'
       
  1657             translateLabel: true
       
  1658             isButton: true
       
  1659             indication: alignToGridHolder
       
  1660             labelImage: (ResourceRetriever #'Expecco::ExpeccoIconLibrary' alignToGridIcon)
       
  1661           )
       
  1662          )
       
  1663         nil
       
  1664         nil
       
  1665       )
       
  1666 !
  1455 
  1667 
  1456 menu
  1668 menu
  1457     "This resource specification was automatically generated
  1669     "This resource specification was automatically generated
  1458      by the MenuEditor of ST/X."
  1670      by the MenuEditor of ST/X."
  1459 
  1671 
  1478           )
  1690           )
  1479          (MenuItem
  1691          (MenuItem
  1480             label: 'Edit'
  1692             label: 'Edit'
  1481             translateLabel: true
  1693             translateLabel: true
  1482             submenuChannel: menuEdit
  1694             submenuChannel: menuEdit
       
  1695           )
       
  1696          (MenuItem
       
  1697             label: 'View'
       
  1698             translateLabel: true
       
  1699             submenu: 
       
  1700            (Menu
       
  1701               (
       
  1702                (MenuItem
       
  1703                   activeHelpKey: settingsCanvas
       
  1704                   label: 'Canvas'
       
  1705                   translateLabel: true
       
  1706                   indication: painterShown
       
  1707                 )
       
  1708                (MenuItem
       
  1709                   activeHelpKey: settingsGallery
       
  1710                   label: 'Gallery'
       
  1711                   translateLabel: true
       
  1712                   indication: galleryShown
       
  1713                 )
       
  1714                (MenuItem
       
  1715                   label: '-'
       
  1716                 )
       
  1717                (MenuItem
       
  1718                   label: 'Toolbar'
       
  1719                   translateLabel: true
       
  1720                   hideMenuOnActivated: false
       
  1721                   indication: toolBarVisibleHolder
       
  1722                 )
       
  1723                (MenuItem
       
  1724                   label: 'Editor Toolbar'
       
  1725                   translateLabel: true
       
  1726                   hideMenuOnActivated: false
       
  1727                   indication: editToolBarVisibleHolder
       
  1728                 )
       
  1729                (MenuItem
       
  1730                   label: '-'
       
  1731                 )
       
  1732                (MenuItem
       
  1733                   label: 'Load Sketch as Background...'
       
  1734                   itemValue: useSketch
       
  1735                   translateLabel: true
       
  1736                 )
       
  1737                (MenuItem
       
  1738                   label: 'Load Image as Background...'
       
  1739                   itemValue: useBackgroundImage
       
  1740                   translateLabel: true
       
  1741                 )
       
  1742                )
       
  1743               nil
       
  1744               nil
       
  1745             )
  1483           )
  1746           )
  1484          (MenuItem
  1747          (MenuItem
  1485             label: 'Align'
  1748             label: 'Align'
  1486             translateLabel: true
  1749             translateLabel: true
  1487             submenuChannel: menuAlign
  1750             submenuChannel: menuAlign
  1561             translateLabel: true
  1824             translateLabel: true
  1562             submenu: 
  1825             submenu: 
  1563            (Menu
  1826            (Menu
  1564               (
  1827               (
  1565                (MenuItem
  1828                (MenuItem
  1566                   activeHelpKey: settingsCanvas
       
  1567                   label: 'Canvas'
       
  1568                   translateLabel: true
       
  1569                   indication: painterShown
       
  1570                 )
       
  1571                (MenuItem
       
  1572                   activeHelpKey: settingsGallery
       
  1573                   label: 'Gallery'
       
  1574                   translateLabel: true
       
  1575                   indication: galleryShown
       
  1576                 )
       
  1577                (MenuItem
       
  1578                   label: '-'
       
  1579                 )
       
  1580                (MenuItem
       
  1581                   activeHelpKey: settingsAspectsAsInstances
  1829                   activeHelpKey: settingsAspectsAsInstances
  1582                   label: 'Aspects as InstanceVariables'
  1830                   label: 'Aspects as InstanceVariables'
  1583                   translateLabel: true
  1831                   translateLabel: true
  1584                   isVisible: isNotEditingSpecOnly
  1832                   isVisible: isNotEditingSpecOnly
  1585                   indication: generateAspectsAsInstanceVariables:
  1833                   indication: generateAspectsAsInstanceVariables:
  1617                   activeHelpKey: settingsGridManager
  1865                   activeHelpKey: settingsGridManager
  1618                   label: 'Grid Manager...'
  1866                   label: 'Grid Manager...'
  1619                   itemValue: doDefineGrid
  1867                   itemValue: doDefineGrid
  1620                   translateLabel: true
  1868                   translateLabel: true
  1621                 )
  1869                 )
  1622                (MenuItem
       
  1623                   label: 'Load Sketch as Background...'
       
  1624                   itemValue: useSketch
       
  1625                   translateLabel: true
       
  1626                 )
       
  1627                (MenuItem
       
  1628                   label: 'Load Image as Background...'
       
  1629                   itemValue: useBackgroundImage
       
  1630                   translateLabel: true
       
  1631                 )
       
  1632                )
  1870                )
  1633               nil
  1871               nil
  1634               nil
  1872               nil
  1635             )
  1873             )
  1636           )
  1874           )
  2096          (MenuItem
  2334          (MenuItem
  2097             label: '-'
  2335             label: '-'
  2098           )
  2336           )
  2099          (MenuItem
  2337          (MenuItem
  2100             activeHelpKey: sortItems
  2338             activeHelpKey: sortItems
  2101             label: 'Sort Selected Items'
  2339             label: 'Sort Selected Items by Position'
  2102             itemValue: doSortItems
  2340             itemValue: doSortItems
  2103             translateLabel: true
  2341             translateLabel: true
  2104           )
  2342           )
  2105 "/         (MenuItem
  2343 "/         (MenuItem
  2106 "/            label: 'Action'
  2344 "/            label: 'Action'
  2447           )
  2685           )
  2448          (MenuItem
  2686          (MenuItem
  2449             label: '-'
  2687             label: '-'
  2450           )
  2688           )
  2451          (MenuItem
  2689          (MenuItem
  2452             activeHelpKey: editUndo
  2690             label: 'CutCopyPaste'
  2453             enabled: hasUndoHistoryHolder
  2691             translateLabel: true
  2454             label: 'Undo'
  2692             submenuChannel: cutCopyPasteMenuSlice
  2455             itemValue: undoLast
  2693             isMenuSlice: true
       
  2694           )
       
  2695          (MenuItem
       
  2696             label: '-'
       
  2697             startGroup: right
       
  2698           )
       
  2699          (MenuItem
       
  2700             activeHelpKey: settingsCanvas
       
  2701             label: 'Canvas'
       
  2702             translateLabel: true
       
  2703             indication: painterShown
       
  2704           )
       
  2705          (MenuItem
       
  2706             activeHelpKey: settingsGallery
       
  2707             label: 'Gallery'
       
  2708             translateLabel: true
       
  2709             indication: galleryShown
       
  2710           )
       
  2711          )
       
  2712         nil
       
  2713         nil
       
  2714       )
       
  2715 !
       
  2716 
       
  2717 menuToolbar2
       
  2718     "This resource specification was automatically generated
       
  2719      by the MenuEditor of ST/X."
       
  2720 
       
  2721     "Do not manually edit this!! If it is corrupted,
       
  2722      the MenuEditor may not be able to read the specification."
       
  2723 
       
  2724     "
       
  2725      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar2
       
  2726      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar2)) startUp
       
  2727     "
       
  2728 
       
  2729     <resource: #menu>
       
  2730 
       
  2731     ^ 
       
  2732      #(Menu
       
  2733         (
       
  2734          (MenuItem
       
  2735             activeHelpKey: alignSelectionLeft
       
  2736             enabled: canMoveOrAlignSelection
       
  2737             label: 'Align Left'
       
  2738             itemValue: alignSelectionLeft
  2456             translateLabel: true
  2739             translateLabel: true
  2457             isButton: true
  2740             isButton: true
  2458             labelImage: (ResourceRetriever ToolbarIconLibrary undoIcon)
  2741             labelImage: (ResourceRetriever nil iconAlignL)
  2459           )
  2742           )
  2460          (MenuItem
  2743          (MenuItem
  2461             label: '-'
  2744             activeHelpKey: alignSelectionRight
  2462           )
  2745             enabled: canMoveOrAlignSelection
  2463          (MenuItem
  2746             label: 'Align Right'
  2464             activeHelpKey: editCut
  2747             itemValue: alignSelectionRight
  2465             enabled: canCutHolder
       
  2466             label: 'Cut'
       
  2467             itemValue: deleteSelection
       
  2468             translateLabel: true
  2748             translateLabel: true
  2469             isButton: true
  2749             isButton: true
  2470             labelImage: (ResourceRetriever ToolbarIconLibrary cutWidgetIcon)
  2750             labelImage: (ResourceRetriever nil iconAlignR)
  2471           )
  2751           )
  2472          (MenuItem
  2752          (MenuItem
  2473             activeHelpKey: editCopy
  2753             activeHelpKey: alignSelectionTop
  2474             enabled: canCopyHolder
  2754             enabled: canMoveOrAlignSelection
  2475             label: 'Copy'
  2755             label: 'Align Top'
  2476             itemValue: copySelection
  2756             itemValue: alignSelectionTop
  2477             translateLabel: true
  2757             translateLabel: true
  2478             isButton: true
  2758             isButton: true
  2479             labelImage: (ResourceRetriever ToolbarIconLibrary copyWidgetIcon)
  2759             labelImage: (ResourceRetriever nil iconAlignT)
  2480           )
  2760           )
  2481          (MenuItem
  2761          (MenuItem
  2482             activeHelpKey: editPaste
  2762             activeHelpKey: alignSelectionBottom
  2483             enabled: canPasteKeepingLayoutHolder
  2763             enabled: canMoveOrAlignSelection
  2484             label: 'Paste with Layout'
  2764             label: 'Align Bottom'
  2485             itemValue: pasteWithLayout
  2765             itemValue: alignSelectionBottom
  2486             translateLabel: true
  2766             translateLabel: true
  2487             isButton: true
  2767             isButton: true
  2488             labelImage: (ResourceRetriever ToolbarIconLibrary pasteWidgetIcon)
  2768             labelImage: (ResourceRetriever nil iconAlignB)
  2489           )
  2769           )
  2490          (MenuItem
  2770          (MenuItem
  2491             activeHelpKey: editDelete
  2771             activeHelpKey: alignSelectionLeftAndRight
  2492             enabled: canCutHolder
  2772             enabled: canResizeSelection
  2493             label: 'Delete'
  2773             label: 'Align Left & Right'
  2494             itemValue: deleteTotalSelection
  2774             itemValue: alignSelectionLeftAndRight
  2495             translateLabel: true
  2775             translateLabel: true
  2496             isButton: true
  2776             isButton: true
  2497             isVisible: false
  2777             labelImage: (ResourceRetriever nil iconResizeLR)
  2498             labelImage: (ResourceRetriever ToolbarIconLibrary deleteWidgetIcon)
  2778           )
  2499           )
  2779          (MenuItem
  2500          (MenuItem
  2780             activeHelpKey: alignSelectionTopAndBottom
  2501             label: '-'
  2781             enabled: canResizeSelection
  2502           )
  2782             label: 'Align Top & Bottom'
       
  2783             itemValue: alignSelectionTopAndBottom
       
  2784             translateLabel: true
       
  2785             isButton: true
       
  2786             labelImage: (ResourceRetriever nil iconResizeTB)
       
  2787           )
       
  2788          (MenuItem
       
  2789             label: ''
       
  2790           )
       
  2791          (MenuItem
       
  2792             activeHelpKey: changePositionLeft
       
  2793             enabled: canMoveOrAlignSelection
       
  2794             label: 'Move Left'
       
  2795             itemValue: moveSelectionLeft
       
  2796             translateLabel: true
       
  2797             isButton: true
       
  2798             hideMenuOnActivated: false
       
  2799             triggerOnDown: true
       
  2800             labelImage: (ResourceRetriever nil arrowLeft)
       
  2801           )
       
  2802          (MenuItem
       
  2803             activeHelpKey: changePositionRight
       
  2804             enabled: canMoveOrAlignSelection
       
  2805             label: 'Move Right'
       
  2806             itemValue: moveSelectionRight
       
  2807             translateLabel: true
       
  2808             isButton: true
       
  2809             hideMenuOnActivated: false
       
  2810             triggerOnDown: true
       
  2811             labelImage: (ResourceRetriever nil arrowRight)
       
  2812           )
       
  2813          (MenuItem
       
  2814             activeHelpKey: changePositionUp
       
  2815             enabled: canMoveOrAlignSelection
       
  2816             label: 'Move Up'
       
  2817             itemValue: moveSelectionUp
       
  2818             translateLabel: true
       
  2819             isButton: true
       
  2820             triggerOnDown: true
       
  2821             labelImage: (ResourceRetriever nil arrowUp)
       
  2822           )
       
  2823          (MenuItem
       
  2824             activeHelpKey: changePositionDown
       
  2825             enabled: canMoveOrAlignSelection
       
  2826             label: 'Move Down'
       
  2827             itemValue: moveSelectionDown
       
  2828             translateLabel: true
       
  2829             isButton: true
       
  2830             triggerOnDown: true
       
  2831             labelImage: (ResourceRetriever nil arrowDown)
       
  2832           )
       
  2833          (MenuItem
       
  2834             activeHelpKey: editOpenSpecDocumentation
       
  2835             label: 'Widget Documentation'
       
  2836             itemValue: doOpenWidgetDocumentation
       
  2837             translateLabel: true
       
  2838             isButton: true
       
  2839             startGroup: right
       
  2840             labelImage: (ResourceRetriever Icon helpIcon)
       
  2841           )
       
  2842          )
       
  2843         nil
       
  2844         nil
       
  2845       )
       
  2846 !
       
  2847 
       
  2848 moveInListMenuSlice
       
  2849     "This resource specification was automatically generated
       
  2850      by the MenuEditor of ST/X."
       
  2851 
       
  2852     "Do not manually edit this!! If it is corrupted,
       
  2853      the MenuEditor may not be able to read the specification."
       
  2854 
       
  2855     "
       
  2856      MenuEditor new openOnClass:UIPainter andSelector:#editToolbar
       
  2857      (Menu new fromLiteralArrayEncoding:(UIPainter editToolbar)) startUp
       
  2858     "
       
  2859 
       
  2860     <resource: #menu>
       
  2861 
       
  2862     ^ 
       
  2863      #(Menu
       
  2864         (
  2503          (MenuItem
  2865          (MenuItem
  2504             activeHelpKey: moveWidgetUp
  2866             activeHelpKey: moveWidgetUp
  2505             enabled: canChangeOrderInContainer
  2867             enabled: canChangeOrderInContainer
  2506             label: 'Move Up'
  2868             label: 'Move Up'
  2507             itemValue: doStepUp
  2869             itemValue: doStepUp
  2533             label: 'Move Out'
  2895             label: 'Move Out'
  2534             itemValue: doStepOut
  2896             itemValue: doStepOut
  2535             translateLabel: true
  2897             translateLabel: true
  2536             isButton: true
  2898             isButton: true
  2537             labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetLeftDownIcon)
  2899             labelImage: (ResourceRetriever ToolbarIconLibrary moveWidgetLeftDownIcon)
  2538           )
       
  2539          (MenuItem
       
  2540             label: '-'
       
  2541             startGroup: right
       
  2542           )
       
  2543          (MenuItem
       
  2544             activeHelpKey: settingsCanvas
       
  2545             label: 'Canvas'
       
  2546             translateLabel: true
       
  2547             indication: painterShown
       
  2548           )
       
  2549          (MenuItem
       
  2550             activeHelpKey: settingsGallery
       
  2551             label: 'Gallery'
       
  2552             translateLabel: true
       
  2553             indication: galleryShown
       
  2554           )
       
  2555          )
       
  2556         nil
       
  2557         nil
       
  2558       )
       
  2559 !
       
  2560 
       
  2561 menuToolbar2
       
  2562     "This resource specification was automatically generated
       
  2563      by the MenuEditor of ST/X."
       
  2564 
       
  2565     "Do not manually edit this!! If it is corrupted,
       
  2566      the MenuEditor may not be able to read the specification."
       
  2567 
       
  2568     "
       
  2569      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar2
       
  2570      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar2)) startUp
       
  2571     "
       
  2572 
       
  2573     <resource: #menu>
       
  2574 
       
  2575     ^ 
       
  2576      #(Menu
       
  2577         (
       
  2578          (MenuItem
       
  2579             activeHelpKey: alignSelectionLeft
       
  2580             enabled: canMoveOrAlignSelection
       
  2581             label: 'Align Left'
       
  2582             itemValue: alignSelectionLeft
       
  2583             translateLabel: true
       
  2584             isButton: true
       
  2585             labelImage: (ResourceRetriever nil iconAlignL)
       
  2586           )
       
  2587          (MenuItem
       
  2588             activeHelpKey: alignSelectionRight
       
  2589             enabled: canMoveOrAlignSelection
       
  2590             label: 'Align Right'
       
  2591             itemValue: alignSelectionRight
       
  2592             translateLabel: true
       
  2593             isButton: true
       
  2594             labelImage: (ResourceRetriever nil iconAlignR)
       
  2595           )
       
  2596          (MenuItem
       
  2597             activeHelpKey: alignSelectionTop
       
  2598             enabled: canMoveOrAlignSelection
       
  2599             label: 'Align Top'
       
  2600             itemValue: alignSelectionTop
       
  2601             translateLabel: true
       
  2602             isButton: true
       
  2603             labelImage: (ResourceRetriever nil iconAlignT)
       
  2604           )
       
  2605          (MenuItem
       
  2606             activeHelpKey: alignSelectionBottom
       
  2607             enabled: canMoveOrAlignSelection
       
  2608             label: 'Align Bottom'
       
  2609             itemValue: alignSelectionBottom
       
  2610             translateLabel: true
       
  2611             isButton: true
       
  2612             labelImage: (ResourceRetriever nil iconAlignB)
       
  2613           )
       
  2614          (MenuItem
       
  2615             activeHelpKey: alignSelectionLeftAndRight
       
  2616             enabled: canResizeSelection
       
  2617             label: 'Align Left & Right'
       
  2618             itemValue: alignSelectionLeftAndRight
       
  2619             translateLabel: true
       
  2620             isButton: true
       
  2621             labelImage: (ResourceRetriever nil iconResizeLR)
       
  2622           )
       
  2623          (MenuItem
       
  2624             activeHelpKey: alignSelectionTopAndBottom
       
  2625             enabled: canResizeSelection
       
  2626             label: 'Align Top & Bottom'
       
  2627             itemValue: alignSelectionTopAndBottom
       
  2628             translateLabel: true
       
  2629             isButton: true
       
  2630             labelImage: (ResourceRetriever nil iconResizeTB)
       
  2631           )
       
  2632          (MenuItem
       
  2633             label: ''
       
  2634           )
       
  2635          (MenuItem
       
  2636             activeHelpKey: changePositionLeft
       
  2637             enabled: canMoveOrAlignSelection
       
  2638             label: 'Move Left'
       
  2639             itemValue: moveSelectionLeft
       
  2640             translateLabel: true
       
  2641             isButton: true
       
  2642             hideMenuOnActivated: false
       
  2643             triggerOnDown: true
       
  2644             labelImage: (ResourceRetriever nil arrowLeft)
       
  2645           )
       
  2646          (MenuItem
       
  2647             activeHelpKey: changePositionRight
       
  2648             enabled: canMoveOrAlignSelection
       
  2649             label: 'Move Right'
       
  2650             itemValue: moveSelectionRight
       
  2651             translateLabel: true
       
  2652             isButton: true
       
  2653             hideMenuOnActivated: false
       
  2654             triggerOnDown: true
       
  2655             labelImage: (ResourceRetriever nil arrowRight)
       
  2656           )
       
  2657          (MenuItem
       
  2658             activeHelpKey: changePositionUp
       
  2659             enabled: canMoveOrAlignSelection
       
  2660             label: 'Move Up'
       
  2661             itemValue: moveSelectionUp
       
  2662             translateLabel: true
       
  2663             isButton: true
       
  2664             triggerOnDown: true
       
  2665             labelImage: (ResourceRetriever nil arrowUp)
       
  2666           )
       
  2667          (MenuItem
       
  2668             activeHelpKey: changePositionDown
       
  2669             enabled: canMoveOrAlignSelection
       
  2670             label: 'Move Down'
       
  2671             itemValue: moveSelectionDown
       
  2672             translateLabel: true
       
  2673             isButton: true
       
  2674             triggerOnDown: true
       
  2675             labelImage: (ResourceRetriever nil arrowDown)
       
  2676           )
       
  2677          (MenuItem
       
  2678             activeHelpKey: editOpenSpecDocumentation
       
  2679             label: 'Widget Documentation'
       
  2680             itemValue: doOpenWidgetDocumentation
       
  2681             translateLabel: true
       
  2682             isButton: true
       
  2683             startGroup: right
       
  2684             labelImage: (ResourceRetriever Icon helpIcon)
       
  2685           )
  2900           )
  2686          )
  2901          )
  2687         nil
  2902         nil
  2688         nil
  2903         nil
  2689       )
  2904       )
  2690 ! !
  2905 ! !
  2691 
  2906 
  2692 !UIPainter methodsFor:'aspects'!
  2907 !UIPainter methodsFor:'aspects'!
  2693 
  2908 
       
  2909 alignToGridHolder
       
  2910     |holder|
       
  2911 
       
  2912     (holder := builder bindingAt:#alignToGridHolder) isNil ifTrue:[
       
  2913         holder := (self class settings at: #GridAlign ifAbsent: [painter gridAlign]) asValue.
       
  2914         builder aspectAt:#alignToGridHolder put: holder.
       
  2915         holder addDependent:self.
       
  2916     ].
       
  2917     ^ holder
       
  2918 !
       
  2919 
  2694 aspectFor:aKey
  2920 aspectFor:aKey
  2695     "returns the aspect for aKey or nil"
  2921     "returns the aspect for aKey or nil"
  2696 
  2922 
  2697     ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
  2923     ^ aspects at:aKey ifAbsent:[ super aspectFor:aKey ]
  2698 !
  2924 !
  2776 canReplaceSelection
  3002 canReplaceSelection
  2777     treeView isCanvasSelected ifTrue:[^ false].
  3003     treeView isCanvasSelected ifTrue:[^ false].
  2778     ^ true
  3004     ^ true
  2779 !
  3005 !
  2780 
  3006 
       
  3007 editToolBarVisibleHolder
       
  3008     |holder|
       
  3009 
       
  3010     (holder := builder bindingAt:#editToolBarVisibleHolder) isNil ifTrue:[
       
  3011         holder := self class defaultEditToolbarVisible asValue.
       
  3012         builder aspectAt:#editToolBarVisibleHolder put: holder.
       
  3013         holder addDependent:self.
       
  3014     ].
       
  3015     ^ holder
       
  3016 !
       
  3017 
  2781 enableChannel
  3018 enableChannel
  2782     "true if modifications are allowed otherwise in test mode"
  3019     "true if modifications are allowed otherwise in test mode"
  2783 
  3020 
  2784     ^ builder valueAspectFor:#enableChannel initialValue:true
  3021     ^ builder valueAspectFor:#enableChannel initialValue:true
  2785 !
  3022 !
  2801     ].
  3038     ].
  2802     ^ holder
  3039     ^ holder
  2803 
  3040 
  2804 !
  3041 !
  2805 
  3042 
       
  3043 gridShownHolder
       
  3044     |holder|
       
  3045 
       
  3046     (holder := builder bindingAt:#gridShownHolder) isNil ifTrue:[
       
  3047         holder := (self class settings at: #GridShown ifAbsent: [painter gridShown]) asValue.
       
  3048         builder aspectAt:#gridShownHolder put: holder.
       
  3049         holder addDependent:self.
       
  3050     ].
       
  3051     ^ holder
       
  3052 !
       
  3053 
  2806 hasOneSelectionOtherThanCanvas
  3054 hasOneSelectionOtherThanCanvas
  2807     "returns a value holder which is true in case that one widget is selected
  3055     "returns a value holder which is true in case that one widget is selected
  2808      other than the root"
  3056      other than the root"
  2809 
  3057 
  2810     ^ builder booleanValueAspectFor:#hasOneSelectionOtherThanCanvas
  3058     ^ builder booleanValueAspectFor:#hasOneSelectionOtherThanCanvas
  2875     |holder|
  3123     |holder|
  2876 
  3124 
  2877     (holder := builder bindingAt:#tabModel) isNil ifTrue:[
  3125     (holder := builder bindingAt:#tabModel) isNil ifTrue:[
  2878         holder := AspectAdaptor new subject:self; forAspect:#tabSelection.
  3126         holder := AspectAdaptor new subject:self; forAspect:#tabSelection.
  2879         builder aspectAt:#tabModel put:holder.
  3127         builder aspectAt:#tabModel put:holder.
       
  3128     ].
       
  3129     ^ holder
       
  3130 !
       
  3131 
       
  3132 toolBarVisibleHolder
       
  3133     |holder|
       
  3134 
       
  3135     (holder := builder bindingAt:#toolBarVisibleHolder) isNil ifTrue:[
       
  3136         holder := self class defaultToolbarVisible asValue.
       
  3137         builder aspectAt:#toolBarVisibleHolder put: holder.
       
  3138         holder addDependent:self.
  2880     ].
  3139     ].
  2881     ^ holder
  3140     ^ holder
  2882 !
  3141 !
  2883 
  3142 
  2884 treeView
  3143 treeView
  3129             self treeSelectionChanged
  3388             self treeSelectionChanged
  3130         ]
  3389         ]
  3131     ]
  3390     ]
  3132 !
  3391 !
  3133 
  3392 
  3134 update:something with:aParameter from:someObject
  3393 toolBarVisibilityChanged
       
  3394     |toolBarVisible editToolBarVisible toolBar editToolBar noteBook topOffset|
       
  3395 
       
  3396     topOffset := 0.
       
  3397 
       
  3398     toolBar := self componentAt:#ToolBar.
       
  3399     toolBar notNil ifTrue:[
       
  3400         toolBarVisible := self toolBarVisibleHolder value.
       
  3401         DefaultToolBarVisible := toolBarVisible.
       
  3402         toolBarVisible ifTrue:[
       
  3403             topOffset := topOffset + toolBar height.
       
  3404         ]
       
  3405     ].
       
  3406 
       
  3407     editToolBar := self componentAt:#EditToolBar.
       
  3408     editToolBar notNil ifTrue:[
       
  3409         editToolBar layout 
       
  3410             topOffset:topOffset bottomOffset:(topOffset + editToolBar height).
       
  3411         "/ force it to recompute its dimension
       
  3412         editToolBar container notNil ifTrue:[
       
  3413             editToolBar containerChangedSize.
       
  3414         ].
       
  3415         editToolBarVisible := self editToolBarVisibleHolder value.
       
  3416         DefaultEditToolBarVisible := editToolBarVisible.
       
  3417         editToolBarVisible ifTrue:[
       
  3418             topOffset := topOffset + editToolBar height.
       
  3419         ]
       
  3420     ].
       
  3421 
       
  3422     noteBook := self componentAt:#Painter.
       
  3423     noteBook notNil ifTrue:[
       
  3424         noteBook layout topOffset:topOffset.
       
  3425         "/ force it to recompute its dimension
       
  3426         noteBook container notNil ifTrue:[
       
  3427             noteBook containerChangedSize.
       
  3428         ].
       
  3429     ].
       
  3430 
       
  3431     "Created: / 18-02-2007 / 14:46:22 / cg"
       
  3432 !
       
  3433 
       
  3434 update:something with:aParameter from:changedObject
  3135     "catches change notifications"
  3435     "catches change notifications"
  3136 
  3436 
  3137     |window lbl|
  3437     |window lbl|
  3138 
  3438 
  3139     someObject == treeView model ifTrue:[
  3439     ((changedObject == self toolBarVisibleHolder)
       
  3440     or:[ changedObject == self editToolBarVisibleHolder ]) ifTrue:[
       
  3441         self toolBarVisibilityChanged.
       
  3442         ^ self
       
  3443     ].
       
  3444     changedObject == self gridShownHolder ifTrue:[
       
  3445         self class settings at: #GridShown  put: changedObject value.
       
  3446         painter gridShown:changedObject value.
       
  3447         ^ self
       
  3448     ].
       
  3449     changedObject == self alignToGridHolder ifTrue:[
       
  3450         self class settings at: #GridAlign  put: changedObject value.
       
  3451         painter gridAlign:changedObject value.
       
  3452         ^ self
       
  3453     ].
       
  3454 
       
  3455     changedObject == treeView model ifTrue:[
  3140         (something == #selection
  3456         (something == #selection
  3141         or:[something == #selectionIndex]) ifTrue:[self treeSelectionChanged].
  3457         or:[something == #selectionIndex]) ifTrue:[self treeSelectionChanged].
  3142         ^ self
  3458         ^ self
  3143     ].
  3459     ].
  3144 
  3460 
  3145     someObject == self galleryShown ifTrue:[
  3461     changedObject == self galleryShown ifTrue:[
  3146         "/ galleryShown toggle changed
  3462         "/ galleryShown toggle changed
  3147         window := selectionPanel window.
  3463         window := selectionPanel window.
  3148         (someObject value) ifTrue:[
  3464         (changedObject value) ifTrue:[
  3149             self raiseUIView:window
  3465             self raiseUIView:window
  3150         ] ifFalse:[
  3466         ] ifFalse:[
  3151             self hideUIView:window
  3467             self hideUIView:window
  3152         ].
  3468         ].
  3153         ^ self
  3469         ^ self
  3154     ].
  3470     ].
  3155 
  3471 
  3156     someObject == self painterShown ifTrue:[
  3472     changedObject == self painterShown ifTrue:[
  3157         "/ canvasShown toggle changed
  3473         "/ canvasShown toggle changed
  3158         window := self painter topView.
  3474         window := self painter topView.
  3159         (someObject value) ifTrue:[
  3475         (changedObject value) ifTrue:[
  3160             self raiseUIView:window
  3476             self raiseUIView:window
  3161         ] ifFalse:[
  3477         ] ifFalse:[
  3162             self hideUIView:window
  3478             self hideUIView:window
  3163         ].
  3479         ].
  3164         ^ self
  3480         ^ self
  3165     ].
  3481     ].
  3166 
  3482 
  3167     someObject == self autoAcceptOnSelectionChange ifTrue:[
  3483     changedObject == self autoAcceptOnSelectionChange ifTrue:[
  3168         lbl := someObject value ifTrue:['Apply'] ifFalse:['OK'].
  3484         lbl := changedObject value ifTrue:['Apply'] ifFalse:['OK'].
  3169         (builder componentAt:'acceptButton') label:(resources string:lbl).
  3485         (builder componentAt:'acceptButton') label:(resources string:lbl).
  3170         ^ self
  3486         ^ self
  3171     ].
  3487     ].
  3172 
  3488 
  3173     "Modified: / 16.7.1998 / 19:09:57 / cg"
  3489     "Modified: / 16.7.1998 / 19:09:57 / cg"
  3297     ^ spec
  3613     ^ spec
  3298 ! !
  3614 ! !
  3299 
  3615 
  3300 !UIPainter methodsFor:'initialization'!
  3616 !UIPainter methodsFor:'initialization'!
  3301 
  3617 
       
  3618 hideToolBarButtonCreated:aButton
       
  3619     aButton passiveLevel:(MenuPanel defaultLevel). 
       
  3620 "/    aButton passiveLevel:1.
       
  3621     aButton activeLevel:-1.
       
  3622     aButton backgroundColor:(MenuPanel defaultBackgroundColor).
       
  3623 !
       
  3624 
  3302 initialize
  3625 initialize
  3303     |name scroller viewScroller|
  3626     |name scroller viewScroller|
  3304 
  3627 
  3305     super initialize.
  3628     super initialize.
  3306 
  3629 
  3307     modified := false.
  3630     modified := false.
       
  3631 
  3308     aspects := IdentityDictionary new.
  3632     aspects := IdentityDictionary new.
  3309     aspects at:#classNameChannel put:'NewApplication' asValue.
  3633     aspects at:#classNameChannel put:'NewApplication' asValue.
  3310     aspects at:#superclassNameChannel put:'ApplicationModel' asValue.
  3634     aspects at:#superclassNameChannel put:'ApplicationModel' asValue.
  3311     aspects at:#methodNameChannel put:'windowSpec' asValue.
  3635     aspects at:#methodNameChannel put:'windowSpec' asValue.
  3312 
  3636 
  4164     "Modified: / 31-08-2006 / 10:13:31 / cg"
  4488     "Modified: / 31-08-2006 / 10:13:31 / cg"
  4165 !
  4489 !
  4166 
  4490 
  4167 postBuildWith: aBuilder
  4491 postBuildWith: aBuilder
  4168     super postBuildWith:aBuilder.
  4492     super postBuildWith:aBuilder.
       
  4493 
       
  4494     (self toolBarVisibleHolder value 
       
  4495     or:[ self editToolBarVisibleHolder value ]) ifTrue:[ self toolBarVisibilityChanged ].
       
  4496 
       
  4497     "Created: / 18-02-2007 / 15:03:08 / cg"
  4169 
  4498 
  4170     self setupPainter.
  4499     self setupPainter.
  4171 
  4500 
  4172     "Modified: / 22.8.1998 / 17:41:34 / cg"
  4501     "Modified: / 22.8.1998 / 17:41:34 / cg"
  4173 !
  4502 !
  4367                 spec usePreferredWidth:(layoutTool aspectFor:#usePreferredWidth) value.
  4696                 spec usePreferredWidth:(layoutTool aspectFor:#usePreferredWidth) value.
  4368                 spec usePreferredHeight:(layoutTool aspectFor:#usePreferredHeight) value.
  4697                 spec usePreferredHeight:(layoutTool aspectFor:#usePreferredHeight) value.
  4369                 spec useDynamicPreferredWidth:(layoutTool aspectFor:#useDynamicPreferredWidth) value.
  4698                 spec useDynamicPreferredWidth:(layoutTool aspectFor:#useDynamicPreferredWidth) value.
  4370                 spec useDynamicPreferredHeight:(layoutTool aspectFor:#useDynamicPreferredHeight) value.
  4699                 spec useDynamicPreferredHeight:(layoutTool aspectFor:#useDynamicPreferredHeight) value.
  4371                 painter setLayout:layout.
  4700                 painter setLayout:layout.
       
  4701                 spec layout:layout.
  4372                 painter updateFromSpec:spec.
  4702                 painter updateFromSpec:spec.
  4373             ].
  4703             ].
  4374         ]
  4704         ]
  4375     ] ifFalse:[
  4705     ] ifFalse:[
  4376         self isHelpToolSelected ifTrue:[
  4706         self isHelpToolSelected ifTrue:[
  5024     "removes all widgets, specClass, and specSelector"
  5354     "removes all widgets, specClass, and specSelector"
  5025 
  5355 
  5026     self askForModification ifFalse: [^nil].
  5356     self askForModification ifFalse: [^nil].
  5027     specClass := specClassName := specSelector := nil.
  5357     specClass := specClassName := specSelector := nil.
  5028     self painter removeAll.
  5358     self painter removeAll.
  5029     treeView canvas topView name:  UIPainter defaultNameOfCanvas.
  5359     treeView canvas topView 
  5030     treeView canvas topView label: UIPainter defaultNameOfCanvas.
  5360         name:  UIPainter defaultNameOfCanvas;
       
  5361         label: UIPainter defaultNameOfCanvas.
  5031     self helpTool doNew.
  5362     self helpTool doNew.
  5032     self treeSelectionChanged.
  5363     self treeSelectionChanged.
  5033     treeView selectedNode changed.
  5364     treeView selectedNode changed.
  5034     self tabModel value: self tabList value first.
  5365     self tabModel value: self tabList value first.
  5035     self updateInfoLabel.
  5366     self updateInfoLabel.
  5279         openWith: self painter generateWindowSpecMethodSource 
  5610         openWith: self painter generateWindowSpecMethodSource 
  5280         title: 'Window Spec'
  5611         title: 'Window Spec'
  5281 
  5612 
  5282 !
  5613 !
  5283 
  5614 
       
  5615 hideEditToolbar
       
  5616     self editToolBarVisibleHolder value:false
       
  5617 !
       
  5618 
       
  5619 hideToolbar
       
  5620     self toolBarVisibleHolder value:false
       
  5621 !
       
  5622 
  5284 replaceWidgetByClass:aSpecOrWidgetClass
  5623 replaceWidgetByClass:aSpecOrWidgetClass
  5285     |specClass oldSpec newSpec painter|
  5624     |specClass oldSpec newSpec painter|
  5286 
  5625 
  5287     (aSpecOrWidgetClass isSubclassOf:UISpecification) ifTrue:[
  5626     (aSpecOrWidgetClass isSubclassOf:UISpecification) ifTrue:[
  5288         specClass := aSpecOrWidgetClass.
  5627         specClass := aSpecOrWidgetClass.
  5543     "removes all items other than canvas"
  5882     "removes all items other than canvas"
  5544 
  5883 
  5545     lastDrawnMaster := nil.
  5884     lastDrawnMaster := nil.
  5546     windowSpec := nil.
  5885     windowSpec := nil.
  5547 
  5886 
       
  5887     self canvas components notEmptyOrNil ifTrue:[ self halt ].
  5548     self canvas subViews copy do:[:aView|
  5888     self canvas subViews copy do:[:aView|
  5549         "/ care to not destroy the transparent input view
  5889         "/ care to not destroy the transparent input view
  5550         (aView isInputOnly) ifFalse:[aView destroy]
  5890         (aView isInputOnly) ifFalse:[aView destroy]
  5551     ].
  5891     ].
  5552     model root name: UIPainter defaultNameOfCanvas asBoldText.
  5892     model root name: UIPainter defaultNameOfCanvas asBoldText.
  5553     model removeAllOtherThanRoot.
  5893     model removeAllOtherThanRoot.
  5554 
       
  5555 !
  5894 !
  5556 
  5895 
  5557 removeView:aView
  5896 removeView:aView
  5558     "removes a view"
  5897     "removes a view"
  5559 
  5898 
  6087     canvas setSelection:(newParentItem contents view) withRedraw:false.
  6426     canvas setSelection:(newParentItem contents view) withRedraw:false.
  6088     canvas pasteWithLayout.
  6427     canvas pasteWithLayout.
  6089 !
  6428 !
  6090 
  6429 
  6091 doSortItems
  6430 doSortItems
  6092     "moves child 'anOffset' forward or backward in list of children"
  6431     "sort items by their top-left position"
  6093 
  6432 
  6094     |selectedItems parent sortedItems newChildren itemList parentView|
  6433     |selectedItems parent sortedItems newChildren itemList parentView|
  6095 
  6434 
  6096     self askForSelectionChangeAllowed ifFalse:[^ self].
  6435     self askForSelectionChangeAllowed ifFalse:[^ self].
  6097 
  6436 
  6098     selectedItems := self selectedNodes.
  6437     selectedItems := self selectedNodes.
  6099     selectedItems size <= 1 ifTrue:[^ self].
  6438     selectedItems size <= 1 ifTrue:[^ self].
  6100     parent := selectedItems first parent.
  6439     parent := selectedItems first parent.
  6101     (parent isNil or:[(selectedItems conform:[:e| e parent == parent]) not]) ifTrue:[^ self].
  6440     (parent isNil or:[(selectedItems conform:[:e| e parent == parent]) not]) ifTrue:[^ self].
  6102 
  6441 
  6103     sortedItems := selectedItems sort:[:a :b| a contents view origin isLeftOrAbove:(b contents view origin)].
  6442     sortedItems := selectedItems sort:[:a :b| 
       
  6443                             a contents view origin isLeftOrAbove:(b contents view origin)].
  6104     itemList := selectedItems asIdentitySet.
  6444     itemList := selectedItems asIdentitySet.
  6105 
  6445 
  6106     newChildren := parent children collect:[:eachChild|
  6446     newChildren := parent children collect:[:eachChild|
  6107         (itemList includes:eachChild) ifTrue:[
  6447         (itemList includes:eachChild) ifTrue:[
  6108             sortedItems removeFirst.
  6448             sortedItems removeFirst.
  6120     self canvas hideSelection.
  6460     self canvas hideSelection.
  6121     newChildren keysAndValuesDo:[:idx :eachItem|
  6461     newChildren keysAndValuesDo:[:idx :eachItem|
  6122         parentView changeSequenceOrderFor:eachItem contents view to:idx.
  6462         parentView changeSequenceOrderFor:eachItem contents view to:idx.
  6123     ].
  6463     ].
  6124     parentView specClass isLayoutContainer ifFalse:[
  6464     parentView specClass isLayoutContainer ifFalse:[
       
  6465         parentView components notEmptyOrNil ifTrue:[ self halt ].
  6125         parentView subViews do:[:v| v raise ].
  6466         parentView subViews do:[:v| v raise ].
  6126     ].
  6467     ].
  6127     self canvas showSelection.
  6468     self canvas showSelection.
  6128 
  6469 
  6129     self selectNodes:itemList.
  6470     self selectNodes:itemList asOrderedCollection.
  6130 !
  6471 !
  6131 
  6472 
  6132 doStepIn
  6473 doStepIn
  6133     "move the currently selected widget into the next available container below"
  6474     "move the currently selected widget into the next available container below"
  6134 
  6475 
  6154         self doChangeParentOfSelectedItemTo:(item parent)
  6495         self doChangeParentOfSelectedItemTo:(item parent)
  6155     ].
  6496     ].
  6156 !
  6497 !
  6157 
  6498 
  6158 doStepOver:anIndex
  6499 doStepOver:anIndex
  6159     "moves child 'anOffset' forward or backward in list of children"
  6500     "moves child 'anIndex' forward or backward in list of children"
  6160 
  6501 
  6161     |item idx size prnt spVw view canvas|
  6502     |item idx size prnt spVw view canvas|
  6162 
  6503 
  6163     self askForSelectionChangeAllowed ifFalse:[^ self].
  6504     self askForSelectionChangeAllowed ifFalse:[^ self].
  6164 
  6505 
  6186     canvas hideSelection.
  6527     canvas hideSelection.
  6187 
  6528 
  6188     spVw changeSequenceOrderFor:view to:idx.
  6529     spVw changeSequenceOrderFor:view to:idx.
  6189 
  6530 
  6190     spVw specClass isLayoutContainer ifFalse:[
  6531     spVw specClass isLayoutContainer ifFalse:[
       
  6532         "/ spVw components notEmptyOrNil ifTrue:[ self halt ].
  6191         spVw subViews do:[:v| v raise ].
  6533         spVw subViews do:[:v| v raise ].
  6192     ].
  6534     ].
  6193     canvas showSelection.
  6535     canvas showSelection.
  6194     self selectNode:item.
  6536     self selectNode:item.
  6195 ! !
  6537 ! !