ModalBox.st
author Claus Gittinger <cg@exept.de>
Mon, 13 Feb 2017 20:47:37 +0100
changeset 7891 8cc23e3f937f
parent 7848 bccc2879a64e
child 7981 d3b4f232af3b
permissions -rw-r--r--
#OTHER by cg comment/format
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     1
"
6
7ee0cfde237d *** empty log message ***
claus
parents: 5
diff changeset
     2
 COPYRIGHT (c) 1990 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
     3
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     4
48194c26a46c Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
48194c26a46c Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
48194c26a46c Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
48194c26a46c Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
48194c26a46c Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
48194c26a46c Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
48194c26a46c Initial revision
claus
parents:
diff changeset
    11
"
3266
4db6dd90cc17 category change
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
    12
"{ Package: 'stx:libview' }"
4db6dd90cc17 category change
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
    13
6777
8527109b401d class: ModalBox
Claus Gittinger <cg@exept.de>
parents: 6269
diff changeset
    14
"{ NameSpace: Smalltalk }"
8527109b401d class: ModalBox
Claus Gittinger <cg@exept.de>
parents: 6269
diff changeset
    15
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    16
StandardSystemView subclass:#ModalBox
1221
7ae7d7a901de added escapeIsCancel flag (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
    17
	instanceVariableNames:'shadowView exclusiveKeyboard escapeIsCancel'
1865
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
    18
	classVariableNames:'UseTransientViews DefaultExtent'
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    19
	poolDictionaries:''
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
    20
	category:'Views-Basic'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    21
!
48194c26a46c Initial revision
claus
parents:
diff changeset
    22
1232
8106eef0084c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
    23
!ModalBox class methodsFor:'documentation'!
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    24
46
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    25
copyright
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    26
"
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    27
 COPYRIGHT (c) 1990 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
    28
	      All Rights Reserved
46
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    29
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    30
 This software is furnished under a license and may be used
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    31
 only in accordance with the terms of that license and with the
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    33
 be provided or otherwise made available to, or used by, any
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    34
 other person.  No title to or ownership of the software is
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    35
 hereby transferred.
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    36
"
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    37
!
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    38
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    39
documentation
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    40
"
46
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
    41
    this class implements modal boxes; ModalBoxes are different from
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
    42
    others, in that they take control over the current topview, until
81
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
    43
    all processing is done (i.e. the currently active topview and all of
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
    44
    its subviews will not handle user events while the box is active).
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    45
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    46
    ModalBoxes are either implemented as transient windows
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    47
    (if UseTransientViews := true) or as override redirect views.
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    48
    Some window managers have problems with either; so you may want to
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    49
    change the default setting from your display.rc file.
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
    50
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
    51
    [see also:]
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
    52
	StandardSystemView
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
    53
	DialogBox
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
    54
	( introduction to view programming :html: programming/viewintro.html )
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
    55
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 596
diff changeset
    56
    [author:]
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
    57
	Claus Gittinger
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    58
"
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    59
! !
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    60
1232
8106eef0084c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
    61
!ModalBox class methodsFor:'initialization'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    62
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    63
initialize
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    64
    UseTransientViews := true.
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
    65
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
    66
    "
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
    67
     UseTransientViews := false
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
    68
    "
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
    69
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
    70
    "Modified: 24.7.1997 / 15:18:59 / cg"
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    71
! !
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    72
1232
8106eef0084c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
    73
!ModalBox class methodsFor:'defaults'!
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    74
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    75
defaultExtent
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    76
    "this defines the defaultExtent for instances of me;
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    77
     the value returned here is usually not correct for concrete subclasses,
587
c0fb8bc13596 commentary
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
    78
     so you better redefine this method.
c0fb8bc13596 commentary
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
    79
     The value returned here is usually ignored, and
c0fb8bc13596 commentary
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
    80
     the value from preferredExtent taken instead."
c0fb8bc13596 commentary
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
    81
1865
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
    82
    DefaultExtent notNil ifTrue:[
2193
8ef9d174d111 default extent a bit bigger.
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    83
	^ DefaultExtent
1865
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
    84
    ].
2193
8ef9d174d111 default extent a bit bigger.
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    85
    ^ (Screen current pixelPerMillimeter * (60 @ 20)) rounded
587
c0fb8bc13596 commentary
Claus Gittinger <cg@exept.de>
parents: 514
diff changeset
    86
2193
8ef9d174d111 default extent a bit bigger.
Claus Gittinger <cg@exept.de>
parents: 1970
diff changeset
    87
    "Modified: / 27.7.1998 / 20:15:15 / cg"
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    88
!
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
    89
596
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    90
defaultLabel
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    91
    "return the boxes default window title."
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    92
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    93
    ^ 'PopUp'
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    94
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    95
    "Created: 23.4.1996 / 17:14:21 / cg"
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    96
!
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
    97
1865
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
    98
updateStyleCache
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
    99
    "extract values from the styleSheet and cache them in class variables"
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   100
1931
27aa9e5b15dd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   101
    <resource: #style (#'modalBox.defaultExtent')>
1865
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   102
1931
27aa9e5b15dd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   103
    DefaultExtent := StyleSheet at:'modalBox.defaultExtent' default:nil.
1865
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   104
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   105
    "
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   106
     self updateStyleCache
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   107
    "
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   108
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   109
    "Modified: 31.8.1995 / 03:01:14 / claus"
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   110
    "Created: 15.8.1997 / 01:40:53 / cg"
1931
27aa9e5b15dd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1915
diff changeset
   111
    "Modified: 20.10.1997 / 15:07:37 / cg"
1865
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   112
!
43c2eaba229d allow default topViews extends to be overwritten by styleSheet
Claus Gittinger <cg@exept.de>
parents: 1826
diff changeset
   113
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   114
useTransientViews:aBoolean
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   115
    "change the way modalBoxes are created on the Display.
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   116
     If the argument is true, transient views are used;
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   117
     otherwise override redirect views are used.
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   118
     Depending on your windowmanager, either one may have problems.
959
a47e44337899 modalBoxes from non-windowGroup processes (background process)
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   119
     You may want to change the setting
1397
932c517ad29c moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   120
     from your display.rc or d_xxx.rc file.
932c517ad29c moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   121
     This is now obsolete - transient views work and are always used."
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   122
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   123
    UseTransientViews := aBoolean.
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   124
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   125
    "
144
claus
parents: 141
diff changeset
   126
     ModalBox useTransientViews:false
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   127
     ModalBox useTransientViews:true
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   128
    "
959
a47e44337899 modalBoxes from non-windowGroup processes (background process)
Claus Gittinger <cg@exept.de>
parents: 953
diff changeset
   129
1397
932c517ad29c moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   130
    "Modified: 28.2.1997 / 22:27:46 / cg"
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
   131
! !
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   132
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   133
!ModalBox methodsFor:'accessing'!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   134
3460
d60f9cd59bdb optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 3440
diff changeset
   135
escapeIsCancel
d60f9cd59bdb optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 3440
diff changeset
   136
    "return the escapeIsCancel setting - defaults to true for modalMox here."
d60f9cd59bdb optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 3440
diff changeset
   137
d60f9cd59bdb optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 3440
diff changeset
   138
    ^ escapeIsCancel
d60f9cd59bdb optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 3440
diff changeset
   139
!
d60f9cd59bdb optionBox: cancel-value corrected
Claus Gittinger <cg@exept.de>
parents: 3440
diff changeset
   140
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   141
exclusiveKeyboard:aBoolean
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   142
    "set/clear exclusive locking of the keyboard;
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   143
     If set, the box will take total control over the
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   144
     keyboard, not allowing input to other views/boxes
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   145
     while active.
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   146
     DANGER:
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   147
	only use this for very very urgent boxes, since
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   148
	no interaction with ANY view on the screen is possible then."
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   149
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   150
    exclusiveKeyboard := aBoolean
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   151
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   152
    "Modified: 12.5.1996 / 21:55:09 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   153
! !
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   154
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   155
!ModalBox methodsFor:'event handling'!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   156
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   157
coveredBy:aView
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   158
    "the receiver has been covered by another view.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   159
     If the other view is a non-modal one, raise"
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   160
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   161
    |mainGroup topViews|
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   162
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   163
    "
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   164
     if the other view is not a modal- (or shadow-, or popup-) -view,
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   165
     bring myself to the front again.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   166
    "
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   167
    aView isPopUpView ifFalse:[
7891
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   168
        "
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   169
         if I have a mainGroup,
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   170
         only raise if it's one of my maingroup-views
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   171
        "
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   172
        windowGroup notNil ifTrue:[
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   173
            mainGroup := windowGroup mainGroup.
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   174
            mainGroup notNil ifTrue:[
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   175
                topViews := mainGroup topViews.
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   176
                topViews notNil ifTrue:[
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   177
                    topViews do:[:eachTopView |
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   178
                        aView == eachTopView ifTrue:[
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   179
                            self raise.
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   180
                            ^ self
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   181
                        ]
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   182
                    ]
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   183
                ].
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   184
                ^ self
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   185
            ]
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   186
        ].
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   187
        self raise
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   188
    ]
7891
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   189
8cc23e3f937f #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7848
diff changeset
   190
    "Modified (format): / 13-02-2017 / 20:27:00 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   191
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   192
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   193
terminate
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   194
    "this is the close from a windowmanager
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   195
     (only if UseTransientViews == true)"
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   196
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   197
    "
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   198
     if I am a dialog, make the receiver invisible and leave control.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   199
     But, do not destroy the underlying view resources, to allow for
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   200
     another open/show to occur later.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   201
     if I have been opened modeLess, perform the normal destroy operation.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   202
    "
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   203
    (windowGroup isNil or:[windowGroup isModal]) ifTrue:[
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   204
	self hide
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   205
    ] ifFalse:[
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   206
	super terminate
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   207
    ]
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   208
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   209
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   210
visibilityChange:how
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   211
    "raise when covered - this should not be needed, since we
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   212
     have been created as override-redirect window (which should
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   213
     stay on top - but some window managers (fvwm) seem to ignore
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   214
     this ..."
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   215
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   216
    "the code below is not good, since it will lead to
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   217
     oscillating raises when two modalBoxes are going to cover
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   218
     each other - see coveredBy:-handling ..."
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   219
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   220
"/    how ~~ #fullyVisible ifTrue:[
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   221
"/        self raise
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   222
"/    ]
7133
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   223
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   224
     super visibilityChange:how.
1970
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   225
!
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   226
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   227
xxxpointerEnter:state x:x y:y
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   228
    "mhmh: this seems to be a special X kludge;
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   229
     without the following, we will not regain input focus after
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   230
     pointer is reentered."
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   231
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   232
"/
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   233
"/ experimental: disabled; bad behavior with some windowManagers,
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   234
"/ if enter/leave events are processed late.
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   235
"/
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   236
    self getKeyboardFocus.
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   237
    super pointerEnter:state x:x y:y
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   238
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   239
    "Created: / 8.12.1997 / 19:18:45 / cg"
5b602928ee03 experimental: no longer grab the keyboardFocus in a dialogs
Claus Gittinger <cg@exept.de>
parents: 1931
diff changeset
   240
    "Modified: / 8.12.1997 / 19:19:39 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   241
! !
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   242
3884
dc9ea4cfc963 method category rename
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   243
!ModalBox methodsFor:'initialization & release'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   244
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   245
addToCurrentProject
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   246
    "ignored here"
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   247
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   248
    ^ self
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   249
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   250
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   251
create
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   252
    super create.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   253
    shadowView notNil ifTrue:[
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   254
	self saveUnder:true
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   255
    ]
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   256
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   257
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   258
destroy
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   259
    "destroy the view.
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   260
     redefined to also destroy my shadow, if there is one,
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   261
     and to release the global keyboard grab (if there is one)"
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   262
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   263
    shadowView notNil ifTrue:[
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   264
	shadowView destroy.
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   265
	shadowView := nil
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   266
    ].
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   267
    exclusiveKeyboard ifTrue:[
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   268
	self forceUngrabKeyboard
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   269
    ].
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   270
    super destroy.
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   271
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   272
    "Modified: 12.5.1996 / 21:56:10 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   273
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   274
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   275
initEvents
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   276
    "initialize event handling; redefined to enable visibility changes"
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   277
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   278
    super initEvents.
1221
7ae7d7a901de added escapeIsCancel flag (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   279
    self enableEvent:#visibilityChange.
7ae7d7a901de added escapeIsCancel flag (ST-80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 965
diff changeset
   280
    escapeIsCancel := true.
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   281
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   282
    "Modified: 12.5.1996 / 21:56:31 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   283
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   284
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   285
initStyle
1263
f5af4e2abd71 commentary
Claus Gittinger <cg@exept.de>
parents: 1232
diff changeset
   286
    "setup viewStyle specifics"
f5af4e2abd71 commentary
Claus Gittinger <cg@exept.de>
parents: 1232
diff changeset
   287
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   288
    |style|
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   289
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   290
    super initStyle.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   291
    style := styleSheet name.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   292
    ((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   293
	self borderWidth:0.
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   294
	UseTransientViews ifFalse:[
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   295
	    self level:2
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   296
	]
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   297
    ]
1263
f5af4e2abd71 commentary
Claus Gittinger <cg@exept.de>
parents: 1232
diff changeset
   298
f5af4e2abd71 commentary
Claus Gittinger <cg@exept.de>
parents: 1232
diff changeset
   299
    "Modified: 22.1.1997 / 11:57:35 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   300
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   301
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   302
initialize
7848
bccc2879a64e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7661
diff changeset
   303
    <modifier: #super> "must be called if redefined"
bccc2879a64e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7661
diff changeset
   304
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   305
    |form resizeButton moveButton|
81
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   306
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   307
    super initialize.
48194c26a46c Initial revision
claus
parents:
diff changeset
   308
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   309
    "/ self beDialogView.
4272
ecdbad167dfd default windowStyle is now toolDialog
ca
parents: 4197
diff changeset
   310
    self beToolDialog.
ecdbad167dfd default windowStyle is now toolDialog
ca
parents: 4197
diff changeset
   311
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   312
    exclusiveKeyboard := false.
596
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   313
"/    label := ' '.
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   314
596
e196ea43d242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 587
diff changeset
   315
"/    label := 'Popup'.
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   316
81
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   317
    UseTransientViews ifFalse:[
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   318
        (PopUpView shadowsOnDevice:device) ifTrue:[
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   319
            shadowView := (ShadowView onDevice:device) for:self
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   320
        ].
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   321
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   322
        form := Form width:8 height:8
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   323
                     fromArray:#[2r00000000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   324
                                 2r00000000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   325
                                 2r00000000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   326
                                 2r00000001
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   327
                                 2r00000011
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   328
                                 2r00000111
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   329
                                 2r00001111
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   330
                                 2r00011111
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   331
                                ]
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   332
                     onDevice:device.
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   333
        resizeButton := Button label:form in:self.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   334
        resizeButton origin:1.0 @ 1.0 corner:1.0@1.0.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   335
        resizeButton activeForegroundColor:(resizeButton foregroundColor).
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   336
        resizeButton activeBackgroundColor:(resizeButton backgroundColor).
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   337
        resizeButton enteredBackgroundColor:(resizeButton backgroundColor).
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   338
        resizeButton leftInset:-8; topInset:-8.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   339
        resizeButton releaseAction:[].
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   340
        resizeButton pressAction:[resizeButton turnOff; redraw. self doResize].
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   341
        resizeButton borderWidth:0.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   342
        resizeButton activeLevel:0; passiveLevel:0.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   343
        resizeButton cursor:(Cursor corner).
89
ea2bf46eb669 *** empty log message ***
claus
parents: 86
diff changeset
   344
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   345
        form := Form width:8 height:8
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   346
                     fromArray:#[2r11111000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   347
                                 2r11110000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   348
                                 2r11100000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   349
                                 2r11000000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   350
                                 2r10000000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   351
                                 2r00000000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   352
                                 2r00000000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   353
                                 2r00000000
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   354
                                ]
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   355
                     onDevice:device.
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   356
        moveButton := Button label:form in:self.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   357
        moveButton origin:0.0 @ 0.0 corner:0.0@0.0.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   358
        moveButton activeForegroundColor:(moveButton foregroundColor).
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   359
        moveButton activeBackgroundColor:(moveButton backgroundColor).
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   360
        moveButton enteredBackgroundColor:(moveButton backgroundColor).
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   361
        moveButton rightInset:-8; bottomInset:-8.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   362
        moveButton releaseAction:[].
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   363
        moveButton pressAction:[moveButton turnOff; redraw. self doMove].
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   364
        moveButton borderWidth:0.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   365
        moveButton activeLevel:0; passiveLevel:0.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   366
        moveButton cursor:(Cursor origin)
81
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   367
    ].
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   368
7848
bccc2879a64e #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 7661
diff changeset
   369
    "Modified (format): / 08-02-2017 / 00:26:36 / cg"
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   370
!
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   371
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   372
isPopUpView
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   373
    "return true, if I want to come up without decoration
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   374
     and popUp to top immediately."
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   375
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   376
    ^ UseTransientViews not
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   377
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   378
    "Modified: 24.7.1997 / 15:20:14 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   379
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   380
2480
b4ffc5f3377f when realized, automatically assign the focus to the
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   381
realize
2690
f3d660bbe4a3 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   382
    super realize.
4179
d3a1cfe411db initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   383
    self assignInitialKeyboardFocus.
2690
f3d660bbe4a3 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   384
f3d660bbe4a3 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   385
    "Modified: / 3.5.1996 / 23:48:04 / stefan"
f3d660bbe4a3 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2644
diff changeset
   386
    "Modified: / 20.5.1999 / 18:17:34 / cg"
2480
b4ffc5f3377f when realized, automatically assign the focus to the
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   387
!
b4ffc5f3377f when realized, automatically assign the focus to the
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   388
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   389
reinitialize
2644
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   390
    "if I have already been reinited - return"
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   391
    self drawableId notNil ifTrue:[
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   392
        ^ self
2644
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   393
    ].
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   394
    "physically create the view & subviews"
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   395
    self recreate.
644
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   396
2644
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   397
"/   super reinitialize.
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   398
"/   self unmap.
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   399
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   400
    "Modified: / 3.5.1996 / 23:48:04 / stefan"
bb15778539af oops - restart with iconified views recreated them
Claus Gittinger <cg@exept.de>
parents: 2589
diff changeset
   401
    "Modified: / 6.5.1999 / 09:38:06 / cg"
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   402
!
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   403
81
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   404
resize
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   405
    "resize myself to make everything visible"
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   406
4197
1984b2ba83de Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents: 4179
diff changeset
   407
    |newExtent maxExtent|
81
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   408
151
claus
parents: 144
diff changeset
   409
    newExtent := self preferredExtent.
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   410
    newExtent := newExtent min:(device extent).
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   411
4197
1984b2ba83de Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents: 4179
diff changeset
   412
    maxExtent := self maxExtent.
1984b2ba83de Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents: 4179
diff changeset
   413
    maxExtent notNil ifTrue:[
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   414
        newExtent := newExtent min:maxExtent.
81
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   415
    ].
4197
1984b2ba83de Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents: 4179
diff changeset
   416
    newExtent ~= self extent ifTrue:[
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   417
        (shown and:[shadowView notNil]) ifTrue:[
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   418
            shadowView unmap.
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   419
            self extent:newExtent.
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   420
            shadowView realize.
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   421
            self raise
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   422
        ] ifFalse:[
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   423
            self extent:newExtent.
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   424
        ].
4197
1984b2ba83de Do not set maxExtent (to the Screen size) in StandartSystemView.
Stefan Vogel <sv@exept.de>
parents: 4179
diff changeset
   425
    ].
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   426
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   427
    "Modified: / 21-01-2011 / 13:50:11 / cg"
180
claus
parents: 157
diff changeset
   428
!
claus
parents: 157
diff changeset
   429
claus
parents: 157
diff changeset
   430
resizeUnderPointer
claus
parents: 157
diff changeset
   431
    "resize myself to make everything visible, AND possibly change the origin
claus
parents: 157
diff changeset
   432
     to have the mouse pointer stay within my bounds.
claus
parents: 157
diff changeset
   433
     This is used for self-resizing enterBoxes, to avoid moving
claus
parents: 157
diff changeset
   434
     the box away from the cursor."
claus
parents: 157
diff changeset
   435
4935
57354733f7d4 use usableExtent in resizeUnderPointer (multi-screen configurations)
Claus Gittinger <cg@exept.de>
parents: 4771
diff changeset
   436
    |newExtent newLeft delta screenWidth|
180
claus
parents: 157
diff changeset
   437
claus
parents: 157
diff changeset
   438
    newExtent := self preferredExtent.
claus
parents: 157
diff changeset
   439
    newExtent = self extent ifTrue:[^ self].
claus
parents: 157
diff changeset
   440
claus
parents: 157
diff changeset
   441
    shown ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   442
        delta := width - newExtent x.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   443
        newLeft := left + delta.
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   444
        (((newLeft @ top) extent:newExtent) containsPoint:device pointerPosition
6777
8527109b401d class: ModalBox
Claus Gittinger <cg@exept.de>
parents: 6269
diff changeset
   445
        ) ifFalse:[
8527109b401d class: ModalBox
Claus Gittinger <cg@exept.de>
parents: 6269
diff changeset
   446
            newLeft := left
8527109b401d class: ModalBox
Claus Gittinger <cg@exept.de>
parents: 6269
diff changeset
   447
        ].
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   448
        newLeft < 0 ifTrue:[newLeft := 0].
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   449
        screenWidth := device usableWidth.
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   450
        newLeft + newExtent x > screenWidth ifTrue:[
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   451
            newLeft := screenWidth - newExtent x
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   452
        ].
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   453
        shadowView notNil ifTrue:[
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   454
            shadowView unmap.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   455
        ].
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   456
        self origin:(newLeft @ top) extent:newExtent.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   457
        shadowView notNil ifTrue:[
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   458
            shadowView realize.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   459
            self raise.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   460
        ].
180
claus
parents: 157
diff changeset
   461
    ] ifFalse:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   462
        self extent:newExtent.
180
claus
parents: 157
diff changeset
   463
    ].
claus
parents: 157
diff changeset
   464
claus
parents: 157
diff changeset
   465
    "Modified: 6.9.1995 / 15:31:21 / claus"
644
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   466
    "Modified: 3.5.1996 / 23:48:17 / stefan"
81
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   467
! !
4ba554473294 *** empty log message ***
claus
parents: 72
diff changeset
   468
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   469
!ModalBox methodsFor:'move & resize'!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   470
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   471
doMove
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   472
    "the move button was pressed.
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   473
     This method is only used with non-transient views
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   474
     (UseTransientViews == false)."
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   475
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   476
    |r|
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   477
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   478
    r := device rectangleFromUser:(self origin corner:self corner) keepExtent:true.
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   479
    shadowView notNil ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   480
        shadowView unmap
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   481
    ].
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   482
    self origin:r origin extent:(self extent).
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   483
    shadowView notNil ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   484
        shadowView realize.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   485
        self raise.
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   486
    ].
