-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenusrc.zig
94 lines (70 loc) · 1.31 KB
/
menusrc.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//----------------------
//---date text----------
//----------------------
const std = @import("std");
// terminal Fonction
const term = @import("cursed");
// menu Fonction
const mnu = @import("menu").mnu;
const allocator = std.heap.page_allocator;
var NMENU = std.ArrayList(mnu.DEFMENU ).init(allocator);
//----------------------
// Define Global DSPF MENU
//----------------------
const xmnu01 = enum {
Repertoire,
Table,
Logique,
Join,
Exit,
};
const mnu01 = mnu.newMenu(
"mnu01",
12, 43,
mnu.CADRE.line1,
mnu.MNUVH.horizontal,
&.{
"Repertoire",
"Table",
"Logique",
"Join",
"Exit",
}
);
//----------------------
// Define Global DSPF MENU
//----------------------
const xmnurep = enum {
Work,
List,
Exit,
};
const mnurep = mnu.newMenu(
"mnurep",
14, 43,
mnu.CADRE.line1,
mnu.MNUVH.vertical,
&.{
"Work",
"List",
"Exit",
}
);
//----------------------------------
// squelette
//----------------------------------
pub fn main() !void {
// init terminal
term.enableRawMode();
defer term.disableRawMode() ;
// Initialisation
term.titleTerm("MY-TITLE");
term.resizeTerm(44,168);
term.cls();
var nopt : usize = 0;
while (true) {
nopt = mnu.ioMenu(mnu??,nopt);
if (nopt == @intFromEnum(xmnu??.Exit )) break;
//--- ---
}
}