Grafoscopio/src/Grafoscopio/GrafoscopioEditingArea.clas...

44 lines
1.3 KiB
Smalltalk
Raw Normal View History

2020-03-30 17:02:46 +00:00
Class {
#name : #GrafoscopioEditingArea,
#superclass : #RubEditingArea,
#category : #'Grafoscopio-Rub'
}
2020-04-03 11:08:47 +00:00
{ #category : #private }
GrafoscopioEditingArea >> drawSubmorphsOn: aCanvas [
"Display submorphs back to front"
| drawBlock |
submorphs isEmpty ifTrue: [^self].
drawBlock := [:canvas | submorphs reverseDo: [:m | canvas fullDrawMorph: m]].
self clipSubmorphs
ifTrue: [aCanvas clipBy: (aCanvas clipRect intersect: self clippingBounds ifNone: [ ^ self ]) during: drawBlock]
2020-04-03 11:08:47 +00:00
ifFalse: [drawBlock value: aCanvas].
"Draw the focus here since we are using inset bounds
for the focus rectangle."
aCanvas gfcParagraph: self paragraph bounds: self drawingBounds color: self textColor.
(scrollPane isNil and: [ self readOnly not and: [ self hasKeyboardFocus or: [ self hasFindReplaceFocus ] ] ])
ifTrue: [self drawKeyboardFocusOn: aCanvas ]
]
2020-03-30 17:02:46 +00:00
{ #category : #private }
GrafoscopioEditingArea >> newParagraph [
| newParagraph |
newParagraph := self privateInstantiateParagraphObject.
newParagraph textArea: self.
newParagraph container: self compositionRectangle.
^ newParagraph
]
{ #category : #private }
GrafoscopioEditingArea >> privateInstantiateParagraphObject [
^ RubOpeningClosingDelimiterDecorator next: GrafoscopioParagraph new.
]
{ #category : #private }
GrafoscopioEditingArea >> wrapped [
^ true.
]