644
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   487
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   488
    "Modified: 3.5.1996 / 23:47:38 / stefan"
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   489
    "Modified: 24.7.1997 / 16:07:18 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   490
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   491
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   492
doResize
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   493
    "the resize button was pressed.
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   494
     This method is only used with non-transient views
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   495
     (UseTransientViews == false)."
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   496
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   497
    |r|
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   498
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   499
    r := device rectangleFromUser:(self origin corner:self corner).
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   500
    shadowView notNil ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   501
        shadowView unmap
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   502
    ].
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   503
    self origin:r origin extent:(r extent max:(100@100)).
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   504
    shadowView notNil ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   505
        shadowView realize.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   506
        self raise
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   507
    ].
644
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   508
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   509
    "Modified: 3.5.1996 / 23:47:47 / stefan"
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   510
    "Modified: 24.7.1997 / 15:18:46 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   511
! !
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   512
3266
4db6dd90cc17 category change
Claus Gittinger <cg@exept.de>
parents: 3093
diff changeset
   513
!ModalBox methodsFor:'queries-internal'!
1700
ea1abaa7901d preps for native window support
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   514
1915
f86162de1a2f extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   515
windowLabelFor:labelString
f86162de1a2f extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   516
    "dialogs do not include the hostname in the window label"
