[r8756]: ooDialog / trunk / ooDialog / BaseDialog.cls Maximize Restore History

Download this file

BaseDialog.cls    268 lines (223 with data), 13.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
/*----------------------------------------------------------------------------*/
/* */
/* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
/* Copyright (c) 2005-2012 Rexx Language Association. All rights reserved. */
/* */
/* This program and the accompanying materials are made available under */
/* the terms of the Common Public License v1.0 which accompanies this */
/* distribution. A copy is also available at the following address: */
/* http://www.oorexx.org/license.html */
/* */
/* Redistribution and use in source and binary forms, with or */
/* without modification, are permitted provided that the following */
/* conditions are met: */
/* */
/* Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in */
/* the documentation and/or other materials provided with the distribution. */
/* */
/* Neither the name of Rexx Language Association nor the names */
/* of its contributors may be used to endorse or promote products */
/* derived from this software without specific prior written permission. */
/* */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* */
/*----------------------------------------------------------------------------*/
/**
* Windows Dialog Interface for Open Object Rexx (ooRexx.)
*
* This module contains the WindowsExtensions mixinclass. This class is
* inherited by the PlainBaseDialog class and helps form the foundation of all
* non-trivial dialogs.
*
* Some classes related to Windows resources are also included here.
*/
/**
* The class WindowExtensions implements methods that are common to all windows,
* no matter whether they are dialogs or dialog controls. It's an extension to
* the WindowBase mixin-class.
*
* Note that this mixin class contains (did contian) many methods that should
* not be a part of a dialog control class. It also contains (did contain) many
* methods that would be bettor off in a separate class. The original comment
* above, does not seem to have been followed through on.
*/
::class 'WindowExtensions' public mixinclass Object
::method initWindowExtensions external "LIBRARY oodialog winex_initWindowExtensions"
::method setFont unguarded external "LIBRARY oodialog winex_setFont"
::method getFont unguarded external "LIBRARY oodialog winex_getFont"
-- createFont() has always been broken, maintained for program compatibility.
-- createFontEx() is a correct implementation.
::method createFont unguarded external "LIBRARY oodialog winex_createFont"
::method createFontEx unguarded external "LIBRARY oodialog winex_createFontEx"
::method deleteFont unguarded external "LIBRARY oodialog winex_deleteObject"
::method scroll unguarded external "LIBRARY oodialog winex_scroll"
::method hScrollPos unguarded external "LIBRARY oodialog winex_getScrollPos"
::method setHScrollPos unguarded external "LIBRARY oodialog winex_setScrollPos"
::method vScrollPos unguarded external "LIBRARY oodialog winex_getScrollPos"
::method setVScrollPos unguarded external "LIBRARY oodialog winex_setScrollPos"
::method loadBitmap unguarded external "LIBRARY oodialog winex_loadBitmap"
::method removeBitmap unguarded external "LIBRARY oodialog winex_removeBitmap"
::method write unguarded external "LIBRARY oodialog winex_write"
::method writeDirect unguarded external "LIBRARY oodialog winex_writeDirect"
::method createBrush unguarded external "LIBRARY oodialog winex_createBrush"
::method createPen unguarded external "LIBRARY oodialog winex_createPen"
::method deleteObject unguarded external "LIBRARY oodialog winex_deleteObject"
::method getTextAlign unguarded external "LIBRARY oodialog winex_getTextAlign" -- Document for 4.2.1, not for 4.2.0
::method setTextAlign unguarded external "LIBRARY oodialog winex_setTextAlign" -- Document for 4.2.1, not for 4.2.0
::method getTextExtent unguarded external "LIBRARY oodialog winex_getTextExtent"
::method getDC unguarded external "LIBRARY oodialog winex_getDC"
::method freeDC unguarded external "LIBRARY oodialog winex_freeDC"
::method objectToDC unguarded external "LIBRARY oodialog winex_objectToDC"
::method fontToDC unguarded
use strict arg dc, hFont
return self~objectToDC(dc, hFont)
::method rectangle unguarded external "LIBRARY oodialog winex_rectangle"
::method drawLine unguarded external "LIBRARY oodialog winex_drawLine"
::method drawPixel unguarded external "LIBRARY oodialog winex_drawPixel"
::method getPixel unguarded external "LIBRARY oodialog winex_getPixel"
::method fillDrawing unguarded external "LIBRARY oodialog winex_fillDrawing"
::method drawArc unguarded external "LIBRARY oodialog winex_drawArcOrPie"
::method drawPie unguarded external "LIBRARY oodialog winex_drawArcOrPie"
::method drawAngleArc unguarded external "LIBRARY oodialog winex_drawAngleArc"
::method getArcDirection unguarded external "LIBRARY oodialog winex_getSetArcDirection"
::method setArcDirection unguarded external "LIBRARY oodialog winex_getSetArcDirection"
::method fontColor unguarded external "LIBRARY oodialog winex_fontColor"
::method transparentText unguarded external "LIBRARY oodialog winex_textBkMode"
::method opaqueText unguarded external "LIBRARY oodialog winex_textBkMode"
-- DEPRECATED
::method absRect2LogRect unguarded
parse arg l, t, r, b
ret.left = l/self~factorX
ret.right = r/self~factorX
ret.top = t/self~factorY
ret.bottom = b/self~factorY
return ret.
::method cursor_Arrow unguarded
use strict arg
forward to (.Mouse~new(self)) message 'ARROW'
::method cursor_AppStarting unguarded
use strict arg
forward to (.Mouse~new(self)) message 'APPSTARTING'
::method cursor_Cross unguarded
use strict arg
forward to (.Mouse~new(self)) message 'CROSS'
::method cursor_No unguarded
use strict arg
forward to (.Mouse~new(self)) message 'NO'
::method cursor_Wait unguarded
use strict arg
forward to (.Mouse~new(self)) message 'WAIT'
::method cursorPos unguarded
forward to (.Mouse~new(self)) message 'GETCURSORPOS' continue
return result~x result~y
::method logRect2AbsRect unguarded
parse arg l, t, r, b
ret.left = l*self~factorX
ret.right = r*self~factorX
ret.top = t*self~factorY
ret.bottom = b*self~factorY
return ret.
::method restoreCursorShape unguarded
forward to (.Mouse~new(self)) message 'RESTORECURSOR'
::method setCursorPos unguarded
forward to (.Mouse~new(self)) message 'SETCURSORPOS'
::class 'ResourceImage' public
::method init external "LIBRARY oodialog ri_init"
::method release external "LIBRARY oodialog ri_release"
::method handle external "LIBRARY oodialog ri_handle"
::method isNull external "LIBRARY oodialog ri_isNull"
::method systemErrorCode external "LIBRARY oodialog ri_systemErrorCode"
::method getImage external "LIBRARY oodialog ri_getImage"
::method getImages external "LIBRARY oodialog ri_getImages"
::class 'Image' public
::method toID class external "LIBRARY oodialog image_toID_cls"
::method getImage class external "LIBRARY oodialog image_getImage_cls"
::method fromFiles class external "LIBRARY oodialog image_fromFiles_cls"
-- ::method getGDIImage class external "LIBRARY oodialog image_getGDIImage_cls" future enhancement
::method fromIDs class external "LIBRARY oodialog image_fromIDs_cls"
::method userIcon class external "LIBRARY oodialog image_userIcon_cls"
::method colorRef class external "LIBRARY oodialog image_colorRef_cls"
::method getRValue class external "LIBRARY oodialog image_getRValue_cls"
::method getGValue class external "LIBRARY oodialog image_getGValue_cls"
::method getBValue class external "LIBRARY oodialog image_getBValue_cls"
::method init external "LIBRARY oodialog image_init"
::method release external "LIBRARY oodialog image_release"
::method handle external "LIBRARY oodialog image_handle"
::method isNull external "LIBRARY oodialog image_isNull"
::method systemErrorCode external "LIBRARY oodialog image_systemErrorCode"
::class 'ImageList' public
::method create class external "LIBRARY oodialog il_create_cls"
::method init external "LIBRARY oodialog il_init"
::method release external "LIBRARY oodialog il_release"
::method add external "LIBRARY oodialog il_add"
::method addMasked external "LIBRARY oodialog il_addMasked"
::method addIcon external "LIBRARY oodialog il_addIcon"
::method addImages external "LIBRARY oodialog il_addImages"
::method getCount external "LIBRARY oodialog il_getCount"
::method getImageSize external "LIBRARY oodialog il_getImageSize"
::method duplicate external "LIBRARY oodialog il_duplicate"
::method remove external "LIBRARY oodialog il_remove"
::method removeAll external "LIBRARY oodialog il_removeAll"
::method handle external "LIBRARY oodialog il_handle"
::method isNull external "LIBRARY oodialog il_isNull"
::class 'CustomDraw' public mixinclass EventNotification
::constant CDRF_DODEFAULT 0 -- 0x00000000
::constant CDRF_NEWFONT 2 -- 0x00000002
::constant CDRF_SKIPDEFAULT 4 -- 0x00000004
::constant CDRF_DOERASE 8 -- 0x00000008 draw the background
::constant CDRF_SKIPPOSTPAINT 256 -- 0x00000100 don't draw the focus rect
::constant CDRF_NOTIFYPOSTPAINT 16 -- 0x00000010
::constant CDRF_NOTIFYITEMDRAW 32 -- 0x00000020
::constant CDRF_NOTIFYSUBITEMDRAW 32 -- 0x00000020 flags are the same, MS can distinguish by context
::constant CDRF_NOTIFYPOSTERASE 64 -- 0x00000040
::constant CDDS_PREPAINT 1 -- 0x00000001
::constant CDDS_POSTPAINT 2 -- 0x00000002
::constant CDDS_PREERASE 3 -- 0x00000003
::constant CDDS_POSTERASE 4 -- 0x00000004
::constant CDDS_ITEM 65536 -- 0x00010000 the 0x000010000 bit means it's individual item specific
::constant CDDS_ITEMPREPAINT 65537 -- 0x00010001 (CDDS_ITEM | CDDS_PREPAINT)
::constant CDDS_ITEMPOSTPAINT 65538 -- 0x00010002 (CDDS_ITEM | CDDS_POSTPAINT)
::constant CDDS_ITEMPREERASE 65539 -- 0x00010003 (CDDS_ITEM | CDDS_PREERASE)
::constant CDDS_ITEMPOSTERASE 65540 -- 0x00010004 (CDDS_ITEM | CDDS_POSTERASE)
::constant CDDS_SUBITEM 131072 -- 0x00020000
::constant CDDS_SUBITEMPREPAINT 196609 -- 0x00030001 -- ooRexx defined for convenience
::constant CDDS_SUBITEMPOSTPAINT 196610 -- 0x00030002 -- ooRexx defined for convenience
::constant CLR_NONE 4294967295 -- 0xFFFFFFFFL
::constant CLR_INVALID 4294967295 -- 0xFFFFFFFFL
::constant CLR_DEFAULT 4278190080 -- xFF000000L
::method customDraw external "LIBRARY oodialog cd_init"
::method customDrawControl external "LIBRARY oodialog cd_customDrawControl"
::method RGB external "LIBRARY oodialog image_colorRef_cls"
::class 'ResizingAdmin' public mixinclass Object
::constant IDC_DEFAULT_PINTO_WINDOW 0
::attribute minSize get external "LIBRARY oodialog ra_minSize"
::attribute minSize set external "LIBRARY oodialog ra_setMinSize"
::attribute maxSize get external "LIBRARY oodialog ra_maxSize"
::attribute maxSize set external "LIBRARY oodialog ra_setMaxSize"
::method controlBottom external "LIBRARY oodialog ra_controlSide"
::method controlLeft external "LIBRARY oodialog ra_controlSide"
::method controlRight external "LIBRARY oodialog ra_controlSide"
::method controlSizing external "LIBRARY oodialog ra_controlSizing"
::method controlTop external "LIBRARY oodialog ra_controlSide"
::method defaultBottom external "LIBRARY oodialog ra_defaultSide"
::method defaultLeft external "LIBRARY oodialog ra_defaultSide"
::method defaultRight external "LIBRARY oodialog ra_defaultSide"
::method defaultSizing external "LIBRARY oodialog ra_defaultSizing"
::method defaultTop external "LIBRARY oodialog ra_defaultSide"
::method defineSizing
return 0
-- Internal use only
::method initResizing private external "LIBRARY oodialog ra_initResizing" -- Do not document