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