f86162de1a2f extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   517
f86162de1a2f extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   518
    ^ labelString
f86162de1a2f extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   519
f86162de1a2f extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   520
    "Created: 22.9.1997 / 10:14:02 / cg"
f86162de1a2f extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   521
!
f86162de1a2f extracted windowLabel generation into a separate method
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
   522
1700
ea1abaa7901d preps for native window support
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   523
windowStyle
3715
70eea03a8d8d comment
Claus Gittinger <cg@exept.de>
parents: 3649
diff changeset
   524
    "return a symbol describing my style (one of: #dialog, #popUp or #normal)
1700
ea1abaa7901d preps for native window support
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   525
     (may be used internally by the device as a decoration hint)"
ea1abaa7901d preps for native window support
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   526
4272
ecdbad167dfd default windowStyle is now toolDialog
ca
parents: 4197
diff changeset
   527
    UseTransientViews ifFalse:[
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   528
	^ #popUp
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   529
    ].
4272
ecdbad167dfd default windowStyle is now toolDialog
ca
parents: 4197
diff changeset
   530
    ^ super windowStyle
1700
ea1abaa7901d preps for native window support
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   531
ea1abaa7901d preps for native window support
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   532
    "Created: 2.5.1997 / 14:34:17 / cg"
