100 flyByHelpSpec |
100 flyByHelpSpec |
101 <resource: #help> |
101 <resource: #help> |
102 |
102 |
103 ^super flyByHelpSpec addPairsFrom:#( |
103 ^super flyByHelpSpec addPairsFrom:#( |
104 |
104 |
105 #alignSelectionBottom |
|
106 'Align Bottom Edges' |
|
107 |
|
108 #alignSelectionCenterHor |
|
109 'Align Centers Vertically' |
|
110 |
|
111 #alignSelectionCenterVer |
|
112 'Align Centers Horizontally' |
|
113 |
|
114 #alignSelectionLeft |
|
115 'Align Left Edges' |
|
116 |
|
117 #alignSelectionLeftAndRight |
|
118 'Align Horizontal Edges' |
|
119 |
|
120 #alignSelectionRight |
|
121 'Align Right Edges' |
|
122 |
|
123 #alignSelectionTop |
|
124 'Align Top Edges' |
|
125 |
|
126 #alignSelectionTopAndBottom |
|
127 'Align Vertical Edges' |
|
128 |
|
129 #centerSelectionHor |
|
130 'Center Horizontally' |
|
131 |
|
132 #centerSelectionVer |
|
133 'Center Vertically' |
|
134 |
|
135 #changePositionDown |
|
136 'Move Towards Bottom' |
|
137 |
|
138 #changePositionLeft |
|
139 'Move Towards Left' |
|
140 |
|
141 #changePositionRight |
|
142 'Move Towards Right' |
|
143 |
|
144 #changePositionUp |
|
145 'Move Towards Top' |
|
146 |
|
147 #editCopy |
|
148 'Copy Widget' |
|
149 |
|
150 #editCut |
|
151 'Cut Widget' |
|
152 |
|
153 #editPaste |
|
154 'Paste Widget' |
|
155 |
|
156 #editDelete |
|
157 'Delete Widget' |
|
158 |
|
159 |
|
160 #editDimensionCopyExtent |
|
161 'Copy Extent' |
|
162 |
|
163 #editDimensionCopyLayout |
|
164 'Copy Layout' |
|
165 |
|
166 #editDimensionPasteExtent |
|
167 'Paste Extent' |
|
168 |
|
169 #editDimensionPasteHeight |
|
170 'Paste Height' |
|
171 |
|
172 #editDimensionPasteLayout |
|
173 'Paste Layout' |
|
174 |
|
175 #editDimensionPasteWidth |
|
176 'Paste Width' |
|
177 |
|
178 #editInspectSpec |
|
179 'Inspect Spec' |
|
180 |
|
181 #editBrowseViewClass |
|
182 'Browse Widgets Class' |
|
183 |
|
184 #editInspectView |
|
185 'Inspect Widget' |
|
186 |
|
187 #editOpenSpecDocumentation |
|
188 'WidgetDocumentation' |
|
189 |
|
190 #fileBrowseClass |
|
191 'Browse Applications Class' |
|
192 |
|
193 #fileBrowseAspectMethods |
|
194 'Browse Applications Aspect Methods' |
|
195 |
|
196 #fileLoad |
|
197 'Load Spec from Method' |
|
198 |
|
199 #fileLoadSubspec |
|
200 'Load SubSpec' |
|
201 |
|
202 #fileNew |
|
203 'New Spec' |
|
204 |
|
205 #filePickAnInterface |
|
206 'Pick Spec' |
|
207 |
|
208 #fileSave |
105 #fileSave |
209 'Save Spec as Method' |
106 'Save Spec' |
210 |
107 |
211 #fileSaveAs |
|
212 'Save Spec as' |
|
213 |
|
214 #fileShowWindowSpec |
|
215 'View Spec' |
|
216 |
|
217 #generateAspectMethods |
|
218 'Generate Aspect Methods' |
|
219 |
|
220 #generateHookMethods |
|
221 'Generate Hook Methods' |
|
222 |
|
223 #moveWidgetDown |
|
224 'Move Down' |
|
225 |
|
226 #moveWidgetInto |
|
227 'Move Into' |
|
228 |
|
229 #moveWidgetOut |
|
230 'Move Out' |
|
231 |
|
232 #moveWidgetUp |
|
233 'Move Up' |
|
234 |
|
235 #pasteBuffer |
|
236 'Paste' |
|
237 |
|
238 #pasteWithLayout |
|
239 'Paste With Layout' |
|
240 |
|
241 #settingsCanvas |
|
242 'Toggle Canvas' |
|
243 |
|
244 #settingsGallery |
|
245 'Toggle Gallery' |
|
246 |
|
247 #spreadSelectionHor |
|
248 'Spread Horizontally' |
|
249 |
|
250 #spreadSelectionVer |
|
251 'Spread Vertically' |
|
252 |
|
253 #testGeometryTestMode |
|
254 'Toggle Test Mode' |
|
255 |
|
256 #testStartApplication |
|
257 'Start Application' |
|
258 |
108 |
259 ) |
109 ) |
260 ! |
110 ! |
261 |
111 |
262 helpSpec |
112 helpSpec |
1390 (MenuItem |
1241 (MenuItem |
1391 activeHelpKey: testStartApplication |
1242 activeHelpKey: testStartApplication |
1392 label: 'Start Application' |
1243 label: 'Start Application' |
1393 itemValue: doStartApplication |
1244 itemValue: doStartApplication |
1394 translateLabel: true |
1245 translateLabel: true |
|
1246 isVisible: isNotEditingSpecOnly |
1395 ) |
1247 ) |
1396 (MenuItem |
1248 (MenuItem |
1397 label: '-' |
1249 label: '-' |
|
1250 isVisible: isNotEditingSpecOnly |
1398 ) |
1251 ) |
1399 (MenuItem |
1252 (MenuItem |
1400 activeHelpKey: testGeometryTestMode |
1253 activeHelpKey: testGeometryTestMode |
1401 label: 'Geometry Test Mode' |
1254 label: 'Geometry Test Mode' |
1402 translateLabel: true |
1255 translateLabel: true |
1432 activeHelpKey: settingsRedefineAspectMethods |
1285 activeHelpKey: settingsRedefineAspectMethods |
1433 enabled: hasSpecClass |
1286 enabled: hasSpecClass |
1434 label: 'Redefine Aspect Methods' |
1287 label: 'Redefine Aspect Methods' |
1435 translateLabel: true |
1288 translateLabel: true |
1436 indication: redefineAspectMethods: |
1289 indication: redefineAspectMethods: |
|
1290 isVisible: isNotEditingSpecOnly |
1437 ) |
1291 ) |
1438 (MenuItem |
1292 (MenuItem |
1439 activeHelpKey: settingsAspectsAsInstances |
1293 activeHelpKey: settingsAspectsAsInstances |
1440 enabled: hasSpecClass |
1294 enabled: hasSpecClass |
1441 label: 'Aspects as InstanceVariables' |
1295 label: 'Aspects as InstanceVariables' |
1442 translateLabel: true |
1296 translateLabel: true |
1443 indication: generateAspectsAsInstanceVariables: |
1297 indication: generateAspectsAsInstanceVariables: |
|
1298 isVisible: isNotEditingSpecOnly |
1444 ) |
1299 ) |
1445 (MenuItem |
1300 (MenuItem |
1446 label: 'AutoAccept on Selection-Change ' |
1301 label: 'AutoAccept on Selection-Change ' |
1447 translateLabel: true |
1302 translateLabel: true |
1448 indication: autoAcceptOnSelectionChange |
1303 indication: autoAcceptOnSelectionChange |
2753 |window lbl| |
2606 |window lbl| |
2754 |
2607 |
2755 someObject == treeView model ifTrue:[ |
2608 someObject == treeView model ifTrue:[ |
2756 (something == #selection |
2609 (something == #selection |
2757 or:[something == #selectionIndex]) ifTrue:[self treeSelectionChanged]. |
2610 or:[something == #selectionIndex]) ifTrue:[self treeSelectionChanged]. |
2758 ^ self |
2611 ^ self |
2759 ]. |
2612 ]. |
2760 |
2613 |
2761 someObject == self galleryShown ifTrue:[ |
2614 someObject == self galleryShown ifTrue:[ |
2762 "/ galleryShown toggle changed |
2615 "/ galleryShown toggle changed |
2763 window := selectionPanel window. |
2616 window := selectionPanel window. |
2764 (someObject value) ifTrue:[ |
2617 (someObject value) ifTrue:[ |
2765 self raiseUIView:window |
2618 self raiseUIView:window |
2766 ] ifFalse:[ |
2619 ] ifFalse:[ |
2767 self hideUIView:window |
2620 self hideUIView:window |
2768 ]. |
2621 ]. |
2769 ^ self |
2622 ^ self |
2770 ]. |
2623 ]. |
2771 |
2624 |
2772 someObject == self painterShown ifTrue:[ |
2625 someObject == self painterShown ifTrue:[ |
2773 "/ canvasShown toggle changed |
2626 "/ canvasShown toggle changed |
2774 window := self painter topView. |
2627 window := self painter topView. |
2775 (someObject value) ifTrue:[ |
2628 (someObject value) ifTrue:[ |
2776 self raiseUIView:window |
2629 self raiseUIView:window |
2777 ] ifFalse:[ |
2630 ] ifFalse:[ |
2778 self hideUIView:window |
2631 self hideUIView:window |
2779 ]. |
2632 ]. |
2780 ^ self |
2633 ^ self |
2781 ]. |
2634 ]. |
2782 |
2635 |
2783 someObject == self autoAcceptOnSelectionChange ifTrue:[ |
2636 someObject == self autoAcceptOnSelectionChange ifTrue:[ |
2784 lbl := someObject value ifTrue:['Apply'] ifFalse:['OK']. |
2637 lbl := someObject value ifTrue:['Apply'] ifFalse:['OK']. |
2785 (builder componentAt:'acceptButton') label:(resources string:lbl). |
2638 (builder componentAt:'acceptButton') label:(resources string:lbl). |
2958 painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
2811 painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
2959 treeView := treeView canvas:painter specName:name. |
2812 treeView := treeView canvas:painter specName:name. |
2960 painter treeView:treeView. |
2813 painter treeView:treeView. |
2961 treeView model addDependent:self. |
2814 treeView model addDependent:self. |
2962 painter enableChannel:(self enableChannel). |
2815 painter enableChannel:(self enableChannel). |
|
2816 |
|
2817 selectionPanel := self selectionPanelClass new. |
|
2818 selectionPanel allButOpenInterface:#windowSpec. |
2963 ! ! |
2819 ! ! |
2964 |
2820 |
2965 !UIPainter methodsFor:'menus-dynamic'! |
2821 !UIPainter methodsFor:'menus-dynamic'! |
2966 |
2822 |
2967 menuEdit |
2823 menuEdit |
3605 self askForModification ifFalse:[^ self]. |
3465 self askForModification ifFalse:[^ self]. |
3606 |
3466 |
3607 self setClass:aClass selector:selector. |
3467 self setClass:aClass selector:selector. |
3608 |
3468 |
3609 (aClass respondsTo:selector) ifTrue:[ |
3469 (aClass respondsTo:selector) ifTrue:[ |
3610 self painter setupFromSpec:(aClass perform:selector). |
3470 self loadFromSpec:(aClass perform:selector). |
3611 ] |
3471 ] |
3612 ! |
3472 ! |
3613 |
3473 |
3614 loadFromMessage:classAndSelector |
3474 loadFromMessage:classAndSelector |
3615 "loads a window spec by evaluating aMessageString |
3475 "loads a window spec by evaluating aMessageString |
3616 (which is something like 'fooClass windowSpec')" |
3476 (which is something like 'fooClass windowSpec')" |
3617 |
3477 |
3618 self askForModification ifFalse:[^ self]. |
3478 self askForModification ifFalse:[^ self]. |
3619 |
3479 |
3620 classAndSelector notNil ifTrue:[ |
3480 classAndSelector notNil ifTrue:[ |
3621 self loadFromClass:classAndSelector methodClass andSelector:classAndSelector methodSelector |
3481 self |
|
3482 loadFromClass:classAndSelector methodClass |
|
3483 andSelector:classAndSelector methodSelector |
3622 ] |
3484 ] |
|
3485 ! |
|
3486 |
|
3487 loadFromSpec:aSpec |
|
3488 "loads a window spec proper" |
|
3489 |
|
3490 self askForModification ifFalse:[^ self]. |
|
3491 |
|
3492 self painter setupFromSpec:aSpec. |
3623 ! |
3493 ! |
3624 |
3494 |
3625 openInterface:aSymbol |
3495 openInterface:aSymbol |
3626 "in addition to opening my interface, also open up a gallery and a painter" |
3496 "in addition to opening my interface, also open up a gallery and a painter" |
3627 |
3497 |
3628 |cls topView galleryWindow icon name| |
3498 |topView| |
3629 |
3499 |
3630 self specClass notNil ifTrue:[ |
3500 self setupSpecClassAndSelector. |
3631 specClassName isBehavior ifTrue:[ |
|
3632 name := specClassName nameWithoutPrefix. |
|
3633 ] ifFalse:[ |
|
3634 name := specClassName printString string |
|
3635 ] |
|
3636 ]. |
|
3637 (aspects at:#classNameChannel) value:(specClassName ? 'NewApplication'). |
|
3638 |
|
3639 specSuperclassName isNil ifTrue:[ |
|
3640 specClassName notNil ifTrue:[ |
|
3641 (cls := self resolveName:specClassName) notNil ifTrue:[ |
|
3642 specSuperclassName := cls superclass name. |
|
3643 ] |
|
3644 ] |
|
3645 ]. |
|
3646 aspects at:#superclassNameChannel |
|
3647 put:((specSuperclassName notNil |
|
3648 ifTrue:[ specSuperclassName ] |
|
3649 ifFalse:[ 'ApplicationModel' ]) asValue). |
|
3650 aspects at:#superclassNameDefaults |
|
3651 put:#( 'ApplicationModel' 'SimpleDialog' ) asValue. |
|
3652 aspects at:#methodNameChannel |
|
3653 put:((specSelector notNil |
|
3654 ifTrue:[ specSelector asValue ] |
|
3655 ifFalse:[ #windowSpec ]) asValue). |
|
3656 |
3501 |
3657 "/ treeView := TreeView new. |
3502 "/ treeView := TreeView new. |
3658 "/ treeView windowSpecClass:(self defaultWindowSpecClass). |
3503 "/ treeView windowSpecClass:(self defaultWindowSpecClass). |
3659 "/ treeView |
3504 "/ treeView |
3660 "/ selectConditionBlock:[:newSelection | self selectionChangeAllowed:newSelection ]. |
3505 "/ selectConditionBlock:[:newSelection | self selectionChangeAllowed:newSelection ]. |
3674 |
3519 |
3675 super openInterface:aSymbol. |
3520 super openInterface:aSymbol. |
3676 |
3521 |
3677 topView := self window. |
3522 topView := self window. |
3678 topView label:'GUI Painter'. |
3523 topView label:'GUI Painter'. |
3679 painterView openInGroup:(topView windowGroup). |
3524 |
3680 painterView application:self. |
3525 "/ self setupCanvasAndSelectionPanel. |
3681 |
3526 "/ |
3682 selectionPanel := self selectionPanelClass new. |
3527 "/ selectionPanel window waitUntilVisible. |
3683 selectionPanel allButOpenInterface:#windowSpec. |
3528 "/ painterView window waitUntilVisible. |
3684 galleryWindow := selectionPanel window. |
3529 "/ self window waitUntilVisible. |
3685 galleryWindow beToolWindow. |
3530 "/ [ Delay waitForSeconds:0.5. self window topView raise ] fork. |
3686 galleryWindow openInGroup:(topView windowGroup). |
|
3687 |
|
3688 selectionPanel masterApplication:self. |
|
3689 icon := Smalltalk imageFromFileNamed:'UIPainter.xbm' forClass:self class. |
|
3690 topView iconLabel:'GUI Painter'. |
|
3691 topView icon:icon. |
|
3692 painterView iconLabel:'GUI Canvas'. |
|
3693 painterView icon:icon. |
|
3694 |
|
3695 "/ painterView topView raise. |
|
3696 topView bePartner. |
|
3697 painterView bePartner. |
|
3698 galleryWindow bePartner. |
|
3699 galleryWindow iconLabel:'GUI Gallery'. |
|
3700 galleryWindow icon:icon. |
|
3701 |
|
3702 selectionPanel window waitUntilVisible. |
|
3703 painterView window waitUntilVisible. |
|
3704 self window waitUntilVisible. |
|
3705 [ Delay waitForSeconds:0.5. self window topView raise ] fork. |
|
3706 |
3531 |
3707 "Modified: / 31-08-2006 / 10:13:16 / cg" |
3532 "Modified: / 31-08-2006 / 10:13:16 / cg" |
3708 ! |
3533 ! |
3709 |
3534 |
3710 openOnClass:aClass |
3535 openOnClass:aClass |
3787 |
3612 |
3788 galleryWindow raise. |
3613 galleryWindow raise. |
3789 canvasWindow raise. |
3614 canvasWindow raise. |
3790 ]. |
3615 ]. |
3791 |
3616 |
|
3617 self setupCanvasAndSelectionPanel. |
|
3618 |
|
3619 "/ selectionPanel window waitUntilVisible. |
|
3620 "/ painterView window waitUntilVisible. |
|
3621 "/ self window waitUntilVisible. |
|
3622 [ Delay waitForSeconds:0.1. |
|
3623 self window topView raise. |
|
3624 Delay waitForSeconds:0.25. |
|
3625 self window topView raise |
|
3626 ] fork. |
3792 "Modified: / 13.7.1999 / 21:26:52 / cg" |
3627 "Modified: / 13.7.1999 / 21:26:52 / cg" |
3793 ! |
3628 ! |
3794 |
3629 |
3795 selectionPanelClass |
3630 selectionPanelClass |
3796 ^ UISelectionPanel |
3631 ^ UISelectionPanel |
|
3632 ! |
|
3633 |
|
3634 setupCanvasAndSelectionPanel |
|
3635 |topView galleryWindow icon| |
|
3636 |
|
3637 icon := Smalltalk imageFromFileNamed:'UIPainter.xbm' forClass:self class. |
|
3638 |
|
3639 topView := self window. |
|
3640 |
|
3641 painterView openInGroup:(topView windowGroup). |
|
3642 painterView application:self. |
|
3643 |
|
3644 galleryWindow := selectionPanel window. |
|
3645 galleryWindow beToolWindow. |
|
3646 galleryWindow openInGroup:(topView windowGroup). |
|
3647 |
|
3648 selectionPanel masterApplication:self. |
|
3649 |
|
3650 topView iconLabel:'GUI Painter'. |
|
3651 topView icon:icon. |
|
3652 painterView iconLabel:'GUI Canvas'. |
|
3653 painterView icon:icon. |
|
3654 galleryWindow iconLabel:'GUI Gallery'. |
|
3655 galleryWindow icon:icon. |
|
3656 |
|
3657 topView bePartner. |
|
3658 painterView bePartner. |
|
3659 galleryWindow bePartner. |
3797 ! |
3660 ! |
3798 |
3661 |
3799 setupPainter |
3662 setupPainter |
3800 "sets the painter's grid parameters, if defined" |
3663 "sets the painter's grid parameters, if defined" |
3801 |
3664 |
3811 painter gridShown: (settings at: #GridShown ifAbsent:false). |
3674 painter gridShown: (settings at: #GridShown ifAbsent:false). |
3812 painter gridAlign: (settings at: #GridAlign ifAbsent:false). |
3675 painter gridAlign: (settings at: #GridAlign ifAbsent:false). |
3813 painter shown ifTrue:[painter clearView]. |
3676 painter shown ifTrue:[painter clearView]. |
3814 |
3677 |
3815 "Modified: / 22.8.1998 / 17:41:34 / cg" |
3678 "Modified: / 22.8.1998 / 17:41:34 / cg" |
|
3679 ! |
|
3680 |
|
3681 setupSpecClassAndSelector |
|
3682 |cls name| |
|
3683 |
|
3684 self specClass notNil ifTrue:[ |
|
3685 specClassName isBehavior ifTrue:[ |
|
3686 name := specClassName nameWithoutPrefix. |
|
3687 ] ifFalse:[ |
|
3688 name := specClassName printString string |
|
3689 ] |
|
3690 ]. |
|
3691 (aspects at:#classNameChannel) value:(specClassName ? 'NewApplication'). |
|
3692 |
|
3693 specSuperclassName isNil ifTrue:[ |
|
3694 specClassName notNil ifTrue:[ |
|
3695 (cls := self resolveName:specClassName) notNil ifTrue:[ |
|
3696 specSuperclassName := cls superclass name. |
|
3697 ] |
|
3698 ] |
|
3699 ]. |
|
3700 aspects at:#superclassNameChannel |
|
3701 put:((specSuperclassName notNil |
|
3702 ifTrue:[ specSuperclassName ] |
|
3703 ifFalse:[ 'ApplicationModel' ]) asValue). |
|
3704 aspects at:#superclassNameDefaults |
|
3705 put:#( 'ApplicationModel' 'SimpleDialog' ) asValue. |
|
3706 aspects at:#methodNameChannel |
|
3707 put:((specSelector notNil |
|
3708 ifTrue:[ specSelector asValue ] |
|
3709 ifFalse:[ #windowSpec ]) asValue). |
3816 ! ! |
3710 ! ! |
3817 |
3711 |
3818 !UIPainter methodsFor:'user actions'! |
3712 !UIPainter methodsFor:'user actions'! |
3819 |
3713 |
3820 accept |
3714 accept |