This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomerTouch.bbj
81 lines (57 loc) · 2.33 KB
/
CustomerTouch.bbj
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
REM if INFO(3,6)<>"5" then
REM ::components/util/Util.bbj::Util.runAsBui(pgm(-1))
REM fi
use ::components/ui/unbound/WindowStack.bbj::WindowStack
use ::ui/CustomerTouchScreenCombo.bbj::CustomerTouchScreenCombo
use ::bl/CustomerBusinessComponent.bbj::CustomerBusinessComponent
rem * this sample shows a touch version of a search grid + form
rem * embedded in a child window
rem * note that WindowStack by default can be used
rem * to achieve a full screen display of the screen
listpagesize$ = stbl("!LIST_PAGE_SIZE","10")
BBjAPI().getConfig().setOptionSetting("FAST_TOUCH_CLICK", 1)
sg! = BBjAPI().openSysGui("X0")
w=1200
h=600
screenSize! = BBjAPI().getSysGui().getSystemMetrics().getScreenSize()
REM w=screenSize!.width
REM h=screenSize!.height
wnd! = sg!.addWindow(0,0,w,h,"",$01080010$ )
REM wnd! = sg!.addWindow(0,0,640,480,"",$01081010$ )
wnd!.setCallback(BBjAPI.ON_SCREEN_RESIZE,"resize")
wnd!.setCallback(BBjAPI.ON_RESIZE,"resize")
wnd!.setCallback(wnd!.ON_CLOSE,"byebye")
frame! = wnd!.addChildWindow(100,0,0,w,h,"",$00000800$,BBjAPI().getSysGui().getAvailableContext())
frame!.setBackColor(BBjAPI().makeColor("YELLOW"))
WindowStack.setContainerWnd(frame!)
bc! = new CustomerBusinessComponent()
cw! = WindowStack.openWindow(bc!.getTitle())
ctc! = new CustomerTouchScreenCombo(cw!, bc!)
WindowStack.setWidget(ctc!)
REM myTopBar! = wnd!.addStaticText(110, 0, 0, w, 40, "")
REM myTopBar!.setName("topGradientBar")
REM wnd!.addImage(111,0,0,2500,40,"components/css/banner.png")
REM myStatusBar! = wnd!.addStaticText(112, 0, h-20, w, 20, "")
REM myStatusBar!.setName("topGradientBar")
myExit! = wnd!.addButton(200, w-24-8, 8, 30, 30, "")
myExit!.setName("exitButton")
myExit!.setCallback(BBjAPI.ON_BUTTON_PUSH, "byebye")
wnd!.setVisible(1)
gosub delayedResize
process_events
byebye:
bye
resize:
BBjAPI().removeTimer("CustomerTouchDelayedResize",err=*next)
BBjAPI().createTimer("CustomerTouchDelayedResize",.5,"delayedResize")
return
delayedResize:
BBjAPI().removeTimer("CustomerTouchDelayedResize",err=*next)
screenSize! = BBjAPI().getSysGui().getSystemMetrics().getScreenSize()
w = screenSize!.width -10
h = screenSize!.height -200
wnd!.setSize(w,h)
myExit!.setLocation(w-24-8,8)
frame!.setSize(w,h)
WindowStack.resize(w,h)
return