1825
c6f133f38dff fixed non-transient mode
Claus Gittinger <cg@exept.de>
parents: 1700
diff changeset
   533
    "Modified: 24.7.1997 / 15:22:39 / cg"
1700
ea1abaa7901d preps for native window support
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   534
! !
ea1abaa7901d preps for native window support
Claus Gittinger <cg@exept.de>
parents: 1400
diff changeset
   535
3881
6661ab0fa781 method category rename
Claus Gittinger <cg@exept.de>
parents: 3859
diff changeset
   536
!ModalBox methodsFor:'show & hide'!
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   537
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   538
autoHideAfter:seconds with:anAction
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   539
    "install a background process, which hides the box
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   540
     after some time. Also, if non-nil, anAction will be
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   541
     evaluated then. The action will not be evaluated if
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   542
     the box is closed by the user pressing a button."
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   543
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   544
    "the implementation is simple: just fork of a process
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   545
     to hide me."
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   546
    [
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   547
	Delay waitForSeconds:seconds.
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   548
	self shown ifTrue:[
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   549
	    self hide.
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   550
	    anAction value
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   551
	]
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   552
    ] forkAt:4.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   553
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   554
    "
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   555
     |b|
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   556
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   557
     b := InfoBox title:'hello there'.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   558
     b autoHideAfter:5 with:[].
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   559
     b showAtCenter.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   560
    "
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   561
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   562
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   563
fixSize
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   564
    "this is sent right before the modalBox is made visible;
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   565
     If the size is not fixed, adjust my size."
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   566
5945
52161987f2f1 changed: #fixSize
Claus Gittinger <cg@exept.de>
parents: 5889
diff changeset
   567
    sizeFixed ifFalse:[
52161987f2f1 changed: #fixSize
Claus Gittinger <cg@exept.de>
parents: 5889
diff changeset
   568
        self resize.
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   569
    ].
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   570
    super fixSize.
