Skip to content

Commit c784bc3

Browse files
committed
Set wait cursor on DB Connect (Issue #4)
1 parent c6ced6d commit c784bc3

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

APLSource/GUI/ExpandDatabase.aplf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
t c←⍵
66
s←c t ##.DB.Connect ⍺
77
s≡¯1:''
8+
oldCursor←t SetCursor'Wait'
89
schemas tables←↓⍉##.DB.GetTables ⍺
910
dMat←schemas{(1 2⍴⍺,1)(⍵,(⍤¯1)2)}⌸tables
1011
items←t.Items
@@ -13,4 +14,5 @@
1314
cItems←⊃,/{⍵[;1]}¨,dMat
1415
cDepths←∊{⍵[;2]}¨,dMat
1516
t.(Items Depth)←cItems cDepths{(start↑⍵),⍺,(start↓⍵)}¨items depths
17+
t SetCursor oldCursor
1618
}

APLSource/GUI/MakeTreeView.aplf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
⍝ ⍺ ←→ config settings
44
f←⍵.##
55
connections←f ListDatabases ⍺
6-
tree←⍎'tree'⍵.⎕WC'TreeView'('Size' 100 100)('Posn' 0 0)('Attach' 'Top' 'Left' 'Bottom' 'Right')
6+
tree←⍎'tree'⍵.⎕WC'TreeView'('Attach' 'Top' 'Left' 'Bottom' 'Right')
7+
_←Fullsize tree
78
depths←(≢connections)⍴0
89
tree.Items←connections
910
tree.Depth←depths

APLSource/GUI/SetCursor.aplf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SetCursor←{
2+
⍝ ⍺ ←→ GUI object
3+
⍝ ⍵ ←→ new State number, or 'Wait'
4+
⍝ ← ←→ old cursor
5+
⎕IO←0
6+
b←'wait'≡##.Utils.Lowercase ⍵
7+
w←1 ⍝ Defined in GUI docs
8+
s←b⊃⍵ w
9+
⍺.⎕WS'CursorObj's
10+
}

APLSource/Utils/Lowercase.aplf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Lowercase←{
2+
(819⌶)⍵
3+
}

0 commit comments

Comments
 (0)