UIPainter.st
changeset 1186 4cea2d4e9dbc
parent 1185 6c14008722e9
child 1188 4805027d9d33
equal deleted inserted replaced
1185:6c14008722e9 1186:4cea2d4e9dbc
   687 
   687 
   688     <resource: #canvas>
   688     <resource: #canvas>
   689 
   689 
   690     ^ 
   690     ^ 
   691      #(#FullSpec
   691      #(#FullSpec
   692         #name: #windowSpec
   692 	#name: #windowSpec
   693         #window: 
   693 	#window: 
   694        #(#WindowSpec
   694        #(#WindowSpec
   695           #label: 'GUI Painter'
   695 	  #label: 'GUI Painter'
   696           #name: 'GUI Painter'
   696 	  #name: 'GUI Painter'
   697           #layout: #(#LayoutFrame 220 0 200 0 827 0 722 0)
   697 	  #layout: #(#LayoutFrame 220 0 200 0 827 0 722 0)
   698           #min: #(#Point 560 460)
   698 	  #min: #(#Point 560 460)
   699           #max: #(#Point 1160 870)
   699 	  #max: #(#Point 1160 870)
   700           #bounds: #(#Rectangle 220 200 828 723)
   700 	  #bounds: #(#Rectangle 220 200 828 723)
   701           #menu: #menu
   701 	  #menu: #menu
   702         )
   702 	)
   703         #component: 
   703 	#component: 
   704        #(#SpecCollection
   704        #(#SpecCollection
   705           #collection: #(
   705 	  #collection: #(
   706            #(#MenuPanelSpec
   706 	   #(#MenuPanelSpec
   707               #name: 'menuToolbarView'
   707 	      #name: 'menuToolbarView'
   708               #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0)
   708 	      #layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 32 0)
   709               #tabable: true
   709 	      #tabable: true
   710               #menu: #menuToolbar
   710 	      #menu: #menuToolbar
   711             )
   711 	    )
   712            #(#VariableHorizontalPanelSpec
   712 	   #(#VariableHorizontalPanelSpec
   713               #name: 'hpanel'
   713 	      #name: 'hpanel'
   714               #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
   714 	      #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -26 1.0)
   715               #level: 1
   715 	      #level: 1
   716               #handles: #(#Any 0.318868 1.0)
   716 	      #handles: #(#Any 0.318868 1.0)
   717               #component: 
   717 	      #component: 
   718              #(#SpecCollection
   718 	     #(#SpecCollection
   719                 #collection: #(
   719 		#collection: #(
   720                  #(#ArbitraryComponentSpec
   720 		 #(#ArbitraryComponentSpec
   721                     #name: 'treeView'
   721 		    #name: 'treeView'
   722                     #tabable: true
   722 		    #tabable: true
   723                     #menu: #menuEdit
   723 		    #menu: #menuEdit
   724                     #hasHorizontalScrollBar: true
   724 		    #hasHorizontalScrollBar: true
   725                     #hasVerticalScrollBar: true
   725 		    #hasVerticalScrollBar: true
   726                     #miniScrollerHorizontal: true
   726 		    #miniScrollerHorizontal: true
   727                     #miniScrollerVertical: true
   727 		    #miniScrollerVertical: true
   728                     #hasBorder: false
   728 		    #hasBorder: false
   729                     #component: #treeView
   729 		    #component: #treeView
   730                   )
   730 		  )
   731                  #(#ViewSpec
   731 		 #(#ViewSpec
   732                     #name: 'specHolderView'
   732 		    #name: 'specHolderView'
   733                     #borderWidth: 1
   733 		    #borderWidth: 1
   734                     #component: 
   734 		    #component: 
   735                    #(#SpecCollection
   735 		   #(#SpecCollection
   736                       #collection: #(
   736 		      #collection: #(
   737                        #(#MenuPanelSpec
   737 		       #(#MenuPanelSpec
   738                           #name: 'menuToolbar2View'
   738 			  #name: 'menuToolbar2View'
   739                           #layout: #(#LayoutFrame -1 0.0 -2 0 -1 1.0 30 0)
   739 			  #layout: #(#LayoutFrame -1 0.0 -2 0 -1 1.0 30 0)
   740                           #enableChannel: #canMoveOrAlignSelection
   740 			  #enableChannel: #canMoveOrAlignSelection
   741                           #tabable: true
   741 			  #tabable: true
   742                           #menu: #menuToolbar2
   742 			  #menu: #menuToolbar2
   743                         )
   743 			)
   744                        #(#NoteBookViewSpec
   744 		       #(#NoteBookViewSpec
   745                           #name: 'noteBook'
   745 			  #name: 'noteBook'
   746                           #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -30 1.0)
   746 			  #layout: #(#LayoutFrame 0 0.0 34 0.0 0 1.0 -30 1.0)
   747                           #enableChannel: #enableChannel
   747 			  #enableChannel: #enableChannel
   748                           #tabable: true
   748 			  #tabable: true
   749                           #model: #tabModel
   749 			  #model: #tabModel
   750                           #menu: #tabList
   750 			  #menu: #tabList
   751                           #canvas: #noteBookView
   751 			  #canvas: #noteBookView
   752                         )
   752 			)
   753                        #(#HorizontalPanelViewSpec
   753 		       #(#HorizontalPanelViewSpec
   754                           #name: 'horizontalPanelView1'
   754 			  #name: 'horizontalPanelView1'
   755                           #layout: #(#LayoutFrame -163 1 -1 0 -35 1.0 28 0)
   755 			  #layout: #(#LayoutFrame -163 1 -1 0 -35 1.0 28 0)
   756                           #horizontalLayout: #fit
   756 			  #horizontalLayout: #fit
   757                           #verticalLayout: #fit
   757 			  #verticalLayout: #fit
   758                           #horizontalSpace: 0
   758 			  #horizontalSpace: 0
   759                           #verticalSpace: 0
   759 			  #verticalSpace: 0
   760                           #component: 
   760 			  #component: 
   761                          #(#SpecCollection
   761 			 #(#SpecCollection
   762                             #collection: #(
   762 			    #collection: #(
   763                              #(#ArrowButtonSpec
   763 			     #(#ArrowButtonSpec
   764                                 #name: 'MoveLeftButton'
   764 				#name: 'MoveLeftButton'
   765                                 #activeHelpKey: #changePositionLeft
   765 				#activeHelpKey: #changePositionLeft
   766                                 #tabable: true
   766 				#tabable: true
   767                                 #model: #moveSelectionLeft
   767 				#model: #moveSelectionLeft
   768                                 #enableChannel: #canMoveOrAlignSelection
   768 				#enableChannel: #canMoveOrAlignSelection
   769                                 #isTriggerOnDown: true
   769 				#isTriggerOnDown: true
   770                                 #actionValue: ''
   770 				#direction: #left
   771                                 #direction: #left
   771 				#useDefaultExtent: true
   772                                 #useDefaultExtent: true
   772 			      )
   773                               )
   773 			     #(#ArrowButtonSpec
   774                              #(#ArrowButtonSpec
   774 				#name: 'MoveRightButton'
   775                                 #name: 'MoveRightButton'
   775 				#activeHelpKey: #changePositionRight
   776                                 #activeHelpKey: #changePositionRight
   776 				#model: #moveSelectionRight
   777                                 #model: #moveSelectionRight
   777 				#enableChannel: #canMoveOrAlignSelection
   778                                 #enableChannel: #canMoveOrAlignSelection
   778 				#isTriggerOnDown: true
   779                                 #isTriggerOnDown: true
   779 				#direction: #right
   780                                 #actionValue: ''
   780 				#useDefaultExtent: true
   781                                 #direction: #right
   781 			      )
   782                                 #useDefaultExtent: true
   782 			     #(#ArrowButtonSpec
   783                               )
   783 				#name: 'MoveDownButton'
   784                              #(#ArrowButtonSpec
   784 				#activeHelpKey: #changePositionDown
   785                                 #name: 'MoveDownButton'
   785 				#model: #moveSelectionDown
   786                                 #activeHelpKey: #changePositionDown
   786 				#enableChannel: #canMoveOrAlignSelection
   787                                 #model: #moveSelectionDown
   787 				#isTriggerOnDown: true
   788                                 #enableChannel: #canMoveOrAlignSelection
   788 				#direction: #down
   789                                 #isTriggerOnDown: true
   789 				#useDefaultExtent: true
   790                                 #actionValue: ''
   790 			      )
   791                                 #direction: #down
   791 			     #(#ArrowButtonSpec
   792                                 #useDefaultExtent: true
   792 				#name: 'MoveUpButton'
   793                               )
   793 				#activeHelpKey: #changePositionUp
   794                              #(#ArrowButtonSpec
   794 				#model: #moveSelectionUp
   795                                 #name: 'MoveUpButton'
   795 				#enableChannel: #canMoveOrAlignSelection
   796                                 #activeHelpKey: #changePositionUp
   796 				#isTriggerOnDown: true
   797                                 #model: #moveSelectionUp
   797 				#direction: #up
   798                                 #enableChannel: #canMoveOrAlignSelection
   798 				#useDefaultExtent: true
   799                                 #isTriggerOnDown: true
   799 			      )
   800                                 #actionValue: ''
   800 			     )
   801                                 #direction: #up
       
   802                                 #useDefaultExtent: true
       
   803                               )
       
   804                              )
       
   805                            
   801                            
   806                           )
   802 			  )
   807                         )
   803 			)
   808                        #(#ActionButtonSpec
   804 		       #(#ActionButtonSpec
   809                           #label: 'helpIcon'
   805 			  #label: 'helpIcon'
   810                           #name: 'openWidgetDocumentationButton'
   806 			  #name: 'openWidgetDocumentationButton'
   811                           #layout: #(#LayoutFrame -28 1 -1 0 0 1 28 0)
   807 			  #layout: #(#LayoutFrame -28 1 -1 0 0 1 28 0)
   812                           #activeHelpKey: #editOpenSpecDocumentation
   808 			  #activeHelpKey: #editOpenSpecDocumentation
   813                           #hasCharacterOrientedLabel: false
   809 			  #hasCharacterOrientedLabel: false
   814                           #model: #doOpenWidgetDocumentation
   810 			  #model: #doOpenWidgetDocumentation
   815                         )
   811 			)
   816                        #(#ActionButtonSpec
   812 		       #(#ActionButtonSpec
   817                           #label: 'Cancel'
   813 			  #label: 'Cancel'
   818                           #name: 'cancelButton'
   814 			  #name: 'cancelButton'
   819                           #layout: #(#LayoutFrame 2 0 -26 1 -1 0.5 -2 1)
   815 			  #layout: #(#LayoutFrame 2 0 -26 1 -1 0.5 -2 1)
   820                           #activeHelpKey: #commitCancel
   816 			  #activeHelpKey: #commitCancel
   821                           #tabable: true
   817 			  #tabable: true
   822                           #model: #cancel
   818 			  #model: #cancel
   823                           #enableChannel: #modifiedChannel
   819 			  #enableChannel: #modifiedChannel
   824                         )
   820 			)
   825                        #(#ActionButtonSpec
   821 		       #(#ActionButtonSpec
   826                           #label: 'OK'
   822 			  #label: 'OK'
   827                           #name: 'acceptButton'
   823 			  #name: 'acceptButton'
   828                           #layout: #(#LayoutFrame 1 0.5 -26 1 -2 1 -2 1)
   824 			  #layout: #(#LayoutFrame 1 0.5 -26 1 -2 1 -2 1)
   829                           #activeHelpKey: #commitOK
   825 			  #activeHelpKey: #commitOK
   830                           #tabable: true
   826 			  #tabable: true
   831                           #model: #accept
   827 			  #model: #accept
   832                           #enableChannel: #modifiedChannel
   828 			  #enableChannel: #modifiedChannel
   833                         )
   829 			)
   834                        )
   830 		       )
   835                      
   831                      
   836                     )
   832 		    )
   837                   )
   833 		  )
   838                  )
   834 		 )
   839                
   835                
   840               )
   836 	      )
   841             )
   837 	    )
   842            #(#UISubSpecification
   838 	   #(#UISubSpecification
   843               #name: 'infoBarSubSpec'
   839 	      #name: 'infoBarSubSpec'
   844               #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
   840 	      #layout: #(#LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0)
   845               #majorKey: #ToolApplicationModel
   841 	      #majorKey: #ToolApplicationModel
   846               #minorKey: #windowSpecForInfoBar
   842 	      #minorKey: #windowSpecForInfoBar
   847             )
   843 	    )
   848            )
   844 	   )
   849          
   845          
   850         )
   846 	)
   851       )
   847       )
   852 ! !
   848 ! !
   853 
   849 
   854 !UIPainter class methodsFor:'menu specs'!
   850 !UIPainter class methodsFor:'menu specs'!
   855 
   851 
   869 
   865 
   870     ^
   866     ^
   871      
   867      
   872        #(#Menu
   868        #(#Menu
   873           
   869           
   874            #(
   870 	   #(
   875              #(#MenuItem
   871 	     #(#MenuItem
   876                 #label: 'About'
   872 		#label: 'About'
   877                 #translateLabel: true
   873 		#translateLabel: true
   878                 #activeHelpKey: #about
   874 		#activeHelpKey: #about
   879                 #labelImage: #(#ResourceRetriever nil #menuIcon)
   875 		#labelImage: #(#ResourceRetriever nil #menuIcon)
   880                 #submenuChannel: #menuAbout
   876 		#submenuChannel: #menuAbout
   881             )
   877 	    )
   882              #(#MenuItem
   878 	     #(#MenuItem
   883                 #label: 'File'
   879 		#label: 'File'
   884                 #translateLabel: true
   880 		#translateLabel: true
   885                 #activeHelpKey: #file
   881 		#activeHelpKey: #file
   886                 #enabled: #enableChannel
   882 		#enabled: #enableChannel
   887                 #submenu: 
   883 		#submenu: 
   888                  #(#Menu
   884 		 #(#Menu
   889                     
   885                     
   890                      #(
   886 		     #(
   891                        #(#MenuItem
   887 		       #(#MenuItem
   892                           #label: 'New'
   888 			  #label: 'New'
   893                           #translateLabel: true
   889 			  #translateLabel: true
   894                           #value: #doNew
   890 			  #value: #doNew
   895                           #activeHelpKey: #fileNew
   891 			  #activeHelpKey: #fileNew
   896                       )
   892 		      )
   897                        #(#MenuItem
   893 		       #(#MenuItem
   898                           #label: '-'
   894 			  #label: '-'
   899                       )
   895 		      )
   900                        #(#MenuItem
   896 		       #(#MenuItem
   901                           #label: 'Load...'
   897 			  #label: 'Load...'
   902                           #translateLabel: true
   898 			  #translateLabel: true
   903                           #value: #doLoad
   899 			  #value: #doLoad
   904                           #activeHelpKey: #fileLoad
   900 			  #activeHelpKey: #fileLoad
   905                       )
   901 		      )
   906                        #(#MenuItem
   902 		       #(#MenuItem
   907                           #label: 'Load Subspec...'
   903 			  #label: 'Load Subspec...'
   908                           #translateLabel: true
   904 			  #translateLabel: true
   909                           #value: #doLoadSubspec
   905 			  #value: #doLoadSubspec
   910                           #activeHelpKey: #fileLoadSubspec
   906 			  #activeHelpKey: #fileLoadSubspec
   911                       )
   907 		      )
   912                        #(#MenuItem
   908 		       #(#MenuItem
   913                           #label: '-'
   909 			  #label: '-'
   914                       )
   910 		      )
   915                        #(#MenuItem
   911 		       #(#MenuItem
   916                           #label: 'Save'
   912 			  #label: 'Save'
   917                           #translateLabel: true
   913 			  #translateLabel: true
   918                           #value: #doSave
   914 			  #value: #doSave
   919                           #activeHelpKey: #fileSave
   915 			  #activeHelpKey: #fileSave
   920                       )
   916 		      )
   921                        #(#MenuItem
   917 		       #(#MenuItem
   922                           #label: 'Save As...'
   918 			  #label: 'Save As...'
   923                           #translateLabel: true
   919 			  #translateLabel: true
   924                           #value: #doSaveAs
   920 			  #value: #doSaveAs
   925                           #activeHelpKey: #fileSaveAs
   921 			  #activeHelpKey: #fileSaveAs
   926                       )
   922 		      )
   927                        #(#MenuItem
   923 		       #(#MenuItem
   928                           #label: 'Define Class And Selector...'
   924 			  #label: 'Define Class And Selector...'
   929                           #translateLabel: true
   925 			  #translateLabel: true
   930                           #value: #doDefineClassAndSelector
   926 			  #value: #doDefineClassAndSelector
   931                           #activeHelpKey: #fileSaveAs
   927 			  #activeHelpKey: #fileSaveAs
   932                       )
   928 		      )
   933                        #(#MenuItem
   929 		       #(#MenuItem
   934                           #label: '-'
   930 			  #label: '-'
   935                       )
   931 		      )
   936                        #(#MenuItem
   932 		       #(#MenuItem
   937                           #label: 'Pick A Window Spec...'
   933 			  #label: 'Pick A Window Spec...'
   938                           #translateLabel: true
   934 			  #translateLabel: true
   939                           #value: #doPickAView
   935 			  #value: #doPickAView
   940                           #activeHelpKey: #filePickAnInterface
   936 			  #activeHelpKey: #filePickAnInterface
   941                       )
   937 		      )
   942                        #(#MenuItem
   938 		       #(#MenuItem
   943                           #label: '-'
   939 			  #label: '-'
   944                       )
   940 		      )
   945                        #(#MenuItem
   941 		       #(#MenuItem
   946                           #label: 'Show Window Spec'
   942 			  #label: 'Show Window Spec'
   947                           #translateLabel: true
   943 			  #translateLabel: true
   948                           #value: #doWindowSpec
   944 			  #value: #doWindowSpec
   949                           #activeHelpKey: #fileShowWindowSpec
   945 			  #activeHelpKey: #fileShowWindowSpec
   950                       )
   946 		      )
   951                        #(#MenuItem
   947 		       #(#MenuItem
   952                           #label: 'Browse Class'
   948 			  #label: 'Browse Class'
   953                           #translateLabel: true
   949 			  #translateLabel: true
   954                           #value: #doBrowseClass
   950 			  #value: #doBrowseClass
   955                           #activeHelpKey: #fileBrowseClass
   951 			  #activeHelpKey: #fileBrowseClass
   956                           #enabled: #hasSpecClass
   952 			  #enabled: #hasSpecClass
   957                       )
   953 		      )
   958                        #(#MenuItem
   954 		       #(#MenuItem
   959                           #label: 'Browse Aspect Methods'
   955 			  #label: 'Browse Aspect Methods'
   960                           #translateLabel: true
   956 			  #translateLabel: true
   961                           #value: #doBrowseAspectMethods
   957 			  #value: #doBrowseAspectMethods
   962                           #activeHelpKey: #fileBrowseAspectMethods
   958 			  #activeHelpKey: #fileBrowseAspectMethods
   963                           #enabled: #hasSpecClass
   959 			  #enabled: #hasSpecClass
   964                       )
   960 		      )
   965                        #(#MenuItem
   961 		       #(#MenuItem
   966                           #label: '-'
   962 			  #label: '-'
   967                       )
   963 		      )
   968                        #(#MenuItem
   964 		       #(#MenuItem
   969                           #label: 'Exit'
   965 			  #label: 'Exit'
   970                           #translateLabel: true
   966 			  #translateLabel: true
   971                           #value: #closeRequest
   967 			  #value: #closeRequest
   972                           #activeHelpKey: #fileExit
   968 			  #activeHelpKey: #fileExit
   973                       )
   969 		      )
   974                     ) nil
   970 		    ) nil
   975                     nil
   971 		    nil
   976                 )
   972 		)
   977             )
   973 	    )
   978              #(#MenuItem
   974 	     #(#MenuItem
   979                 #label: 'Edit'
   975 		#label: 'Edit'
   980                 #translateLabel: true
   976 		#translateLabel: true
   981                 #activeHelpKey: #edit
   977 		#activeHelpKey: #edit
   982                 #submenuChannel: #menuEdit
   978 		#submenuChannel: #menuEdit
   983             )
   979 	    )
   984              #(#MenuItem
   980 	     #(#MenuItem
   985                 #label: 'Align'
   981 		#label: 'Align'
   986                 #translateLabel: true
   982 		#translateLabel: true
   987                 #activeHelpKey: #align
   983 		#activeHelpKey: #align
   988                 #submenuChannel: #menuAlign
   984 		#submenuChannel: #menuAlign
   989             )
   985 	    )
   990              #(#MenuItem
   986 	     #(#MenuItem
   991                 #label: 'Generate'
   987 		#label: 'Generate'
   992                 #translateLabel: true
   988 		#translateLabel: true
   993                 #activeHelpKey: #generate
   989 		#activeHelpKey: #generate
   994                 #submenu: 
   990 		#submenu: 
   995                  #(#Menu
   991 		 #(#Menu
   996                     
   992                     
   997                      #(
   993 		     #(
   998                        #(#MenuItem
   994 		       #(#MenuItem
   999                           #label: 'Aspect Methods'
   995 			  #label: 'Aspect Methods'
  1000                           #translateLabel: true
   996 			  #translateLabel: true
  1001                           #value: #doGenerateAspectMethods
   997 			  #value: #doGenerateAspectMethods
  1002                           #activeHelpKey: #generateAspectMethods
   998 			  #activeHelpKey: #generateAspectMethods
  1003                           #enabled: #hasSpecClass
   999 			  #enabled: #hasSpecClass
  1004                       )
  1000 		      )
  1005                        #(#MenuItem
  1001 		       #(#MenuItem
  1006                           #label: 'Menu Stub Methods'
  1002 			  #label: 'Menu Stub Methods'
  1007                           #translateLabel: true
  1003 			  #translateLabel: true
  1008                           #value: #doGenerateMenuMethods
  1004 			  #value: #doGenerateMenuMethods
  1009                       )
  1005 		      )
  1010                        #(#MenuItem
  1006 		       #(#MenuItem
  1011                           #label: '-'
  1007 			  #label: '-'
  1012                       )
  1008 		      )
  1013                        #(#MenuItem
  1009 		       #(#MenuItem
  1014                           #label: 'Hook Methods'
  1010 			  #label: 'Hook Methods'
  1015                           #translateLabel: true
  1011 			  #translateLabel: true
  1016                           #value: #doGenerateHookMethods
  1012 			  #value: #doGenerateHookMethods
  1017                           #activeHelpKey: #generateHookMethods
  1013 			  #activeHelpKey: #generateHookMethods
  1018                           #enabled: #hasSpecClass
  1014 			  #enabled: #hasSpecClass
  1019                       )
  1015 		      )
  1020                     ) nil
  1016 		    ) nil
  1021                     nil
  1017 		    nil
  1022                 )
  1018 		)
  1023             )
  1019 	    )
  1024              #(#MenuItem
  1020 	     #(#MenuItem
  1025                 #label: 'Test'
  1021 		#label: 'Test'
  1026                 #translateLabel: true
  1022 		#translateLabel: true
  1027                 #activeHelpKey: #test
  1023 		#activeHelpKey: #test
  1028                 #submenu: 
  1024 		#submenu: 
  1029                  #(#Menu
  1025 		 #(#Menu
  1030                     
  1026                     
  1031                      #(
  1027 		     #(
  1032                        #(#MenuItem
  1028 		       #(#MenuItem
  1033                           #label: 'Start Application'
  1029 			  #label: 'Start Application'
  1034                           #translateLabel: true
  1030 			  #translateLabel: true
  1035                           #value: #doStartApplication
  1031 			  #value: #doStartApplication
  1036                           #activeHelpKey: #testStartApplication
  1032 			  #activeHelpKey: #testStartApplication
  1037                       )
  1033 		      )
  1038                        #(#MenuItem
  1034 		       #(#MenuItem
  1039                           #label: '-'
  1035 			  #label: '-'
  1040                       )
  1036 		      )
  1041                        #(#MenuItem
  1037 		       #(#MenuItem
  1042                           #label: 'Geometry Test Mode'
  1038 			  #label: 'Geometry Test Mode'
  1043                           #translateLabel: true
  1039 			  #translateLabel: true
  1044                           #activeHelpKey: #testGeometryTestMode
  1040 			  #activeHelpKey: #testGeometryTestMode
  1045                           #indication: #testMode:
  1041 			  #indication: #testMode:
  1046                       )
  1042 		      )
  1047                     ) nil
  1043 		    ) nil
  1048                     nil
  1044 		    nil
  1049                 )
  1045 		)
  1050             )
  1046 	    )
  1051              #(#MenuItem
  1047 	     #(#MenuItem
  1052                 #label: 'Settings'
  1048 		#label: 'Settings'
  1053                 #translateLabel: true
  1049 		#translateLabel: true
  1054                 #activeHelpKey: #settings
  1050 		#activeHelpKey: #settings
  1055                 #submenu: 
  1051 		#submenu: 
  1056                  #(#Menu
  1052 		 #(#Menu
  1057                     
  1053                     
  1058                      #(
  1054 		     #(
  1059                        #(#MenuItem
  1055 		       #(#MenuItem
  1060                           #label: 'Canvas'
  1056 			  #label: 'Canvas'
  1061                           #translateLabel: true
  1057 			  #translateLabel: true
  1062                           #activeHelpKey: #settingsCanvas
  1058 			  #activeHelpKey: #settingsCanvas
  1063                           #indication: #painterShown
  1059 			  #indication: #painterShown
  1064                       )
  1060 		      )
  1065                        #(#MenuItem
  1061 		       #(#MenuItem
  1066                           #label: 'Gallery'
  1062 			  #label: 'Gallery'
  1067                           #translateLabel: true
  1063 			  #translateLabel: true
  1068                           #activeHelpKey: #settingsGallery
  1064 			  #activeHelpKey: #settingsGallery
  1069                           #indication: #galleryShown
  1065 			  #indication: #galleryShown
  1070                       )
  1066 		      )
  1071                        #(#MenuItem
  1067 		       #(#MenuItem
  1072                           #label: '-'
  1068 			  #label: '-'
  1073                       )
  1069 		      )
  1074                        #(#MenuItem
  1070 		       #(#MenuItem
  1075                           #label: 'Redefine Aspect Methods'
  1071 			  #label: 'Redefine Aspect Methods'
  1076                           #translateLabel: true
  1072 			  #translateLabel: true
  1077                           #activeHelpKey: #settingsRedefineAspectMethods
  1073 			  #activeHelpKey: #settingsRedefineAspectMethods
  1078                           #enabled: #hasSpecClass
  1074 			  #enabled: #hasSpecClass
  1079                           #indication: #redefineAspectMethods:
  1075 			  #indication: #redefineAspectMethods:
  1080                       )
  1076 		      )
  1081                        #(#MenuItem
  1077 		       #(#MenuItem
  1082                           #label: 'Aspects As Instances'
  1078 			  #label: 'Aspects As Instances'
  1083                           #translateLabel: true
  1079 			  #translateLabel: true
  1084                           #activeHelpKey: #settingsAspectsAsInstances
  1080 			  #activeHelpKey: #settingsAspectsAsInstances
  1085                           #enabled: #hasSpecClass
  1081 			  #enabled: #hasSpecClass
  1086                           #indication: #generateAspectsAsInstanceVariables:
  1082 			  #indication: #generateAspectsAsInstanceVariables:
  1087                       )
  1083 		      )
  1088                        #(#MenuItem
  1084 		       #(#MenuItem
  1089                           #label: '-'
  1085 			  #label: '-'
  1090                       )
  1086 		      )
  1091 "/                       #(#MenuItem
  1087 "/                       #(#MenuItem
  1092 "/                          #label: 'Fonts'
  1088 "/                          #label: 'Fonts'
  1093 "/                          #submenuChannel: #menuFont
  1089 "/                          #submenuChannel: #menuFont
  1094 "/                      )
  1090 "/                      )
  1095 "/                       #(#MenuItem
  1091 "/                       #(#MenuItem
  1096 "/                          #label: '-'
  1092 "/                          #label: '-'
  1097 "/                      )
  1093 "/                      )
  1098                        #(#MenuItem
  1094 		       #(#MenuItem
  1099                           #label: 'Undo Manager...'
  1095 			  #label: 'Undo Manager...'
  1100                           #translateLabel: true
  1096 			  #translateLabel: true
  1101                           #value: #openUndoMenu
  1097 			  #value: #openUndoMenu
  1102                           #activeHelpKey: #settingsUndoManager
  1098 			  #activeHelpKey: #settingsUndoManager
  1103                           #enabled: #hasUndoHistory
  1099 			  #enabled: #hasUndoHistory
  1104                       )
  1100 		      )
  1105                        #(#MenuItem
  1101 		       #(#MenuItem
  1106                           #label: 'Grid Manager...'
  1102 			  #label: 'Grid Manager...'
  1107                           #translateLabel: true
  1103 			  #translateLabel: true
  1108                           #value: #doDefineGrid
  1104 			  #value: #doDefineGrid
  1109                           #activeHelpKey: #settingsGridManager
  1105 			  #activeHelpKey: #settingsGridManager
  1110                       )
  1106 		      )
  1111                     ) nil
  1107 		    ) nil
  1112                     nil
  1108 		    nil
  1113                 )
  1109 		)
  1114             )
  1110 	    )
  1115              #(#MenuItem
  1111 	     #(#MenuItem
  1116                 #label: 'History'
  1112 		#label: 'History'
  1117                 #translateLabel: true
  1113 		#translateLabel: true
  1118                 #activeHelpKey: #history
  1114 		#activeHelpKey: #history
  1119                 #submenuChannel: #menuHistory
  1115 		#submenuChannel: #menuHistory
  1120             )
  1116 	    )
  1121              #(#MenuItem
  1117 	     #(#MenuItem
  1122                 #label: 'Help'
  1118 		#label: 'Help'
  1123                 #translateLabel: true
  1119 		#translateLabel: true
  1124                 #startGroup: #right
  1120 		#startGroup: #right
  1125                 #activeHelpKey: #help
  1121 		#activeHelpKey: #help
  1126                 #submenu: 
  1122 		#submenu: 
  1127                  #(#Menu
  1123 		 #(#Menu
  1128                     
  1124                     
  1129                      #(
  1125 		     #(
  1130                        #(#MenuItem
  1126 		       #(#MenuItem
  1131                           #label: 'Tutorial'
  1127 			  #label: 'Tutorial'
  1132                           #translateLabel: true
  1128 			  #translateLabel: true
  1133                           #value: #openHTMLDocument:
  1129 			  #value: #openHTMLDocument:
  1134                           #activeHelpKey: #helpTutorial
  1130 			  #activeHelpKey: #helpTutorial
  1135                           #argument: 'tools/uipainter/TOP.html'
  1131 			  #argument: 'tools/uipainter/TOP.html'
  1136                       )
  1132 		      )
  1137                        #(#MenuItem
  1133 		       #(#MenuItem
  1138                           #label: '-'
  1134 			  #label: '-'
  1139                       )
  1135 		      )
  1140                        #(#MenuItem
  1136 		       #(#MenuItem
  1141                           #label: 'Functions'
  1137 			  #label: 'Functions'
  1142                           #translateLabel: true
  1138 			  #translateLabel: true
  1143                           #value: #openHTMLDocument:
  1139 			  #value: #openHTMLDocument:
  1144                           #activeHelpKey: #helpFunctions
  1140 			  #activeHelpKey: #helpFunctions
  1145                           #argument: 'tools/uipainter/Functions.html'
  1141 			  #argument: 'tools/uipainter/Functions.html'
  1146                       )
  1142 		      )
  1147                        #(#MenuItem
  1143 		       #(#MenuItem
  1148                           #label: 'Examples'
  1144 			  #label: 'Examples'
  1149                           #translateLabel: true
  1145 			  #translateLabel: true
  1150                           #value: #openHTMLDocument:
  1146 			  #value: #openHTMLDocument:
  1151                           #activeHelpKey: #helpExamples
  1147 			  #activeHelpKey: #helpExamples
  1152                           #argument: 'tools/uipainter/Examples.html'
  1148 			  #argument: 'tools/uipainter/Examples.html'
  1153                       )
  1149 		      )
  1154                        #(#MenuItem
  1150 		       #(#MenuItem
  1155                           #label: '-'
  1151 			  #label: '-'
  1156                       )
  1152 		      )
  1157                        #(#MenuItem
  1153 		       #(#MenuItem
  1158                           #label: 'Help Tool'
  1154 			  #label: 'Help Tool'
  1159                           #translateLabel: true
  1155 			  #translateLabel: true
  1160                           #value: #openHTMLDocument:
  1156 			  #value: #openHTMLDocument:
  1161                           #activeHelpKey: #helpHelpTool
  1157 			  #activeHelpKey: #helpHelpTool
  1162                           #argument: 'tools/uipainter/HelpTool.html'
  1158 			  #argument: 'tools/uipainter/HelpTool.html'
  1163                       )
  1159 		      )
  1164                        #(#MenuItem
  1160 		       #(#MenuItem
  1165                           #label: 'Layout Tool'
  1161 			  #label: 'Layout Tool'
  1166                           #translateLabel: true
  1162 			  #translateLabel: true
  1167                           #value: #openHTMLDocument:
  1163 			  #value: #openHTMLDocument:
  1168                           #activeHelpKey: #helpLayoutTool
  1164 			  #activeHelpKey: #helpLayoutTool
  1169                           #argument: 'tools/uipainter/LayoutTool.html'
  1165 			  #argument: 'tools/uipainter/LayoutTool.html'
  1170                       )
  1166 		      )
  1171                        #(#MenuItem
  1167 		       #(#MenuItem
  1172                           #label: '-'
  1168 			  #label: '-'
  1173                       )
  1169 		      )
  1174                        #(#MenuItem
  1170 		       #(#MenuItem
  1175                           #label: 'Selected Widget'
  1171 			  #label: 'Selected Widget'
  1176                           #translateLabel: true
  1172 			  #translateLabel: true
  1177                           #value: #doOpenWidgetDocumentation
  1173 			  #value: #doOpenWidgetDocumentation
  1178                           #activeHelpKey: #helpSelectedWidget
  1174 			  #activeHelpKey: #helpSelectedWidget
  1179                       )
  1175 		      )
  1180                        #(#MenuItem
  1176 		       #(#MenuItem
  1181                           #label: '-'
  1177 			  #label: '-'
  1182                       )
  1178 		      )
  1183                        #(#MenuItem
  1179 		       #(#MenuItem
  1184                           #label: 'Show Help Texts'
  1180 			  #label: 'Show Help Texts'
  1185                           #translateLabel: true
  1181 			  #translateLabel: true
  1186                           #activeHelpKey: #helpShowHelp
  1182 			  #activeHelpKey: #helpShowHelp
  1187                           #indication: #showingHelp:
  1183 			  #indication: #showingHelp:
  1188                       )
  1184 		      )
  1189                     ) nil
  1185 		    ) nil
  1190                     nil
  1186 		    nil
  1191                 )
  1187 		)
  1192             )
  1188 	    )
  1193           ) nil
  1189 	  ) nil
  1194           nil
  1190 	  nil
  1195       )
  1191       )
  1196 
  1192 
  1197     "Modified: / 23.8.1998 / 16:09:22 / cg"
  1193     "Modified: / 23.8.1998 / 16:09:22 / cg"
  1198 !
  1194 !
  1199 
  1195 
  1860     "returns the notebook view; initialize the tools embedded in the notebook"
  1856     "returns the notebook view; initialize the tools embedded in the notebook"
  1861 
  1857 
  1862     |noteBook modifiedChannel helpTool layoutTool specTool|
  1858     |noteBook modifiedChannel helpTool layoutTool specTool|
  1863 
  1859 
  1864     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
  1860     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
  1865         noteBook   := View new.
  1861 	noteBook   := View new.
  1866         layoutTool := UILayoutTool new.
  1862 	layoutTool := UILayoutTool new.
  1867         helpTool   := UIHelpTool   new.
  1863 	helpTool   := UIHelpTool   new.
  1868         helpTool buildFromClass:specClass.
  1864 	helpTool buildFromClass:specClass.
  1869         specTool   := UISpecificationTool new.
  1865 	specTool   := UISpecificationTool new.
  1870         modifiedChannel    := self modifiedChannel.
  1866 	modifiedChannel    := self modifiedChannel.
  1871 
  1867 
  1872         layoutTool masterApplication:self.
  1868 	layoutTool masterApplication:self.
  1873         specTool   masterApplication:self.
  1869 	specTool   masterApplication:self.
  1874         helpTool   masterApplication:self.
  1870 	helpTool   masterApplication:self.
  1875 
  1871 
  1876         layoutCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1872 	layoutCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1877         helpCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1873 	helpCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1878         specCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1874 	specCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1879 
  1875 
  1880         layoutCanvas client:layoutTool.
  1876 	layoutCanvas client:layoutTool.
  1881         helpCanvas   client:helpTool.
  1877 	helpCanvas   client:helpTool.
  1882         specTool builder:(specCanvas client:specTool).
  1878 	specTool builder:(specCanvas client:specTool).
  1883 
  1879 
  1884         layoutTool masterApplication:self.
  1880 	layoutTool masterApplication:self.
  1885         specTool   masterApplication:self.
  1881 	specTool   masterApplication:self.
  1886         helpTool   masterApplication:self.
  1882 	helpTool   masterApplication:self.
  1887 
  1883 
  1888         layoutTool modifiedHolder:modifiedChannel.
  1884 	layoutTool modifiedHolder:modifiedChannel.
  1889         helpTool   modifiedHolder:modifiedChannel.
  1885 	helpTool   modifiedHolder:modifiedChannel.
  1890         specTool   modifiedHolder:modifiedChannel.
  1886 	specTool   modifiedHolder:modifiedChannel.
  1891 
  1887 
  1892         builder aspectAt:#noteBookView put:noteBook.
  1888 	builder aspectAt:#noteBookView put:noteBook.
  1893     ].
  1889     ].
  1894     ^ noteBook
  1890     ^ noteBook
  1895 !
  1891 !
  1896 
  1892 
  1897 painterShown
  1893 painterShown
  1954     "opens a Table Column Editor on current widget"
  1950     "opens a Table Column Editor on current widget"
  1955 
  1951 
  1956     |cls loadedFromClass loadedFromSpec editor tableColumnsOrSelector|
  1952     |cls loadedFromClass loadedFromSpec editor tableColumnsOrSelector|
  1957 
  1953 
  1958     (cls := self resolveName:specClass) isNil ifTrue:[
  1954     (cls := self resolveName:specClass) isNil ifTrue:[
  1959         self askForSaving ifFalse: [^self].
  1955 	self askForSaving ifFalse: [^self].
  1960         cls := self resolveName:specClass.
  1956 	cls := self resolveName:specClass.
  1961     ].
  1957     ].
  1962     self modifiedChannel value ifTrue:[
  1958     self modifiedChannel value ifTrue:[
  1963         (self confirm:'Accept changes made to spec ?') ifTrue:[
  1959 	(self confirm:'Accept changes made to spec ?') ifTrue:[
  1964             self accept
  1960 	    self accept
  1965         ]
  1961 	]
  1966     ].
  1962     ].
  1967 
  1963 
  1968     loadedFromSpec := loadedFromClass := false.
  1964     loadedFromSpec := loadedFromClass := false.
  1969     editor := DataSetBuilder new.
  1965     editor := DataSetBuilder new.
  1970     editor masterApplication:self.
  1966     editor masterApplication:self.
  1971     editor specClass: cls.
  1967     editor specClass: cls.
  1972     editor rowClassName:(self specTool specification rowClassName).
  1968     editor rowClassName:(self specTool specification rowClassName).
  1973     ((tableColumnsOrSelector := self specTool specification columnHolder) notNil and: 
  1969     ((tableColumnsOrSelector := self specTool specification columnHolder) notNil and: 
  1974     [cls class implements: tableColumnsOrSelector]) ifTrue: [
  1970     [cls class implements: tableColumnsOrSelector]) ifTrue: [
  1975         editor openModalOnClass: cls andSelector: tableColumnsOrSelector.
  1971 	editor openModalOnClass: cls andSelector: tableColumnsOrSelector.
  1976         loadedFromClass := true.
  1972 	loadedFromClass := true.
  1977     ] ifFalse: [       
  1973     ] ifFalse: [       
  1978         (tableColumnsOrSelector := self specTool specification columns) isNil ifTrue: [
  1974 	(tableColumnsOrSelector := self specTool specification columns) isNil ifTrue: [
  1979             editor openModal
  1975 	    editor openModal
  1980         ] ifFalse: [         
  1976 	] ifFalse: [         
  1981             editor openModalOnResourceSpec:tableColumnsOrSelector.
  1977 	    editor openModalOnResourceSpec:tableColumnsOrSelector.
  1982             loadedFromSpec := true
  1978 	    loadedFromSpec := true
  1983         ].
  1979 	].
  1984     ].
  1980     ].
  1985 
  1981 
  1986     loadedFromClass ifTrue: [
  1982     loadedFromClass ifTrue: [
  1987         self specTool specification columns:nil.
  1983 	self specTool specification columns:nil.
  1988         self specTool specification rowClassName:nil.
  1984 	self specTool specification rowClassName:nil.
  1989         self modifiedChannel value:true.
  1985 	self modifiedChannel value:true.
  1990         self accept.
  1986 	self accept.
  1991     ].
  1987     ].
  1992 
  1988 
  1993     (loadedFromSpec not and: [editor hasSaved and:[editor specSelector ~= tableColumnsOrSelector]]) ifTrue:[
  1989     (loadedFromSpec not and: [editor hasSaved and:[editor specSelector ~= tableColumnsOrSelector]]) ifTrue:[
  1994         self specTool specification columnHolder:editor specSelector.
  1990 	self specTool specification columnHolder:editor specSelector.
  1995         self modifiedChannel value:true.
  1991 	self modifiedChannel value:true.
  1996         self accept.
  1992 	self accept.
  1997         ^self
  1993 	^self
  1998     ].
  1994     ].
  1999     loadedFromClass ifFalse: [
  1995     loadedFromClass ifFalse: [
  2000         self specTool specification columns:(editor columns).
  1996 	self specTool specification columns:(editor columns).
  2001         self specTool specification rowClassName:(editor rowClassName).
  1997 	self specTool specification rowClassName:(editor rowClassName).
  2002         self modifiedChannel value: editor modified.
  1998 	self modifiedChannel value: editor modified.
  2003     ].
  1999     ].
  2004 
  2000 
  2005 
  2001 
  2006 !
  2002 !
  2007 
  2003 
  2009     "opens a Menu Editor on current widget"
  2005     "opens a Menu Editor on current widget"
  2010 
  2006 
  2011     |cls selectorOrMenu editor selectedSpec spec|
  2007     |cls selectorOrMenu editor selectedSpec spec|
  2012 
  2008 
  2013     (cls := self resolveName:specClass) isNil ifTrue:[
  2009     (cls := self resolveName:specClass) isNil ifTrue:[
  2014         self askForSaving ifFalse: [^self].
  2010 	self askForSaving ifFalse: [^self].
  2015         cls := self resolveName:specClass.
  2011 	cls := self resolveName:specClass.
  2016     ].
  2012     ].
  2017 
  2013 
  2018     cls notNil ifTrue:[
  2014     cls notNil ifTrue:[
  2019         spec := self specTool specification.
  2015 	spec := self specTool specification.
  2020 
  2016 
  2021         self modifiedChannel value ifTrue:[
  2017 	self modifiedChannel value ifTrue:[
  2022             (self confirm:'Accept changes made to spec ?') ifTrue:[
  2018 	    (self confirm:'Accept changes made to spec ?') ifTrue:[
  2023                 self accept
  2019 		self accept
  2024             ]
  2020 	    ]
  2025         ].
  2021 	].
  2026 
  2022 
  2027         (selectorOrMenu := spec menuSelector) notNil ifTrue:[
  2023 	(selectorOrMenu := spec menuSelector) notNil ifTrue:[
  2028             selectorOrMenu := selectorOrMenu asSymbol
  2024 	    selectorOrMenu := selectorOrMenu asSymbol
  2029         ] ifFalse:[
  2025 	] ifFalse:[
  2030             "/ cg: q&d hack ...
  2026 	    "/ cg: q&d hack ...
  2031 
  2027 
  2032             (selectedSpec := treeView propertySelected) notNil ifTrue:[
  2028 	    (selectedSpec := treeView propertySelected) notNil ifTrue:[
  2033                 Object errorSignal handle:[:ex |
  2029 		Object errorSignal handle:[:ex |
  2034                     selectorOrMenu := nil.
  2030 		    selectorOrMenu := nil.
  2035                 ] do:[
  2031 		] do:[
  2036                     selectorOrMenu := selectedSpec view asMenu.
  2032 		    selectorOrMenu := selectedSpec view asMenu.
  2037                 ]
  2033 		]
  2038             ].
  2034 	    ].
  2039         ].
  2035 	].
  2040 
  2036 
  2041         editor := MenuEditor new.
  2037 	editor := MenuEditor new.
  2042         editor masterApplication:self.
  2038 	editor masterApplication:self.
  2043         editor specClass: cls.
  2039 	editor specClass: cls.
  2044         editor useHelpTool: self helpTool. 
  2040 	editor useHelpTool: self helpTool. 
  2045         selectorOrMenu class ~~ Menu
  2041 	selectorOrMenu class ~~ Menu
  2046             ifTrue:  [editor openModalOnClass:cls andSelector:selectorOrMenu]
  2042 	    ifTrue:  [editor openModalOnClass:cls andSelector:selectorOrMenu]
  2047             ifFalse: [editor openModalOnMenu:selectorOrMenu].
  2043 	    ifFalse: [editor openModalOnMenu:selectorOrMenu].
  2048         self helpTool updateList.
  2044 	self helpTool updateList.
  2049 
  2045 
  2050 "/        editor specSelector ~= selectorOrMenu ifTrue:[
  2046 "/        editor specSelector ~= selectorOrMenu ifTrue:[
  2051             editor hasSaved ifTrue:[
  2047 	    editor hasSaved ifTrue:[
  2052                 spec menuSelector:editor specSelector.
  2048 		spec menuSelector:editor specSelector.
  2053                 self modifiedChannel value:true.
  2049 		self modifiedChannel value:true.
  2054                 self accept
  2050 		self accept
  2055 "/            ]
  2051 "/            ]
  2056         ].
  2052 	].
  2057     ]
  2053     ]
  2058 
  2054 
  2059     "Modified: / 16.7.1998 / 18:16:42 / cg"
  2055     "Modified: / 16.7.1998 / 18:16:42 / cg"
  2060 !
  2056 !
  2061 
  2057 
  2163      widget has changed"
  2159      widget has changed"
  2164 
  2160 
  2165     |property spec|
  2161     |property spec|
  2166 
  2162 
  2167     (property := treeView propertySelected) notNil ifTrue:[
  2163     (property := treeView propertySelected) notNil ifTrue:[
  2168         spec := property spec copy.
  2164 	spec := property spec copy.
  2169         self specTool specification:spec.
  2165 	self specTool specification:spec.
  2170         self setViewInLayoutTool:(property view) spec:spec.
  2166 	self setViewInLayoutTool:(property view) spec:spec.
  2171         self modifiedChannel value:false
  2167 	self modifiedChannel value:false
  2172     ] ifFalse:[
  2168     ] ifFalse:[
  2173         self layoutTool layoutView notNil ifTrue:[
  2169 	self layoutTool layoutView notNil ifTrue:[
  2174             self modifiedChannel value:false.
  2170 	    self modifiedChannel value:false.
  2175             self treeSelection
  2171 	    self treeSelection
  2176         ]
  2172 	]
  2177     ]
  2173     ]
  2178 !
  2174 !
  2179 
  2175 
  2180 update:something with:aParameter from:someObject
  2176 update:something with:aParameter from:someObject
  2181     "catches change notifications"
  2177     "catches change notifications"
  2182 
  2178 
  2183     |window|
  2179     |window|
  2184 
  2180 
  2185     someObject == treeView model ifTrue:[
  2181     someObject == treeView model ifTrue:[
  2186         (something == #selection
  2182 	(something == #selection
  2187         or:[something == #selectionIndex]) ifTrue:[self treeSelection].
  2183 	or:[something == #selectionIndex]) ifTrue:[self treeSelection].
  2188       ^ self
  2184       ^ self
  2189     ].
  2185     ].
  2190 
  2186 
  2191     someObject == self galleryShown ifTrue:[
  2187     someObject == self galleryShown ifTrue:[
  2192         "/ galleryShown toggle changed
  2188 	"/ galleryShown toggle changed
  2193         window := selectionPanel window.
  2189 	window := selectionPanel window.
  2194         (someObject value) ifTrue:[
  2190 	(someObject value) ifTrue:[
  2195             self raiseUIView:window
  2191 	    self raiseUIView:window
  2196         ] ifFalse:[
  2192 	] ifFalse:[
  2197             self hideUIView:window
  2193 	    self hideUIView:window
  2198         ].
  2194 	].
  2199       ^ self
  2195       ^ self
  2200     ].
  2196     ].
  2201 
  2197 
  2202     someObject == self painterShown ifTrue:[
  2198     someObject == self painterShown ifTrue:[
  2203         "/ canvasShown toggle changed
  2199 	"/ canvasShown toggle changed
  2204         window := self painter topView.
  2200 	window := self painter topView.
  2205         (someObject value) ifTrue:[
  2201 	(someObject value) ifTrue:[
  2206             self raiseUIView:window
  2202 	    self raiseUIView:window
  2207         ] ifFalse:[
  2203 	] ifFalse:[
  2208             self hideUIView:window
  2204 	    self hideUIView:window
  2209         ].
  2205 	].
  2210       ^ self
  2206       ^ self
  2211     ].
  2207     ].
  2212 
  2208 
  2213     "Modified: / 16.7.1998 / 19:09:57 / cg"
  2209     "Modified: / 16.7.1998 / 19:09:57 / cg"
  2214 !
  2210 !
  2225     self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas).
  2221     self hasOneSelectionOtherThanCanvas value:(treeView hasOneSelectionOtherThanCanvas).
  2226 
  2222 
  2227     treeView notNil
  2223     treeView notNil
  2228     ifTrue:
  2224     ifTrue:
  2229     [
  2225     [
  2230         treeSelection := treeView selection.
  2226 	treeSelection := treeView selection.
  2231         "/ the top-node cannot be cut, copied or pasted.
  2227 	"/ the top-node cannot be cut, copied or pasted.
  2232         canCutOrCopy := treeSelection size >= 1 and:[treeSelection first ~~ 1].
  2228 	canCutOrCopy := treeSelection size >= 1 and:[treeSelection first ~~ 1].
  2233         clipboard := self getSelection.
  2229 	clipboard := self getSelection.
  2234 
  2230 
  2235         clipboard isCollection ifTrue:[clipboard notEmpty ifTrue:[sel := clipboard first]]
  2231 	clipboard isCollection ifTrue:[clipboard notEmpty ifTrue:[sel := clipboard first]]
  2236                               ifFalse:[sel := clipboard].
  2232 			      ifFalse:[sel := clipboard].
  2237 
  2233 
  2238         canPaste := (sel isKindOf:UISpecification) and: 
  2234 	canPaste := (sel isKindOf:UISpecification) and: 
  2239                     [treeSelection size  = 1 
  2235 		    [treeSelection size  = 1 
  2240                     and:[treeSelection first == 1 
  2236 		    and:[treeSelection first == 1 
  2241                     or: [self canPasteInto: treeView selectedNode contents view]]]
  2237 		    or: [self canPasteInto: treeView selectedNode contents view]]]
  2242     ].
  2238     ].
  2243 
  2239 
  2244     self valueOfCanCut value: canCutOrCopy.
  2240     self valueOfCanCut value: canCutOrCopy.
  2245     self valueOfCanCopy value: canCutOrCopy.
  2241     self valueOfCanCopy value: canCutOrCopy.
  2246     self valueOfCanPaste value: canPaste.            
  2242     self valueOfCanPaste value: canPaste.            
  2349     specClass isNil ifTrue:[^ false].
  2345     specClass isNil ifTrue:[^ false].
  2350 
  2346 
  2351     cls := self resolveName:specClass.
  2347     cls := self resolveName:specClass.
  2352 
  2348 
  2353     cls isNil ifTrue:[
  2349     cls isNil ifTrue:[
  2354         superclass := self resolveName:specSuperclass.
  2350 	superclass := self resolveName:specSuperclass.
  2355 
  2351 
  2356         superclass isNil ifTrue:[
  2352 	superclass isNil ifTrue:[
  2357             self warn:'No class named ' , specSuperclass , ' exists!!'.
  2353 	    self warn:'No class named ' , specSuperclass , ' exists!!'.
  2358             ^ false.
  2354 	    ^ false.
  2359         ].
  2355 	].
  2360 
  2356 
  2361         (self confirm:'Create class ' , specClass asBoldText, '?') ifTrue:[
  2357 	(self confirm:'Create class ' , specClass asBoldText, '?') ifTrue:[
  2362             cls := superclass 
  2358 	    cls := superclass 
  2363                         subclass:(specClass asSymbol)
  2359 			subclass:(specClass asSymbol)
  2364                         instanceVariableNames:''
  2360 			instanceVariableNames:''
  2365                         classVariableNames:''
  2361 			classVariableNames:''
  2366                         poolDictionaries:''
  2362 			poolDictionaries:''
  2367                         category:'Applications'.
  2363 			category:'Applications'.
  2368 
  2364 
  2369             cls name ~= specClass ifTrue:[
  2365 	    cls name ~= specClass ifTrue:[
  2370                 self information:'Created new class is ' , cls name.
  2366 		self information:'Created new class is ' , cls name.
  2371                 specClass := cls name
  2367 		specClass := cls name
  2372             ].
  2368 	    ].
  2373             ^ true.
  2369 	    ^ true.
  2374         ].
  2370 	].
  2375         ^ false.
  2371 	^ false.
  2376     ].
  2372     ].
  2377     cls isBehavior ifFalse:[
  2373     cls isBehavior ifFalse:[
  2378         self warn:'A global named ' , specClass , ' exists, but it is no class.'.
  2374 	self warn:'A global named ' , specClass , ' exists, but it is no class.'.
  2379         ^ false.
  2375 	^ false.
  2380     ].
  2376     ].
  2381 
  2377 
  2382     specSuperclass isBehavior ifFalse:[
  2378     specSuperclass isBehavior ifFalse:[
  2383         specSuperclass isEmpty ifFalse:[
  2379 	specSuperclass isEmpty ifFalse:[
  2384             superclass := self resolveName:specSuperclass
  2380 	    superclass := self resolveName:specSuperclass
  2385         ] ifTrue:[
  2381 	] ifTrue:[
  2386             specSuperclass := nil.
  2382 	    specSuperclass := nil.
  2387         ]
  2383 	]
  2388     ] ifTrue:[
  2384     ] ifTrue:[
  2389         superclass := specSuperclass
  2385 	superclass := specSuperclass
  2390     ].
  2386     ].
  2391 
  2387 
  2392     specSuperclass notNil ifTrue:[
  2388     specSuperclass notNil ifTrue:[
  2393         superclass isNil ifTrue:[
  2389 	superclass isNil ifTrue:[
  2394             self warn:'No class named ' , specSuperclass , ' exists!!'.
  2390 	    self warn:'No class named ' , specSuperclass , ' exists!!'.
  2395             ^ false.
  2391 	    ^ false.
  2396         ].
  2392 	].
  2397 
  2393 
  2398         (cls isSubclassOf:superclass) ifFalse:[
  2394 	(cls isSubclassOf:superclass) ifFalse:[
  2399             self information:('A global named ' , specClass , ' exists,\' ,
  2395 	    self information:('A global named ' , specClass , ' exists,\' ,
  2400                               'but is not a subclass of ' , superclass name , '.\\' ,
  2396 			      'but is not a subclass of ' , superclass name , '.\\' ,
  2401                               'Check and try again if that is not what you want.') withCRs.
  2397 			      'Check and try again if that is not what you want.') withCRs.
  2402         ]
  2398 	]
  2403     ].
  2399     ].
  2404 
  2400 
  2405     superclass isNil ifTrue:[
  2401     superclass isNil ifTrue:[
  2406         cls notNil ifTrue:[
  2402 	cls notNil ifTrue:[
  2407             specSuperclass := cls superclass name
  2403 	    specSuperclass := cls superclass name
  2408         ]
  2404 	]
  2409     ].
  2405     ].
  2410 
  2406 
  2411     ^ true
  2407     ^ true
  2412 
  2408 
  2413     "Modified: 12.8.1997 / 23:39:10 / cg"
  2409     "Modified: 12.8.1997 / 23:39:10 / cg"
  2495     "sets view for layout tool"
  2491     "sets view for layout tool"
  2496 
  2492 
  2497     |type|
  2493     |type|
  2498 
  2494 
  2499     self painter topView == aView ifTrue:[
  2495     self painter topView == aView ifTrue:[
  2500         type := #Extent
  2496 	type := #Extent
  2501     ].
  2497     ].
  2502     self layoutTool layoutView:aView type:type spec:aSpec
  2498     self layoutTool layoutView:aView type:type spec:aSpec
  2503 
  2499 
  2504 !
  2500 !
  2505 
  2501 
  2632     "called whenever the selection of the treeview has changed"
  2628     "called whenever the selection of the treeview has changed"
  2633 
  2629 
  2634     |view list spec slices size property tabComponent|
  2630     |view list spec slices size property tabComponent|
  2635 
  2631 
  2636     self isModified ifTrue:[
  2632     self isModified ifTrue:[
  2637         (self confirm:'Accept modifications in section ' , tabSelection printString asBoldText, '?') ifTrue:[
  2633 	(self confirm:'Accept modifications in section ' , tabSelection printString asBoldText, '?') ifTrue:[
  2638             self accept
  2634 	    self accept
  2639         ]
  2635 	]
  2640     ].
  2636     ].
  2641 
  2637 
  2642     treeView isCanvasSelected ifTrue:[
  2638     treeView isCanvasSelected ifTrue:[
  2643         spec := treeView canvasSpec.
  2639 	spec := treeView canvasSpec.
  2644         view := self painter topView.
  2640 	view := self painter topView.
  2645     ] ifFalse:[
  2641     ] ifFalse:[
  2646         (property := treeView propertySelected) notNil ifTrue:[
  2642 	(property := treeView propertySelected) notNil ifTrue:[
  2647             treeView canResizeSelectedWidget ifTrue:[
  2643 	    treeView canResizeSelectedWidget ifTrue:[
  2648                 view := property view.
  2644 		view := property view.
  2649             ].
  2645 	    ].
  2650             spec := property spec copy.
  2646 	    spec := property spec copy.
  2651         ]
  2647 	]
  2652     ].
  2648     ].
  2653     tabComponent := builder componentAt:#noteBook.
  2649     tabComponent := builder componentAt:#noteBook.
  2654     self setViewInLayoutTool:view spec:spec.
  2650     self setViewInLayoutTool:view spec:spec.
  2655     self specTool specification:spec.
  2651     self specTool specification:spec.
  2656 
  2652 
  2657     spec notNil ifTrue:[
  2653     spec notNil ifTrue:[
  2658         self helpTool helpKey:(spec activeHelpKey).
  2654 	self helpTool helpKey:(spec activeHelpKey).
  2659         slices := spec class slices.
  2655 	slices := spec class slices.
  2660         size   := slices size.
  2656 	size   := slices size.
  2661 
  2657 
  2662         view notNil ifTrue:[
  2658 	view notNil ifTrue:[
  2663             self treeView isCanvasSelected 
  2659 	    self treeView isCanvasSelected 
  2664             ifFalse:
  2660 	    ifFalse:
  2665             [
  2661 	    [
  2666                 list := Array new:(size + 2).
  2662 		list := Array new:(size + 2).
  2667                 list at:(size + 2) put:(UILayoutTool label).
  2663 		list at:(size + 2) put:(UILayoutTool label).
  2668             ]
  2664 	    ]
  2669             ifTrue:
  2665 	    ifTrue:
  2670             [
  2666 	    [
  2671                 list := Array new:(size + 1).
  2667 		list := Array new:(size + 1).
  2672                 list at:(size + 1) put:(UILayoutTool label).
  2668 		list at:(size + 1) put:(UILayoutTool label).
  2673             ].
  2669 	    ].
  2674         ] ifFalse:[
  2670 	] ifFalse:[
  2675             list := Array new:(size + 1).
  2671 	    list := Array new:(size + 1).
  2676         ].
  2672 	].
  2677 
  2673 
  2678         1 to:size do:[:i| list at:i put:((slices at:i) first asString)].
  2674 	1 to:size do:[:i| list at:i put:((slices at:i) first asString)].
  2679         self treeView isCanvasSelected ifFalse: [list at:(size + 1) put:(UIHelpTool label)].
  2675 	self treeView isCanvasSelected ifFalse: [list at:(size + 1) put:(UIHelpTool label)].
  2680 
  2676 
  2681         self tabList value:list.
  2677 	self tabList value:list.
  2682         self showHelp:spec class name for:self.
  2678 	self showHelp:spec class name for:self.
  2683         tabComponent enabled:true.
  2679 	tabComponent enabled:true.
  2684 
  2680 
  2685         (tabSelection := tabComponent selection) isNil ifTrue:[
  2681 	(tabSelection := tabComponent selection) isNil ifTrue:[
  2686             tabComponent setSelection:(tabSelection := list first)
  2682 	    tabComponent setSelection:(tabSelection := list first)
  2687         ].
  2683 	].
  2688         self raiseTabView
  2684 	self raiseTabView
  2689     ] ifFalse:[
  2685     ] ifFalse:[
  2690         self helpTool helpKey:nil.
  2686 	self helpTool helpKey:nil.
  2691         tabComponent enabled:false.
  2687 	tabComponent enabled:false.
  2692         self defaultInfoLabel.
  2688 	self defaultInfoLabel.
  2693     ].
  2689     ].
  2694     self modifiedChannel value:false.
  2690     self modifiedChannel value:false.
  2695 
  2691 
  2696     self updateChannels
  2692     self updateChannels
  2697 ! !
  2693 ! !
  2804     modified := false.
  2800     modified := false.
  2805 
  2801 
  2806     aspects := IdentityDictionary new.
  2802     aspects := IdentityDictionary new.
  2807 
  2803 
  2808     aspects at:#classNameChannel put:(
  2804     aspects at:#classNameChannel put:(
  2809         (specClass notNil ifTrue:[specClass]
  2805 	(specClass notNil ifTrue:[specClass]
  2810                          ifFalse:['NewApplication']) asValue
  2806 			 ifFalse:['NewApplication']) asValue
  2811     ).
  2807     ).
  2812     specSuperclass isNil ifTrue:[
  2808     specSuperclass isNil ifTrue:[
  2813         specClass notNil ifTrue:[
  2809 	specClass notNil ifTrue:[
  2814             (cls := self resolveName:specClass) notNil ifTrue:[
  2810 	    (cls := self resolveName:specClass) notNil ifTrue:[
  2815                 specSuperclass := cls superclass name.
  2811 		specSuperclass := cls superclass name.
  2816             ]
  2812 	    ]
  2817         ]
  2813 	]
  2818     ].
  2814     ].
  2819     aspects at:#superclassNameChannel put:(
  2815     aspects at:#superclassNameChannel put:(
  2820         (specSuperclass notNil ifTrue:[specSuperclass]
  2816 	(specSuperclass notNil ifTrue:[specSuperclass]
  2821                          ifFalse:['ApplicationModel']) asValue
  2817 			 ifFalse:['ApplicationModel']) asValue
  2822     ).
  2818     ).
  2823     aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue.
  2819     aspects at:#superclassNameDefaults put:#('ApplicationModel' 'SimpleDialog') asValue.
  2824     aspects at:#methodNameChannel put:(
  2820     aspects at:#methodNameChannel put:(
  2825         (specSelector notNil ifTrue:[specSelector asValue]
  2821 	(specSelector notNil ifTrue:[specSelector asValue]
  2826                             ifFalse:[#windowSpec]) asValue
  2822 			    ifFalse:[#windowSpec]) asValue
  2827     ).
  2823     ).
  2828 
  2824 
  2829     "/ the canvas ...
  2825     "/ the canvas ...
  2830 
  2826 
  2831     treeView    := TreeView new.
  2827     treeView    := TreeView new.
  2905 
  2901 
  2906     super postOpenWith:aBuilder.
  2902     super postOpenWith:aBuilder.
  2907 
  2903 
  2908     cls := specClass.
  2904     cls := specClass.
  2909     cls isString ifTrue:[
  2905     cls isString ifTrue:[
  2910         cls := Smalltalk at:(cls string asSymbol)
  2906 	cls := Smalltalk at:(cls string asSymbol)
  2911     ].
  2907     ].
  2912     sel := specSelector.
  2908     sel := specSelector.
  2913     specSelector := nil.
  2909     specSelector := nil.
  2914     specClass    := nil.
  2910     specClass    := nil.
  2915 
  2911 
  2923     painter gridShown: (settings at: #GridShown ifAbsent:false).
  2919     painter gridShown: (settings at: #GridShown ifAbsent:false).
  2924     painter gridAlign: (settings at: #GridAlign ifAbsent:false).
  2920     painter gridAlign: (settings at: #GridAlign ifAbsent:false).
  2925     painter clear.
  2921     painter clear.
  2926 
  2922 
  2927     cls notNil ifTrue:[
  2923     cls notNil ifTrue:[
  2928         self setClass:cls selector:sel.
  2924 	self setClass:cls selector:sel.
  2929 
  2925 
  2930         (cls respondsTo:sel) ifTrue:[  
  2926 	(cls respondsTo:sel) ifTrue:[  
  2931             painter setupFromSpec:(cls perform:sel).
  2927 	    painter setupFromSpec:(cls perform:sel).
  2932         ]
  2928 	]
  2933     ].
  2929     ].
  2934     treeView selection: #(1).
  2930     treeView selection: #(1).
  2935 
  2931 
  2936     "Modified: / 22.8.1998 / 17:41:34 / cg"
  2932     "Modified: / 22.8.1998 / 17:41:34 / cg"
  2937 ! !
  2933 ! !
  2948 
  2944 
  2949     painter := self painter.
  2945     painter := self painter.
  2950     spec := self specTool specification.
  2946     spec := self specTool specification.
  2951 
  2947 
  2952     self isLayoutToolSelected ifTrue:[
  2948     self isLayoutToolSelected ifTrue:[
  2953         layoutTool := self layoutTool.
  2949 	layoutTool := self layoutTool.
  2954 
  2950 
  2955         (layout := layoutTool layout) notNil ifTrue:[
  2951 	(layout := layoutTool layout) notNil ifTrue:[
  2956             layoutTool layoutType == #Extent ifTrue:[
  2952 	    layoutTool layoutType == #Extent ifTrue:[
  2957                 layoutView := layoutTool layoutView.
  2953 		layoutView := layoutTool layoutView.
  2958 
  2954 
  2959                 layoutView == painter topView ifTrue:[
  2955 		layoutView == painter topView ifTrue:[
  2960                     layoutView extent:layout
  2956 		    layoutView extent:layout
  2961                 ] ifFalse:[
  2957 		] ifFalse:[
  2962                     spec useDefaultExtent:(layoutTool aspectFor:#useDefaultExtent) value.
  2958 		    spec useDefaultExtent:(layoutTool aspectFor:#useDefaultExtent) value.
  2963                     spec useDefaultExtent ifTrue:[
  2959 		    spec useDefaultExtent ifTrue:[
  2964                         "/ temporarily unfreeze the widgets size
  2960 			"/ temporarily unfreeze the widgets size
  2965                         "/ (but remember, the old setting, which is actually
  2961 			"/ (but remember, the old setting, which is actually
  2966                         "/ controlled by the resizeForLabel attribute)
  2962 			"/ controlled by the resizeForLabel attribute)
  2967                         t := layoutView sizeFixed.
  2963 			t := layoutView sizeFixed.
  2968                         layoutView sizeFixed:false.
  2964 			layoutView sizeFixed:false.
  2969                         layout := layoutView preferredExtent.    
  2965 			layout := layoutView preferredExtent.    
  2970                         layoutView sizeFixed:t.
  2966 			layoutView sizeFixed:t.
  2971                     ].
  2967 		    ].
  2972                     painter setExtent:layout.
  2968 		    painter setExtent:layout.
  2973                     painter updateFromSpec:spec.
  2969 		    painter updateFromSpec:spec.
  2974                 ]
  2970 		]
  2975             ] ifFalse:[
  2971 	    ] ifFalse:[
  2976                 painter setLayout:layout
  2972 		painter setLayout:layout
  2977             ]
  2973 	    ]
  2978         ]
  2974 	]
  2979     ] ifFalse:[
  2975     ] ifFalse:[
  2980         self isHelpToolSelected ifTrue:[
  2976 	self isHelpToolSelected ifTrue:[
  2981             self helpTool accept.      
  2977 	    self helpTool accept.      
  2982             spec activeHelpKey:self helpTool helpKey.
  2978 	    spec activeHelpKey:self helpTool helpKey.
  2983         ].      
  2979 	].      
  2984         painter updateFromSpec:spec
  2980 	painter updateFromSpec:spec
  2985     ].
  2981     ].
  2986 
  2982 
  2987     modified := false.
  2983     modified := false.
  2988 !
  2984 !
  2989 
  2985 
  3024      reread the old attributes"
  3020      reread the old attributes"
  3025 
  3021 
  3026     |spec key view|
  3022     |spec key view|
  3027 
  3023 
  3028     self isModified ifTrue:[
  3024     self isModified ifTrue:[
  3029         (spec := self painter specForSelection) notNil ifTrue:[
  3025 	(spec := self painter specForSelection) notNil ifTrue:[
  3030             key := spec activeHelpKey.
  3026 	    key := spec activeHelpKey.
  3031         ].
  3027 	].
  3032         self helpTool helpKey:key.
  3028 	self helpTool helpKey:key.
  3033 
  3029 
  3034         treeView isCanvasSelected ifTrue: [
  3030 	treeView isCanvasSelected ifTrue: [
  3035             spec := treeView canvasSpec.
  3031 	    spec := treeView canvasSpec.
  3036         ].
  3032 	].
  3037         self specTool specification:spec.
  3033 	self specTool specification:spec.
  3038         view := self layoutTool layoutView.
  3034 	view := self layoutTool layoutView.
  3039 
  3035 
  3040         self setViewInLayoutTool:view spec:spec.
  3036 	self setViewInLayoutTool:view spec:spec.
  3041         spec class == DataSetSpec ifTrue:[
  3037 	spec class == DataSetSpec ifTrue:[
  3042             view notNil ifTrue:[
  3038 	    view notNil ifTrue:[
  3043                 view columnDescriptors:(spec columns)
  3039 		view columnDescriptors:(spec columns)
  3044             ]
  3040 	    ]
  3045         ].        
  3041 	].        
  3046         self modifiedChannel value:false.
  3042 	self modifiedChannel value:false.
  3047         modified := false
  3043 	modified := false
  3048     ]
  3044     ]
  3049 !
  3045 !
  3050 
  3046 
  3051 doBrowseAspectMethods
  3047 doBrowseAspectMethods
  3052     "opens a browser on the aspect methods"
  3048     "opens a browser on the aspect methods"
  3145     bindings at:#alignToGrid put:((settings at: #GridAlign ifAbsent: [painter gridAlign]) asValue).
  3141     bindings at:#alignToGrid put:((settings at: #GridAlign ifAbsent: [painter gridAlign]) asValue).
  3146     bindings at:#hspace      put:((gridPara at:1) asValue).
  3142     bindings at:#hspace      put:((gridPara at:1) asValue).
  3147     bindings at:#vspace      put:((gridPara at:2) asValue).
  3143     bindings at:#vspace      put:((gridPara at:2) asValue).
  3148 
  3144 
  3149     (self openDialogInterface:#dialogSpecForDefiningGridParameters withBindings:bindings) ifFalse:[
  3145     (self openDialogInterface:#dialogSpecForDefiningGridParameters withBindings:bindings) ifFalse:[
  3150         ^ self
  3146 	^ self
  3151     ].
  3147     ].
  3152 
  3148 
  3153     hspace := (bindings at:#hspace) value ? 5.
  3149     hspace := (bindings at:#hspace) value ? 5.
  3154     vspace := (bindings at:#vspace) value ? 5.
  3150     vspace := (bindings at:#vspace) value ? 5.
  3155 
  3151 
  3334     |code painter cls ns|
  3330     |code painter cls ns|
  3335 
  3331 
  3336     self askForSectionModification.
  3332     self askForSectionModification.
  3337 
  3333 
  3338     self hasSpecClassAndSelector ifFalse:[
  3334     self hasSpecClassAndSelector ifFalse:[
  3339         self doDefineClassAndSelector isNil ifTrue: [^nil]
  3335 	self doDefineClassAndSelector isNil ifTrue: [^nil]
  3340     ].
  3336     ].
  3341 
  3337 
  3342     (specClass notNil and: [(cls := Smalltalk at: specClass asSymbol) isClass]) ifFalse:[   
  3338     (specClass notNil and: [(cls := Smalltalk at: specClass asSymbol) isClass]) ifFalse:[   
  3343         self warn:('Oops - cannot save - class not found: ' , specClass).
  3339 	self warn:('Oops - cannot save - class not found: ' , specClass).
  3344         ^nil
  3340 	^nil
  3345     ].
  3341     ].
  3346 
  3342 
  3347 "/    specClass notNil ifTrue:[
  3343 "/    specClass notNil ifTrue:[
  3348 "/        (specClass includes:$:) ifFalse:[
  3344 "/        (specClass includes:$:) ifFalse:[
  3349 "/            (ns := Smalltalk defaultNameSpace) notNil ifTrue:[
  3345 "/            (ns := Smalltalk defaultNameSpace) notNil ifTrue:[
  3370 "/        specClass := cls name.
  3366 "/        specClass := cls name.
  3371 "/    ].
  3367 "/    ].
  3372 
  3368 
  3373     painter := self painter.
  3369     painter := self painter.
  3374     painter 
  3370     painter 
  3375         className:specClass
  3371 	className:specClass
  3376         superclassName:specSuperclass
  3372 	superclassName:specSuperclass
  3377         selector:specSelector.
  3373 	selector:specSelector.
  3378 
  3374 
  3379     code := painter generateWindowSpecMethodSource withCRs.
  3375     code := painter generateWindowSpecMethodSource withCRs.
  3380 
  3376 
  3381     Transcript showCR:'generating windowSpec code...'.
  3377     Transcript showCR:'generating windowSpec code...'.
  3382 
  3378 
  3387     self updateInfoLabel.
  3383     self updateInfoLabel.
  3388     modified := false.
  3384     modified := false.
  3389     painter resetModification.
  3385     painter resetModification.
  3390 
  3386 
  3391     (cls class implements: specSelector) ifTrue:[
  3387     (cls class implements: specSelector) ifTrue:[
  3392         self addToHistory: (specClass, ' ', specSelector) -> #loadFromMessage:.
  3388 	self addToHistory: (specClass, ' ', specSelector) -> #loadFromMessage:.
  3393     ].
  3389     ].
  3394 
  3390 
  3395 
  3391 
  3396 !
  3392 !
  3397 
  3393 
  3426     "starts the application on the editing window spec"
  3422     "starts the application on the editing window spec"
  3427 
  3423 
  3428     |cls application|
  3424     |cls application|
  3429 
  3425 
  3430     self hasSpecClassAndSelector ifFalse:[
  3426     self hasSpecClassAndSelector ifFalse:[
  3431         self doSave isNil ifTrue: [^nil].
  3427 	self doSave isNil ifTrue: [^nil].
  3432     ] ifTrue: [
  3428     ] ifTrue: [
  3433         self askForSectionModification.    
  3429 	self askForSectionModification.    
  3434         (modified or: [self painter isModified or: [self helpTool modified]])
  3430 	(modified or: [self painter isModified or: [self helpTool modified]])
  3435         ifTrue:
  3431 	ifTrue:
  3436         [
  3432 	[
  3437             ((YesNoBox title:'Window Spec was modified!!')        
  3433 	    ((YesNoBox title:'Window Spec was modified!!')        
  3438                 noText:'Cancel';
  3434 		noText:'Cancel';
  3439                 yesText:'Save it and start';
  3435 		yesText:'Save it and start';
  3440                 showAtPointer;
  3436 		showAtPointer;
  3441                 accepted) ifFalse: [^nil].
  3437 		accepted) ifFalse: [^nil].
  3442             self doSave isNil ifTrue: [^nil]
  3438 	    self doSave isNil ifTrue: [^nil]
  3443         ]
  3439 	]
  3444     ].
  3440     ].
  3445 
  3441 
  3446     cls := self resolveName:specClass.
  3442     cls := self resolveName:specClass.
  3447     cls isNil ifTrue:[
  3443     cls isNil ifTrue:[
  3448         self warn:'Oops cannot start application - no class:' , specClass.
  3444 	self warn:'Oops cannot start application - no class:' , specClass.
  3449         ^ nil
  3445 	^ nil
  3450     ].
  3446     ].
  3451     ((application := cls new) respondsTo:#openInterface:) ifFalse:[
  3447     ((application := cls new) respondsTo:#openInterface:) ifFalse:[
  3452         ^ self warn:('The application does not respond to the ''openInterface:'' message.\\(maybe the spec is supposed to be used as subApplication/subCanvas)') withCRs.
  3448         ^ self warn:('The application does not respond to the ''openInterface:'' message.\\(maybe the spec is supposed to be used as subApplication/subCanvas)') withCRs.
  3453     ].        
  3449     ].        
  3454     application openInterface:specSelector
  3450     application openInterface:specSelector
  3635 
  3631 
  3636     lastDrawnMaster := nil.
  3632     lastDrawnMaster := nil.
  3637     windowSpec := nil.
  3633     windowSpec := nil.
  3638 
  3634 
  3639     self canvas subViews copy do:[:aView|
  3635     self canvas subViews copy do:[:aView|
  3640         "/ care to not destroy the transparent input view
  3636 	"/ care to not destroy the transparent input view
  3641         (aView isInputOnly) ifFalse:[aView destroy]
  3637 	(aView isInputOnly) ifFalse:[aView destroy]
  3642     ].
  3638     ].
  3643     model root name: UIPainter defaultNameOfCanvas asBoldText.
  3639     model root name: UIPainter defaultNameOfCanvas asBoldText.
  3644     model removeAllOtherThanRoot.
  3640     model removeAllOtherThanRoot.
  3645 
  3641 
  3646 !
  3642 !
  3668 
  3664 
  3669     fullSpec := FullSpec new.
  3665     fullSpec := FullSpec new.
  3670     fullSpec name:specNameSymbol.
  3666     fullSpec name:specNameSymbol.
  3671 
  3667 
  3672     fullSpec fromBuilder:(self canvas topView)
  3668     fullSpec fromBuilder:(self canvas topView)
  3673               components:(SpecCollection new collection:aSpecArray).
  3669 	      components:(SpecCollection new collection:aSpecArray).
  3674 
  3670 
  3675     windowSpec notNil ifTrue:[
  3671     windowSpec notNil ifTrue:[
  3676         winSpec := fullSpec window.
  3672 	winSpec := fullSpec window.
  3677         winSpec copyValuesFromSpec:windowSpec.
  3673 	winSpec copyValuesFromSpec:windowSpec.
  3678         winSpec name: winSpec label.
  3674 	winSpec name: winSpec label.
  3679     ].    
  3675     ].    
  3680     ^ fullSpec literalArrayEncoding.
  3676     ^ fullSpec literalArrayEncoding.
  3681 
  3677 
  3682 !
  3678 !
  3683 
  3679