UIPainter.st
changeset 778 a4b931b2aff6
parent 774 5ca0853de0bc
child 785 35ad7901368c
equal deleted inserted replaced
777:ce2a772e73fa 778:a4b931b2aff6
   350 
   350 
   351 iconAlignB
   351 iconAlignB
   352     "This resource specification was automatically generated
   352     "This resource specification was automatically generated
   353      by the ImageEditor of ST/X."
   353      by the ImageEditor of ST/X."
   354 
   354 
   355     "Do not manually edit this!!!! If it is corrupted,
   355     "Do not manually edit this!! If it is corrupted,
   356      the ImageEditor may not be able to read the specification."
   356      the ImageEditor may not be able to read the specification."
   357 
   357 
   358     "
   358     "
   359      ImageEditor openOnClass:self andSelector:#iconAlignB
   359      ImageEditor openOnClass:self andSelector:#iconAlignB
   360     "
   360     "
   361 
   361 
   362     <resource: #image>
   362     <resource: #image>
   363 
   363 
   364     ^Icon
   364     ^Icon
   365         constantNamed:#'UIPainter iconAlignB'
   365         constantNamed:#'UIPainter iconAlignB'
   366         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@@@@G@@@@@@@G@E@@@@@G@G@@@@@G@G@@@@@G@G@@@E@G@G@@@G@G@G@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@G C@G @@G'' @G'' @G'' @G'' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' G'''' O??0O??0@@@@@@@C@@@@') ; yourself); yourself]!
   366         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@E@@@@@@@G@@@@@@@G@E@@@@@G@G@@@@@G@G@@@@@G@G@@@E@G@G@@@G@G@G@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@G C@G @@G'' @G'' @G'' @G'' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' G'''' O??0O??0@@@@@@@C@@@@') ; yourself); yourself]
       
   367 !
   367 
   368 
   368 iconAlignL
   369 iconAlignL
   369     "This resource specification was automatically generated
   370     "This resource specification was automatically generated
   370      by the ImageEditor of ST/X."
   371      by the ImageEditor of ST/X."
   371 
   372 
   372     "Do not manually edit this!!!! If it is corrupted,
   373     "Do not manually edit this!! If it is corrupted,
   373      the ImageEditor may not be able to read the specification."
   374      the ImageEditor may not be able to read the specification."
   374 
   375 
   375     "
   376     "
   376      ImageEditor openOnClass:self andSelector:#iconAlignL
   377      ImageEditor openOnClass:self andSelector:#iconAlignL
   377     "
   378     "
   378 
   379 
   379     <resource: #image>
   380     <resource: #image>
   380 
   381 
   381     ^Icon
   382     ^Icon
   382         constantNamed:#'UIPainter iconAlignL'
   383         constantNamed:#'UIPainter iconAlignL'
   383         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(UUUU@@@(_???@@@(@@@@@E@(@@@@@@@(@@@@@@@(@@@@@@@(UU@@@@@(_?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@F@@@G?? G?? G?? G?? F@@@F@@@G? @G? @G? @G? @F@@@@@@@@@@@') ; yourself); yourself]!
   384         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@(@@@@@@@(@@@@@@@(UUUP@I@(_??0@@@(@@@@@@@(@@@@@@@(@@@@@@@(@@@@@@@(UUUU@@@(_???@@@(@@@@@E@(@@@@@@@(@@@@@@@(@@@@@@@(UU@@@@@(_?@@@@@(@@@@@@@(@@@@@@@@@@@@@E@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@F@@@G?>@G?>@G?>@G?>@F@@@F@@@G?? G?? G?? G?? F@@@F@@@G? @G? @G? @G? @F@@@@@@@@@@@') ; yourself); yourself]
       
   385 !
   384 
   386 
   385 iconAlignLR
   387 iconAlignLR
   386     "This resource specification was automatically generated
   388     "This resource specification was automatically generated
   387      by the ImageEditor of ST/X."
   389      by the ImageEditor of ST/X."
   388 
   390 
   401 
   403 
   402 iconAlignR
   404 iconAlignR
   403     "This resource specification was automatically generated
   405     "This resource specification was automatically generated
   404      by the ImageEditor of ST/X."
   406      by the ImageEditor of ST/X."
   405 
   407 
   406     "Do not manually edit this!!!! If it is corrupted,
   408     "Do not manually edit this!! If it is corrupted,
   407      the ImageEditor may not be able to read the specification."
   409      the ImageEditor may not be able to read the specification."
   408 
   410 
   409     "
   411     "
   410      ImageEditor openOnClass:self andSelector:#iconAlignR
   412      ImageEditor openOnClass:self andSelector:#iconAlignR
   411     "
   413     "
   418 
   420 
   419 iconAlignT
   421 iconAlignT
   420     "This resource specification was automatically generated
   422     "This resource specification was automatically generated
   421      by the ImageEditor of ST/X."
   423      by the ImageEditor of ST/X."
   422 
   424 
   423     "Do not manually edit this!!!! If it is corrupted,
   425     "Do not manually edit this!! If it is corrupted,
   424      the ImageEditor may not be able to read the specification."
   426      the ImageEditor may not be able to read the specification."
   425 
   427 
   426     "
   428     "
   427      ImageEditor openOnClass:self andSelector:#iconAlignT
   429      ImageEditor openOnClass:self andSelector:#iconAlignT
   428     "
   430     "
   429 
   431 
   430     <resource: #image>
   432     <resource: #image>
   431 
   433 
   432     ^Icon
   434     ^Icon
   433         constantNamed:#'UIPainter iconAlignT'
   435         constantNamed:#'UIPainter iconAlignT'
   434         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@G@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@@@@@@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' @G'' @G'' @G'' @G'' @G @@G C@@@@@@@@@@@@') ; yourself); yourself]!
   436         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@K@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@K@G@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@G@@@@@G@@@@@@@G@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G'''' G'''' G'''' G''''!!G'''' G'''' G'''' @G'' @G'' @G'' @G'' @G @@G C@@@@@@@@@@@@') ; yourself); yourself]
       
   437 !
   435 
   438 
   436 iconAlignTB
   439 iconAlignTB
   437     "This resource specification was automatically generated
   440     "This resource specification was automatically generated
   438      by the ImageEditor of ST/X."
   441      by the ImageEditor of ST/X."
   439 
   442 
   440     "Do not manually edit this!!!! If it is corrupted,
   443     "Do not manually edit this!! If it is corrupted,
   441      the ImageEditor may not be able to read the specification."
   444      the ImageEditor may not be able to read the specification."
   442 
   445 
   443     "
   446     "
   444      ImageEditor openOnClass:self andSelector:#iconAlignTB
   447      ImageEditor openOnClass:self andSelector:#iconAlignTB
   445     "
   448     "
   446 
   449 
   447     <resource: #image>
   450     <resource: #image>
   448 
   451 
   449     ^Icon
   452     ^Icon
   450         constantNamed:#'UIPainter iconAlignTB'
   453         constantNamed:#'UIPainter iconAlignTB'
   451         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@G@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@H@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@@@G@G@D@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@H@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G''''!!G'''' G'''' G'''' G'''' G'''' G'''' G''''!!G''''!!G''& G'''' O??0O??2@@@@@@@@@@@@') ; yourself); yourself]! !
   454         ifAbsentPut:[(Depth2Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@A@@@@@@@@@@@@@@@@B*****(@B*****(@@@@@@@@@@E@E@E@G@G@G@G@@@G@G@G@@@G@G@G@@@G@G@G@H@G@G@G@@@G@G@G@A@G@G@G@@@G@G@G@@@G@G@D@@@@@@@@@@B*****(@B*****(@@@@@@@@@@@@@@@@H@@@@@@@@') ; colorMapFromArray:#[0 0 0 255 255 255 0 0 127 170 170 170]; mask:((Depth1Image new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@C@@@@O??0O??0G'''' G''''!!G'''' G'''' G'''' G'''' G'''' G'''' G''''!!G''''!!G''& G'''' O??0O??2@@@@@@@@@@@@') ; yourself); yourself]
       
   455 ! !
   452 
   456 
   453 !UIPainter class methodsFor:'interface specs'!
   457 !UIPainter class methodsFor:'interface specs'!
   454 
   458 
   455 dialogSpecForDefiningClassAndSelector
   459 dialogSpecForDefiningClassAndSelector
   456     "This resource specification was automatically generated
   460     "This resource specification was automatically generated
  1105 
  1109 
  1106 menuAlign
  1110 menuAlign
  1107     "This resource specification was automatically generated
  1111     "This resource specification was automatically generated
  1108      by the MenuEditor of ST/X."
  1112      by the MenuEditor of ST/X."
  1109 
  1113 
  1110     "Do not manually edit this. If it is corrupted,
  1114     "Do not manually edit this!! If it is corrupted,
  1111      the MenuEditor may not be able to read the specification."
  1115      the MenuEditor may not be able to read the specification."
  1112 
  1116 
  1113     "
  1117     "
  1114      MenuEditor new openOnClass:UIPainter andSelector:#menuAlign
  1118      MenuEditor new openOnClass:UIPainter andSelector:#menuAlign
  1115      (Menu new fromLiteralArrayEncoding:(UIPainter menuAlign)) startUp
  1119      (Menu new fromLiteralArrayEncoding:(UIPainter menuAlign)) startUp
  1441 
  1445 
  1442 menuToolbar
  1446 menuToolbar
  1443     "This resource specification was automatically generated
  1447     "This resource specification was automatically generated
  1444      by the MenuEditor of ST/X."
  1448      by the MenuEditor of ST/X."
  1445 
  1449 
  1446     "Do not manually edit this. If it is corrupted,
  1450     "Do not manually edit this!! If it is corrupted,
  1447      the MenuEditor may not be able to read the specification."
  1451      the MenuEditor may not be able to read the specification."
  1448 
  1452 
  1449     "
  1453     "
  1450      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar
  1454      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar
  1451      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar)) startUp
  1455      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar)) startUp
  1579 
  1583 
  1580 menuToolbar2
  1584 menuToolbar2
  1581     "This resource specification was automatically generated
  1585     "This resource specification was automatically generated
  1582      by the MenuEditor of ST/X."
  1586      by the MenuEditor of ST/X."
  1583 
  1587 
  1584     "Do not manually edit this. If it is corrupted,
  1588     "Do not manually edit this!! If it is corrupted,
  1585      the MenuEditor may not be able to read the specification."
  1589      the MenuEditor may not be able to read the specification."
  1586 
  1590 
  1587     "
  1591     "
  1588      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar2
  1592      MenuEditor new openOnClass:UIPainter andSelector:#menuToolbar2
  1589      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar2)) startUp
  1593      (Menu new fromLiteralArrayEncoding:(UIPainter menuToolbar2)) startUp
  1948 
  1952 
  1949     selector := self specTool specification listSelector.
  1953     selector := self specTool specification listSelector.
  1950 
  1954 
  1951     editor := TabListEditor new.
  1955     editor := TabListEditor new.
  1952     editor masterApplication:self.
  1956     editor masterApplication:self.
       
  1957     selector isArray ifTrue: [^self warn: 'Cannot open the Tab List Editor on an array!!!!'].
  1953     editor openModalOnClass:specClass andSelector:selector.
  1958     editor openModalOnClass:specClass andSelector:selector.
  1954 
  1959 
  1955     editor specSelector ~= selector ifTrue:[
  1960     editor specSelector ~= selector ifTrue:[
  1956         editor hasSaved ifTrue:[
  1961         editor hasSaved ifTrue:[
  1957             self specTool specification listSelector:editor specSelector.
  1962             self specTool specification listSelector:editor specSelector.
  3575 
  3580 
  3576     self model iconAction: 
  3581     self model iconAction: 
  3577     [:aNode|
  3582     [:aNode|
  3578         |specClass|       
  3583         |specClass|       
  3579         (specClass := aNode contents spec) isNil 
  3584         (specClass := aNode contents spec) isNil 
  3580         ifTrue:  
  3585             ifTrue: [WindowSpec icon]
  3581         [
  3586             ifFalse:[specClass class icon]
  3582             WindowSpec icon
       
  3583         ]
       
  3584         ifFalse:
       
  3585         [
       
  3586             ((selection size > 1) and: [(listOfNodes at:selection first) == aNode])
       
  3587             ifTrue: 
       
  3588             [
       
  3589                 specClass class icon copyWithColorMapProcessing:[:clr | clr blendWith:Color red]
       
  3590             ] 
       
  3591             ifFalse:
       
  3592             [
       
  3593                 specClass class icon
       
  3594             ]
       
  3595         ]. 
       
  3596     ].
  3587     ].
  3597 
  3588 
  3598     self model labelAction: 
  3589     self model labelAction: 
  3599     [:aNode|
  3590     [:aNode|
  3600         |spec|
  3591         |spec|
  3601         (spec := aNode contents spec) notNil
  3592         (spec := aNode contents spec) notNil
  3602             ifTrue:  [self nameForSpecInList:spec] 
  3593         ifTrue:  
  3603             ifFalse: [aNode name]
  3594         [   
       
  3595             ((selection size > 1) and: [(listOfNodes at:selection first) == aNode])
       
  3596                 ifTrue: [(Text string:'M' foregroundColor:Color black backgroundColor:Color red), ' ',(self nameForSpecInList:spec)] 
       
  3597                 ifFalse:[self nameForSpecInList:spec]
       
  3598         ] 
       
  3599         ifFalse: 
       
  3600         [
       
  3601             aNode name
       
  3602         ]
  3604     ]
  3603     ]
  3605 ! !
  3604 ! !
  3606 
  3605 
  3607 !UIPainter::TreeView methodsFor:'private'!
  3606 !UIPainter::TreeView methodsFor:'private'!
  3608 
  3607 
  3628             selection do:[:i|
  3627             selection do:[:i|
  3629                 i ~~ 1 ifTrue:[sel add:(listOfNodes at:i) contents view]
  3628                 i ~~ 1 ifTrue:[sel add:(listOfNodes at:i) contents view]
  3630             ]
  3629             ]
  3631         ].
  3630         ].
  3632         self canvas updateSelectionFromModel:sel
  3631         self canvas updateSelectionFromModel:sel
  3633     ].
  3632     ].             
  3634     size = 1 ifTrue:[
  3633     size = 1 ifTrue:[
  3635         oldSelection size = 2 ifTrue: [
  3634         oldSelection size > 1 ifTrue: [
  3636         self redrawLine: (lastDrawnMaster := selection first)]
  3635             (listOfNodes at:lastDrawnMaster) retrieveLabel.
       
  3636             self redrawLine: lastDrawnMaster. 
       
  3637             lastDrawnMaster := selection first
       
  3638         ]
  3637     ].
  3639     ].
  3638     size > 1 ifTrue:[
  3640     size > 1 ifTrue:[
  3639         selection first ~~ lastDrawnMaster ifTrue: [
  3641         selection first ~~ lastDrawnMaster ifTrue: [
  3640         self redrawLine: (lastDrawnMaster := selection first)]
  3642             (listOfNodes at:selection first) retrieveLabel.
       
  3643             lastDrawnMaster notNil ifTrue: [(listOfNodes at:lastDrawnMaster) retrieveLabel].
       
  3644             self redrawLine: lastDrawnMaster. 
       
  3645             self redrawLine: (lastDrawnMaster := selection first)
       
  3646         ]
  3641     ]
  3647     ]
  3642     ifFalse: [
  3648     ifFalse: [
  3643         lastDrawnMaster := nil
  3649         lastDrawnMaster := nil
  3644     ]
  3650     ]
  3645 ! !
  3651 ! !