942 !UIPainter methodsFor:'startup / release'! |
935 !UIPainter methodsFor:'startup / release'! |
943 |
936 |
944 closeRequest |
937 closeRequest |
945 "close all windows open by builder |
938 "close all windows open by builder |
946 " |
939 " |
|
940 |anyUnsavedChanges| |
|
941 |
|
942 objectList painter isModified ifTrue:[ |
|
943 (self confirm:'quit without saving ?') ifFalse:[ |
|
944 ^ self |
|
945 ] |
|
946 ]. |
|
947 |
947 objectList removeDependent:self. |
948 objectList removeDependent:self. |
948 objectList painter release. |
949 objectList painter release. |
949 objectList := nil. |
950 objectList := nil. |
950 |
951 |
951 selectionPanel notNil ifTrue:[ |
952 selectionPanel notNil ifTrue:[ |
963 topView := self window. |
964 topView := self window. |
964 |
965 |
965 topView == aTopView ifTrue:[ |
966 topView == aTopView ifTrue:[ |
966 super closeRequestFor:aTopView |
967 super closeRequestFor:aTopView |
967 ] ifFalse:[ |
968 ] ifFalse:[ |
968 (selectionPanel notNil and:[aTopView == selectionPanel window]) ifTrue:[ |
969 topView raise. |
969 aTopView application:nil. |
970 topView device beep |
970 aTopView terminate. |
|
971 selectionPanel := nil. |
|
972 ] ifFalse:[ |
|
973 topView raise. |
|
974 topView device beep |
|
975 ] |
|
976 ]. |
971 ]. |
977 ! |
972 ! |
978 |
973 |
979 openInterface |
974 openInterface |
980 "open interfaces |
975 "open interfaces |
981 " |
976 " |
982 |painterView painter cls topView| |
977 |cls painter| |
983 |
978 |
984 aspects := IdentityDictionary new. |
979 aspects := IdentityDictionary new. |
985 |
980 |
986 aspects at:#classNameChannel put:( |
981 aspects at:#classNameChannel put:( |
987 (specClass notNil ifTrue:[specClass] |
982 (specClass notNil ifTrue:[specClass] |
1000 ). |
995 ). |
1001 aspects at:#methodNameChannel put:( |
996 aspects at:#methodNameChannel put:( |
1002 (specSelector notNil ifTrue:[specSelector] |
997 (specSelector notNil ifTrue:[specSelector] |
1003 ifFalse:[#windowSpec]) asValue |
998 ifFalse:[#windowSpec]) asValue |
1004 ). |
999 ). |
1005 |
1000 painter := UIPainterView new. |
1006 painterView := StandardSystemView new. |
|
1007 painterView label:'unnamed canvas'. |
|
1008 painterView extent:300@300. |
|
1009 |
|
1010 painter := UIPainterView in:painterView. |
|
1011 painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
1001 painter layout:(0.0 @ 0.0 corner:1.0 @ 1.0) asLayout. |
1012 |
|
1013 objectList := painter listHolder. |
1002 objectList := painter listHolder. |
1014 objectList addDependent:self. |
1003 objectList addDependent:self. |
1015 |
|
1016 super openInterface. |
1004 super openInterface. |
1017 |
1005 |
1018 topView := self window. |
|
1019 topView label:'Interface Builder'. |
|
1020 topView icon:(Image fromFile:'bitmaps/Builder.xbm' resolution:100). |
|
1021 |
|
1022 painterView openInGroup:(topView windowGroup). |
|
1023 |
|
1024 topView beMaster. |
|
1025 painterView beSlave. |
|
1026 painterView application:self. |
|
1027 painterView open. |
|
1028 selectionPanel := UISelectionPanel open. |
|
1029 selectionPanel window beSlave. |
|
1030 selectionPanel window application:self. |
|
1031 ! |
1006 ! |
1032 |
1007 |
1033 openNewWindowCanvas |
1008 openNewWindowCanvas |
1034 "open new |
1009 "open new |
1035 " |
1010 " |
1059 |
1034 |
1060 painter className:aClass name. |
1035 painter className:aClass name. |
1061 painter methodName:aSelector. |
1036 painter methodName:aSelector. |
1062 painter setupFromSpec:(aClass perform:aSelector). |
1037 painter setupFromSpec:(aClass perform:aSelector). |
1063 |
1038 |
|
1039 ! |
|
1040 |
|
1041 postOpenWith:aBuilder |
|
1042 "open all subApplications |
|
1043 " |
|
1044 |pview window| |
|
1045 |
|
1046 window := self window. |
|
1047 window bePartner. |
|
1048 window label:'Interface Builder'. |
|
1049 window icon:(Image fromFile:'bitmaps/Builder.xbm' resolution:100). |
|
1050 |
|
1051 selectionPanel := UISelectionPanel newDefault. |
|
1052 selectionPanel allButOpenInterface:#windowSpec. |
|
1053 selectionPanel window openInGroup:(window windowGroup). |
|
1054 selectionPanel window bePartner. |
|
1055 selectionPanel openWindow. |
|
1056 selectionPanel window application:self. |
|
1057 |
|
1058 pview := StandardSystemView new. |
|
1059 pview label:'unnamed canvas'. |
|
1060 pview extent:300@300. |
|
1061 pview add:(self painter). |
|
1062 pview openInGroup:(window windowGroup). |
|
1063 pview bePartner. |
|
1064 pview open. |
|
1065 pview application:self. |
|
1066 |
1064 ! ! |
1067 ! ! |
1065 |
1068 |
1066 !UIPainter methodsFor:'user interaction - dialog'! |
1069 !UIPainter methodsFor:'user interaction - dialog'! |
|
1070 |
|
1071 browseAppClass |
|
1072 "open a browser on the class" |
|
1073 |
|
1074 |cls| |
|
1075 |
|
1076 specClass isNil ifTrue:[ |
|
1077 self information:'no class yet'. |
|
1078 ^ self |
|
1079 ]. |
|
1080 |
|
1081 specClass isBehavior ifFalse:[ |
|
1082 cls := Smalltalk at:specClass asSymbol |
|
1083 ] ifTrue:[ |
|
1084 cls := specClass |
|
1085 ]. |
|
1086 |
|
1087 cls isNil ifTrue:[ |
|
1088 self information:'no class yet'. |
|
1089 ^ self |
|
1090 ]. |
|
1091 |
|
1092 SystemBrowser openInClass:cls |
|
1093 |
|
1094 |
|
1095 ! |
1067 |
1096 |
1068 checkClassAndSelector |
1097 checkClassAndSelector |
1069 "check for class & superclass" |
1098 "check for class & superclass" |
1070 |
1099 |
1071 |superclass cls| |
1100 |superclass cls| |