5945
52161987f2f1 changed: #fixSize
Claus Gittinger <cg@exept.de>
parents: 5889
diff changeset
   571
52161987f2f1 changed: #fixSize
Claus Gittinger <cg@exept.de>
parents: 5889
diff changeset
   572
    "Modified: / 27-10-2012 / 12:16:58 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   573
!
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   574
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   575
hide
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   576
    "make the receiver invisible and leave control"
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   577
2579
774e6fb33dde checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2577
diff changeset
   578
    |masterGroup|
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   579
1314
99e3347abb6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   580
    realized ifFalse:[^ self].
99e3347abb6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   581
644
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   582
    shadowView notNil ifTrue:[shadowView unmap].
3313
acf38fcda6e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3266
diff changeset
   583
    windowGroup notNil ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   584
        windowGroup focusView:nil.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   585
        masterGroup := windowGroup previousGroup.
3313
acf38fcda6e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3266
diff changeset
   586
    ].
acf38fcda6e9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3266
diff changeset
   587
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   588
    exclusiveKeyboard ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   589
        self forceUngrabKeyboard
675
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   590
    ].
fc15e8886089 removed leaveCOntrol (not used); added comments
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   591
644
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   592
    self unmap.
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   593
2579
774e6fb33dde checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2577
diff changeset
   594
    masterGroup notNil ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   595
        "
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   596
         this is a kludge for IRIS and others which do not provide backingstore:
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   597
         when we hide a modalbox (such as a searchbox) which covered
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   598
         a scrollbar, the scrollbars bitblt-method will copy from the
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   599
         not-yet redrawn area - effectively clearing the scroller.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   600
         We need a short delay here, since at this time, the expose event has
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   601
         not yet arrived.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   602
        "
