-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclFixer011.clw
235 lines (196 loc) · 8.83 KB
/
clFixer011.clw
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
MEMBER('clFixer.clw') ! This is a MEMBER module
INCLUDE('ABRESIZE.INC'),ONCE
INCLUDE('ABTOOLBA.INC'),ONCE
INCLUDE('ABWINDOW.INC'),ONCE
MAP
INCLUDE('CLFIXER011.INC'),ONCE !Local module procedure declarations
END
!!! <summary>
!!! Generated from procedure template - Window
!!! Window
!!! </summary>
MainDashboard PROCEDURE
i LONG
lngRecords LONG
EnhancedFocusManager EnhancedFocusClassType
QuickWindow WINDOW('Main Dashboard'),AT(,,401,227),FONT('Segoe UI',9,,FONT:regular,CHARSET:DEFAULT),RESIZE, |
CENTER,ICON('toolbox.ico'),GRAY,IMM,HLP('MyDashboard'),SYSTEM
BUTTON(' &OK'),AT(343,204,47,14),USE(?Ok),LEFT,ICON('WAOK.ICO'),MSG('Close this screen'), |
TIP('Close this screen')
BUTTON('Process the Files'),AT(11,11,91,18),USE(?btnScanFiles),FONT(,,,FONT:bold),LEFT,ICON('WIZFIND.ICO'), |
MSG('Find the files and make the requested changes'),TIP('Find the files and make the' & |
' requested changes')
PROMPT('Files Found:'),AT(95,16,63),USE(?glo:qRecords:Prompt),RIGHT,TRN
ENTRY(@n-14B),AT(163,15,60,12),USE(glo:qRecords),RIGHT(1),FLAT,MSG('Queue Records'),READONLY, |
TIP('Queue Records')
PROMPT('Folders:'),AT(286,16,38),USE(?glo:qFolders:Prompt),RIGHT
ENTRY(@n-14B),AT(328,15,60,12),USE(glo:qFolders),RIGHT(1),FLAT,MSG('Number of Folders scanned'), |
READONLY,TIP('Number of Folders scanned')
PROMPT('App Description:'),AT(99,39,58),USE(?glo:AppDescription:Prompt),RIGHT
ENTRY(@s50),AT(163,38,225,12),USE(glo:AppDescription),FLAT,MSG('Description'),READONLY,TIP('Description')
PROMPT('Root Path:'),AT(99,54,58),USE(?glo:RootPath:Prompt),RIGHT
ENTRY(@s255),AT(163,53,225,12),USE(glo:RootPath),FLAT,MSG('Root Path'),READONLY,TIP('Root Path')
PROMPT('File Extensions:'),AT(99,68,58),USE(?glo:FileExtensions:Prompt),RIGHT
ENTRY(@s250),AT(163,68,225,12),USE(glo:FileExtensions),FLAT,MSG('File Extensions'),READONLY, |
TIP('File Extensions')
PROMPT('Exclude Files:'),AT(99,85,58),USE(?glo:ExcludeFiles:Prompt),RIGHT
TEXT,AT(163,83,225,100),USE(glo:ExcludeFiles),VSCROLL,FLAT,MSG('Exclude Files'),READONLY,TIP('Exclude Files')
ENTRY(@s80),AT(12,187,376,10),USE(glo:ProgressMessage),CENTER,FLAT,MSG('Progress Message'), |
READONLY,TIP('Progress Message'),TRN
END
omit('***',WE::CantCloseNowSetHereDone=1) !Getting Nested omit compile error, then uncheck the "Check for duplicate CantCloseNowSetHere variable declaration" in the WinEvent local template
WE::CantCloseNowSetHereDone equate(1)
WE::CantCloseNowSetHere long
!***
ThisWindow CLASS(WindowManager)
Init PROCEDURE(),BYTE,PROC,DERIVED
Kill PROCEDURE(),BYTE,PROC,DERIVED
TakeAccepted PROCEDURE(),BYTE,PROC,DERIVED
TakeEvent PROCEDURE(),BYTE,PROC,DERIVED
TakeWindowEvent PROCEDURE(),BYTE,PROC,DERIVED
END
Toolbar ToolbarClass
Resizer CLASS(WindowResizeClass)
Init PROCEDURE(BYTE AppStrategy=AppStrategy:Resize,BYTE SetWindowMinSize=False,BYTE SetWindowMaxSize=False)
END
CODE
GlobalResponse = ThisWindow.Run() ! Opens the window and starts an Accept Loop
!---------------------------------------------------------------------------
DefineListboxStyle ROUTINE
!|
!| This routine create all the styles to be shared in this window
!| It`s called after the window open
!|
!---------------------------------------------------------------------------
ThisWindow.Init PROCEDURE
ReturnValue BYTE,AUTO
CODE
GlobalErrors.SetProcedureName('MainDashboard')
SELF.Request = GlobalRequest ! Store the incoming request
ReturnValue = PARENT.Init()
IF ReturnValue THEN RETURN ReturnValue.
SELF.FirstField = ?Ok
SELF.VCRRequest &= VCRRequest
SELF.Errors &= GlobalErrors ! Set this windows ErrorManager to the global ErrorManager
CLEAR(GlobalRequest) ! Clear GlobalRequest after storing locally
CLEAR(GlobalResponse)
SELF.AddItem(Toolbar)
IF SELF.Request = SelectRecord
SELF.AddItem(?Ok,RequestCancelled) ! Add the close control to the window manger
ELSE
SELF.AddItem(?Ok,RequestCompleted) ! Add the close control to the window manger
END
SELF.Open(QuickWindow) ! Open window
Do DefineListboxStyle
Alert(AltKeyPressed) ! WinEvent : These keys cause a program to crash on Windows 7 and Windows 10.
Alert(F10Key) !
Alert(CtrlF10) !
Alert(ShiftF10) !
Alert(CtrlShiftF10) !
Alert(AltSpace) !
WinAlertMouseZoom()
WinAlert(WE::WM_QueryEndSession,,Return1+PostUser)
Resizer.Init(AppStrategy:Surface,Resize:SetMinSize) ! Controls like list boxes will resize, whilst controls like buttons will move
SELF.AddItem(Resizer) ! Add resizer to window manager
INIMgr.Fetch('MainDashboard',QuickWindow) ! Restore window settings from non-volatile store
Resizer.Resize ! Reset required after window size altered by INI manager
SELF.SetAlerts()
EnhancedFocusManager.Init(1,12648447,0,0,16777152,0,65535,0,2,65535,0,0,0,'»',8)
EnhancedFocusManager.SetOnScreenKeyboard(False) !Will disable the OSK
EnhancedFocusManager.DisableControlType(CREATE:Check)
RETURN ReturnValue
ThisWindow.Kill PROCEDURE
ReturnValue BYTE,AUTO
CODE
If self.opened Then WinAlert().
ReturnValue = PARENT.Kill()
IF ReturnValue THEN RETURN ReturnValue.
IF SELF.Opened
INIMgr.Update('MainDashboard',QuickWindow) ! Save window data to non-volatile store
END
GlobalErrors.SetProcedureName
RETURN ReturnValue
ThisWindow.TakeAccepted PROCEDURE
ReturnValue BYTE,AUTO
Looped BYTE
CODE
LOOP ! This method receive all EVENT:Accepted's
IF Looped
RETURN Level:Notify
ELSE
Looped = 1
END
ReturnValue = PARENT.TakeAccepted()
CASE ACCEPTED()
OF ?btnScanFiles
ThisWindow.Update()
! Click the Scan Files button
DirAllFileAndFolders(glo:RootPath,glo:FileExtensions)
! 'c:\Clarion11.1','*.inc;*.clw;*.txa;*.dctx;*.def;*.equ;*.tpl;*.tft;*.xml;*.tpw;*.tpl;')
END
RETURN ReturnValue
END
ReturnValue = Level:Fatal
RETURN ReturnValue
ThisWindow.TakeEvent PROCEDURE
ReturnValue BYTE,AUTO
Looped BYTE
CODE
LOOP ! This method receives all events
IF Looped
RETURN Level:Notify
ELSE
Looped = 1
END
EnhancedFocusManager.TakeEvent()
ReturnValue = PARENT.TakeEvent()
If event() = event:VisibleOnDesktop !or event() = event:moved
ds_VisibleOnDesktop()
end
RETURN ReturnValue
END
ReturnValue = Level:Fatal
RETURN ReturnValue
ThisWindow.TakeWindowEvent PROCEDURE
ReturnValue BYTE,AUTO
Looped BYTE
CODE
LOOP ! This method receives all window specific events
IF Looped
RETURN Level:Notify
ELSE
Looped = 1
END
CASE EVENT()
OF EVENT:CloseDown
if WE::CantCloseNow
WE::MustClose = 1
cycle
else
self.CancelAction = cancel:cancel
self.response = requestcancelled
end
END
ReturnValue = PARENT.TakeWindowEvent()
CASE EVENT()
OF EVENT:OpenWindow
!// Reset clFiles
lngRecords = RECORDS(clFiles)
LOOP i = lngRecords to 1 BY -1 ! Loop i
GET(clFiles,i)
CLEAR(clFiles)
DELETE(clFiles)
END ! Loop i
glo:qRecords = RECORDS(clFiles)
glo:ProgressMessage = 'Freeware copyright <169> 2023 Black and White Inc'
DISPLAY()
post(event:visibleondesktop)
END
RETURN ReturnValue
END
ReturnValue = Level:Fatal
RETURN ReturnValue
Resizer.Init PROCEDURE(BYTE AppStrategy=AppStrategy:Resize,BYTE SetWindowMinSize=False,BYTE SetWindowMaxSize=False)
CODE
PARENT.Init(AppStrategy,SetWindowMinSize,SetWindowMaxSize)
SELF.SetParentDefaults() ! Calculate default control parent-child relationships based upon their positions on the window