Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r8763]: docs / trunk / oodialog / en-US / static.xml Maximize Restore History

Download this file

static.xml    718 lines (644 with data), 27.5 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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "oodialog.ent">
%BOOK_ENTITIES;
]>
<!--#########################################################################
#
# Description: Open Object Rexx: ooDialog Reference XML file.
#
# Copyright (c) 2005-2013 Rexx Language Association. All rights reserved.
# Portions Copyright (c) 2004, IBM Corporation. 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.
#
#########################################################################
-->
<chapter id="clsStatic" xreflabel="Static"><title>Static Controls</title>
<indexterm><primary>Static class</primary></indexterm>
<para>
Static controls are used in applications as labels or to separate groups of controls. Although static controls are
child windows, they cannot be selected. Because of that, they do not receive the keyboard focus and do not have a
keyboard interface. Since static controls are not meant to interact with the user, the
<computeroutput>Static</computeroutput> class has relatively few methods, compared to some of the other dialog control
classes.
</para>
<para>
A static control can have a notify style. With this style the control will receive mouse input and then notifies its
parent dialog when the user clicks or double clicks the control.
</para>
<para>
There are four basic types of static controls. Each type has one or more styles.
<simplelist type='horiz' columns='1'>
<member>Simple Graphics</member>
<member>Text</member>
<member>Image</member>
<member>Owner-Drawn</member>
</simplelist>
</para>
<para>
Simple graphic static controls draw a filled rectangle, a frame, or an etched line. They are primarily used to
separate groups of controls. Text static controls display text. They are usually used for labels, or to display
information to the user. Image static controls display an image, icon, bitmap or enhanced metafile. ooDialog does
not have much, if any, support for owner-drawn static controls.
</para>
<para>
The <computeroutput>Static</computeroutput> class provides methods to work with and manipulate the underlying
Windows static dialog control which it represents. It is a concrete subclass of the dialog <xref
linkend="chpDialogControlObject"/> object and therefore has all methods of the of the dialog control object.
</para>
<para>
By default, static controls are assigned a resource ID of -1. There is no way to query or modify static controls
unless the control has a positive resource ID. Which in most circumstances is fine, usually static controls
do not need to be modified. Be sure to assign a positive resource ID to static controls that will be
modified during the execution of a dialog.
</para>
<para>
In addition to the methods of the class itself, the following methods from other classes in the ooDialog framework are
needed, or are useful, when working with static controls:
<variablelist>
<varlistentry><term><emphasis role="bold">Instantiation:</emphasis></term>
<listitem>
<para>
Use the <xref linkend="tmthNewStatic"/> method of the
<xref linkend="chpDialogObject"/> object to retrieve a new Static object.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Dynamic Definition:</emphasis></term>
<listitem>
<para>
To dynamically define a static control in a <xref linkend="clsUserDialog"/> class, use one of the
methods listed in the Create <link linkend="sctCreateStaticControls">Static</link> Controls section of the
<computeroutput>UserDialog</computeroutput> documentation. There are a number of convenience methods for creating
different types of static controls.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Event Notification</emphasis></term>
<listitem>
<para>
To connect the <xref linkend="ovvEvents"/> notifications sent by the underlying static control to
a method in the Rexx dialog object use the <xref linkend="mthConnectStaticEvent"/>()
method.
</para>
</listitem></varlistentry>
</variablelist>
</para>
<section id="sctMethodsStatic"><title>Method Table</title>
<para>
The following table provides links to the documentation for the primary methods and attributes used in working
with Static objects, including the relevant methods from other classes:
</para>
<table id="tblStaticMethods" frame="all">
<title>Important Static Methods</title>
<tgroup cols="2">
<colspec colwidth="1*" />
<colspec colwidth="4*" />
<thead>
<row>
<entry>Method</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry align="center"><emphasis role="bold">Useful</emphasis></entry>
<entry align="center"><emphasis role="bold"> External Methods</emphasis></entry>
</row>
<row>
<entry><xref linkend="tmthNewStatic"/></entry>
<entry>Returns a <computeroutput>Static</computeroutput> object for the control with the specified ID.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateBlackFrame"/></entry>
<entry>Creates a static black frame control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateBlackRect"/></entry>
<entry>Creates a static black rectangle control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateEtchedFrame"/></entry>
<entry>Creates a static etched frame control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateEtchedHorizontal"/></entry>
<entry>Creates a static control in the dialog template that is an etched horizontal line.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateEtchedVertical"/></entry>
<entry>Creates a static frame control in the dialog template that is a single etched vertical line.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateGrayFrame"/></entry>
<entry>Creates a static gray frame control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateGrayRect"/></entry>
<entry>Creates a static gray rectangle control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateStatic"/></entry>
<entry>Creates a static control in the dialog template</entry>
</row>
<row>
<entry><xref linkend="tmthCreateStaticText"/></entry>
<entry>Creates a static text control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateStaticImage"/></entry>
<entry>Creates a static image control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateWhiteFrame"/></entry>
<entry>Creates a white static frame control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthCreateWhiteRect"/></entry>
<entry>Creates a white static rectangle control in the dialog template.</entry>
</row>
<row>
<entry><xref linkend="tmthConnectStaticEvent"/></entry>
<entry>Connects static event notifications to a method in the Rexx dialog object</entry>
</row>
<row>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
<entry align="center"><emphasis role="bold">Instance Methods</emphasis></entry>
</row>
<row>
<entry><xref linkend="mthGetIcon"/></entry>
<entry>Gets the static control's icon image, if there is one.</entry>
</row>
<row>
<entry><xref linkend="mthGetImageClsStaticControl"/></entry>
<entry>Returns the static control's image, if there is one.</entry>
</row>
<row>
<entry><xref linkend="mthSetIcon"/></entry>
<entry>Sets or removes the icon image for the static control.</entry>
</row>
<row>
<entry><xref linkend="mthSetImageClsStaticControl"/></entry>
<entry>Sets or removes the image for the static control.</entry>
</row>
</tbody></tgroup>
</table>
</section>
<section id="tmthCreateBlackFrame" xreflabel="createBlackFrame"><title>createBlackFrame (UserDialog method)</title>
<para>
The <xref linkend="mthCreateBlackFrame"/> method creates a black <link linkend="figFramesRects">frame</link> static control
in the dialog template. The rectangle is drawn with the current window frame color, which is black in the default color
scheme. This is the basic syntax:
<programlisting>
<![CDATA[
>>--createBlackFrame(--+------+--x-,-y-,-cx-,-cy--+-----------+-)--------------><
+--id--+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createBlackFrame() [UserDialog method] -->
<section id="tmthCreateBlackRect" xreflabel="createBlackRect"><title>createBlackRect (UserDialog method)</title>
<para>
The <xref linkend="mthCreateBlackRect"/> method creates a black <link linkend="figFramesRects">rectangle</link> static
control in the dialog template. The rectangle is filled with the current window frame color, which is black in the default
color scheme. This is the basic syntax:
<programlisting>
<![CDATA[
>>--createBlackRect(--+------+--x-,-y-,-cx-,-cy--+-----------+-)---------------><
+--id--+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createBlackRect() [UserDialog method] -->
<section id="tmthCreateEtchedFrame" xreflabel="createEtchedFrame"><title>createEtchedFrame (UserDialog method)</title>
<para>
The <xref linkend="mthCreateEtchedFrame"/> method adds an etched <link linkend="figFramesRects">frame</link> static control
to the dialog template. This is the basic syntax:
<programlisting>
<![CDATA[
>>--createEtchedFrame(--+-------+--x-,-y-,-cx-,-cy--+-----------+-)------------><
+--id-,-+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createEtchedFrame() [UserDialog method] -->
<section id="tmthCreateEtchedHorizontal" xreflabel="createEtchedHorizontal">
<title>createEtchedHorizontal (UserDialog method)</title>
<para>
The <xref linkend="mthCreateEtchedHorizontal"/> method adds an etched horizontal <link linkend="figFramesRects">line</link>
static control to the dialog.
<programlisting>
<![CDATA[
>>--createEtchedHorizontal(--+-------+--x-,-y-,-cx-,-cy--+-----------+-)-------><
+--id-,-+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createEtchedHorizontal() [UserDialog method] -->
<section id="tmthCreateEtchedVertical" xreflabel="createEtchedVertical">
<title>createEtchedVertical (UserDialog method)</title>
<para>
The <xref linkend="mthCreateEtchedVertical"/> method adds an etched vertical <link linkend="figFramesRects">line</link>
static control to the dialog.
<programlisting>
<![CDATA[
>>--createEtchedVertical(--+-------+--x-,-y-,-cx-,-cy--+-----------+-)---------><
+--id-,-+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createEtchedVertical() [UserDialog method] -->
<section id="tmthCreateGrayFrame" xreflabel="createGrayFrame"><title>createGrayFrame (UserDialog method)</title>
<para>
The <xref linkend="mthCreateGrayFrame"/> method creates a gray <link linkend="figFramesRects">frame</link> static control
in the dialog template. The frame is drawn with the same color as the screen background (desktop), which is gray in the
default color scheme. This is the basic syntax:
<programlisting>
<![CDATA[
>>--createGrayFrame(--+------+--x-,-y-,-cx-,-cy--+-----------+-)---------------><
+--id--+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createGrayFrame() [UserDialog method] -->
<section id="tmthCreateGrayRect" xreflabel="createGrayRect"><title>createGrayRect (UserDialog method)</title>
<para>
The <xref linkend="mthCreateGrayRect"/> method creates a gray <link linkend="figFramesRects">rectangle</link> static
control in the dialog template. The rectangle is filled with the same color as the screen background (desktop), which is
gray in the default color scheme. This is the basic syntax:
<programlisting>
<![CDATA[
>>--createGrayRect(--+------+--x-,-y-,-cx-,-cy--+-----------+-)----------------><
+--id--+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createGrayRect() [UserDialog method] -->
<section id="tmthCreateStatic" xreflabel="createStatic"><title>createStatic (UserDialog method)</title>
<para>
A static control can be added to the dialog template for a <xref linkend="clsUserDialog"/> dialog
through the <xref linkend="mthCreateStatic"/>() method. This method uses the <emphasis
role="italic">style</emphasis> argument to specify any type and style of static control. The basic syntax is:
<programlisting>
<![CDATA[
>>--createStatic(--+----+--,-x-,-y-,-cx-,-cy--+----------+--+---------+--)-----><
+-id-+ +-,-style--+ +-,-text--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createStatic() [UserDialog method] -->
<section id="tmthCreateStaticImage" xreflabel="createStaticImage"><title>createStaticImage (UserDialog method)</title>
<para>
The <xref linkend="mthCreateStaticImage"/> method creates a static control that displays images
in the dialog template. The basic syntax is:
<programlisting>
<![CDATA[
>>--createStaticImage(--id--,-x--,-y--,-cx--,-cy--+----------+--)--------------><
+-,-style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createStaticImage() [UserDialog method] -->
<section id="tmthCreateStaticText" xreflabel="createStaticText"><title>createStaticText (UserDialog method)</title>
<para>
The <xref linkend="mthCreateStaticText"/> method creates a static text control in the dialog
template. The basic syntax is:
<programlisting>
<![CDATA[
>>-createStaticText(-+------+--x-,--y-+------+-+------+-+----------+-+--------+-)-><
+-id-,-+ +-,-cx-+ +-,-cy-+ +-,-style--+ +-,-text-+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createStaticText() [UserDialog method] -->
<section id="tmthCreateWhiteFrame" xreflabel="createWhiteFrame"><title>createWhiteFrame (UserDialog method)</title>
<para>
The <xref linkend="mthCreateWhiteFrame"/> method creates a white <link linkend="figFramesRects">frame</link> static control
in the dialog template. The frame is drawn with the current window background color, which is white in the default color
scheme. This is the basic syntax:
<programlisting>
<![CDATA[
>>--createWhiteFrame(--+------+--x-,-y-,-cx-,-cy--+-----------+-)--------------><
+--id--+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createWhiteFrame() [UserDialog method] -->
<section id="tmthCreateWhiteRect" xreflabel="createWhiteRect"><title>createWhiteRect (UserDialog method)</title>
<para>
The <xref linkend="mthCreateWhiteRect"/> method creates a white <link linkend="figFramesRects">rectangle</link> static
control in the dialog template. The rectangle is filled with the current window background color, which is white in the
default color scheme. The basic syntax is:
<programlisting>
<![CDATA[
>>--createWhiteRect(--+------+--x-,-y-,-cx-,-cy--+-----------+-)---------------><
+--id--+ +-,--style--+
]]>
</programlisting>
</para>
</section> <!-- End UserDialog::createWhiteRect() [UserDialog method] -->
<section id="tmthConnectStaticEvent" xreflabel="connectStaticEvent"><title>connectStaticEvent (dialog object method)</title>
<para>
To connect event notifications from an static control use the <xref linkend="mthConnectStaticEvent"/>() method of the
<xref linkend="chpDialogObject"/> object. The basic syntax is:
<programlisting> <![CDATA[
>>--connectStaticEvent(--id--,--event--+----------------+--)-------------------><
+--,-methodName--+
]]>
</programlisting>
</para>
</section> <!-- End connectStaticEvent() [EventNotification method] -->
<section id="tmthNewStatic" xreflabel="newStatic"><title>newStatic (dialog object method)</title>
<para>
Static objects can not be instantiated by the programmer from Rexx code. Rather an Static object is obtained
by using the <xref linkend="mthNewStatic"/> method of the <xref linkend="chpDialogObject"/> object. The syntax is:
<programlisting>
<![CDATA[
>>--newStatic(--id--)----------------------------><
]]>
</programlisting>
</para>
</section> <!-- End newStatic() [PlainBaseDialog method] -->
<section id="mthGetIcon" xreflabel="getIcon"><title>getIcon</title>
<indexterm><primary>getIcon</primary></indexterm>
<indexterm><primary>Static class</primary><secondary>getIcon</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getIcon--------------------------------------><
]]>
</programlisting>
<para>
Gets the static control's icon image, if there is one. Only the image type of static control can have
an icon.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>
This method takes no arguments.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
The current icon<xref linkend="clsImage"/> object for the control, if there is one. If the control does
not have an icon set, then .nil is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Programmers should manage the image objects as they think best. See the <xref linkend="clsImage"/>
documentation for a discussion of this. The static control does not make a copy of the icon, nor does it release an
icon.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example determines if the icon image for the static control has been set. If not, the image is loaded and set.
<programlisting>
<![CDATA[
staticControl = self~newStatic(IDC_ST_ICON)
icon = staticControl~getIcon
if icon == .nil then do
size = .Size~new(48, 48)
icon = .Image~getImage("appIcon", .Image~toID(IMAGE_ICON), size)
staticControl~setIcon(icon)
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Static::getIcon() -->
<section id="mthGetImageClsStaticControl" xreflabel="getImage"><title>getImage</title>
<indexterm><primary>getImage</primary><secondary>Static class</secondary></indexterm>
<indexterm><primary>Static class</primary><secondary>getImage</secondary></indexterm>
<programlisting>
<![CDATA[
>>--getImage(--+--------+--)---------------------><
+--type--+
]]>
</programlisting>
<para>
Returns the static control's image, if there is one. Only the image type static control will have an
image.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The only argument is:
<variablelist>
<varlistentry><term>type [optional]</term>
<listitem>
<para>
Specifies the type of the image: bitmap, icon, cursor, or enhanced metafile. You can use the <xref linkend="clsImage"/>
<xref linkend="mthToIDClsImage"/> to get the correct numeric value for one of the following symbols:
</para>
<simplelist type='horiz' columns='2'>
<member>IMAGE_BITMAP</member> <member>IMAGE_ICON</member>
<member>IMAGE_CURSOR</member> <member>IMAGE_ENHMETAFILE</member>
</simplelist>
<para>
The default is IMAGE_BITMAP.
</para>
<para>
The programmer does not have to use .Image~toID() to get the numeric value for type. The correct number itself
can be used. In general, symbolic IDs are used to make code more readable and less prone to error. However,
since the value of IMAGE_CURSOR is 2, for example, the programmer could use 2 directly for the type argument.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns the <xref linkend="clsImage"/> object for the control, if there is one. If no image
has been set, then .nil is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Programmers should manage the image objects as they think best. See the <xref linkend="clsImage"/>
documentation for a discussion of this. The static control does not make a copy of the image, nor does it release
an image.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
This example gets the image from a static control and releases the image.
<programlisting>
<![CDATA[
::method onExit
expose staticPicture
image = staticPicture~getImage(.Image~toID(IMAGE_CURSOR))
if \ image~isNull then image~release
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Static::getImage() -->
<section id="mthSetIcon" xreflabel="setIcon"><title>setIcon</title>
<indexterm><primary>setIcon</primary></indexterm>
<indexterm><primary>Static class</primary><secondary>setIcon</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setIcon(--newImage--)------------------------><
]]>
</programlisting>
<para>
Sets or removes the icon image for this static control. This method only effects the image type static control. For
instance an icon can not be set for a frame or rectangle.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The single argument is:
<variablelist>
<varlistentry><term>newImage [required]</term>
<listitem>
<para>
An<xref linkend="clsImage"/> object that represents the image for the control, or .nil to remove an
existing image. The image object must be an icon image.
</para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns the existing image object, if there is one. Otherwise .nil is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
The programmer should manage the image objects as he thinks best. See the <xref linkend="clsImage"/>
documentation for a discussion of this. The static control does not make a copy of the icon, nor does it release an
icon image.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
<programlisting>
<![CDATA[
icon = .Image~getImage(.Image~toID(IDI_QUESTION), .Image~toID(IMAGE_ICON))
if \ icon~isNull then do
oldIcon = iconControl~setIcon(icon)
...
end
else do
-- handle error
...
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Static::setIcon() -->
<section id="mthSetImageClsStaticControl" xreflabel="setImage"><title>setImage</title>
<indexterm><primary>setImage</primary><secondary>Static class</secondary></indexterm>
<indexterm><primary>Static class</primary><secondary>setImage</secondary></indexterm>
<programlisting>
<![CDATA[
>>--setImage(--imageObject--)--------------------><
]]>
</programlisting>
<para>
Sets or removes the image for the static control. An image can only be set with the image type static
control.
</para>
<variablelist>
<varlistentry><term><emphasis role="bold">Arguments:</emphasis></term>
<listitem>
<para>The arguments are:
<variablelist>
<varlistentry><term>imageObject [required]</term>
<listitem>
<para>
An<xref linkend="clsImage"/> object that represents the image for the control, or .nil to remove an
existing image. The image object can be any image type, including an icon image.
</para> </listitem></varlistentry>
</variablelist> </para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Return value:</emphasis></term>
<listitem>
<para>
This method returns the existing image object, if there is one. Otherwise .nil is returned.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Details:</emphasis></term>
<listitem>
<para>
Raises syntax errors when incorrect arguments are detected.
</para>
<para>
Programmers should manage the image objects as they think best. See the
<xref linkend="clsImage"/> documentation for a discussion of this. The static control does
not make a copy of the image, nor does it release an image.
</para>
</listitem></varlistentry>
<varlistentry><term><emphasis role="bold">Example:</emphasis></term>
<listitem>
<para>
<programlisting>
<![CDATA[
image = .Image~getImage("Camera.bmp", .Image~toID(IMAGE_BITMAP))
if \ image~isNull then do
oldImage = staticControl~setImage(image)
if oldImage \== .nil then oldImage~release
...
end
else do
-- handle error
...
end
]]>
</programlisting>
</para>
</listitem></varlistentry>
</variablelist>
</section> <!-- End Static::setImage() -->
</chapter> <!-- End Static class -->