7584
7a00eb12dd75 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7264
diff changeset
   603
        device sync.     "/ that's a round trip, to ensure that all expose events are present..."
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   604
        Delay waitForSeconds:0.05.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   605
        masterGroup processExposeEvents
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   606
    ].
644
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   607
85ce9499c925 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 616
diff changeset
   608
    "Modified: 3.5.1996 / 23:47:57 / stefan"
1314
99e3347abb6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1263
diff changeset
   609
    "Modified: 8.2.1997 / 17:41:16 / cg"
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   610
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   611
393
3504a0adbb2d use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   612
hideRequest
3504a0adbb2d use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   613
    "hide request from windowGroup (i.e. via Escape key).
7661
fa9faa4f9526 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 7584
diff changeset
   614
     Can be redefined in subclasses which don't like this"
393
3504a0adbb2d use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   615
3440
33d132092b22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
   616
    self hide
393
3504a0adbb2d use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   617
!
3504a0adbb2d use hideRequest to close via Escape key (allows redefinition);
Claus Gittinger <cg@exept.de>
parents: 371
diff changeset
   618
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   619
mapped
48194c26a46c Initial revision
claus
parents:
diff changeset
   620
    "wait till visible for grabbing"
48194c26a46c Initial revision
claus
parents:
diff changeset
   621
48194c26a46c Initial revision
claus
parents:
diff changeset
   622
    super mapped.
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   623
3344
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   624
"/    "take it away from any popup menu possibly still active"
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   625
"/
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   626
"/    self forceUngrabKeyboard.
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   627
"/    self forceUngrabPointer.
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   628
"/
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   629
    "
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   630
     if I am a super-modal box, take the keyboard
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   631
    "
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   632
    exclusiveKeyboard ifTrue:[
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   633
	self forceUngrabKeyboard.
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   634
	self grabKeyboard.
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   635
    ].
3344
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   636
"/
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   637
"/"/    UseTransientViews ifFalse:[
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   638
"/        "
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   639
"/         get the focus
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   640
"/        "
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   641
"/        self getKeyboardFocus.
4c3428823365 moved focus & grabHandling to TopViews openModal handling
ca
parents: 3328
diff changeset
   642
"/        self enableEnterLeaveEvents
3351
458b3f245e69 *** empty log message ***
ca
parents: 3344
diff changeset
   643
"/"/    ]
3440
33d132092b22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3351
diff changeset
   644
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   645
46
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
   646
open
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   647
    "default for modalboxes is to come up modal at the pointer position"
46
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
   648
3520
d434192f89f6 honor forceModalToCenter
Claus Gittinger <cg@exept.de>
parents: 3460
diff changeset
   649
    ForceModalBoxesToOpenAtCenter == true ifTrue:[
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   650
	^ self showAtCenter
3520
d434192f89f6 honor forceModalToCenter
Claus Gittinger <cg@exept.de>
parents: 3460
diff changeset
   651
    ].
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   652
    ^ self showAtPointer
46
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
   653
!
7b331e9012fd *** empty log message ***
claus
parents: 21
diff changeset
   654
953
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   655
openAt:aPoint
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   656
    "default for modalboxes is to come up modal at the pointer position"
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   657
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   658
    ^ self openModalAt:aPoint
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   659
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   660
    "Created: 17.7.1996 / 14:50:44 / cg"
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   661
!
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   662
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   663
openAtCenter
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   664
    "default for modalboxes is to come up modal at the pointer position"
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   665
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   666
    ^ self openModalAtCenter
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   667
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   668
    "Created: 17.7.1996 / 14:50:35 / cg"
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   669
!
226d5ccde5fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 922
diff changeset
   670
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   671
openModal:aBlock
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   672
    "open the box modal;
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   673
     In addition to the basic (inherited) modalloop, change
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   674
     the current active windowgroups cursors to the busy-stop cursor, show
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   675
     a shadow, and raise the box."
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   676
1397
932c517ad29c moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   677
    shadowView notNil ifTrue:[shadowView realize].
932c517ad29c moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   678
    super openModal:aBlock.
300
6a63af1fec3e passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   679
6a63af1fec3e passing group to avoid multiple activeGroup searches
Claus Gittinger <cg@exept.de>
parents: 296
diff changeset
   680
    "Created: 10.12.1995 / 14:07:01 / cg"
1397
932c517ad29c moved tranientView setup up in the hierarchy
Claus Gittinger <cg@exept.de>
parents: 1314
diff changeset
   681
    "Modified: 28.2.1997 / 22:32:49 / cg"
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   682
!
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   683
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   684
show
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   685
    "make myself visible (at the last or default position) and take control.
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   686
     If that position is out of the screen area, moves the receiver to make
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   687
     it fully visible."
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   688
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   689
    self fixSize.
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   690
    self makeFullyVisible.
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   691
    self openModal
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   692
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   693
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   694
     |b|
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   695
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   696
     b := InfoBox title:'hello'.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   697
     b show.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   698
    "
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   699
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   700
    "Modified: 7.3.1996 / 17:57:49 / cg"
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   701
!
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   702
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   703
showAt:aPoint
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   704
    "make myself visible at aPoint.
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   705
     Fix position to make box fully visible"
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   706
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   707
    self fixSize.
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   708
    self fixPosition:aPoint.
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   709
    self openModal
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   710
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   711
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   712
     |b|
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   713
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   714
     b := InfoBox title:'hello'.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   715
     b showAt:(0 @ 0).
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   716
     b showAt:(400 @ 400).
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   717
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   718
!
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   719
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   720
showAt:aPoint center:center
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   721
    "make myself visible at aPoint. center specifies
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   722
     if the view should show up centered around aPoint."
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   723
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   724
    self showAt:aPoint centerX:center centerY:center
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   725
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   726
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   727
     |b|
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   728
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   729
     b := InfoBox title:'hello'.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   730
     b showAt:(100 @ 100) center:true.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   731
     b showAt:(100 @ 100) center:false.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   732
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   733
!
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   734
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   735
showAt:aPoint centerX:centerX centerY:centerY
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   736
    "make myself visible at aPoint. centerX/centerY specify
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   737
     if the view should show up centered around aPoint.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   738
     Fix position to make box fully visible"
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   739
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   740
    |dx dy|
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   741
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   742
    self fixSize.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   743
    centerX ifTrue:[
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   744
        dx := self width // 2.
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   745
    ] ifFalse:[
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   746
        dx := 0
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   747
    ].
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   748
    centerY ifTrue:[
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   749
        dy := self height // 2.
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   750
    ] ifFalse:[
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   751
        dy := 0
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   752
    ].
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   753
    self origin:(aPoint - (dx @ dy)).
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   754
    self makeFullyVisible.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   755
    self openModal
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   756
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   757
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   758
     |b|
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   759
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   760
     b := InfoBox title:'hello'.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   761
     b showAt:(100 @ 100).
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   762
     b showAt:(100 @ 100) centerX:true centerY:false.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   763
    "
5678
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   764
414d0473ad21 force the extent to be no bigger than the screen
Claus Gittinger <cg@exept.de>
parents: 5626
diff changeset
   765
    "Modified: / 21-01-2011 / 13:58:29 / cg"
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   766
!
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   767
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   768
showAtCenter
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   769
    "make myself visible at the screen center."
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   770
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   771
    self showAt:(device centerOfMonitorHavingPointer) center:true
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   772
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   773
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   774
     |b|
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   775
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   776
     b := InfoBox title:'hello'.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   777
     b showAtCenter.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   778
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   779
!
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   780
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   781
showAtPointer
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   782
    "make myself visible at mouse pointer shifted to have
66
398cf6bfb241 *** empty log message ***
claus
parents: 59
diff changeset
   783
     convenient button under cursor. self positionOffset should
7133
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   784
     return that offset (usually redefined, since we don't know here,
66
398cf6bfb241 *** empty log message ***
claus
parents: 59
diff changeset
   785
     which button should be under cursor)."
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   786
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   787
    |first pointerPosition positionOffset pos monitorBounds alignedPos|
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   788
5626
0d7703a9eef6 changed: #showAtPointer
Claus Gittinger <cg@exept.de>
parents: 5616
diff changeset
   789
    "/ ****** MULTI SCREEN
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   790
    pointerPosition := device pointerPosition.
3859
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   791
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   792
    self fixSize.
3859
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   793
    positionOffset := self positionOffset.
5626
0d7703a9eef6 changed: #showAtPointer
Claus Gittinger <cg@exept.de>
parents: 5616
diff changeset
   794
    pos := alignedPos := pointerPosition - positionOffset.
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   795
5626
0d7703a9eef6 changed: #showAtPointer
Claus Gittinger <cg@exept.de>
parents: 5616
diff changeset
   796
    UserPreferences current forceWindowsIntoMonitorBounds ifTrue:[
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   797
        monitorBounds := device monitorBoundsAt:pointerPosition.
5626
0d7703a9eef6 changed: #showAtPointer
Claus Gittinger <cg@exept.de>
parents: 5616
diff changeset
   798
        alignedPos := (pos x max:monitorBounds left) @ (pos y max:monitorBounds top).
0d7703a9eef6 changed: #showAtPointer
Claus Gittinger <cg@exept.de>
parents: 5616
diff changeset
   799
    ].
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   800
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   801
    positionOffset := pointerPosition - alignedPos.
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   802
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   803
    self fixPosition:alignedPos.
5513
9af55a873ca9 changed: #showAtPointer
Claus Gittinger <cg@exept.de>
parents: 5495
diff changeset
   804
    pos := self origin.
3859
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   805
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   806
    "We have got a problem here:
5616
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   807
        X11 adds some window decoration. The size of the decoration is only known
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   808
        after the view is visible!!
