Update after changes in list/tree view.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Tue, 03 Feb 2015 05:38:59 +0000
changeset 384 8238ebef6929
parent 381 57ef482699a6
child 385 26d6f86c3744
child 386 21f377c318cd
Update after changes in list/tree view. Instead of #displayLabel:h:on:x:y:h: override #displayLabel:h:on:x:y:h:isHighlightedAsSelected:
SmallSense__PO.st
SmallSense__VariablePO.st
--- a/SmallSense__PO.st	Sat Jan 31 08:37:29 2015 +0000
+++ b/SmallSense__PO.st	Tue Feb 03 05:38:59 2015 +0000
@@ -120,6 +120,12 @@
     "Created: / 12-08-2014 / 10:40:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+forPackage:aSymbol
+    ^ PackagePO new initializeWithPackage: aSymbol
+
+    "Created: / 02-10-2014 / 00:01:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 subject: anObject
     <resource: #obsolete>
 
@@ -251,14 +257,6 @@
     "Modified: / 20-05-2014 / 11:32:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-subject
-    <resource: #obsolete>
-
-    self error: 'Should no longer be sent'.
-
-    "Modified: / 20-05-2014 / 10:16:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 subject:anObject
     <resource: #obsolete>
 
@@ -267,6 +265,19 @@
     "Modified: / 20-05-2014 / 10:16:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!PO methodsFor:'accessing-private'!
+
+subject
+    "Return the real object for which the receiver
+     is a presentor.
+
+     For internal usage only."
+
+    ^ self subclassResponsibility
+
+    "Modified: / 20-06-2014 / 11:09:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !PO methodsFor:'completion'!
 
 insert
@@ -303,20 +314,19 @@
 
 !PO methodsFor:'displaying'!
 
-displayLabel:lab h:labelH on:gc x:x0 y:y0 h:h
-    | cx cy icon hint hintW |
+displayLabel:lab h:lH on:gc x:x y:y0 h:h isHighlightedAsSelected: highlighted
+    | cx hint hintW cy |
 
-    cx := x0.
+    cx := x.
 
-    "/ Display icon...
-    icon := self icon.
-    icon notNil ifTrue:[
-        icon displayOn: gc x: cx y: y0 + (h // 2) - (icon height // 2).
-    ].
-    cx := cx + IconWidth.
+"/    iconOrNil := self icon.
+"/    iconOrNil notNil ifTrue:[
+"/        iconOrNil displayOn: aGC x: cx y: y + (h / 2) - (iconOrNil height / 2).
+"/    ].
+"/    cx := cx + IconWidth.
 
     "/ Display label
-    super displayLabel:lab h:labelH on:gc x:cx y:y0 h:h.
+    super displayLabel:lab h:lH on:gc x:cx y:y0 h:h isHighlightedAsSelected: highlighted.
 
     "/ Display hint
     hint := self hint.
@@ -344,13 +354,17 @@
         ].
 
         cx := gc width - hintW - 3"right padding".
-        cy := y0 - ((labelH + 1 - h) // 2).    
+        cy := y0 - ((lH + 1 - h) // 2).    
         (hint isString and:[hint isText not]) ifTrue:[ 
             | savPaint |
 
             cy := cy + (hint ascentOn:gc).   
             savPaint := gc paint.
-            gc paint: (Color gray: 40).
+            highlighted ifTrue:[
+                gc paint: (Color white).
+            ] ifFalse:[ 
+                gc paint: (Color gray: 40).
+            ].
             hint displayOn:gc x: cx y:cy.  
             gc paint: savPaint
         ] ifFalse:[ 
@@ -361,8 +375,25 @@
         ].
     ].
 
-    "Created: / 24-07-2013 / 00:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 20-05-2014 / 12:22:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 03-02-2015 / 05:34:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+displayOn:aGC x:x y:y h:h 
+    | cx iconOrNil |
+
+    cx := x.
+
+    parent isNil ifTrue:[
+        iconOrNil := self icon.
+        iconOrNil notNil ifTrue:[
+            iconOrNil displayOn: aGC x: cx y: y + (h / 2) - (iconOrNil height / 2).
+        ].
+        cx := cx + IconWidth.
+    ].
+
+    super displayOn:aGC x:cx y:y h:h
+
+    "Created: / 28-04-2014 / 00:16:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 displayString
@@ -414,6 +445,10 @@
     ^ false
 !
 
+isSmallSensePluggablePO
+    ^ false
+!
+
 isSmallSenseSnippetPO
     ^ false
 !
--- a/SmallSense__VariablePO.st	Sat Jan 31 08:37:29 2015 +0000
+++ b/SmallSense__VariablePO.st	Tue Feb 03 05:38:59 2015 +0000
@@ -127,10 +127,10 @@
 
 !VariablePO methodsFor:'displaying'!
 
-displayLabel:aLabel h:lH on:aGC x:x y:y h:h
+displayLabel:aLabel h:lH on:aGC x:x y:y h:h isHighlightedAsSelected: highlighted
     | lw cn cnw fg y0 |
 
-    super displayLabel:aLabel h:lH on:aGC x:x y:y h:h.
+    super displayLabel:aLabel h:lH on:aGC x:x y:y h:h isHighlightedAsSelected: highlighted.
 
     class isNil ifTrue:[ ^ self ]. "/ Could be pseudo-variable
 
@@ -147,7 +147,7 @@
         aGC paint: fg.
     ]
 
-    "Created: / 18-09-2013 / 00:19:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 03-02-2015 / 05:34:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 displayOn:aGC x:x y:y opaque:opaque