Hi Peter,
Can you get the last Roassal Version and try the next piece of code?
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
| v shape |
v := RTView new.
1 to: 20 do: [ :i |
shape := RTEditableLabel new.
shape text:
'Red
Yellow
Green'.
v add: shape element@RTDraggable.
].
RTGridLayout on: v elements.
v open
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
or simple line
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
| v shape |
v := RTView new.
1 to: 20 do: [ :i |
shape := RTEditableLabel new.
shape text: 'Hello World'.
v add: shape element@RTDraggable.
].
RTGridLayout on: v elements.
v open
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
Press double-click over one element to edit the text of that shape.
Please, tell me what do you think about this.
Cheers,
Milton
2015-02-02 14:19 GMT-03:00 Alexandre Bergel <alexandre.bergel(a)me.com>om>:
Hi Peter!
We will have a look at your code.
Cheers,
Alexandre
Le 1 févr. 2015 à 18:21, Peter Uhnák
<i.uhnak(a)gmail.com> a écrit :
Hi,
is it possible to embed (any) editable text field inside Roassal?
I managed to add the editor morph inside Trachel's athens canvas,
however
there is no way I can access it... my guess is that TRMorph takes
all the events, or drawing the morph on the canvas destroys something.
I tried it with PluggableTextFieldMorph (shows the border of the edit
field, but
no text), and TxTextEditorMorph (shows text).
Is there any way around this? Adding the morph inside AthensWrapMorph
works
correctly, so my guess is that TRMorph must be doing something...
perhaps I should also add it as a submorph of TRMorph somehow?
My testing code follows:
------------------------------------------------
"opening the canvas and adding custom shape"
trCanvas := TRCanvas new.
text := SBEditableTextShape new.
trCanvas addShape: text.
trCanvas open.
------------------------------------------------
------------------------------------------------
"content of SBEditableTextShape - same as the attachement"
'From Pharo4.0 of 18 March 2013 [Latest update: #40470] on 1 February
2015 at
10:13:04.069249 pm'!
TRShape subclass: #SBEditableTextShape
instanceVariableNames: 'txMorph txModel wrapMorph textMorph'
classVariableNames: ''
poolDictionaries: ''
category: '_Sandbox'!
!SBEditableTextShape methodsFor: 'drawing' stamp: 'PeterUhnak 2/1/2015
22:10'!
drawOn: aCanvas
" aCanvas fullDrawMorph: textMorph."
aCanvas fullDrawMorph: txMorph.! !
!SBEditableTextShape methodsFor: 'initialization' stamp: 'PeterUhnak
2/1/2015 22:07'!
initialize
| string |
super initialize.
string := 'quick brown fox jumps over the lazy dog'.
txModel := string asTxModel.
txMorph := TxTextEditorMorph text: txModel.
txMorph extent: 150 @ 50.
textMorph := PluggableTextFieldMorph new.
textMorph extent: 150 @ 50.
textMorph setText: string.
textMorph ghostText: 'ghost text'.! !
------------------------------------------------
Any help is appreciated,
Peter
<SBEditableTextShape.st>
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev