UIPainterView.st
changeset 1467 b46624bb6994
parent 1450 a113274a03bf
child 1474 d2ee565fa32a
equal deleted inserted replaced
1466:6fecdd5341dc 1467:b46624bb6994
    12 
    12 
    13 "{ Package: 'stx:libtool2' }"
    13 "{ Package: 'stx:libtool2' }"
    14 
    14 
    15 UIObjectView subclass:#UIPainterView
    15 UIObjectView subclass:#UIPainterView
    16 	instanceVariableNames:'treeView listHolder superclassName className methodName
    16 	instanceVariableNames:'treeView listHolder superclassName className methodName
    17 		categoryName handleColor handleMasterColor'
    17 		categoryName handleColorBlack handleColorWhite handleMasterColor'
    18 	classVariableNames:'HandCursor RedefineAspectMethods AspectsAsInstances'
    18 	classVariableNames:'HandCursor RedefineAspectMethods AspectsAsInstances'
    19 	poolDictionaries:''
    19 	poolDictionaries:''
    20 	category:'Interface-UIPainter'
    20 	category:'Interface-UIPainter'
    21 !
    21 !
    22 
    22 
  1415 create
  1415 create
  1416     "colors on device
  1416     "colors on device
  1417     "
  1417     "
  1418     super create.
  1418     super create.
  1419 
  1419 
  1420     handleColor       := handleColor onDevice:device.
  1420     handleColorBlack  := handleColorBlack onDevice:device.
       
  1421     handleColorWhite  := handleColorWhite onDevice:device.
  1421     handleMasterColor := handleMasterColor onDevice:device.
  1422     handleMasterColor := handleMasterColor onDevice:device.
  1422 !
  1423 !
  1423 
  1424 
  1424 initialize
  1425 initialize
  1425     "setup attributes
  1426     "setup attributes
  1428     superclassName    := 'ApplicationModel'.
  1429     superclassName    := 'ApplicationModel'.
  1429     className         := 'NewApplication'.
  1430     className         := 'NewApplication'.
  1430     methodName        := 'windowSpec'.
  1431     methodName        := 'windowSpec'.
  1431     categoryName      := 'Applications'.
  1432     categoryName      := 'Applications'.
  1432     HandCursor        := Cursor leftHand.
  1433     HandCursor        := Cursor leftHand.
  1433     handleColor       := Color black.
  1434     handleColorBlack  := Color black.
       
  1435     handleColorWhite  := Color white.
  1434     handleMasterColor := Color red.
  1436     handleMasterColor := Color red.
  1435 
  1437 
  1436     self backgroundColor: self class defaultViewBackgroundColor.
  1438     self backgroundColor: self class defaultViewBackgroundColor.
  1437 !
  1439 !
  1438 
  1440 
  1507 
  1509 
  1508     selectionHiddenLevel == 0 ifTrue:[
  1510     selectionHiddenLevel == 0 ifTrue:[
  1509         sel := treeView selection.
  1511         sel := treeView selection.
  1510         (sel size > 1 and: 
  1512         (sel size > 1 and: 
  1511         [(treeView model list at: sel first) contents view == aComponent])
  1513         [(treeView model list at: sel first) contents view == aComponent])
  1512             ifTrue: [hColor := handleMasterColor]
  1514         ifTrue: [
  1513             ifFalse:[hColor := handleColor].
  1515             hColor := handleMasterColor
       
  1516         ] ifFalse:[
       
  1517             aComponent viewBackground brightness < 0.5 ifTrue:[
       
  1518                 hColor := handleColorWhite
       
  1519             ] ifFalse:[
       
  1520                 hColor := handleColorBlack
       
  1521             ]
       
  1522         ].
  1514 
  1523 
  1515         self paint:hColor.
  1524         self paint:hColor.
  1516 
  1525 
  1517         (wasClipped := clipChildren) ifTrue:[
  1526         (wasClipped := clipChildren) ifTrue:[
  1518             self clippedByChildren:(clipChildren := false). 
  1527             self clippedByChildren:(clipChildren := false).