3859
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   809
5616
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   810
        So there is a (hopefully) small offset from the pointer to the requested
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   811
        position. The only way to resolve this, is to move the pointer to
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   812
        the requested position after the view is visible"
3859
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   813
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   814
    first := true.
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   815
    self openModal:[
5616
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   816
        (first and:[shown]) ifTrue:[
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   817
            first := false.
7133
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   818
            "in Linux - SuSe Tumbleweed 2016-01 the Delay is required, otherwise the pointer
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   819
             is shown relative to the root window. No idea why this is needed. Maybe the
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   820
             window manager (kwin) does something."
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   821
            Delay waitForMilliseconds:10.
5616
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   822
            self setPointerPosition:positionOffset.
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   823
        ].
58aca56e8491 changed: #showAtPointer
Michael Beyl <mb@exept.de>
parents: 5611
diff changeset
   824
        true
3859
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   825
    ].
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   826
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   827
    "/ cannot use:
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   828
    "/    self showAt:(device pointerPosition - self positionOffset).
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   829
    "/ because the resizing must be done before the
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   830
    "/ positionOffset is grabbed (it may change due to the resize)
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   831
72
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   832
    "
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   833
     |b|
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   834
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   835
     b := InfoBox title:'hello'.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   836
     b showAtPointer.
3e84121988c3 *** empty log message ***
claus
parents: 66
diff changeset
   837
    "
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   838
5626
0d7703a9eef6 changed: #showAtPointer
Claus Gittinger <cg@exept.de>
parents: 5616
diff changeset
   839
    "Modified: / 22-10-2010 / 11:20:05 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   840
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   841
48194c26a46c Initial revision
claus
parents:
diff changeset
   842
showAtPointerNotCovering:aView
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   843
    "make myself visible at mouse pointer shifted to have
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   844
     convenient button under cursor.
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   845
     Fix position to make the box fully visible AND to make sure that
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   846
     aView is not covered."
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   847
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   848
    |pos newX|
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   849
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   850
    pos := device pointerPosition - self positionOffset.
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   851
5611
4c8229c880fd Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5609
diff changeset
   852
    ((Rectangle origin:pos extent:self extent)
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   853
        intersects: (aView origin corner: aView corner))
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   854
    ifTrue:[
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   855
        "
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   856
         try to the right of the untouchable view
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   857
        "
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   858
        newX := (aView origin x + aView width).
7264
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   859
        newX + width > device usableWidth ifTrue:[
84b62bae4dc0 device access
Claus Gittinger <cg@exept.de>
parents: 7133
diff changeset
   860
            newX := device usableWidth - width
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   861
        ].
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   862
        pos x:newX.
54
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   863
29a6b2f8e042 *** empty log message ***
claus
parents: 46
diff changeset
   864
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   865
        ((Rectangle origin:pos extent:self extent)
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   866
            intersects: (aView origin corner: aView corner))
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   867
        ifTrue:[
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   868
            "
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   869
             try to the left of the untouchable view
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   870
            "
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   871
            newX := aView origin x - width.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   872
            "
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   873
             should look for vertical possibilities too ...
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   874
            "
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   875
            pos x:newX.
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   876
        ]
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   877
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   878
    ].
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   879
    self showAt:pos
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   880
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   881
    "Modified: 7.3.1996 / 17:58:10 / cg"
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   882
!
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   883
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   884
showCenteredIn:aView
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   885
    "make myself visible at the center if aView."
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   886
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   887
    |top|
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   888
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   889
    top := aView topView.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   890
    top raise.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   891
    self showAt:(top center + (aView originRelativeTo:top)) center:true
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   892
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   893
    "
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   894
     |b|
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   895
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   896
     b := InfoBox title:'hello'.
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   897
     b showCenteredIn:Transcript.
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   898
    "
514
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   899
122e61a00a9d commentary
Claus Gittinger <cg@exept.de>
parents: 421
diff changeset
   900
    "Modified: 7.3.1996 / 17:58:53 / cg"
2577
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   901
!
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   902
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   903
unmapped
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   904
    "mhmh - unmapped by the windowManager - if realized (i.e. not closing),
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   905
     keep the realized flag true (to avoid exiting the modal event loop).
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   906
     Consider this a kludge."
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   907
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   908
    |r|
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   909
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   910
    r := realized.
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   911
    super unmapped.
c7c9b49a3794 kludge workaround - keep realized flag value when unmapped
Claus Gittinger <cg@exept.de>
parents: 2480
diff changeset
   912
    realized := r.
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   913
! !
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   914
1232
8106eef0084c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1221
diff changeset
   915
!ModalBox class methodsFor:'documentation'!
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   916
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   917
version
7133
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   918
    ^ '$Header$'
5386
7bb5b24b9bb2 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 5226
diff changeset
   919
!
7bb5b24b9bb2 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 5226
diff changeset
   920
7bb5b24b9bb2 no more direct accesses to borderWidth and borderColor
Claus Gittinger <cg@exept.de>
parents: 5226
diff changeset
   921
version_CVS
7133
Stefan Vogel <sv@exept.de>
parents: 6777
diff changeset
   922
    ^ '$Header$'
270
f80e2a67de1e oops - checkin failed
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   923
! !
3859
a11d876ebc26 Fix #showAtPointer to take care of window manager title bars.
Stefan Vogel <sv@exept.de>
parents: 3715
diff changeset
   924
6269
703a7c20f524 class: ModalBox
Stefan Vogel <sv@exept.de>
parents: 5968
diff changeset
   925
296
655507429feb checkin from browser
Claus Gittinger <cg@exept.de>
parents: 270
diff changeset
   926
ModalBox initialize!