-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathui_msg_box.tbh
More file actions
73 lines (64 loc) · 3.32 KB
/
ui_msg_box.tbh
File metadata and controls
73 lines (64 loc) · 3.32 KB
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
'===========================================================================
' ui_msg_box library
'
' required device specific properties and methods:
' sub lcd_clear(x as word, y as word, width as word, height as word) 'clear lcd
' sub device_msg_box_pre(
' byref msg as string(MB_MSG_LEN), 'message to be displayed in the Message Box
' x as word, 'x coordination
' y as word, 'y coordination
' w as word, 'width of the msgbox
' h as word, 'height of the msgbox
' align as pl_lcd_text_alignment, 'alignment of the text in the msgbox
' byref keycode_str as string(20), 'this string contains the characters which ASCII is correspond to the keycode of keys on the keypad that msgbox responds to
' bolder as no_yes, 'if the msgbox is wrap with a visible bolder line
' timeout as byte 'if no respond from the keypad within the time defined by "timeout", exit the msgbox and return to the previous screen. If timeout = 0, no time out applies
' ) 'prepare the message box, print buttons etc.
' sub device_msg_box_post(
' byref msg as string(MB_MSG_LEN), 'message to be displayed in the Message Box
' x as word, 'x coordination
' y as word, 'y coordination
' w as word, 'width of the msgbox
' h as word, 'height of the msgbox
' align as pl_lcd_text_alignment, 'alignment of the text in the msgbox
' byref keycode_str as string(20), 'this string contains the characters which ASCII is correspond to the keycode of keys on the keypad that msgbox responds to
' bolder as no_yes, 'if the msgbox is wrap with a visible bolder line
' timeout as byte 'if no respond from the keypad within the time defined by "timeout", exit the msgbox and return to the previous screen. If timeout = 0, no time out applies
' ) 'closing the message box
' sub device_mb_key_proc(key_event as pl_kp_event_codes, key_code as byte) 'the operating of keys can be different in each device, therefore, we make it a device specific procedure.
' sub device_mb_interrupt() 'user can poll other events in the procedure.
'===========================================================================
'file name for standard font (proportional)
#ifndef LCD_STD_FONT
#define LCD_STD_FONT "Tibbo-5x7(VP).bin"
#endif
'legth of message
#ifndef MB_MSG_LEN
#define MB_MSG_LEN 60
#endif
'vertical spacing for the message box(number of pixels between lines)
#ifndef MSB_VER_SPACING
#define MSB_VER_SPACING 1
#endif
'horizontal space for the message box(number of pixels between characters)
#ifndef MSB_HOR_SPACING
#define MSB_HOR_SPACING 1
#endif
'width of message box bolder(in pixels)
#ifndef MSG_BOX_BOLDER
#define MSG_BOX_BOLDER 2
#endif
'the space between the bolder and the actual message that is being printed
#ifndef MSB_BOLDER_PADDING
#define MSB_BOLDER_PADDING 5
#endif
'lock the lcd(define it as nothing to remove the lcd locking effect)
#ifndef LCD_LOCK
#define LCD_LOCK lcd.lock
#endif
'lock the lcd(define it as nothing to remove the lcd locking effect)
#ifndef LCD_UNLOCK
#define LCD_UNLOCK lcd.unlock
#endif
'--------------------------------------------------------------------------------
declare function ui_msg_box(byref msg as string(60),x as word, y as word, w as word, h as word,align as pl_lcd_text_alignment, byref keycode_str as string(20), bolder as no_yes, timeout as byte) as byte