813 specChannel := specification asValue. |
813 specChannel := specification asValue. |
814 specification class addBindingsTo:aspects for:specification channel:specChannel. |
814 specification class addBindingsTo:aspects for:specification channel:specChannel. |
815 |
815 |
816 "/ arrange for being notified, if any aspect changes |
816 "/ arrange for being notified, if any aspect changes |
817 aspects do:[:el| el addDependent:self ]. |
817 aspects do:[:el| el addDependent:self ]. |
818 |
|
819 ! ! |
818 ! ! |
820 |
819 |
821 !UISpecificationTool methodsFor:'actions'! |
820 !UISpecificationTool methodsFor:'actions'! |
822 |
821 |
823 setMaxExtent |
822 setMaxExtent |
944 ]. |
944 ]. |
945 ! ! |
945 ! ! |
946 |
946 |
947 !UISpecificationTool::BuildInView methodsFor:'accessing'! |
947 !UISpecificationTool::BuildInView methodsFor:'accessing'! |
948 |
948 |
949 destroyAllSubSpecs |
|
950 "destroy all subViews which represents a specification |
|
951 " |
|
952 outerFrame destroySubViews. |
|
953 |
|
954 scrolledView notNil ifTrue:[ |
|
955 scrolledView := nil. |
|
956 self sizeChanged:nil. |
|
957 ] |
|
958 |
|
959 |
|
960 ! |
|
961 |
|
962 scrolledView:aView |
949 scrolledView:aView |
963 "set the view to be scrolled" |
950 "set the view to be scrolled" |
964 |scr theOneComponent y| |
951 |wrapper y| |
965 |
952 |
966 scrolledView == aView ifTrue:[^ self]. |
953 scrolledView == aView ifTrue:[^ self]. |
967 |
954 |
968 scrolledView notNil ifTrue:[scrolledView unmap]. |
955 scrolledView notNil ifTrue:[scrolledView beInvisible]. |
969 |
956 |
970 (scrolledView := aView) isNil ifTrue:[ |
957 scrolledView := aView. |
971 ^ self |
958 |
972 ]. |
959 (scrolledView notNil and:[scrolledView superView ~~ frame]) ifTrue:[ |
973 |
|
974 scrolledView superView == outerFrame ifFalse:[ |
|
975 scrolledView borderWidth:0; level:0. |
960 scrolledView borderWidth:0; level:0. |
976 |
961 |
977 outerFrame addSubView:scrolledView. |
962 frame addSubView:scrolledView. |
|
963 |
978 scrolledView subViews size == 1 ifTrue:[ |
964 scrolledView subViews size == 1 ifTrue:[ |
979 theOneComponent := scrolledView subViews first. |
965 wrapper := scrolledView subViews first. |
980 theOneComponent isScrollWrapper ifTrue:[ |
966 wrapper isScrollWrapper ifTrue:[ |
981 "/ give it a full-relative size, and let it do |
967 "/ give it a full-relative size, and let it do |
982 "/ the scrolling itself. |
968 "/ the scrolling itself. |
983 y := 1.0 |
969 y := 1.0 |
984 ] |
970 ] |
985 ]. |
971 ]. |
986 y isNil ifTrue:[ |
972 y isNil ifTrue:[ |
987 y := scrolledView preferredExtent y |
973 y := scrolledView preferredExtent y |
988 ]. |
974 ]. |
989 scrolledView origin:0@0 corner:1.0 @ y. |
975 scrolledView origin:0@0 corner:1.0 @ y. |
990 scrolledView := scrolledView. |
|
991 scrolledView allViewBackground:(self viewBackground). |
976 scrolledView allViewBackground:(self viewBackground). |
992 ]. |
977 ]. |
993 |
978 |
994 realized ifTrue:[ |
979 realized ifTrue:[ |
995 scrolledView realize. |
980 scrolledView ifNotNil:[scrolledView beVisible]. |
996 self sizeChanged:nil. |
981 self sizeChanged:nil. |
997 ]. |
982 ]. |
998 |
983 model value:scrolledView. |
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 ! ! |
984 ! ! |
1004 |
985 |
1005 !UISpecificationTool::BuildInView methodsFor:'initialization'! |
986 !UISpecificationTool::BuildInView methodsFor:'initialization'! |
1006 |
|
1007 initialize |
|
1008 super initialize. |
|
1009 outerFrame := SimpleView origin:0.0@0.0 corner:1.0@1.0 in:self. |
|
1010 outerFrame borderWidth:0; level:0. |
|
1011 |
|
1012 |
|
1013 ! |
|
1014 |
987 |
1015 level:aLevel |
988 level:aLevel |
1016 super level:0 |
989 super level:0 |
1017 ! |
990 ! |
1018 |
991 |