Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
sunbelt-plb-samples/legacy_demo/edittext.pls at main · KcsDev1982/sunbelt-plb-samples · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
KcsDev1982
/
sunbelt-plb-samples
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
5
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
main
Breadcrumbs
sunbelt-plb-samples
/
legacy_demo
/
edittext.pls
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
256 lines (253 loc) · 7.47 KB
main
Breadcrumbs
sunbelt-plb-samples
/
legacy_demo
/
edittext.pls
Copy path
Top
File metadata and controls
Code
Blame
256 lines (253 loc) · 7.47 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
*...........................................................................
.
.Example Program: EDITTEXT.PLS
.
. This demonstration programs shows some of the capabilities of the
. Edittext objects.
.
. Copyright @ 1997, Sunbelt Computer Systems, Inc.
. All Rights Reserved.
.............................................................................
.
. Revision History
.
. 9-10-98 JSS: Convert to GUI screen I/O
. Modify search routine to work for newly entered text.
.
. Aug 06 2010 updated to eliminate obsolete DIALOG object and to use
. new techniques, properties and methods.
.
............................................................................
.
INCLUDE PLBEQU.INC
.
.
.Define the Replacement File Menu
.
FileMenu MENU
FileData INIT ")File;E)xit"
*
.Define the New Search Menu
.
FindMenu MENU
FindData INIT ")Search;/F)Find ...",011,"Ctrl+F;":
"/G(Find a)gain",011,"Ctrl+G"
*
.Define the Find window objects
.
Findcol COLLECTION
FindWin WINDOW
FindBtn BUTTON
CancBtn BUTTON
Label STATTEXT
Edit EDITTEXT
*
.Search Variables
.
SrchBtn FORM "1"
CanBtn EQU 2
SrchText EQU 3
SrchFld FORM "4"
STxtSize FORM 8
SrchData DIM 100
Stxt DIM 5120
*
.Edittext Object and Data
.
EditText EDITTEXT
.
Sample INIT "What is PL/B?",0x7F,0x7F,0x7F,0x7F:
"The PL/B language is an interactive,":
" data entry programming language ":
"designed primarily for business programming. ":
"Since its creation,PL/B has evolved into ":
"a powerful business programming ":
"language running under more than 60 combinations ":
"of hardware and operating ":
"systems. ",0x7F,0x7F:
"The PL/B language is easy to learn":
" and powerful enough to create complex programs."
*
.Page Heading
.
Header STATTEXT
*
.Local Variables
.
StartSel FORM 4
EndSel FORM 4
Result FORM 9
MAGENTA COLOR
WHITE COLOR
BLACK COLOR
*............................................................................
.
.Ready the Screen
.
SETMODE *LTGRAY=ON,*3D=ON
DISPLAY *BGCOLOR=*YELLOW,*ES
. Define colors
CREATE MAGENTA=*MAGENTA
CREATE WHITE=*WHITE
*
.Create the Screen Heading
.
CREATE Header=2:4:23:55,"Edit Text Demo":
"Times(24,ITALIC,BOLD)",BORDER,STYLE=3DOUT:
ALIGNMENT=1,FGCOLOR=MAGENTA
.
*
.Create the Replacement File Menu
.
CREATE FileMenu,FileData
*
.Create the New Search Menu
.
CREATE FindMenu,FindData
*
.Create the Find Window
.
CREATE FindWin=1:150:1:420,TITLE="Find Window":
WINTYPE=$MODELESS,WINPOS=$PARENTCENTER:
BGCOLOR=$BtnFace
*
. Now that the window is created, create the object on the window
.
CREATE FindWin;FindBtn=95:120:100:150,"Find":
DEFAULT=$TRUE,ENABLED=$False
CREATE FindWin;CancBtn=95:120:200:250,"Cancel",CANCEL=$True
CREATE FindWin;Label=50:75:20:70,"Find:",">Arial(12)"
CREATE FindWin;Edit=50:75:100:400,FONT=">Arial(12)":
BORDER=$TRUE,STYLE=3DON
*
. register the events we want to process
.
EVENTREG Edit,$CHANGE,CanSrch
EVENTREG FindBtn,$CLICK,Search
EVENTREG CancBtn,$CLICK,Cancel
EVENTREG FindWin,$CLOSE,Cancel
*
. Establish a collection that contains all the objects of our find window
.
LISTINS Findcol,FindWin,Edit,Label,CancBtn,FindBtn
.
*
.Create an Edittext Object on the main window
.
CREATE EditText=5:24:5:75,BORDER,FONT="Times(12)":
MULTILINE,WORDWRAP,MAXCHARS=5120,BGCOLOR=WHITE
.
*
.Load the Data into the Edittext Object
.
SETPROP EditText,TEXT=Sample
*
. Activate all the objects
.
ACTIVATE FileMenu,Quit,Result
ACTIVATE FindMenu,FindIt,Result
ACTIVATE Header
ACTIVATE EditText
*
.Wait for an Event to Occur
.
LOOP
WAITEVENT
REPEAT
*...........................................................................
.
.Find Menu Item Selected
.
FindIt
IF (Result = 1) // Find Requested
*
. Get current contents of edit text box into Stxt for searching
.
GETPROP EditText,TEXT=Stxt
*
. Get the currently selected text to initialize the find window
.
GETPROP EditText,SELTEXT=SrchData
SETPROP Edit,TEXT=SrchData
*
. set find button appropreatly
.
CALL CanSrch
*
.Activate the Find Dialog
.
ACTIVATE Findcol
SETFOCUS Edit
.
RESET Stxt
ELSE
*
.Search Again Requested
.
BUMP Stxt
CALL SEARCH
.
ENDIF
RETURN
*............................................................................
.
. Search Edit Handling Routine
.
CanSrch
*
. Enable or Disable the Find Button and Find Again Menu Item
. Based on the Contents of the Search Text
.
Edit.GetTextLength giving StxtSize
IF ZERO
SETPROP FindBtn,ENABLED=$False
DISABLEITEM FindMenu,2
ELSE
SETPROP FindBtn,ENABLED=$TRUE
ENABLEITEM FindMenu,2
ENDIF
.
RETURN
*............................................................................
.
.Search for the Specified Text
.
Search
DEACTIVATE FindCol
.
*
.Search for the String
.
GETPROP Edit,TEXT=SrchData
SCAN SrchData,Stxt
*
.If Found, Highlight Selection
.
IF EQUAL
MOVEFPTR Stxt,StartSel
SUB "1",StartSel
SETITEM EditText,1,StartSel
COUNT Result,SrchData
SETITEM EditText,2,(StartSel + Result)
SETFOCUS EditText
ELSE
*
.Catch Search Failure
.
ALERT CAUTION,"String Not Found",RESULT,"Search"
ENDIF
.
RETURN
*............................................................................
.
. Cancel the Find dialog
.
Cancel
DEACTIVATE FindCol
RETURN
*.............................................................................
.
.Terminate the Program
.
Quit
STOP
You can’t perform that action at this time.