forked from patrickTingen/DataDigger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frameLib.i
174 lines (122 loc) · 5.07 KB
/
frameLib.i
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
&ANALYZE-SUSPEND _VERSION-NUMBER AB_v10r12
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Include
/*------------------------------------------------------------------------
File :
Purpose :
Syntax :
Description :
Author(s) :
Created :
Notes :
----------------------------------------------------------------------*/
/* This .W file was created with the Progress AppBuilder. */
/*----------------------------------------------------------------------*/
/* *************************** Definitions ************************** */
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
/* ******************** Preprocessor Definitions ******************** */
/* _UIB-PREPROCESSOR-BLOCK-END */
&ANALYZE-RESUME
/* *********************** Procedure Settings ************************ */
&ANALYZE-SUSPEND _PROCEDURE-SETTINGS
/* Settings for THIS-PROCEDURE
Type: Include
Allow:
Frames: 0
Add Fields to: Neither
Other Settings: INCLUDE-ONLY
*/
&ANALYZE-RESUME _END-PROCEDURE-SETTINGS
/* ************************* Create Window ************************** */
&ANALYZE-SUSPEND _CREATE-WINDOW
/* DESIGN Window definition (used by the UIB)
CREATE WINDOW Include ASSIGN
HEIGHT = 13.05
WIDTH = 60.
/* END WINDOW DEFINITION */
*/
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Include
/* *************************** Main Block *************************** */
run initFrames.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
/* ********************** Internal Procedures *********************** */
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE initFrames Include
PROCEDURE initFrames :
/*------------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------------*/
DELETE WIDGET {&WINDOW-NAME}.
{&WINDOW-NAME} = CURRENT-WINDOW.
run reparentFrames(input frame DEFAULT-FRAME:handle, input phParent).
run enable_UI.
/* Adjust the size of the frame to the rectange (if provided) */
if valid-handle(phRectangle) then
run setFrame ( input phRectangle:x + 2
, input phRectangle:y + 2
, input phRectangle:width-pixels - 4
, input phRectangle:height-pixels - 4
).
END PROCEDURE.
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE reparentFrames Include
PROCEDURE reparentFrames :
/*------------------------------------------------------------------------------
Name : reparentFrames
Desc : Reparent all frames
------------------------------------------------------------------------------*/
DEFINE INPUT PARAMETER phOldParent AS HANDLE NO-UNDO.
DEFINE INPUT PARAMETER phNewParent AS HANDLE NO-UNDO.
/* Attach all frames on the main frame to the parent */
define variable hWidget as handle no-undo.
repeat:
hWidget = phOldParent:first-child:first-child.
if not valid-handle(hWidget) then leave.
if hWidget:type = 'FRAME' then hWidget:frame = phNewParent.
end.
end procedure. /* reparentFrames */
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE setFrame Include
PROCEDURE setFrame :
/*------------------------------------------------------------------------------
Name : setFrame
Desc : Position the frame to a specified location with a specified size
------------------------------------------------------------------------------*/
define input parameter piFrame-x as integer no-undo.
define input parameter piFrame-y as integer no-undo.
define input parameter piFrame-w as integer no-undo.
define input parameter piFrame-h as integer no-undo.
if piFrame-w <> ? then
do:
frame {&frame-name}:width-pixels = piFrame-w.
frame {&frame-name}:virtual-width-pixels = piFrame-w.
end.
if piFrame-h <> ? then
do:
frame {&frame-name}:height-pixels = piFrame-h.
frame {&frame-name}:virtual-height-pixels = piFrame-h.
end.
if piFrame-x <> ? then frame {&frame-name}:x = piFrame-x.
if piFrame-y <> ? then frame {&frame-name}:y = piFrame-y.
end procedure. /* setFrame */
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE viewFrame Include
PROCEDURE viewFrame :
/*------------------------------------------------------------------------------
Name : viewFrame
Desc : Show or hide the frame
------------------------------------------------------------------------------*/
define input parameter plView as logical no-undo.
frame {&frame-name}:hidden = not plView.
if plView then apply 'entry' to frame {&frame-name}.
end procedure. /* viewFrame */
/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME