InfoBox.st
author Claus Gittinger <cg@exept.de>
Wed, 18 Dec 2019 19:08:06 +0100
changeset 6768 c9329ef316b5
parent 6741 e10ca4712018
child 6837 0247bc167e3a
permissions -rw-r--r--
regenerated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6741
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
     1
"{ Encoding: utf8 }"
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
     2
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     3
"
5
claus
parents: 3
diff changeset
     4
 COPYRIGHT (c) 1989 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
     5
	      All Rights Reserved
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     6
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    12
 hereby transferred.
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    13
"
2362
f6ace7307e4d examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
    14
"{ Package: 'stx:libwidg' }"
f6ace7307e4d examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
    15
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
    16
"{ NameSpace: Smalltalk }"
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
    17
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
    18
DialogBox subclass:#InfoBox
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
    19
	instanceVariableNames:'formAndLabelPanel formLabel textLabel'
355
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    20
	classVariableNames:'InfoBitmap'
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    21
	poolDictionaries:''
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    22
	category:'Views-DialogBoxes'
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    23
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    24
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
    25
!InfoBox class methodsFor:'documentation'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
    26
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    27
copyright
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    28
"
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    29
 COPYRIGHT (c) 1989 by Claus Gittinger
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    30
	      All Rights Reserved
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    31
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    32
 This software is furnished under a license and may be used
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    33
 only in accordance with the terms of that license and with the
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    35
 be provided or otherwise made available to, or used by, any
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    36
 other person.  No title to or ownership of the software is
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    37
 hereby transferred.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    38
"
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    39
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
    40
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
    41
!
8
82e87dc3540e *** empty log message ***
claus
parents: 7
diff changeset
    42
82e87dc3540e *** empty log message ***
claus
parents: 7
diff changeset
    43
documentation
82e87dc3540e *** empty log message ***
claus
parents: 7
diff changeset
    44
"
355
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    45
   Historic note:
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    46
        originally, ST/X had separate classes for the various entry methods;
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    47
        there were YesNoBox, EnterBox, InfoBox and so on.
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    48
        In the meantime, the DialogBox class (and therefore its alias: Dialog)
5897
2557ab3713e8 #OTHER by mawalch
mawalch
parents: 5402
diff changeset
    49
        is going to duplicate most functionality found in these classes.
355
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    50
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    51
        In the future, those existing subclasses' functionality is going to
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    52
        be moved fully into Dialog, and the subclasses will be replaced by dummy
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    53
        delegators. (They will be kept for backward compatibility, though).
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    54
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    55
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    56
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
    57
    this class implements a pop-up box to show an information message.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
    58
    It has a single ok-Button, which closes the box.
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
    59
    Also entering return has (by default) the same effect as pressing
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
    60
    the ok-button.
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    61
    InfoBox is a superclass of some other boxes - see WarningBox, YesNoBox etc.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    62
    most of them simply redefine the icon shown in the upper left or
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    63
    add buttons.
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    64
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
    65
    [instance variables:]
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    66
355
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    67
        formLabel        <Label>        shows a bitmap (warning, question-mark)
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    68
355
a55f62047156 commentary
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    69
        textLabel        <Label>        shows the boxes text
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    70
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
    71
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
    72
    [author:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
    73
        Claus Gittinger
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
    74
"
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
    75
!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
    76
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
    77
examples
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
    78
"
2469
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    79
    Notice, the preferred use is via the DialogBox class messages,
5897
2557ab3713e8 #OTHER by mawalch
mawalch
parents: 5402
diff changeset
    80
    such as
2469
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    81
                                                                        [exBegin]
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    82
        Dialog information:'Time to go home'
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    83
                                                                        [exEnd]
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    84
    these (DialogBox) mesages are compatible with VW and should therefore
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    85
    be used for portability.
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    86
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    87
    Direct use of InfoBox is only required for highly specialized boxes.
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    88
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    89
da097548025a documentation
Claus Gittinger <cg@exept.de>
parents: 2362
diff changeset
    90
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    91
    InfoBoxes are created with:
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    92
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
    93
        aBox := InfoBox title:'some title'.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
    94
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
    95
    and shown with:
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
    96
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
    97
        aBox showAtPointer
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
    98
    or
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
    99
        aBox open
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   100
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   101
    The default box shows 'yes' in its button; this can be changed with:
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   102
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   103
        aBox okText:'some string'.
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   104
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   105
    the boxes bitmap-image can be changed with:
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   106
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   107
        aBox image:aForm
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   108
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   109
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   110
    Since this type of information is pretty common, a convenient information
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   111
    method has been added to Object.
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   112
    Thus, you can use:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   113
                                                                        [exBegin]
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   114
        self information:'hello world'
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   115
                                                                        [exEnd]
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   116
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   117
    everwhere in your program.
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   118
    for ST-80 compatibility, you can also use:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   119
                                                                        [exBegin]
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   120
        Dialog information:'hello world'
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   121
                                                                        [exEnd]
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   122
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   123
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   124
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   125
    standard box:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   126
                                                                        [exBegin]
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   127
        |box|
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   128
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   129
        box := InfoBox title:'hello world '.
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   130
        box open
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   131
                                                                        [exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   132
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   133
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   134
    changing the buttons label:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   135
                                                                        [exBegin]
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   136
        |box|
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   137
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   138
        box := InfoBox title:'hello world '.
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   139
        box okText:'wow'.
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   140
        box open
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   141
                                                                        [exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   142
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   143
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   144
    changing the icon:
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   145
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   146
                                                                        [exBegin]
2362
f6ace7307e4d examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
   147
        |box|
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   148
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   149
        box := InfoBox title:'hello world '.
2969
eb87f1aedd6c Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents: 2802
diff changeset
   150
        box image:(Image fromFile:'libtool/bitmaps/SBrowser.xbm' inPackage:'stx:libtool').
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   151
        box okText:'wow'.
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   152
        box open
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   153
                                                                        [exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   154
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   155
    or even:
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   156
                                                                        [exBegin]
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   157
        |box|
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   158
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   159
        box := InfoBox title:'hello garfield '.
2362
f6ace7307e4d examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
   160
        box image:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') magnifiedTo:200@100).
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   161
        box okText:'wow'.
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   162
        box open
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   163
                                                                        [exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   164
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   165
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   166
    If you plan to use boxes as in the last example, you may want to
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   167
    keep the box around for reuse (since the image magnification takes some time).
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   168
                                                                        [exBegin]
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   169
        |box|
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   170
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   171
        box := InfoBox title:'hello garfield '.
2362
f6ace7307e4d examples fixed (bitmaps access)
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
   172
        box image:((Image fromFile:'garfield.gif' inPackage:'stx:goodies/bitmaps/gifImages') magnifiedTo:200@100).
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   173
        box okText:'wow'.
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   174
        box open.
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   175
370
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   176
        box title:'hello again'.
dc5b51904d3f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 367
diff changeset
   177
        box open
593
86dd024ed773 examples
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   178
                                                                        [exEnd]
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   179
63
f4eaf04d1eaf *** empty log message ***
claus
parents: 60
diff changeset
   180
"
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   181
! !
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   182
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   183
!InfoBox class methodsFor:'instance creation'!
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   184
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   185
title:titleString
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   186
    "create a new infoBox with title, aTitleString"
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   187
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   188
    ^ (self new) title:titleString
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   189
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   190
    "
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   191
     (InfoBox title:'hello') open
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   192
    "
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   193
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   194
    "Modified: / 22-12-2010 / 19:30:50 / cg"
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   195
!
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   196
5897
2557ab3713e8 #OTHER by mawalch
mawalch
parents: 5402
diff changeset
   197
title:titleString label:labelString
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   198
    "create a new infoBox with label, labelString"
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   199
5897
2557ab3713e8 #OTHER by mawalch
mawalch
parents: 5402
diff changeset
   200
    ^ (self new) title:titleString label:labelString
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   201
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   202
    "
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   203
     (InfoBox title:'hello' label:'Attention' ) open
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   204
    "
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   205
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   206
    "Created: / 22-12-2010 / 19:31:03 / cg"
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   207
! !
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   208
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   209
!InfoBox class methodsFor:'defaults'!
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   210
574
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   211
defaultLabel
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   212
    "return the boxes default window title."
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   213
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   214
    ^ 'Info'
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   215
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   216
    "Created: 23.4.1996 / 17:12:33 / cg"
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   217
!
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   218
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   219
iconBitmap
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   220
    "return the bitmap shown as icon in my instances.
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   221
     This is the default image; you can overwrite this in a concrete
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   222
     instance with the #image: message"
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   223
1365
aa6a855b5013 new resource naming
Claus Gittinger <cg@exept.de>
parents: 1172
diff changeset
   224
    <resource: #style (#'infoBox.icon' #'infoBox.iconFile')>
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   225
2786
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   226
    InfoBitmap isNil ifTrue:[
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   227
        InfoBitmap := self iconBitmapFromStyle:'infoBox.icon' orStyleFile:'infoBox.iconFile' orFilename:'bitmaps/Information.xbm'.
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   228
    ].
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   229
    ^ InfoBitmap
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   230
6242
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   231
    "
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   232
     InfoBitmap := self iconWithAlpha
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   233
    "
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   234
2786
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   235
    "Modified: / 26.10.1997 / 17:02:51 / cg"
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   236
!
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   237
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   238
iconBitmapFromStyle:styleName orStyleFile:styleFile orFilename:fileName
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   239
    "return the bitmap shown as icon in my instances.
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   240
     This is the default image; you can overwrite this in a concrete
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   241
     instance with the #image: message"
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   242
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   243
    |img imgFileName|
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   244
2786
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   245
    img := self styleSheet at:styleName.
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   246
    img isNil ifTrue:[
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   247
        imgFileName := StyleSheet at:styleFile default:fileName.
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   248
        img := Smalltalk imageFromFileNamed:imgFileName forClass:self.
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   249
    ].
2786
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   250
    img notNil ifTrue:[
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   251
        img := img onDevice:Display
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   252
    ].
06de7ca4b263 code shared
Claus Gittinger <cg@exept.de>
parents: 2785
diff changeset
   253
    ^ img
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   254
1365
aa6a855b5013 new resource naming
Claus Gittinger <cg@exept.de>
parents: 1172
diff changeset
   255
    "Modified: / 26.10.1997 / 17:02:51 / cg"
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   256
! !
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   257
6242
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   258
!InfoBox class methodsFor:'image specs'!
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   259
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   260
iconWithAlpha
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   261
    "This resource specification was automatically generated
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   262
     by the ImageEditor of ST/X."
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   263
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   264
    "Do not manually edit this!! If it is corrupted,
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   265
     the ImageEditor may not be able to read the specification."
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   266
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   267
    "
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   268
     self iconWithAlpha inspect
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   269
     ImageEditor openOnClass:self andSelector:#iconWithAlpha
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   270
     Icon flushCachedIcons
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   271
    "
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   272
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   273
    <resource: #image>
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   274
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   275
    ^Icon
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   276
        constantNamed:'WarningBox class iconWithAlpha'
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   277
        ifAbsentPut:[(Depth32Image width:32 height:32 photometric:(#rgba)) bitsPerSample:(#[8 8 8 8]); bits:(ByteArray fromPackedString:'
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   278
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M?_8O?_8NC?8NC ?>C 8O? 8NC?8NC ?>C 8O? 8NC?8NC ?=? 8O?@0LC?7=?@?0@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   279
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@0LC@?<C_7???????????????????????
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   280
????????????????????????????????????????????????(K>??=?_0O<@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   281
@@@@@@@@8NC ?>C 8O??????????????????????????????????????/<C@?:B /????????????????????????????????????????????:B?0O<@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   282
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M?_8O? 8NC???? ?????????????????????????????????3=__?<@@C??@@@??0@_
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   283
W????????????????????????????????????????????;?@7?>?0K??@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C_7>C?8NC ?>C 8O??????
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   284
???????????????????????????@7=??@@A@?0@_ O<@G8C?@@A ?7>@/?????????????????????????????????? 8O???????<C_8O> /;??@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   285
@@@@@@@@@@@@@@@@@@@@@@@@7=? ?>C 8O? 8NC??????????????????????????????????????>C ??<@@FC?@BB_?4B@7?<@HJC?'':C_????????????
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   286
8O???????????????????>C???? 8O??8O???:C@7?>?/;??@@@@@@@@@@@@@@@@@@@@@M?_7??_7=??8NC ?>C?????????????????????????????????
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   287
?????????????8B_0O<_PJC?W8C ?6B@0O???????????>C???? ????8O???>C??????????????>C????_8O??8O???7>_(O?@0K>@@@@@@@@@@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   288
0M?_?=?_8O? 8O????????????????????????????????????????????????????????????????????????????? ????8O???>C???? ????8O???>C?
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   289
?????????????=? ???_8O??0M? ?7=?''??_7<B@@@@@@M?_7??_7=??7>C ?>C?????????8O???>C???? ????8O???>C?????????????????????????
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   290
??????????? ????8O???>C???? ????8O???>C???? ????8NC??=??????????8O???=? ??? ????W7>_?9> (H@@@@@@/<C_?=?_7??_8NC?????????
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   291
??? ????8O???>C???? ????8O???>C???=  JC?G3= ?2A@ O<?PHC?G3= ?0@_PO>@'';???????>C???? ????7>C??=? ???_8O??7>C??>C???? ????
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   292
7>C??=? ??> 0NC?XFB@?=?_0HB?0LC?0M?_?=? ??? ????8O???>C???? ????8O???>C???? ????8O???8B_0O<@HHC?@@A??0@_ O<@HHC?@@A ?7>_
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   293
0O??????7????=? ???_8O??7>C??=? ???_8O??7>C??>C????_8O??0M? ?;?_8O<?PFC?(K>? K?@0O?@0M??7>C??>C???? ????8O???>C???? ????
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   294
8NC??>C???? ??????????????<_PI??@BB_?0@?''?<@G8C?_9?@???????_8O??7>C??=? ???_8O??7>C??=? ???_8O??7????<C ??>?7>C?/=? ?1<?
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   295
W?>_''9>@/<C@?;?@7??_8O??8O???>C???? ????7>C??=? ???_8O??7>C??=? ??? ?????????4A (O<@G8C?@C>_?0@_ O=?''<C?8O???=? ???_8O??
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   296
7>C??=? ???_8O??7>C??=? ???_8O??0NC??;?@8O>?7>C?G2A_?8B_''8B?0LC?/<C_?=? ??? ????7????=? ???_8O??7>C??=? ???_8O??7>C??=??
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   297
??? ????PFB_?0@_ O<@O9??@A>@?7>_0O? ????7>C??<C ???_8O??7>C??<C ???@8O??0NC??=? ???@8O??/<C ?;?@8O<_HE?? I>_ JB?0O>?0M??
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   298
0M? ?=?????_8O??7>C??=? ???_8O??7>C??=? ???_8O??7>C??>C???=@XI??@A>@?0@?''?<@G8C?_9?@?>C????_8O??0NC??<C ???@8O??0NC??<C 
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   299
???@8O??0NC??<C_??>?0NC?(LC ?1< W?>@''9>@(K?@?;>?0O>?7>C?7>C??=? ???_8O??7>C??=? ???_8O??7>C??=? ???_8O??8O???4A ''?<@G8C?
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   300
@C>_?0@_ O=?''<C?8O???<C ???@8O??0NC??<C ???@8O??0NC??<C ???@8O??/<C ?;?@7?>_/=??G2A_?8B_''8B?/<C?(K?@?;?@7??@7???7>C??=? 
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   301
???@8O??7>C??<C ???@8O??0NC??=? ???_????PFB_?0@_ O<@O9??@A>@?7>_0O?_????0NC??<C ???@8O??0NC??<C ???@8O??0NC??;?_??> 0NC?
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   302
(LC_?5= ''?<_HE??''9>  M?_0HB 0M??(K?@?;?@7??@8O??7>C??<C ???@8O??0NC??<C ???@8O??0NC??=????<?XI??@A>@?0@?''?<@G8C?_9?@?=??
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   303
???@8O??0NC??<C ???@8O??0NC??<C ??>?7???(LC ?:B?7?>_/=??HC= ?3=@XO>?/;>@@@@@@I> /?> /<C?(K?@?;?@8O?@8O??0NC??<C ???@8O??
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   304
0NC??<C ???@8O??7????4A ''?<@G8C?@BB_?0@__?=  LC?8O???<C ???@8O??/=???;?_??>?8O??/=???:C@8O>_/=??'';?_?5=?(O<@G4C?XG>@?=?_
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   305
0H@@@@@@7=?@ HB /?>_/<C?(K?@?;?@8O?@7???0NC??<C ???@8O??0NC??<C ??>?7???G3>@?0@ ''?<@O:C?@C>_?1=@ O>?7???0NC??;?_??>?8O??
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   306
/=???;?_??> 0NC?'';?_?9>?0O=?''<C?@BA_?2@?XO>_(JB@7=?@@@@@@@@@@@@@(K>??8B 0O>_(LC?'';?@?:C@8O>?7???0NC??<C ???_????_9?@?0@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   307
XO<@HI??G5>??2A_0O< W<C?G4B??0@? O>@(M??0NC??;?_??> 7???(LC ?9>?7?>_/<C?_:C@?2@?XO<_HE??_7>@ M?_0H@@@@@@@@@@@@@@@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   308
'':B??7>_/?>_/<C?'';?@?9>?7?> 0NC?/=???;? ??>?7???''<C??;?_??> 7???(LC??:C@??>?8O??(M???:C@??>?7???(LC ?9>?7?>_/<C?'';?@?6B_
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   309
/?< PG??G2A@?5= _8B?/;>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@''9> ?6B@(O>@(LC?'':C@?9> 0O>_/=??'';?_?:C@8O>?7???/=???;?_??>?8O??
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   310
0NC??;? ??>?7???''<C ?9>?7?>@(LC? JC@?8B 0O=__:C?G2A_?1< PO=_XG??/;>? @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@(JB ?5= 
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   311
 O=  K?? JB??8B 0O>@(LC? JC@?8B 0O>@(LC?'';?_?9?@8O> 7???(LC??9>?7?>_(LC? JC@?8B 0O=  K??HDA??0@ PO< O5??XG>@ K>?/8@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   312
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@0LB? G>@''8A@XHC?O5>@?5=?(O=?'';??_9>??7>_/?>@(LC? JC@?9?@8O>_0NC? JC_?6B_
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   313
/?<?XHC?HDA??0@_PO< O5??W5=? I>_(HC@0LB@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@7=?@ K>?/8A? I>@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   314
W6A??4A__?< O6C?O4A??7>_/?>@(LC?''<C ?:C@??>@(LC?G3= ?1< PO<?PFC?W6A??8B_''8C@0K>@8M?_@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   315
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M?_0HC_7<B@7=?@ K>?/8A@PFC?O5=??8B?7?>_/>C?(M???7> 7?< O5??XG>@?:B?/8C@0LB@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   316
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@LC@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   317
0H@?PFC?XI>??9>?8O> 0O??_:C_?2@?XO>_(JB@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   318
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@K>?/8@ O6C?W8B??:C@??= (M??HC=_?9>_(H@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   319
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@K?@/8A@W7??
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   320
_:C_?7> 7?<_O6C?''9>  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   321
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@M?_0HA _8C?O6B_?2A@XO>_'':B@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   322
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@B (JB@ HB_ K>?
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   323
/0@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a'); yourself]
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   324
! !
ca40c9a97367 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 6079
diff changeset
   325
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   326
!InfoBox class methodsFor:'styles'!
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   327
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   328
updateStyleCache
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   329
    "extract values from the styleSheet and cache them in class variables.
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   330
     Here, the cached infoBitmap is simply flushed."
440
2beb33cb0146 added style resource directive
Claus Gittinger <cg@exept.de>
parents: 370
diff changeset
   331
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   332
    InfoBitmap := nil
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   333
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   334
    "Modified: 1.4.1997 / 14:44:50 / cg"
59
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   335
! !
450ce95a72a4 *** empty log message ***
claus
parents: 38
diff changeset
   336
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   337
!InfoBox methodsFor:'accessing'!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   338
184
cbc75a3ba885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 180
diff changeset
   339
form:aFormOrImage
cbc75a3ba885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 180
diff changeset
   340
    "historical leftover - define a form to be displayed left of the title"
cbc75a3ba885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 180
diff changeset
   341
2969
eb87f1aedd6c Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents: 2802
diff changeset
   342
    <resource:#obsolete>
eb87f1aedd6c Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents: 2802
diff changeset
   343
184
cbc75a3ba885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 180
diff changeset
   344
    self image:aFormOrImage
cbc75a3ba885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 180
diff changeset
   345
!
cbc75a3ba885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 180
diff changeset
   346
38
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   347
formLabel
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   348
    "return the formLabel = can be used to change its appearance"
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   349
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   350
    ^ formLabel
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   351
!
4b9b70b2cc87 2.10.3 pre-final version
claus
parents: 8
diff changeset
   352
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   353
image:aForm
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   354
    "define a form to be displayed left of the title
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   355
     - usually left as defaulted:
2969
eb87f1aedd6c Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents: 2802
diff changeset
   356
        an exclamation-mark here, warn-sign in warningBox,
eb87f1aedd6c Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents: 2802
diff changeset
   357
        others in other subclasses."
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   358
2969
eb87f1aedd6c Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents: 2802
diff changeset
   359
    formLabel label:aForm.
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   360
    formLabel forceResize.
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   361
    formAndLabelPanel forceResize.
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   362
    verticalPanel forceResize.
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   363
    shown ifTrue:[self resize]
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   364
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   365
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   366
textLabel
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   367
    "return the textLabel = can be used to change its appearance"
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   368
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   369
    ^ textLabel
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   370
!
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   371
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   372
title
6407
4e1d5a0fdce2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 6242
diff changeset
   373
    "return the boxes label string"
6408
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   374
    "sigh: the old name for the windowTitle was label here,
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   375
     and the contents was called title.
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   376
     Squeak expects label to access the title"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   377
6741
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
   378
    ^ textLabel label
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   379
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   380
    "Created: / 22-12-2010 / 19:27:43 / cg"
6408
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   381
    "Modified (comment): / 26-08-2018 / 18:11:29 / Claus Gittinger"
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   382
!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   383
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   384
title:aString
6741
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
   385
    "set the boxes label string"
6408
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   386
    "sigh: the old name for the windowTitle was label here,
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   387
     and the contents was called title.
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   388
     Squeak expects label to access the title"
60
f3c738c24ce6 mostly style
claus
parents: 59
diff changeset
   389
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   390
    aString ~= textLabel label ifTrue:[
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   391
        textLabel label:aString.
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   392
        textLabel forceResize.
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   393
        formAndLabelPanel forceResize.
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   394
        verticalPanel forceResize.
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   395
        shown ifTrue:[self resize]
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   396
    ]
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   397
6408
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   398
    "Created: / 26-08-2018 / 18:21:08 / Claus Gittinger"
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   399
!
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   400
6408
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   401
title:labelString label:windowTitleString
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   402
    "set the boxes label string"
6408
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   403
    "sigh: the old name for the windowTitle was label here,
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   404
     and the contents was called title.
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   405
     Squeak expects label to access the title"
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   406
6408
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   407
    self windowTitle:windowTitleString.
6407
4e1d5a0fdce2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 6242
diff changeset
   408
    self title:labelString.
4e1d5a0fdce2 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 6242
diff changeset
   409
6408
d351185a4ae3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 6407
diff changeset
   410
    "Modified: / 26-08-2018 / 18:25:47 / Claus Gittinger"
6741
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
   411
!
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
   412
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
   413
xxlabel
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
   414
    ^ textLabel label
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
   415
e10ca4712018 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 6634
diff changeset
   416
    "Created: / 26-08-2018 / 17:12:50 / Claus Gittinger"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   417
! !
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   418
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   419
!InfoBox methodsFor:'initialization'!
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   420
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   421
initFormBitmap
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   422
    "setup the bitmap shown in the upper left -
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   423
     extracted into a separate method for easier redefinition
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   424
     in subclasses"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   425
2969
eb87f1aedd6c Do not use obsolete methods with #form:
Stefan Vogel <sv@exept.de>
parents: 2802
diff changeset
   426
    formLabel label:(self class iconBitmap)
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   427
!
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   428
180
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   429
initFormLabel
570
4a82b61a1497 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
   430
    "setup the icon shown in the infoBox.
4a82b61a1497 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
   431
     Can be redefined in subclasses."
4a82b61a1497 commentary
Claus Gittinger <cg@exept.de>
parents: 440
diff changeset
   432
180
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   433
    |mm|
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   434
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   435
    mm := ViewSpacing.
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   436
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   437
    formLabel := Label in:formAndLabelPanel.
3866
7628105ef29f assign textLabel and textForm name when creating views
fm
parents: 3750
diff changeset
   438
    formLabel name: 'formLabel'.
180
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   439
    formLabel borderWidth:0.
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   440
"/    formLabel origin:(mm @ mm).
180
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   441
4385
bd433a8f6b4c refactored
Claus Gittinger <cg@exept.de>
parents: 4381
diff changeset
   442
    "Created: / 16-11-1995 / 18:32:32 / cg"
bd433a8f6b4c refactored
Claus Gittinger <cg@exept.de>
parents: 4381
diff changeset
   443
    "Modified: / 22-04-1996 / 18:15:37 / cg"
bd433a8f6b4c refactored
Claus Gittinger <cg@exept.de>
parents: 4381
diff changeset
   444
    "Modified (format): / 28-02-2012 / 18:20:23 / cg"
180
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   445
!
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   446
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   447
initialize
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   448
    |mm sep|
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   449
6079
0cda554f60c7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5897
diff changeset
   450
    <modifier: #super> "must be called if redefined"
0cda554f60c7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5897
diff changeset
   451
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   452
    super initialize.
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   453
    self addOkButton.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   454
574
165d1b2b7922 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   455
"/    label := 'Info'.
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   456
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   457
"/    mm := ViewSpacing.
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   458
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   459
    formAndLabelPanel := HorizontalPanelView in:self verticalPanel.
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   460
180
0eb12501889e hook to create different labelView in subclasses
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   461
    self initFormLabel.
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   462
    self initFormBitmap.
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   463
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   464
    formLabel width > 500 ifTrue:[
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   465
        textLabel := Label label:'Information' in:verticalPanel.
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   466
    ] ifFalse:[
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   467
        textLabel := Label label:'Information' in:formAndLabelPanel.
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   468
    ].
3866
7628105ef29f assign textLabel and textForm name when creating views
fm
parents: 3750
diff changeset
   469
    textLabel name: 'textLabel'.
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   470
    textLabel borderWidth:0.
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   471
    "/ textLabel origin:[(mm + formLabel widthIncludingBorder + mm) @ mm].
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   472
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   473
"/    yPosition := textLabel corner y.
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   474
"/    formLabel notNil ifTrue:[yPosition := yPosition max:(formLabel corner y)].
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   475
"/    yPosition := yPosition + ViewSpacing.
4295
0d8d95fc9f63 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 4207
diff changeset
   476
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   477
    (styleSheet at:'infoBoxSeparator' default:false) ifTrue:[
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   478
        sep := Separator in:self verticalPanel.
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   479
"/        sep origin:[0.0 @ ((formLabel bottom max:textLabel bottom) + mm)].
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   480
        sep width:1.0. "/ extent:(1.0 @ sep preferredHeight).
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   481
"/        yPosition := yPosition max:(sep corner y).
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   482
"/        yPosition := yPosition + ViewSpacing.
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   483
    ].
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   484
77
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   485
    "
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   486
     |b|
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   487
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   488
     b := InfoBox new.
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   489
     b title:'hello'.
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   490
     b open
565b052f5277 *** empty log message ***
claus
parents: 72
diff changeset
   491
    "
367
bc778f90e42d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 355
diff changeset
   492
6079
0cda554f60c7 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 5897
diff changeset
   493
    "Modified: / 08-02-2017 / 00:26:21 / cg"
0
e6a541c1c0eb Initial revision
claus
parents:
diff changeset
   494
! !
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   495
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   496
!InfoBox methodsFor:'queries'!
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   497
3121
8e4d21e008c9 beep control
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   498
beepWhenOpening
8e4d21e008c9 beep control
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   499
    ^ UserPreferences current beepForInfoDialog
8e4d21e008c9 beep control
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   500
8e4d21e008c9 beep control
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   501
    "
8e4d21e008c9 beep control
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   502
     Dialog information:'hello'
8e4d21e008c9 beep control
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   503
     Dialog warn:'hello'
8e4d21e008c9 beep control
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   504
     Dialog error:'hello'
8e4d21e008c9 beep control
Claus Gittinger <cg@exept.de>
parents: 2969
diff changeset
   505
    "
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   506
! !
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 184
diff changeset
   507
1172
d10e4627b0e3 allow either image or imageFileName to be specified
Claus Gittinger <cg@exept.de>
parents: 797
diff changeset
   508
!InfoBox class methodsFor:'documentation'!
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   509
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   510
version
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   511
    ^ '$Header$'
4207
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   512
!
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   513
281ffd00c1a8 #title:label:
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
   514
version_CVS
5402
36164fbcd8dc class: InfoBox
Claus Gittinger <cg@exept.de>
parents: 4863
diff changeset
   515
    ^ '$Header$'
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   516
! !
4863
12c87ee0e767 Replace references to Diplay with "Screen current" - where appropriate
Stefan Vogel <sv@exept.de>
parents: 4385
diff changeset
   517