Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 31 lines (24 sloc) 1.15 kb
4c5e6d4 first commit
megaannum authored
1
2 " two editors in borders in fixed layout
3 function! forms#example#fixedlayout#Make()
4 let attrs = {'size': 15 , 'init_text': 'one'}
5 let txtEditor1 = forms#newFixedLengthField(attrs)
6 let b1 = forms#newBorder({ 'body': txtEditor1, 'char': '*' })
7
8
9 let attrs = {'size': 10 , 'init_text': 'two'}
10 let txtEditor2 = forms#newFixedLengthField(attrs)
11 let b2 = forms#newBorder({ 'body': txtEditor2, 'char': '+' })
12
13 let fixedlayout = forms#newFixedLayout({
14 \ 'width': 30,
15 \ 'height': 10,
16 \ 'children': [b1, b2],
17 \ 'x_positions': [2, 10],
18 \ 'y_positions': [2, 7]
19 \ })
20 let bg = forms#newBackground({ 'body': fixedlayout} )
21
22 let form = forms#newForm({'body': bg })
23 call form.run()
24 endfunction
25
ee21b40 Better support for both 'light' and 'dard' backgrounds.
megaannum authored
26 function! forms#example#fixedlayout#MakeTest()
27 call forms#AppendInput({'type': 'Sleep', 'time': 5})
28 call forms#AppendInput({'type': 'Exit'})
29 call forms#example#fixedlayout#Make()
30 endfunction
Something went wrong with that request. Please try again.