mirror of
https://github.com/lxsang/Diya-API.git
synced 2024-12-27 03:48:21 +01:00
Merge b8257f7011
This commit is contained in:
commit
6d7ab2dcd6
@ -45,7 +45,7 @@ Diya2DNode >> initialize [
|
|||||||
vbuffer := nil.
|
vbuffer := nil.
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'as yet unclassified' }
|
{ #category : #accessing }
|
||||||
Diya2DNode >> inner: aPoint [
|
Diya2DNode >> inner: aPoint [
|
||||||
^ self boundingBox containsPoint: (self local: aPoint)
|
^ self boundingBox containsPoint: (self local: aPoint)
|
||||||
]
|
]
|
||||||
@ -57,7 +57,7 @@ Diya2DNode >> local: aPoint [
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'as yet unclassified' }
|
{ #category : #accessing }
|
||||||
Diya2DNode >> recFromBuffer [
|
Diya2DNode >> recFromBuffer [
|
||||||
|maxX maxY minX minY x y|
|
|maxX maxY minX minY x y|
|
||||||
maxX := minX := vbuffer at: 1.
|
maxX := minX := vbuffer at: 1.
|
||||||
|
@ -14,9 +14,9 @@ DiyaButton class >> text: string [
|
|||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaButton >> icon: id [
|
DiyaButton >> icon: ico [
|
||||||
label icon: id.
|
label icon: ico.
|
||||||
label updateLayout.
|
label setDirty.
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
@ -48,8 +48,9 @@ DiyaButton >> text: string [
|
|||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaButton >> updateLayout [
|
DiyaButton >> update [
|
||||||
rec extent: self extent.
|
rec extent: self extent.
|
||||||
label position: 0@0.
|
label position: 0@0.
|
||||||
label extent: self extent.
|
label extent: self extent.
|
||||||
|
^true
|
||||||
]
|
]
|
||||||
|
@ -79,7 +79,7 @@ DiyaLabel >> txt: anObject [
|
|||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaLabel >> updateLayout [
|
DiyaLabel >> update [
|
||||||
|offset isize align|
|
|offset isize align|
|
||||||
offset := 0.
|
offset := 0.
|
||||||
icon ifNotNil: [
|
icon ifNotNil: [
|
||||||
@ -96,5 +96,6 @@ DiyaLabel >> updateLayout [
|
|||||||
icon ifNil: [ ^self ].
|
icon ifNil: [ ^self ].
|
||||||
"{ offset. txt extent. txt maxLineWidth. align } inspect."
|
"{ offset. txt extent. txt maxLineWidth. align } inspect."
|
||||||
icon position: (align @( (self extent y - self iconSize ) >> 1)).
|
icon position: (align @( (self extent y - self iconSize ) >> 1)).
|
||||||
|
^ true
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -89,7 +89,7 @@ DiyaNode >> initialize [
|
|||||||
id := Random new nextInt: 1e6
|
id := Random new nextInt: 1e6
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'as yet unclassified' }
|
{ #category : #accessing }
|
||||||
DiyaNode >> inner: aPoint [
|
DiyaNode >> inner: aPoint [
|
||||||
^ self subclassResponsibility
|
^ self subclassResponsibility
|
||||||
]
|
]
|
||||||
@ -140,7 +140,7 @@ DiyaNode >> register: aBlock to: eventName [
|
|||||||
DiyaNode >> render [
|
DiyaNode >> render [
|
||||||
dirty ifTrue:[
|
dirty ifTrue:[
|
||||||
dirty := self update not].
|
dirty := self update not].
|
||||||
shader ifNotNil: [ self setUpShader ].
|
shader ifNotNil: [self setUpShader].
|
||||||
self draw.
|
self draw.
|
||||||
children ifNil: [ ^self ].
|
children ifNil: [ ^self ].
|
||||||
children do: [:c | c render ].
|
children do: [:c | c render ].
|
||||||
@ -178,6 +178,16 @@ DiyaNode >> scale: anObject [
|
|||||||
self updateTF.
|
self updateTF.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaNode >> setClean [
|
||||||
|
dirty := false
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #initialization }
|
||||||
|
DiyaNode >> setDirty [
|
||||||
|
dirty := true
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
{ #category : #accessing }
|
||||||
DiyaNode >> setUpShader [
|
DiyaNode >> setUpShader [
|
||||||
|mem|
|
|mem|
|
||||||
@ -227,7 +237,7 @@ DiyaNode >> tf [
|
|||||||
^ tf
|
^ tf
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #'as yet unclassified' }
|
{ #category : #'event handling' }
|
||||||
DiyaNode >> trigger: evt [
|
DiyaNode >> trigger: evt [
|
||||||
evt enable ifFalse:[^self].
|
evt enable ifFalse:[^self].
|
||||||
ehandlers at: evt mapped type ifPresent:[:handler| handler value: evt].
|
ehandlers at: evt mapped type ifPresent:[:handler| handler value: evt].
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Class {
|
Class {
|
||||||
#name : #DiyaTableLayout,
|
#name : #DiyaTableLayout,
|
||||||
#superclass : #DiyaWidget,
|
#superclass : #DiyaLayout,
|
||||||
#category : #'Diya-Widgets'
|
#category : #'Diya-Widgets'
|
||||||
}
|
}
|
||||||
|
@ -43,14 +43,3 @@ DiyaWidget >> extent: size [
|
|||||||
DiyaWidget >> initialize [
|
DiyaWidget >> initialize [
|
||||||
super initialize.
|
super initialize.
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : #accessing }
|
|
||||||
DiyaWidget >> update [
|
|
||||||
self updateLayout.
|
|
||||||
^ true
|
|
||||||
]
|
|
||||||
|
|
||||||
{ #category : #accessing }
|
|
||||||
DiyaWidget >> updateLayout [
|
|
||||||
self subclassResponsibility
|
|
||||||
]
|
|
||||||
|
Loading…
Reference in New Issue
Block a user