Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 67 lines (54 sloc) 2.253 kB
4c5e6d4 first commit
megaannum authored
1
2 function! forms#example#labelsingrid#Make()
3 let l11 = forms#newLabel({ 'text': '11'})
4
5 let l12 = forms#newLabel({ 'text': 'onetwo'})
6
7 let l1 = forms#newLabel({ 'text': 'one'})
8 let l2 = forms#newLabel({ 'text': 'two'})
9 let l3 = forms#newLabel({ 'text': 'three'})
10
11 let vpoly13 = forms#newVPoly({ 'children': [l1, l2, l3] })
12
13
14 let l21 = forms#newVLabel({ 'text': 'twoone'})
15 let l22 = forms#newLabel({ 'text': '22'})
16 let l23 = forms#newLabel({ 'text': 'twothree'})
17
18 let vpoly31 = forms#newVPoly({ 'children': [l1, l2, l3] })
19 let l32 = forms#newLabel({ 'text': 'threetwo'})
20 let l33 = forms#newLabel({ 'text': '33'})
21
22
23 " nos_rows: (> 0)
24 " nos_columns: (> 0)
25 " char
26 " cell_height
27 " cell_width
28 " major_axis: (row) row or column
29 " halignment: (L) float align 0-1 or L C R
30 " valignment: (T) float align 0-1 or T C B
31 " halignments: [row, (L) float align 0-1 or L C R]
32 " valignments: [column, (T) float align 0-1 or T C B]
33 " data[[row, column, glyph]]
34
35 let grid = forms#newGrid({
36 \ 'nos_rows': 3,
37 \ 'nos_columns': 3,
38 \ 'mode': 'light',
39 \ 'halignment': 'L',
40 \ 'valignment': 'T',
41 \ 'halignments': [[1,'C'],[2,'R']],
42 \ 'valignments': [[1,'C'],[2,'B']],
43 \ 'data': [
44 \ [0, 0, l11],
45 \ [0, 1, l12],
46 \ [0, 2, vpoly13],
47 \ [1, 0, l21],
48 \ [1, 1, l22],
49 \ [1, 2, l23],
50 \ [2, 0, vpoly31],
51 \ [2, 1, l32],
52 \ [2, 2, l33]
53 \ ]
54 \ })
55 " let b = forms#newBorder({ 'body': grid })
56 let bg = forms#newBackground({ 'body': grid} )
57
58 let form = forms#newForm({'body': bg })
59 call form.run()
60 endfunction
61
ee21b40 Better support for both 'light' and 'dard' backgrounds.
megaannum authored
62 function! forms#example#labelsingrid#MakeTest()
63 call forms#AppendInput({'type': 'Sleep', 'time': 5})
64 call forms#AppendInput({'type': 'Exit'})
65 call forms#example#labelsingrid#Make()
66 endfunction
Something went wrong with that request. Please try again.