Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 43 lines (35 sloc) 1.27 kB
4c5e6d4 first commit
megaannum authored
1
2 function! forms#example#deck2#Make()
3 let l1 = forms#newVLabel({'text': "label one"})
4 let bl1 = forms#newBorder({ 'body': l1 })
5 let l2 = forms#newVLabel({'text': "label two"})
6 let bl2 = forms#newBorder({ 'body': l2 })
7 let l3 = forms#newVLabel({'text': "label three"})
8 let bl3 = forms#newBorder({ 'body': l3 })
9
10 let deck = forms#newDeck({ 'children': [bl1, bl2, bl3] })
11
12 function! V5Action(...) dict
13 let pos = a:1
14 call self.deck.setCard(pos)
15 endfunction
16 let action = forms#newAction({ 'execute': function("V5Action")})
17 let action['deck'] = deck
18
19 let attrs = { 'mode': 'single',
20 \ 'pos': 0,
21 \ 'choices': [
22 \ ["one", 1],
ee21b40 Better support for both 'light' and 'dard' backgrounds.
megaannum authored
23 \ ["two", 2],
24 \ ["three", 3]
4c5e6d4 first commit
megaannum authored
25 \ ],
26 \ 'on_selection_action': action
27 \ }
28 let slist = forms#newSelectList(attrs)
29 let b = forms#newBorder({ 'body': slist })
30
31 let hpoly = forms#newHPoly({ 'children': [b, deck], 'alignment': 'T' })
32 let bg = forms#newBackground({ 'body': hpoly} )
33
34 let form = forms#newForm({'body': bg })
35 call form.run()
36 endfunction
37
ee21b40 Better support for both 'light' and 'dard' backgrounds.
megaannum authored
38 function! forms#example#deck2#MakeTest()
39 call forms#AppendInput({'type': 'Sleep', 'time': 5})
40 call forms#AppendInput({'type': 'Exit'})
41 call forms#example#deck2#Make()
42 endfunction
Something went wrong with that request. Please try again.