-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvfumenu.cpp
46 lines (41 loc) · 1.36 KB
/
vfumenu.cpp
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
/****************************************************************************
#
# Copyright (c) 1996-2023 Vladi Belperchinov-Shabanski "Cade"
# https://cade.noxrun.com/ <[email protected]> <[email protected]>
# https://cade.noxrun.com/projects/vfu https://github.com/cade-vs/vfu
#
# SEE `README',`LICENSE' OR `COPYING' FILE FOR LICENSE AND OTHER DETAILS!
#
****************************************************************************/
#include <vslib.h>
#include "vfu.h"
#include "vfuopt.h"
#include "vfumenu.h"
#include "vfuview.h"
int vfu_toggle_box( int x, int y, const wchar_t *title, ToggleEntry* toggles )
{
menu_box_info.bo = opt.menu_borders;
menu_box_info.cn = cMENU_CN;
menu_box_info.ch = cMENU_CH;
menu_box_info.ti = cMENU_TI;
int z = con_toggle_box( x, y, title, toggles, &menu_box_info );
vfu_redraw();
return z;
}
int vfu_menu_box( int x, int y, const wchar_t *title, WArray *wa )
{
menu_box_info.bo = opt.menu_borders;
menu_box_info.cn = cMENU_CN;
menu_box_info.ch = cMENU_CH;
menu_box_info.ti = cMENU_TI;
int z = con_menu_box( x, y, title, wa, 0, &menu_box_info );
vfu_redraw();
return z;
}
int vfu_menu_box( const wchar_t* title, const wchar_t* menustr, int row )
{
WArray wmb = str_split( L",", menustr );
if ( row == -1 ) row = con_max_y() - 5 - wmb.count();
return vfu_menu_box( 50, row, title, &wmb );
}
// eof vfumenu.cpp