{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscrdemo.pls
More file actions
270 lines (270 loc) · 7.7 KB
/
Copy pathscrdemo.pls
File metadata and controls
270 lines (270 loc) · 7.7 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
*...........................................................................
.
.Example Program: SCRDEMO.PLS
.
.This sample programs shows some of the graphical objects available.
.Also, coordination between objects is shown.
.
.Copyright @ 1997, Sunbelt Computer Systems, Inc.
.All Rights Reserved.
.............................................................................
.
.Sample Menu Item
.
SMenu MENU
SData INIT ")Sample;":
"Chec)k Menu Item;":
")Disable Test Alert;":
")Test Alert..."
*
.Local Variables
.
Result FORM 1
CheckV FORM "0"
DisableV FORM "0"
Current FORM "1"
Counter FORM 1
*
.Objects and Data
.
Quit BUTTON
.
BookCB COMBOBOX
BookData INIT "x;":
"Business;":
"Fiction;":
"Health;":
"Mystery;":
"Romance;":
"Travel;":
"Western"
.
BookList DATALIST
Reason ICON
DisableL CHECKBOX
DisableB CHECKBOX
Text STATTEXT
Text1 STATTEXT
EDIT EDITTEXT
*
.Book Names
.
BName DIM 20
BName1 INIT "Sunset Over Water"
BName2 INIT "Selling Oranges"
BName3 INIT "You and Your Liver"
BName4 INIT "Visiting Wawa"
BName5 INIT "Taxes Made Easy"
BName6 INIT "New Dance Steps"
*
.Book Values
.
BValue FORM 1
BValue1 FORM "2"
BValue2 FORM "1"
BValue3 FORM "3"
BValue4 FORM "6"
BValue5 FORM "4"
BValue6 FORM "5"
*............................................................................
.
.Ready the Screen
.
SETMODE *LTGRAY=ON,*3D=ON
DISPLAY *BGCOLOR=*YELLOW,*ES;
*
.Create the Sample Menu
.
CREATE SMenu,SData
*
.Create the Label and Edittext Object
.
CREATE Text=4:5:5:20,"Book Title:","Times(9,Bold)",ALIGNMENT=3
CREATE Edit=4:5:22:50,FONT="Times(9,Bold)",BORDER
*
.Create the Label and Combobox
.
CREATE Text1=6:7:5:20,"Book Classification:":
"Times(9,Bold)",ALIGNMENT=3
CREATE BookCB=6:7:22:50,"",BookData
*
.Create the Book Datalist
.
CREATE BookList=9:14:5:50,FONT="Times(12,Bold)"
*
.Create the Icon
.
CREATE Reason=2:70,10040
*
.Create the Disable Buttons
.
CREATE DisableL=16:17:5:24,"Disable Book &List"
CREATE DisableB=18:19:5:24,"Disable Quit &Button"
*
.Create the Quit Button
.
CREATE Quit=22:23:35:45,"&Quit"
*
.Load the Datalist
.
MOVE "1",Counter
LOOP
LOAD BName BY Counter FROM BName1,BName2:
BName3,BName4,BName5,BName6
INSERTITEM BookList,999,BName
ADD "1",Counter
REPEAT UNTIL (Counter = 7)
*
.Activate the Sample Menu
.
ACTIVATE SMenu,Menu,Result
*
.Activate the Label and Edittext
.
ACTIVATE Text
SETITEM Edit,0,BName
ACTIVATE Edit
*
.Activate the Label and Combobox
.
ACTIVATE Text1
SETITEM BookCB,0,BValue1
ACTIVATE BookCB,BookMenu,Result
*
.Activate the Datalist
.
SETITEM BookList,0,Current
ACTIVATE BookList,BookList,Result
*
.Activate the Icon
.
ACTIVATE Reason,Reason,Result
*
.Activate the Disable Checkboxes
.
ACTIVATE DisableL,DisList,Result
ACTIVATE DisableB,DisButton,Result
*
.Activate the Quit Button
.
ACTIVATE Quit,QuitR,Result
*
.Place the Focus on the DataList
.
SETFOCUS BookList
*
.Wait for an Event to Occur
.
LOOP
WAITEVENT
REPEAT
*..............................................................................
.
.Menu Item Selected
.
Menu
BRANCH Result to Check,Disable,Alert
RETURN
*
.Flip the Check Flag
.
Check
IF (CheckV = 0)
SET CheckV
CHECKITEM SMenu,Result,ON
ELSE
CLEAR CheckV
CHECKITEM SMenu,Result,OFF
ENDIF
RETURN
*
.Disable the Item
.
Disable
IF (DisableV = 0)
SET DisableV
DISABLEITEM SMenu,3
SETITEM SMenu,Result,")Enable Test Alert"
ELSE
CLEAR DisableV
ENABLEITEM SMenu,3
SETITEM SMenu,Result,")Disable Test Alert"
ENDIF
.
RETURN
*
.Display an Alert
.
Alert
ALERT NOTE,"Test Alert",Result,"SCRDEMO"
RETURN
*..........................................................................
.
.A Combobox Item was Selected
.
BookMenu
STORE Result USING Current,BValue1,BValue2,BValue3,BValue4:
BValue5,BValue6
RETURN
*..........................................................................
.
.A Datalist Item Was Selected - Update the Edittext and Combobox Objects
.
BookList
MOVE Result,Current
.
LOAD BName USING Current FROM BName1:
BName2,BName3,BName4,BName5,BName6
.
LOAD BValue USING Current FROM BValue1,BValue2:
BValue3,BValue4,BValue5,BValue6
.
SETITEM Edit,0,BName
SETITEM BookCB,0,BValue
.
RETURN
*.........................................................................
.
.Icon Clicked
.
Reason
ALERT NOTE,"Sample application using GUI PL/B",Result:
"SCRDEMO"
RETURN
*..........................................................................
.
.Disable the book list
.
DisList
IF (Result = 0)
SETITEM DisableL,0,1
DISABLEITEM BookList,0
ELSE
SETITEM DisableL,0,0
ENABLEITEM BookList,0
ENDIF
.
RETURN
*...........................................................................
.
.Disable the Quit button
.
DisButton
IF (Result = 0)
SETITEM DisableB,0,1
DISABLEITEM Quit,0
ELSE
SETITEM DisableB,0,0
ENABLEITEM Quit,0
ENDIF
.
RETURN
*..........................................................................
.
.Terminate the Program
.
QuitR
ALERT PLAIN,"Do you wish to exit this program ?":
RESULT,"SCRDEMO"
STOP IF (Result = 1)
RETURN
You can’t perform that action at this time.
