equal
deleted
inserted
replaced
71 |
71 |
72 [author:] |
72 [author:] |
73 Claus Atzkern |
73 Claus Atzkern |
74 " |
74 " |
75 |
75 |
|
76 ! ! |
|
77 |
|
78 !MenuEditor class methodsFor:'code generation'! |
|
79 |
|
80 generateCodeFor:aClass menuSelector:aSelector |
|
81 |
|
82 |code category| |
|
83 |
|
84 category := self sourceCategory. |
|
85 |
|
86 code := Character excla asString |
|
87 , aClass name , ' methodsFor:' , category storeString |
|
88 , Character excla asString , '\\' |
|
89 |
|
90 , aSelector , '\' |
|
91 , ' "this window spec was automatically generated by the UI Builder"\\' |
|
92 , ' ^ self class ', aSelector, '\\' |
|
93 , '\' |
|
94 , Character excla asString |
|
95 , ' ' |
|
96 , Character excla asString |
|
97 , '\\'. |
|
98 ^ code |
|
99 |
|
100 " |
|
101 self generateCodeFor:MenuEditor menuSelector:#menu |
|
102 " |
|
103 ! |
|
104 |
|
105 sourceCategory |
|
106 "returns the catagory where to instal the menu |
|
107 " |
|
108 ^ 'accessing menu' |
76 ! ! |
109 ! ! |
77 |
110 |
78 !MenuEditor class methodsFor:'icons'! |
111 !MenuEditor class methodsFor:'icons'! |
79 |
112 |
80 iconCreateItem |
113 iconCreateItem |
1850 |
1883 |
1851 code := code withCRs. |
1884 code := code withCRs. |
1852 (ReadStream on:code) fileIn. |
1885 (ReadStream on:code) fileIn. |
1853 |
1886 |
1854 (cls compiledMethodAt:selector) isNil ifTrue:[ |
1887 (cls compiledMethodAt:selector) isNil ifTrue:[ |
1855 category := 'accessing menu'. |
1888 code := self class generateCodeFor:cls menuSelector:selector. |
1856 code := Character excla asString |
|
1857 , cls name , ' methodsFor:' , category storeString |
|
1858 , Character excla asString , '\\' |
|
1859 |
|
1860 , selector , '\' |
|
1861 , ' "this window spec was automatically generated by the ST/X MenuEditor"\\' |
|
1862 , ' ^ self class ', selector, '\\' |
|
1863 , '\' |
|
1864 , Character excla asString |
|
1865 , ' ' |
|
1866 , Character excla asString |
|
1867 , '\\'. |
|
1868 |
|
1869 code := code withCRs. |
1889 code := code withCRs. |
1870 (ReadStream on:code) fileIn. |
1890 (ReadStream on:code) fileIn. |
1871 ]. |
1891 ]. |
1872 |
1892 |
1873 |
1893 |