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