Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mkromberg/jswc
Browse files Browse the repository at this point in the history
  • Loading branch information
mkromberg committed Oct 6, 2024
2 parents 825ec01 + b4dc6e1 commit 41d5094
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 0 deletions.
4 changes: 4 additions & 0 deletions EWC/supportedMethods.apla
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
(
'GetTextSize'
'GetFocus'
'SetCookie'
'GetCookie'
'SetTitle'
'GetTitle'
)
11 changes: 11 additions & 0 deletions demo/CBClearCookie.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CBClearCookie args;e;cookietoset

Event⎕NS''
eEvent.Event⎕NS''
e.(ID EventName Info)(2args),2args

cookietoset'','F1.COOKIETOSET'eWG'Text'

Clearing is just setting with a time in the past
2 eNQ 'F1' 'SetCookie' ('democookie=;max-age=-1')
'F1.G.COOKIES'eWS'Text' ('Cookie: CLEARED')
11 changes: 11 additions & 0 deletions demo/CBRefreshCookie.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CBRefreshCookie args;e;cookie

Event⎕NS''
eEvent.Event⎕NS''
e.(ID EventName Info)(2args),2args

cookie2 eNQ 'F1' 'GetCookie' 'democookie'
:If 0cookie
cookie2⊃⊃cookie
:EndIf
'F1.G.COOKIES'eWS'Text' ('Cookie: ',cookie)
10 changes: 10 additions & 0 deletions demo/CBSetCookie.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CBSetCookie args;e;cookietoset

Event⎕NS''
eEvent.Event⎕NS''
e.(ID EventName Info)(2args),2args

cookietoset'','F1.COOKIETOSET'eWG'Text'

2 eNQ 'F1' 'SetCookie' ('democookie=',cookietoset)
'F1.G.COOKIES'eWS'Text' ('Cookie: ',cookietoset)
9 changes: 9 additions & 0 deletions demo/CBSetTitle.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CBSetTitle args;e;titletoset

Event⎕NS''
eEvent.Event⎕NS''
e.(ID EventName Info)(2args),2args

titletoset'','F1.TITLETOSET'eWG'Text'

2 eNQ 'F1' 'SetTitle' titletoset
18 changes: 18 additions & 0 deletions demo/DemoCookies.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
DemoCookies connected;cookie
EWC.CONNECTEDconnected
⎕PW1000

'F1'eWC'Form' 'Cookies'(50 50)(170 200)('Coord' 'Pixel')

'F1.COOKIETOSET'eWC'Edit'('Posn' 50 10)('Size'(20 150))
'F1.SETCOOKIE'eWC'Button' 'Set Cookie'('Posn' 75 10)('Size'(20 150))('Event' 'Select' 'CBSetCookie')
'F1.REFRESHCOOKIE'eWC'Button' 'Refresh Cookie'('Posn' 100 10)('Size'(20 150))('Event' 'Select' 'CBRefreshCookie')
'F1.CLEARCOOKIE'eWC'Button' 'Clear Cookie'('Posn' 125 10)('Size'(20 150))('Event' 'Select' 'CBClearCookie')

cookie2 eNQ 'F1' 'GetCookie' 'democookie'
:If 0cookie
cookie2⊃⊃cookie
:EndIf

'F1.G'eWC'Group'('Posn'(150 0))('Size'(20 200))
'F1.G.COOKIES'eWC'Text' ('Cookie: ',cookie)(0 10)(20 400)
12 changes: 12 additions & 0 deletions demo/DemoTitle.aplf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DemoTitle connected;title
EWC.CONNECTEDconnected
⎕PW1000

'F1'eWC'Form' 'Title'(50 50)(170 400)('Coord' 'Pixel')

'F1.TITLETOSET'eWC'Edit'('Posn' 50 10)('Size'(20 150))
'F1.SETTITLE'eWC'Button' 'Set Title'('Posn' 75 10)('Size'(20 150))('Event' 'Select' 'CBSetTitle')

title2 eNQ 'F1' 'GetTitle'
'F1.G'eWC'Group'('Posn'(100 0))('Size'(20 400))
'F1.G.COOKIES'eWC'Text' ('Original title on demo load: ',title)(0 10)(20 400)

0 comments on commit 41d5094

Please sign in to comment.