#FEATURE by exept
class: ElectronWorkstation
added: #jsonEncode:
comment/format in:
#destroyView:withId:
#mapWindow:
#unmapWindow:
changed: #createWindowFor:type:origin:extent:minExtent:maxExtent:borderWidth:subViewOf:style:inputOnly:label:owner:icon:iconMask:iconView:
--- a/ElectronWorkstation.st Sun Dec 15 03:49:58 2019 +0100
+++ b/ElectronWorkstation.st Sun Dec 15 03:50:11 2019 +0100
@@ -409,10 +409,19 @@
Logger info:'unimplemented: ungrabPointer'.
! !
+!ElectronWorkstation methodsFor:'private'!
+
+jsonEncode:aReferenceOrObject
+ aReferenceOrObject isBridgeProxy ifFalse:[^ aReferenceOrObject].
+ ^ Dictionary new
+ at:'__ref__' put:aReferenceOrObject bridgeRefId;
+ yourself.
+! !
+
!ElectronWorkstation methodsFor:'window stuff'!
createWindowFor:aView type:typeSymbol origin:org extent:ext
- minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:sv
+ minExtent:minE maxExtent:maxE borderWidth:bw subViewOf:superViewOrNil
style:styleSymbol inputOnly:inp
label:label owner:owner
icon:icn iconMask:icnM iconView:icnV
@@ -432,11 +441,13 @@
"/ withArguments:{ ext x . ext y }.
arg := OrderedDictionary new
at:'width' put:ext x;
- at:'heigth' put:ext y;
+ at:'height' put:ext y;
at:'x' put:org x;
at:'y' put:org y;
yourself.
-
+ superViewOrNil notNil ifTrue:[
+ arg at:'parent' put:(self jsonEncode:superViewOrNil id)
+ ].
result := bridge
callFunction:'createWindow'
withArguments:{ arg "ext x . ext y" }.
@@ -444,6 +455,7 @@
!
destroyView:aView withId:aWindowHandle
+ "/ close is sent to the bridgeObject
aWindowHandle close.
"/ bridge
"/ invokeMethod:'close'
@@ -454,8 +466,8 @@
mapWindow:aWindowId
"map a window"
+ "/ show is sent to the bridgeObject
aWindowId show.
-
!
moveWindow:aWindowHandle x:x y:y
@@ -506,8 +518,8 @@
unmapWindow:aWindowId
"unmap a window"
+ "/ hide is sent to the bridgeObject
aWindowId hide.
-
! !
!ElectronWorkstation::ElectronGraphicsContext class methodsFor:'documentation'!