TopView.st
author Michael Beyl <mb@exept.de>
Wed, 12 Sep 2007 12:34:42 +0200
changeset 4798 096226757fdd
parent 4570 aae3c36ca517
child 4799 b91607dae5bb
permissions -rw-r--r--
+ beScreenDialog
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
135
claus
parents:
diff changeset
     1
"
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
     3
              All Rights Reserved
135
claus
parents:
diff changeset
     4
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    10
 hereby transferred.
claus
parents:
diff changeset
    11
"
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
    12
"{ Package: 'stx:libview' }"
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
    13
135
claus
parents:
diff changeset
    14
View subclass:#TopView
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
    15
	instanceVariableNames:'type iconified keyboardProcessor'
3768
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
    16
	classVariableNames:'TakeFocusWhenMapped ForceModalBoxesToOpenAtCenter
4081
189e44935650 no access to type instVar
Claus Gittinger <cg@exept.de>
parents: 4079
diff changeset
    17
		ForceModalBoxesToOpenAtPointer MasterSlaveMask WindowTypeMask
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    18
		TypeMaster TypeSlave TypePartner TypeDialog TypePopUp
4498
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
    19
		TypeUndecorated TypeToolWindow TypeToolDialog MDIClientMask
4798
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
    20
		MDIClient TypeScreenDialog'
1398
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
    21
	poolDictionaries:''
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
    22
	category:'Views-Basic'
135
claus
parents:
diff changeset
    23
!
claus
parents:
diff changeset
    24
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
    25
!TopView class methodsFor:'documentation'!
135
claus
parents:
diff changeset
    26
claus
parents:
diff changeset
    27
copyright
claus
parents:
diff changeset
    28
"
claus
parents:
diff changeset
    29
 COPYRIGHT (c) 1995 by Claus Gittinger
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
    30
              All Rights Reserved
135
claus
parents:
diff changeset
    31
claus
parents:
diff changeset
    32
 This software is furnished under a license and may be used
claus
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
claus
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
claus
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
claus
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
claus
parents:
diff changeset
    37
 hereby transferred.
claus
parents:
diff changeset
    38
"
claus
parents:
diff changeset
    39
!
claus
parents:
diff changeset
    40
claus
parents:
diff changeset
    41
documentation
claus
parents:
diff changeset
    42
"
claus
parents:
diff changeset
    43
    I am an abstract superclass of StandardSystemView and PopUpView;
claus
parents:
diff changeset
    44
    i.e. views which have no superview.
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    45
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    46
    Do not get confused by the name TopView - your applications
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    47
    topViews are typically instances of StandardSystemView.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    48
1396
d9bfda85ef2b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    49
    [instance variables:]
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    50
        type            <Integer>       encodes master/slave relationship:
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    51
                                            #normal, #master, #slave or #partner
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    52
                                        for modeless views
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    53
                                        (the #master-, #slave- or #partner-type links multiple views 
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    54
                                         into a windowManagers windowGroup -> for de-iconification)
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    55
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    56
                                        encodes window type:
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    57
                                            #normal, #dialog, #popup, #undecorated 
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    58
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    59
    [see also:]
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
    60
        StandardSystemView PopUpView DialogBox 
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    61
        ( introduction to view programming :html: programming/viewintro.html )
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    62
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    63
    [author:]
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    64
        Claus Gittinger
135
claus
parents:
diff changeset
    65
"
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    66
!
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    67
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    68
examples
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    69
"
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    70
  Notice, the following examples only demonstrate the windos style (not its modal behavior).
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    71
  the style is controlled by the systems windowManager, and might even be ignored by some.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    72
  (for example, the dialog- and normal styles often look the same).
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    73
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    74
  The bahavior is controlled by ST/X, and controlled by the open vs. openModeless vs. openModal message.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    75
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    76
  Modeless:
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    77
    regular style:
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    78
                                                            [exBegin]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    79
        |v|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    80
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    81
        v := TopView new.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    82
        v extent:200@200.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    83
        v open
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    84
                                                            [exEnd]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    85
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    86
    dialog:
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    87
                                                            [exBegin]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    88
        |v|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    89
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    90
        v := TopView new.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    91
        v beDialogView.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    92
        v extent:200@200.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    93
        v open
4309
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
    94
        Delay waitForSeconds:10. v destroy.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    95
                                                            [exEnd]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    96
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    97
    popUp (always on top):
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    98
                                                            [exBegin]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
    99
        |v|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   100
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   101
        v := TopView new.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   102
        v bePopUpView.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   103
        v extent:200@200.
4309
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
   104
        v open.
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
   105
        Delay waitForSeconds:10. v destroy.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   106
                                                            [exEnd]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   107
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   108
    undecorated (looks loke popUp, but is not always on top):
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   109
                                                            [exBegin]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   110
        |v|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   111
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   112
        v := TopView new.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   113
        v beUndecorated.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   114
        v extent:200@200.
4309
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
   115
        v open.
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
   116
        Delay waitForSeconds:10. v destroy.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   117
                                                            [exEnd]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   118
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   119
    toolwindow (looks loke normal, but has smaller windowTitle-area on win32):
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   120
                                                            [exBegin]
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   121
        |v|
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   122
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   123
        v := TopView new.
4255
b812f263f716 *** empty log message ***
ca
parents: 4254
diff changeset
   124
        v beToolWindow.
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   125
        v extent:200@200.
4309
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
   126
        v open.
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
   127
        Delay waitForSeconds:10. v destroy.
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   128
                                                            [exEnd]
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   129
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   130
    toolwindow dialog (looks loke normal, but has smaller windowTitle-area on win32):
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   131
                                                            [exBegin]
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   132
        |v|
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   133
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   134
        v := TopView new.
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   135
        v beToolDialog.
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   136
        v extent:200@200.
4309
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
   137
        v open.
537fcbf952e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4256
diff changeset
   138
        Delay waitForSeconds:10. v destroy.
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   139
                                                            [exEnd]
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   140
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   141
  Modal:
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   142
    regular style:
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   143
                                                            [exBegin]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   144
        |v|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   145
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   146
        v := TopView new.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   147
        v extent:200@200.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   148
        v openModal
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   149
                                                            [exEnd]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   150
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   151
    dialog:
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   152
                                                            [exBegin]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   153
        |v|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   154
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   155
        v := TopView new.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   156
        v beDialogView.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   157
        v extent:200@200.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   158
        v openModal
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   159
                                                            [exEnd]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   160
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   161
    popUp (always on top):
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   162
                                                            [exBegin]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   163
        |v|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   164
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   165
        v := TopView new.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   166
        v bePopUpView.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   167
        v extent:200@200.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   168
        v openModal
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   169
                                                            [exEnd]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   170
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   171
    undecorated (looks loke popUp, but is not always on top):
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   172
                                                            [exBegin]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   173
        |v|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   174
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   175
        v := TopView new.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   176
        v beUndecorated.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   177
        v extent:200@200.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   178
        v openModal
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   179
                                                            [exEnd]
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   180
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   181
"
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   182
! !
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   183
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   184
!TopView class methodsFor:'class initialization'!
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   185
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   186
initialize
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   187
    MasterSlaveMask := 16r0F.
4498
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   188
     TypeMaster      := 16r01.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   189
     TypeSlave       := 16r02.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   190
     TypePartner     := 16r03.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   191
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   192
    WindowTypeMask  := 16rF0.
4498
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   193
     TypeDialog      := 16r10.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   194
     TypePopUp       := 16r20.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   195
     TypeUndecorated := 16r30.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   196
     TypeToolWindow  := 16r40.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   197
     TypeToolDialog  := 16r50.
4798
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   198
     TypeScreenDialog:= 16r60.
4498
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   199
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   200
    MDIClientMask   := 16r100.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   201
     MDIClient       := 16r100.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   202
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   203
    "
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   204
     self initialize
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   205
    "
135
claus
parents:
diff changeset
   206
! !
claus
parents:
diff changeset
   207
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   208
!TopView class methodsFor:'defaults'!
135
claus
parents:
diff changeset
   209
claus
parents:
diff changeset
   210
defaultExtent
586
b91f10f632d5 commentary
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   211
    "return the default extent of my instances.
b91f10f632d5 commentary
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   212
     Topviews extents is 2/3 of screen by default"
135
claus
parents:
diff changeset
   213
153
claus
parents: 151
diff changeset
   214
    |display|
claus
parents: 151
diff changeset
   215
claus
parents: 151
diff changeset
   216
    display := Screen current.
3072
7a778116db5a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
   217
    display isNil ifTrue:[
7a778116db5a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
   218
        ^ 600 @ 400
7a778116db5a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3035
diff changeset
   219
    ].
3446
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
   220
    ^ display defaultExtentForTopViews
3519
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   221
!
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   222
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   223
forceModalBoxesToOpenAtCenter
3768
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   224
    "return the flag which forces all modal views to be opened 
3519
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   225
     at the screens center"
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   226
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   227
    ^ ForceModalBoxesToOpenAtCenter ? false
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   228
!
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   229
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   230
forceModalBoxesToOpenAtCenter:aBoolean
3768
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   231
    "set/clear a flag which forces all modal views to be opened
3519
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   232
     at the screens center"
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   233
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   234
    ForceModalBoxesToOpenAtCenter := aBoolean
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   235
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   236
    "
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   237
     TopView forceModalBoxesToOpenAtCenter:true
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   238
     TopView forceModalBoxesToOpenAtCenter:false
ab3bf0ab96d0 added forceModalBoxesToOpenAtCenter: flag
Claus Gittinger <cg@exept.de>
parents: 3446
diff changeset
   239
    "
3768
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   240
!
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   241
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   242
forceModalBoxesToOpenAtPointer
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   243
    "return the flag which forces all modal views to be opened 
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   244
     at the current pointer position"
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   245
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   246
    ^ ForceModalBoxesToOpenAtPointer ? false
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   247
!
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   248
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   249
forceModalBoxesToOpenAtPointer:aBoolean
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   250
    "set/clear the flag which forces all modal views to be opened 
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   251
     at the current pointer position"
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   252
e39ab287f08c added ForceAtPointer flag
Claus Gittinger <cg@exept.de>
parents: 3712
diff changeset
   253
    ForceModalBoxesToOpenAtPointer := aBoolean
3978
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   254
!
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   255
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   256
takeFocusWhenMapped:aBoolean
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   257
    "if turned on, topViews will grab the keyboard when mapped.
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   258
     This is useful on systems like openView or Win32, where a view needs a click
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   259
     otherwise"
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   260
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   261
    TakeFocusWhenMapped := aBoolean
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   262
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   263
    "
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   264
     StandardSystemView takeFocusWhenMapped:true
a7a7e5aa016d takeFocusWhenMapped moved up
ca
parents: 3916
diff changeset
   265
    "
135
claus
parents:
diff changeset
   266
! !
claus
parents:
diff changeset
   267
3880
c4c8268a2d9f method category rename
Claus Gittinger <cg@exept.de>
parents: 3818
diff changeset
   268
!TopView methodsFor:'Compatibility-ST80'!
1410
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   269
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   270
displayBox
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   271
    ^ self bounds
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   272
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   273
    "Created: 3.3.1997 / 16:31:33 / cg"
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   274
!
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   275
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   276
displayBox:aRectangle
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   277
    self origin:aRectangle origin corner:aRectangle corner
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   278
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   279
    "Created: 3.3.1997 / 16:34:38 / cg"
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   280
! !
ee1f7f3b2dfd added #displayBox for ST-80 compatibility
Claus Gittinger <cg@exept.de>
parents: 1401
diff changeset
   281
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   282
!TopView methodsFor:'accessing'!
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   283
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   284
keyboardProcessor
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   285
    "return my keyboard processor"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   286
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   287
    ^ keyboardProcessor
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   288
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   289
    "Created: / 18.6.1998 / 18:52:42 / cg"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   290
    "Modified: / 18.6.1998 / 20:00:18 / cg"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   291
!
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   292
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   293
keyboardProcessor:something
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   294
    "set my keyboard processor"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   295
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   296
    keyboardProcessor := something.
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   297
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   298
    "Created: / 18.6.1998 / 18:52:42 / cg"
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   299
    "Modified: / 18.6.1998 / 20:00:30 / cg"
4138
cb6aed659e6a *** empty log message ***
werner
parents: 4081
diff changeset
   300
!
cb6aed659e6a *** empty log message ***
werner
parents: 4081
diff changeset
   301
cb6aed659e6a *** empty log message ***
werner
parents: 4081
diff changeset
   302
label:labelString iconLabel:iconLabelString
cb6aed659e6a *** empty log message ***
werner
parents: 4081
diff changeset
   303
    "/ ignored here - for compat. with StdSysViews
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   304
! !
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   305
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   306
!TopView methodsFor:'accessing-behavior'!
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   307
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   308
beDialogView
4798
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   309
    "make me a Dialog Window; that is one which raises above all other ST/X views"
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   310
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   311
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   312
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   313
        type := (type bitClear:WindowTypeMask) bitOr:TypeDialog.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   314
        ^ self.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   315
    ].
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   316
    type := #dialog 
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   317
!
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   318
1765
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   319
beIndependent
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   320
    "make this an independent view; i.e. remove any master/slave or partner
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   321
     attribute (this is the default).
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   322
     However, the view remains in the current windowGroup"
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   323
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   324
    "/ the nonInteger handling code is for backward compatibility only.
4081
189e44935650 no access to type instVar
Claus Gittinger <cg@exept.de>
parents: 4079
diff changeset
   325
    type isInteger ifTrue:[
189e44935650 no access to type instVar
Claus Gittinger <cg@exept.de>
parents: 4079
diff changeset
   326
        type := type bitClear:MasterSlaveMask.
189e44935650 no access to type instVar
Claus Gittinger <cg@exept.de>
parents: 4079
diff changeset
   327
        ^ self.
189e44935650 no access to type instVar
Claus Gittinger <cg@exept.de>
parents: 4079
diff changeset
   328
    ].
1765
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   329
    type := nil
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   330
!
4be7b62a32e3 checkin from browser
ca
parents: 1536
diff changeset
   331
4500
964544126594 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4498
diff changeset
   332
beMDIClientView
4498
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   333
    type := (type bitClear:MDIClientMask) bitOr:MDIClient.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   334
!
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   335
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   336
beMaster
4032
ced6a721d1a6 comment
Claus Gittinger <cg@exept.de>
parents: 3978
diff changeset
   337
    "make this a master-view. 
ced6a721d1a6 comment
Claus Gittinger <cg@exept.de>
parents: 3978
diff changeset
   338
     All slave views within the same windowGroup will be closed if any master is closed
ced6a721d1a6 comment
Claus Gittinger <cg@exept.de>
parents: 3978
diff changeset
   339
     and also de/iconify together with their master(s).
ced6a721d1a6 comment
Claus Gittinger <cg@exept.de>
parents: 3978
diff changeset
   340
     (i.e. they follow their master(s))."
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   341
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   342
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   343
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   344
        type := (type bitClear:MasterSlaveMask) bitOr:TypeMaster.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   345
        ^ self.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   346
    ].
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   347
    type := #master
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   348
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   349
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   350
     see example in TopView>>beSlave
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   351
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   352
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   353
    "Created: 10.12.1995 / 13:30:50 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   354
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   355
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   356
bePartner
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   357
    "make this a partner-view. Each partner-view will automatically 
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   358
     close other partner views (within the same windowGroup) when closed."
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   359
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   360
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   361
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   362
        type := (type bitClear:MasterSlaveMask) bitOr:TypePartner.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   363
        ^ self.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   364
    ].
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   365
    type := #partner 
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   366
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   367
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   368
     create two topViews within the same group:
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   369
     if any of them is iconified/deiconified/closed, the other one is also
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   370
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   371
     |top1 top2|
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   372
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   373
     top1 := StandardSystemView new label:'partner'; extent:300@300.
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   374
     top2 := StandardSystemView new label:'partner'; extent:200@200.
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   375
     top1 bePartner.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   376
     top2 bePartner.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   377
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   378
     top1 open.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   379
     top2 openInGroup:(top1 windowGroup)
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   380
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   381
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   382
    "Created: 10.12.1995 / 13:29:59 / cg"
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   383
    "Modified: 25.5.1996 / 11:44:48 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   384
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   385
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   386
bePopUpView
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   387
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   388
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   389
        type := (type bitClear:WindowTypeMask) bitOr:TypePopUp.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   390
        ^ self.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   391
    ].
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   392
    type := #popup 
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   393
!
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   394
4798
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   395
beScreenDialog
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   396
    "make me a Screen-Dialog Window; that is one which raises above ALL other windows
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   397
     (not only st/x ones)"
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   398
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   399
    "/ the nonInteger handling code is for backward compatibility only.
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   400
    type isInteger ifTrue:[
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   401
        type := (type bitClear:WindowTypeMask) bitOr:TypeScreenDialog.
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   402
        ^ self.
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   403
    ].
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   404
    type := #dialog 
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   405
!
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   406
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   407
beSlave
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   408
    "make this a slave-view. It will be closed automatically,
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   409
     whenever any master of the windowgroup is closed.
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   410
     See also: #bePartner"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   411
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   412
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   413
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   414
        type := (type bitClear:MasterSlaveMask) bitOr:TypeSlave.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   415
        ^ self.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   416
    ].
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   417
    type := #slave 
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   418
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   419
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   420
     create two topViews within the same group:
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   421
     the slave is allowed to be iconified/close independ of the master;
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   422
     but if the master is iconified, the slave is also.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   423
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   424
     |top1 top2|
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   425
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   426
     top1 := StandardSystemView new label:'master'; extent:300@300.
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   427
     top2 := StandardSystemView new label:'slave'; extent:200@200.
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   428
     top1 beMaster.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   429
     top2 beSlave.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   430
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   431
     top1 open.
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   432
     top2 openInGroup:(top1 windowGroup)
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   433
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   434
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   435
    "Created: 10.12.1995 / 13:29:10 / cg"
712
7d1330ebc4b8 commentary
Claus Gittinger <cg@exept.de>
parents: 658
diff changeset
   436
    "Modified: 25.5.1996 / 11:45:30 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   437
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   438
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   439
beToolDialog
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   440
    "/ the nonInteger handling code is for backward compatibility only.
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   441
    type isInteger ifTrue:[
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   442
        type := (type bitClear:WindowTypeMask) bitOr:TypeToolDialog.
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   443
        ^ self.
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   444
    ].
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   445
    type := #dialog 
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   446
!
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   447
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   448
beToolWindow
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   449
    "/ the nonInteger handling code is for backward compatibility only.
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   450
    type isInteger ifTrue:[
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   451
        type := (type bitClear:WindowTypeMask) bitOr:TypeToolWindow.
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   452
        ^ self.
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   453
    ].
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   454
    type := nil 
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   455
!
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   456
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   457
beUndecorated
4798
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   458
    "make me an undecorated Window"
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   459
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   460
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   461
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   462
        type := (type bitClear:WindowTypeMask) bitOr:TypeUndecorated.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   463
        ^ self.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   464
    ].
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   465
    type := nil
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   466
!
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   467
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   468
focusSequence:aCollectionOfSubcomponents
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   469
    "define the sequence for stepping through my components."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   470
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   471
    windowGroup isNil ifTrue:[
4140
c381908afb03 *** empty log message ***
werner
parents: 4138
diff changeset
   472
	windowGroup := self windowGroupClass new.
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   473
    ].
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   474
    windowGroup focusSequence:aCollectionOfSubcomponents.
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   475
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   476
    "Created: 6.3.1996 / 15:37:11 / cg"
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   477
    "Modified: 30.4.1996 / 15:41:40 / cg"
4569
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   478
!
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   479
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   480
preferFirstInputFieldWhenAssigningInitialFocus
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   481
    "define the focus behavior for dialogs.
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   482
     If true is returned, input fields take precedence over other keyboard consumers.
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   483
     This used to return true, but the behavior is somewhat ugly."
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   484
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   485
    ^ false
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   486
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   487
    "Created: / 29-08-2006 / 14:28:54 / cg"
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   488
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   489
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   490
!TopView methodsFor:'event handling'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   491
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   492
keyPress:key x:x y:y
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   493
    "notice: this is going to be moved into the upcoming 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   494
     StandardSystemViewController."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   495
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   496
    <resource: #keyboard ( #Tab 
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   497
                           #FocusNext #FocusPrevious 
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   498
                           #CursorDown #CursorUp ) >
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   499
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   500
    windowGroup notNil ifTrue:[
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   501
        key == #Tab ifTrue:[
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   502
            self sensor shiftDown ifTrue:[
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   503
                windowGroup focusPrevious
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   504
            ] ifFalse:[
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   505
                windowGroup focusNext
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   506
            ].
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   507
            ^ self.
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   508
        ].
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   509
        (key == #FocusNext or:[key == #CursorDown]) ifTrue:[
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   510
            windowGroup focusNext.
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   511
            ^ self.
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   512
        ].
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   513
        (key == #FocusPrevious or:[key == #CursorUp])  ifTrue:[
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   514
            windowGroup focusPrevious.
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   515
            ^ self.
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   516
        ].
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   517
    ].
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   518
932
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   519
    super keyPress:key x:x y:y
1748c4b8b848 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 909
diff changeset
   520
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   521
    "Created: 1.2.1996 / 22:08:30 / cg"
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
   522
    "Modified: 9.1.1997 / 12:17:38 / cg"
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   523
!
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
   524
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   525
showActivity:someMessage
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   526
    "some activityNotification shalt be communicated to
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   527
     the user. 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   528
     Default for activity notifications here: ignore them"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   529
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   530
    ^ self
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   531
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   532
    "Created: 16.12.1995 / 18:40:13 / cg"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   533
    "Modified: 23.4.1996 / 21:38:27 / cg"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   534
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   535
2466
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   536
!TopView methodsFor:'help stubs'!
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   537
3697
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   538
flyByHelpTextFor:aSubView
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   539
    "this will vanish - its temporarily here to allow for stdSysViews to be
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   540
     used as a masterApp for dialogs"
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   541
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   542
    ^ nil
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   543
!
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   544
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   545
helpTextFor:aSubView
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   546
    "this will vanish - its temporarily here to allow for stdSysViews to be
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   547
     used as a masterApp for dialogs"
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   548
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   549
    ^ nil
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   550
!
44233528f334 flyByHelpTextFor:
Claus Gittinger <cg@exept.de>
parents: 3621
diff changeset
   551
2466
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   552
showHelp:aHelpText for:aView
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   553
    "dummy - added in case a regular topView is installed
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   554
     as a dialogs masterApplication.
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   555
     Concrete application subclasses may redefine this to
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   556
     display a help text in one of its message areas"
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   557
! !
6a85fa3b62a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2326
diff changeset
   558
3884
dc9ea4cfc963 method category rename
Claus Gittinger <cg@exept.de>
parents: 3881
diff changeset
   559
!TopView methodsFor:'initialization & release'!
2573
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   560
4438
abc5f1353b01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   561
addToCurrentProject
abc5f1353b01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   562
    "for compatibility with views which can"
abc5f1353b01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   563
!
abc5f1353b01 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4424
diff changeset
   564
4178
e176977f5f2c initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   565
assignInitialKeyboardFocus
e176977f5f2c initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   566
    "assign the initial keyboard focus to a 'useful' component."
e176977f5f2c initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   567
4180
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   568
    |componentWithInitialFocus|
4178
e176977f5f2c initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   569
4180
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   570
"/    |keyboardProcessor componentWithInitialFocus|
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   571
"/
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   572
"/    keyboardProcessor := self keyboardProcessor.
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   573
"/    keyboardProcessor notNil ifTrue:[
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   574
"/        componentWithInitialFocus := keyboardProcessor componentWithInitialFocus.
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   575
"/        componentWithInitialFocus notNil ifTrue:[
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   576
"/            self windowGroup focusView:componentWithInitialFocus byTab:true.
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   577
"/            "/ componentWithInitialFocus requestFocus.                    
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   578
"/            ^ self.
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   579
"/        ]
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   580
"/    ].
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   581
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   582
    (windowGroup notNil 
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   583
    and:[(componentWithInitialFocus := windowGroup defaultKeyboardConsumer) notNil]) ifTrue:[
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   584
        windowGroup focusView:componentWithInitialFocus byTab:true "false".
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   585
    ] ifFalse:[
85392e34c7a7 initial focus
Claus Gittinger <cg@exept.de>
parents: 4178
diff changeset
   586
        self assignKeyboardFocusToFirstInputField.
4178
e176977f5f2c initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   587
    ].
e176977f5f2c initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   588
!
e176977f5f2c initial focus - allow explicit setup via InputFieldSpec
Claus Gittinger <cg@exept.de>
parents: 4140
diff changeset
   589
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   590
assignKeyboardFocusToFirstInputField
4569
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   591
    "assign the keyboard focus to the first first keyboardConsumer.
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   592
     (in older versions, this used to favour inputfields over editFields;
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   593
      see (or redefine) preferFirstInputFieldWhenAssigningInitialFocus)"
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   594
4569
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   595
    |firstInputField firstConsumer firstCursorConsumer consumer|
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   596
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   597
    self allSubViewsDo:[:v |
4569
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   598
        (firstInputField isNil and:[v isInputField]) ifTrue:[
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   599
            firstInputField := v
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   600
        ].
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   601
        (firstConsumer isNil and:[v isKeyboardConsumer]) ifTrue:[
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   602
            firstConsumer := v
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   603
        ].
3712
b32f73e34e34 second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents: 3706
diff changeset
   604
        (firstCursorConsumer isNil and:[v isCursorKeyConsumer]) ifTrue:[
b32f73e34e34 second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents: 3706
diff changeset
   605
            firstCursorConsumer := v
b32f73e34e34 second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents: 3706
diff changeset
   606
        ].
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   607
    ].
4569
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   608
    self preferFirstInputFieldWhenAssigningInitialFocus ifTrue:[
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   609
        consumer := firstInputField.
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   610
    ].
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   611
    consumer := (consumer ? firstConsumer ? firstCursorConsumer).
3712
b32f73e34e34 second chance initial focus in dialog is to cursorKeyConsumers
Claus Gittinger <cg@exept.de>
parents: 3706
diff changeset
   612
    consumer notNil ifTrue:[
4569
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   613
        device platformName = 'WIN32' ifTrue:[
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   614
            self windowGroup focusView:consumer byTab:true.
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   615
        ] ifFalse:[
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   616
            consumer requestFocus.
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   617
            "/ consumer requestFocus. - could be denied; but we force it here
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   618
            windowGroup focusView:consumer byTab:false.
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   619
        ].
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   620
    ].
2693
8de1d8fd9a55 changed initial focus assignment
Claus Gittinger <cg@exept.de>
parents: 2590
diff changeset
   621
4569
f7a22f2c6e5a initial focus behavior
Claus Gittinger <cg@exept.de>
parents: 4522
diff changeset
   622
    "Modified: / 29-08-2006 / 14:32:30 / cg"
2590
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   623
!
90d1e3277513 moved #assignKeyboardFocusToFirst....
Claus Gittinger <cg@exept.de>
parents: 2573
diff changeset
   624
2573
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   625
destroy
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   626
    "the receiver is to be destroyed - look for partners and slaves"
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   627
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   628
    |wg dev|
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   629
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   630
    wg := windowGroup.                  "/ have to fetch windowGroup before;
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   631
    dev := device.                      "/ and device ...
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   632
    super destroy.                      "/ ... since destroy nils em
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   633
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   634
"/    dev notNil ifTrue:[
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   635
"/        dev flush
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   636
"/    ].
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   637
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   638
    "/
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   639
    "/ destroy slaves and partners
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   640
    "/
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   641
    self masterSlaveMessage:#destroy inGroup:wg
437ff42d1ba3 category change
Claus Gittinger <cg@exept.de>
parents: 2488
diff changeset
   642
3446
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
   643
    "Modified: 20.3.1997 / 22:14:16 / cg"
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
   644
!
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   645
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   646
initialize
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   647
    "initialize the topViews position for the screens center"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   648
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   649
    |screenCenter|
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   650
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   651
    super initialize.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   652
2874
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   653
    device initializeTopViewHookFor:self.
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   654
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   655
    screenCenter := device center.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   656
    left := screenCenter x - (width // 2).
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   657
    top := screenCenter y - (height // 2).
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   658
    type := 0
2874
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   659
!
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   660
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   661
postRealize
213e4f118402 postRealize and initializeHooks added.
Claus Gittinger <cg@exept.de>
parents: 2808
diff changeset
   662
    super postRealize.
3370
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   663
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   664
    keyboardProcessor isNil ifTrue:[
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   665
        keyboardProcessor := KeyboardProcessor new.
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   666
    ].
3a4990b6bfb5 keyboardProcessor lifted (to have it in dialogs, too)
ca
parents: 3347
diff changeset
   667
3446
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
   668
    device realizedTopViewHookFor:self
3706
c2b41c6ea4ef destroy - release
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   669
!
c2b41c6ea4ef destroy - release
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   670
4407
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   671
realize
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   672
    self isMarkedAsUnmappedModalBox ifTrue:[
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   673
        "/ must clear this flag
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   674
        "/ - otherwise realize thinks it is already realized.
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   675
        realized := false.
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   676
        self unmarkAsUnmappedModalBox.
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   677
    ].
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   678
    super realize.
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   679
!
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
   680
3706
c2b41c6ea4ef destroy - release
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   681
release
c2b41c6ea4ef destroy - release
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   682
    keyboardProcessor notNil ifTrue:[
c2b41c6ea4ef destroy - release
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   683
        keyboardProcessor release.
c2b41c6ea4ef destroy - release
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   684
        keyboardProcessor := nil.
c2b41c6ea4ef destroy - release
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   685
    ].
c2b41c6ea4ef destroy - release
Claus Gittinger <cg@exept.de>
parents: 3697
diff changeset
   686
    super release
3446
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
   687
! !
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   688
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   689
!TopView methodsFor:'misc'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   690
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   691
raiseDeiconified
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   692
    "deiconify & bring to front"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   693
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   694
    self isCollapsed ifTrue:[
3818
6a5b62a616a7 do not unmap in order to raiseDeiconified
Claus Gittinger <cg@exept.de>
parents: 3768
diff changeset
   695
"/        self unmap.
645
a62615e26583 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
   696
        self realize.
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   697
    ].
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   698
    self raise
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   699
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   700
    "
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   701
     Transcript topView raiseDeiconified
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   702
    "
645
a62615e26583 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
   703
a62615e26583 Rename unrealize-->unmap.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
   704
    "Modified: 3.5.1996 / 23:49:36 / stefan"
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   705
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   706
2124
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   707
waitUntilClosed
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   708
    "wait until the receiver has been closed.
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   709
     Can be used to synchronize multiple-window applications,
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   710
     and (especially) to wait until an application session is finished
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   711
     when invoking commands with the rDoit mechanism"
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   712
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   713
    [drawableId isNil] whileFalse:[
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   714
        Delay waitForSeconds:0.1.
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   715
    ].
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   716
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   717
    "asynchronous:
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   718
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   719
     EditTextView open
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   720
    "
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   721
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   722
    "synchronous:
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   723
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   724
     EditTextView open topView waitUntilClosed
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   725
    "
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   726
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   727
    "Modified: / 20.5.1998 / 18:03:37 / cg"
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   728
!
750a1fc2a510 added #waitUntilClosed (mostly for rdoit)
Claus Gittinger <cg@exept.de>
parents: 2103
diff changeset
   729
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   730
withCursor:aCursor do:aBlock
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   731
    "evaluate aBlock while showing aCursor in all my views.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   732
     Return the value as returned by aBlock."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   733
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   734
    windowGroup notNil ifTrue:[
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
   735
        ^ windowGroup withCursor:aCursor do:aBlock
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   736
    ].
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   737
    ^ super withCursor:aCursor do:aBlock
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   738
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   739
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   740
!TopView methodsFor:'queries'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   741
4338
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   742
beepWhenOpening
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   743
    ^ false
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   744
!
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   745
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   746
heightIncludingBorder
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   747
    "return the views overall-height"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   748
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   749
    ^ height
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   750
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   751
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   752
isCollapsed
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   753
    "ST80 compatibility: return true if the view is not shown (i.e. iconified)"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   754
1536
9c4e6fd967fb comment
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
   755
    "/ ^ device windowIsIconified:drawableId
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   756
    ^ shown not
1536
9c4e6fd967fb comment
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
   757
9c4e6fd967fb comment
Claus Gittinger <cg@exept.de>
parents: 1519
diff changeset
   758
    "Modified: 4.4.1997 / 14:44:39 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   759
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   760
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   761
isDialogView
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   762
    "return true if this is a dialog view"
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   763
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   764
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   765
        ^ (type bitAnd:WindowTypeMask) == TypeDialog
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   766
    ].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   767
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   768
    ^ type == #dialog
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   769
!
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   770
4500
964544126594 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4498
diff changeset
   771
isMDIClientView
4498
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   772
    ^ (type bitAnd:MDIClientMask) == MDIClient.
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   773
!
Claus Gittinger <cg@exept.de>
parents: 4438
diff changeset
   774
3620
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   775
isMaster
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   776
    "return true, if this is a masterView"
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   777
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   778
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   779
        ^ (type bitAnd:MasterSlaveMask) == TypeMaster
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   780
    ].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   781
    "/ the nonInteger handling code is for backward compatibility only.
3620
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   782
    ^ type == #master
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   783
!
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   784
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   785
isModal
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   786
    "return true, if the receiver has been opened modal"
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   787
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   788
    windowGroup isNil ifTrue:[^ false].
3446
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
   789
    ^ windowGroup isModal
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
   790
!
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
   791
3621
5990a5870777 added isPartner
Claus Gittinger <cg@exept.de>
parents: 3620
diff changeset
   792
isPartner
5990a5870777 added isPartner
Claus Gittinger <cg@exept.de>
parents: 3620
diff changeset
   793
    "return true, if this is a partnerView"
5990a5870777 added isPartner
Claus Gittinger <cg@exept.de>
parents: 3620
diff changeset
   794
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   795
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   796
        ^ (type bitAnd:MasterSlaveMask) == TypePartner
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   797
    ].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   798
    "/ the nonInteger handling code is for backward compatibility only.
3621
5990a5870777 added isPartner
Claus Gittinger <cg@exept.de>
parents: 3620
diff changeset
   799
    ^ type == #partner
5990a5870777 added isPartner
Claus Gittinger <cg@exept.de>
parents: 3620
diff changeset
   800
!
5990a5870777 added isPartner
Claus Gittinger <cg@exept.de>
parents: 3620
diff changeset
   801
1398
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   802
isPopUpView
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   803
    "return true if I am a popup view.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   804
     (i.e. I want to come up without decoration and popUp to top immediately)"
1398
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   805
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   806
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   807
        ^ (type bitAnd:WindowTypeMask) == TypePopUp
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   808
    ].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   809
    "/ the nonInteger handling code is for backward compatibility only.
1398
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   810
    ^ type == #popup
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   811
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   812
    "Created: 28.2.1997 / 22:12:30 / cg"
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   813
    "Modified: 28.2.1997 / 22:37:01 / cg"
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   814
!
8b54a84a6367 changed #isPopUpView
Claus Gittinger <cg@exept.de>
parents: 1396
diff changeset
   815
4798
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   816
isScreenDialog
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   817
    "return true if I am a screen dialog view.
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   818
     (i.e. I want to come up anove all other windows"
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   819
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   820
    type isInteger ifTrue:[
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   821
        ^ (type bitAnd:WindowTypeMask) == TypeScreenDialog
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   822
    ].
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   823
    "/ the nonInteger handling code is for backward compatibility only.
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   824
    ^ false
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   825
!
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
   826
3620
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   827
isSlave
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   828
    "return true, if this is a slaveView"
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   829
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   830
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   831
        ^ (type bitAnd:MasterSlaveMask) == TypeSlave
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   832
    ].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   833
    "/ the nonInteger handling code is for backward compatibility only.
3620
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   834
    ^ type == #slave
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   835
!
8202baeec111 added isSlave, isMaster
Claus Gittinger <cg@exept.de>
parents: 3585
diff changeset
   836
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   837
isToolDialog
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   838
    "return true if I am a toolWindow dialog view.
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   839
     (i.e. I want to come up with a smaller window-title area)"
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   840
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   841
    type isInteger ifTrue:[
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   842
        ^ (type bitAnd:WindowTypeMask) == TypeToolDialog
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   843
    ].
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   844
    "/ the nonInteger handling code is for backward compatibility only.
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   845
    ^ false
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   846
!
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   847
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   848
isToolWindow
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   849
    "return true if I am a toolWindow view.
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   850
     (i.e. I want to come up with a smaller window-title area)"
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   851
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   852
    type isInteger ifTrue:[
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   853
        ^ (type bitAnd:WindowTypeMask) == TypeToolWindow
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   854
    ].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   855
    "/ the nonInteger handling code is for backward compatibility only.
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   856
    ^ false
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   857
!
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   858
1481
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   859
isTopView
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   860
    "return true, since I am a topView"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   861
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   862
    ^ true
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   863
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   864
    "Created: 22.3.1997 / 14:45:55 / cg"
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   865
!
335881213805 added #isTopView query
Claus Gittinger <cg@exept.de>
parents: 1476
diff changeset
   866
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   867
isUndecoratedView
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   868
    "return true if I am an undecorated view."
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   869
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   870
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   871
        ^ (type bitAnd:WindowTypeMask) == TypeUndecorated
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   872
    ].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   873
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   874
    ^ false
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   875
!
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   876
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   877
preferredExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   878
    "return my preferred extent - this is the minimum size I would like to have.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   879
     The default here is the classes default extent,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   880
     however many subclasses redefine this to compute the actual value
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   881
     depending on the sizes of the contents or subcomponents."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   882
966
8e202c385338 handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   883
    "/ If I have an explicit preferredExtent ..
8e202c385338 handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   884
761
34d17118452a care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
   885
    preferredExtent notNil ifTrue:[
34d17118452a care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
   886
        ^ preferredExtent
34d17118452a care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
   887
    ].
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   888
    ^ self class defaultExtent
761
34d17118452a care for preSet preferredExtent
Claus Gittinger <cg@exept.de>
parents: 712
diff changeset
   889
966
8e202c385338 handle Text items in xOfCol...
Claus Gittinger <cg@exept.de>
parents: 960
diff changeset
   890
    "Modified: 19.7.1996 / 20:45:41 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   891
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   892
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   893
widthIncludingBorder
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   894
    "return the views overall-width"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   895
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   896
    ^ width
2808
627ce4f2a090 respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   897
!
627ce4f2a090 respond to #window - for compatibility with appModel
Claus Gittinger <cg@exept.de>
parents: 2799
diff changeset
   898
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   899
windowStyle
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   900
    "return a symbol describing my style which should be one of
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   901
     #dialog, #popUp, #undecorated, #normal or #toolWindow.
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   902
     This is used by the device as a decoration hint."
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   903
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   904
    |t|
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   905
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   906
    type isInteger ifTrue:[
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   907
        t := type bitAnd:WindowTypeMask.
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   908
        t == TypeUndecorated ifTrue:[^ #undecorated].
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   909
        t == TypeDialog ifTrue:[^ #dialog].
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   910
        t == TypePopUp ifTrue:[^ #popUp].
4254
4e1ead8d389a *** empty log message ***
ca
parents: 4191
diff changeset
   911
        t == TypeToolWindow ifTrue:[^ #toolWindow].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   912
        t == TypeToolDialog ifTrue:[^ #toolDialog].
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   913
        ^ #normal
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   914
    ].
4256
323ae7edb0fe *** empty log message ***
ca
parents: 4255
diff changeset
   915
    "/ the nonInteger handling code is for backward compatibility only.
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
   916
    ^ super windowStyle
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   917
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   918
4338
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   919
!TopView methodsFor:'realization'!
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   920
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   921
openModal
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   922
    "added bell to wake up user"
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   923
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   924
    (self beepWhenOpening) ifTrue:[
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   925
        self beep.
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   926
    ].
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   927
    super openModal
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   928
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   929
    "
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   930
     self warn:'hello'
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   931
     self information:'hello'
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   932
     ModalBox new openModal
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   933
     WarningBox new openModal
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   934
     InfoBox new openModal
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   935
    "
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   936
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   937
    "Modified: 28.5.1996 / 16:59:01 / cg"
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   938
! !
769232b6ca5e beep control
Claus Gittinger <cg@exept.de>
parents: 4309
diff changeset
   939
3881
6661ab0fa781 method category rename
Claus Gittinger <cg@exept.de>
parents: 3880
diff changeset
   940
!TopView methodsFor:'show & hide'!
1399
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   941
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   942
activate
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   943
    "added for MS-windows - much like raise.
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   944
     Raise/Activate seem to work only within my own (ST/X)-windows;
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   945
     they do not raise one of my views above another (for example: command.com)-window.
4424
c4154f4897e1 comments
Claus Gittinger <cg@exept.de>
parents: 4407
diff changeset
   946
     Can anyone tell me what the difference between raise, activate and setForeground 
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   947
     really is (I mean really - not what is written in the crappy documentation)"
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   948
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   949
    drawableId isNil ifTrue:[self create].
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   950
    device activateWindow:drawableId
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   951
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   952
    "
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   953
     Transcript topView activate
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   954
    "
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   955
!
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
   956
1399
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   957
fixPosition:aPoint
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   958
    "set origin to aPoint, but make sure, that the box is fully visible 
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   959
     by shifting it into the visible screen area if nescessary.
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   960
     This prevents invisible modalBoxes (which you could never close)."
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   961
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   962
    self origin:aPoint.
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   963
    self makeFullyVisible
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   964
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
   965
    "Created: 28.2.1997 / 16:39:31 / cg"
1401
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   966
!
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   967
3916
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   968
map
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   969
    "make the view visible on the screen.
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   970
     For topViews, the windowManager will choose (or ask for) the
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   971
     views position on the screen.
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   972
     Notice:
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   973
        Actually, this method is only valid for topViews;
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   974
        however, it is defined here to allow things like 'Button new realize'"
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   975
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   976
    self mapAt:(self origin) iconified:false
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   977
!
5452ecf8d6ef map at old position (remap)
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   978
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   979
mapIconified
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   980
    "make the view visible but iconified.
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   981
     In contrast to map, which does it non-iconified"
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   982
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   983
    realized ifFalse:[
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   984
        "
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   985
         now, make the view visible
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   986
        "
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   987
        realized := true.
2103
dbe7a348084f do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   988
        device
dbe7a348084f do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   989
            mapView:self id:drawableId iconified:true
dbe7a348084f do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   990
            atX:left y:top width:width height:height
dbe7a348084f do not forget minExtent/maxExtent in remap
Claus Gittinger <cg@exept.de>
parents: 1836
diff changeset
   991
            minExtent:(self minExtent) maxExtent:(self maxExtent)
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   992
    ]
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   993
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   994
    "Modified: 25.2.1997 / 22:44:33 / cg"
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   995
    "Created: 24.7.1997 / 12:48:21 / cg"
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   996
!
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
   997
1401
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   998
positionOffset
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
   999
    "return the delta, by which the box should be
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
  1000
     displaced from the mouse pointer.
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
  1001
     Here, the boxes center is returned as a default.
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
  1002
     Usually redefined in subclasses to have the most convenient
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
  1003
     ok-button appear under the pointer."
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
  1004
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
  1005
    ^ self extent // 2
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
  1006
fca5f070bc0b positionOffset also defined here
Claus Gittinger <cg@exept.de>
parents: 1399
diff changeset
  1007
    "Created: 28.2.1997 / 22:56:34 / cg"
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1008
!
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1009
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1010
raise
4424
c4154f4897e1 comments
Claus Gittinger <cg@exept.de>
parents: 4407
diff changeset
  1011
    "MS-windows:
4522
4dcd83c66861 comments
Stefan Vogel <sv@exept.de>
parents: 4500
diff changeset
  1012
     Raise does not raise a window about windows marked as 'TOPMOST'.
4dcd83c66861 comments
Stefan Vogel <sv@exept.de>
parents: 4500
diff changeset
  1013
     (e.g. cmd.exe appears to mark itself as topmost when it gets the focus)"
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1014
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1015
    drawableId isNil ifTrue:[self create].
4354
bfd240fa5c81 raise bug - also for modal views
Claus Gittinger <cg@exept.de>
parents: 4353
diff changeset
  1016
4362
00fdb904e508 setForegroundWindow disabled.
penk
parents: 4361
diff changeset
  1017
false ifTrue:[
4360
d7ef38e69f1d raise again (WIN32).
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  1018
    "WIN32 does not raise above other windows"
4354
bfd240fa5c81 raise bug - also for modal views
Claus Gittinger <cg@exept.de>
parents: 4353
diff changeset
  1019
    device platformName = 'WIN32' ifTrue:[
4360
d7ef38e69f1d raise again (WIN32).
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  1020
        "do not do this for popUps, otherwise nested popUpMenus
d7ef38e69f1d raise again (WIN32).
Claus Gittinger <cg@exept.de>
parents: 4359
diff changeset
  1021
         wont give back their focus correctly - sigh"
4361
48d92da2bcdf raising again (wrong focus in dialogs)
Claus Gittinger <cg@exept.de>
parents: 4360
diff changeset
  1022
        self isModal ifFalse:[
4356
a5fe3fb83a94 oops - do not use setForeground for popUps.
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  1023
            device setForegroundWindow:drawableId.
a5fe3fb83a94 oops - do not use setForeground for popUps.
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  1024
        ]
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1025
    ].
4362
00fdb904e508 setForegroundWindow disabled.
penk
parents: 4361
diff changeset
  1026
].
4357
068e2607388a raise again.
Claus Gittinger <cg@exept.de>
parents: 4356
diff changeset
  1027
    super raise
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1028
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1029
    "
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1030
     Transcript topView activate
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1031
    "
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1032
!
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1033
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1034
setForegroundWindow
4522
4dcd83c66861 comments
Stefan Vogel <sv@exept.de>
parents: 4500
diff changeset
  1035
    "make a window the foreground window (so raise and activate it).
4dcd83c66861 comments
Stefan Vogel <sv@exept.de>
parents: 4500
diff changeset
  1036
     Under Win 98/Me/XP/2000 the window is not raised/activated, if a window from
4dcd83c66861 comments
Stefan Vogel <sv@exept.de>
parents: 4500
diff changeset
  1037
     a different process is currently active - in this case the title bar/icon is flashed.
4dcd83c66861 comments
Stefan Vogel <sv@exept.de>
parents: 4500
diff changeset
  1038
     this also raises the priority of the sending thread slightly"                  
4353
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1039
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1040
    drawableId isNil ifTrue:[self create].
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1041
    device setForegroundWindow:drawableId
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1042
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1043
    "
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1044
     Transcript topView setForegroundWindow
4547c189668a raise bug under win32
Claus Gittinger <cg@exept.de>
parents: 4338
diff changeset
  1045
    "
1399
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  1046
! !
a10829e54d2c fixPosition moved from ModalBox
Claus Gittinger <cg@exept.de>
parents: 1398
diff changeset
  1047
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1048
!TopView methodsFor:'startup'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1049
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1050
openAt:aPosition transientFor:anotherView
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1051
    "force the view to be opened at some position on the screen
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1052
     AND tell the windowManager to NOT let the user choose a position
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1053
     (i.e. suppress any ghostframe).
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1054
     The view is marked as being a transient (i.e. pop-up) view for
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1055
     anotherView - it will deiconify with it and (on some windowManagers)
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1056
     have no iconify button of its own.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1057
     Notice, that its up to the windowManager to care for any borders -
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1058
     it seems not deterministic, where the view actually ends up being positioned.
909
d2d624d57f61 renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 908
diff changeset
  1059
     Not all windowManagers (olwm) honor this - some insist on it ..."
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1060
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1061
    |otherId|
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1062
1836
df791f4fe7b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1829
diff changeset
  1063
    drawableId isNil ifTrue:[self create].
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1064
    anotherView isNil ifTrue:[
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1065
        otherId := drawableId.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1066
    ] ifFalse:[
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1067
        anotherView create.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1068
        otherId := anotherView id.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1069
    ].
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1070
    device setTransient:drawableId for:otherId.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1071
    self origin:aPosition.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1072
    self open
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1073
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1074
    "
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1075
     |v1 v2|
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1076
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1077
     v1 := StandardSystemView extent:300@300.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1078
     v2 := StandardSystemView extent:300@300.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1079
     v1 open.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1080
     v2 openAt:0@0 transientFor:v1.
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1081
    "
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1082
960
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1083
    "
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1084
     |v1|
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1085
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1086
     v1 := StandardSystemView extent:300@300.
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1087
     v1 openAt:0@0 transientFor:v1.
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1088
    "
b9bd0a5c4884 example
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
  1089
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1090
    "Created: 28.6.1996 / 10:51:55 / cg"
1836
df791f4fe7b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1829
diff changeset
  1091
    "Modified: 28.7.1997 / 18:53:16 / cg"
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1092
!
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1093
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1094
openDisplayAt:aPoint
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1095
    "ST-80 compatibility: open the view centered around aPoint"
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1096
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1097
    ^ self openModelessAt:(aPoint - (self extent//2))
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1098
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1099
    "
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1100
     (TopView new extent:200@200) openDisplayAt:300@300
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1101
    "
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1102
!
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1103
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1104
openIconified
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1105
    "open the view in iconified state"
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1106
1829
f6a2d9e8d7c1 fixed #openIconified
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
  1107
    self openModelessAt:nil iconified:true
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1108
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1109
    "
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1110
     FileBrowser new openIconified
1829
f6a2d9e8d7c1 fixed #openIconified
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
  1111
     ChangesBrowser new openIconified
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1112
    "
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1113
1829
f6a2d9e8d7c1 fixed #openIconified
Claus Gittinger <cg@exept.de>
parents: 1821
diff changeset
  1114
    "Modified: 24.7.1997 / 14:54:58 / cg"
1821
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1115
!
d2b91606dc55 added #mapIconified and #openIconified.
Claus Gittinger <cg@exept.de>
parents: 1765
diff changeset
  1116
1336
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1117
openIn:aBoundaryRectangle
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1118
    "set origin & extent and open. 
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1119
     The given extent overrides the receivers preferredExtent.
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1120
     Added for ST-80 compatibility"
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1121
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1122
    self 
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1123
        origin:aBoundaryRectangle origin; 
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1124
        extent:aBoundaryRectangle extent; 
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1125
        sizeFixed:true.
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1126
    self open
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1127
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1128
    "Modified: 12.2.1997 / 11:58:21 / cg"
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1129
!
15847aa31d5c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1317
diff changeset
  1130
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1131
openTransientAt:aPosition
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1132
    "force the view to be opened at soem position on the screen
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1133
     AND tell the windowManager to NOT let the user choose a position
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1134
     (i.e. suppress any ghostframe).
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1135
     Notice, that its up to the windowManager to care for any borders -
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1136
     it seems not deterministic, where the view actually ends up being positioned.
909
d2d624d57f61 renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 908
diff changeset
  1137
     Not all windowManagers (olwm) honor this - some insist on it ..."
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1138
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1139
    self openAt:aPosition transientFor:nil
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1140
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1141
    "normal open:
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1142
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1143
     |v|
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1144
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1145
     v := StandardSystemView extent:300@300.
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1146
     v open
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1147
    "
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1148
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1149
    "open at position:
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1150
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1151
     |v|
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1152
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1153
     v := StandardSystemView extent:300@300.
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1154
     v openTransientAt:10@10
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1155
    "
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1156
908
0fbe814e06ee renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 907
diff changeset
  1157
    "Created: 28.6.1996 / 10:52:30 / cg"
909
d2d624d57f61 renamed #openAt: to #openTransientAt:
Claus Gittinger <cg@exept.de>
parents: 908
diff changeset
  1158
    "Modified: 28.6.1996 / 10:55:15 / cg"
907
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1159
!
6bc7254cdd6a added #openAt: - open a view at forced position
Claus Gittinger <cg@exept.de>
parents: 775
diff changeset
  1160
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1161
openWithExtent:anExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1162
    "set extent and open. The given extent overrides the 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1163
     receivers preferredExtent.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1164
     Added for ST-80 compatibility"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1165
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1166
    self extent:anExtent; sizeFixed:true.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1167
    self open
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1168
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1169
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1170
openWithPriority:aPriority
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1171
    "open the view, run the windowgroup process at
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1172
     other than UserScehdulingPriority."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1173
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1174
    self open.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1175
    windowGroup process priority:aPriority.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1176
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1177
    "Created: 30.4.1996 / 15:34:44 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1178
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1179
157
claus
parents: 153
diff changeset
  1180
!TopView methodsFor:'window events'!
claus
parents: 153
diff changeset
  1181
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1182
mapped 
4355
76a0dbfc0385 raising
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  1183
    "the recevier was mapped (i.e. deiconified);
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1184
     look for partners and slaves."
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1185
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1186
    realized := true. 
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1187
    super mapped.
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1188
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1189
    "/
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1190
    "/ map slaves and partners
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1191
    "/
2799
e7b1ea0db727 partners must be remapped (at the old position)
Claus Gittinger <cg@exept.de>
parents: 2693
diff changeset
  1192
    self masterSlaveMessage:#remap inGroup:windowGroup.
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1193
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1194
    self isModal ifTrue:[
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1195
        "take it away from any popup menu possibly still active"
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1196
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1197
        self forceUngrabKeyboard.
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1198
        self forceUngrabPointer.
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1199
        "
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1200
         get the focus
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1201
        "
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1202
        self getKeyboardFocus.
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1203
        self enableEnterLeaveEvents
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1204
    ] ifFalse:[
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1205
        "
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1206
         ask for the focus - this avoids having to click on the
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1207
         view with WM's which need an explicit click.
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1208
         Q: is this a good idea ?
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1209
        "
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1210
        TakeFocusWhenMapped == true ifTrue:[
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1211
            self getKeyboardFocus.
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1212
        ]
4355
76a0dbfc0385 raising
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  1213
    ].
76a0dbfc0385 raising
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  1214
    device platformName = 'WIN32' ifTrue:[
76a0dbfc0385 raising
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  1215
        self raise
76a0dbfc0385 raising
Claus Gittinger <cg@exept.de>
parents: 4354
diff changeset
  1216
    ].
3347
e7b8350d6525 ismodal moved up;
ca
parents: 3152
diff changeset
  1217
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1218
    "Modified: / 10.9.1998 / 22:02:52 / cg"
3446
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
  1219
    "Modified: 30.5.1996 / 09:37:22 / cg"
e66622e4f832 defaultExtent: ask device
Claus Gittinger <cg@exept.de>
parents: 3370
diff changeset
  1220
!
2488
cb393b7431f0 oops - (re-)fixed mapped/unmapped with partner/slaves
Claus Gittinger <cg@exept.de>
parents: 2466
diff changeset
  1221
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
  1222
masterSlaveMessage:aSelector inGroup:aWindowGroup
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
  1223
    "send aSelector to partners and/or slaves.
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
  1224
     This is a private helper for destroy / mapped / unmapped"
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
  1225
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
  1226
    aWindowGroup notNil ifTrue:[
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1227
        "/
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1228
        "/ if I am a master or partner, send to all slaves
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1229
        "/
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
  1230
        (self isMaster or:[self isPartner]) ifTrue:[
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1231
            aWindowGroup slavesDo:[:v | v perform:aSelector].
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1232
        ].
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1233
        "/
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1234
        "/ if I am a partner, send to all partners
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1235
        "/
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
  1236
        self isPartner ifTrue:[
1353
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1237
            aWindowGroup partnersDo:[:v | v ~~ self ifTrue:[v perform:aSelector]].
d791b80c3bf1 checkin from browser
ca
parents: 1336
diff changeset
  1238
        ].
501
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
  1239
    ].
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
  1240
!
0a701f42de02 focusKey handling now done here & in Controller
Claus Gittinger <cg@exept.de>
parents: 419
diff changeset
  1241
157
claus
parents: 153
diff changeset
  1242
unmapped 
claus
parents: 153
diff changeset
  1243
    "the recevier was unmapped (i.e. iconified);
claus
parents: 153
diff changeset
  1244
     look for partners and slaves."
claus
parents: 153
diff changeset
  1245
3035
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  1246
    |r|
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  1247
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  1248
    (windowGroup notNil and:[windowGroup isModal]) ifTrue:[
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  1249
        "keep the realized flag true (to avoid exiting the modal event loop).
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  1250
         Consider this a kludge."
4407
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1251
        self markAsUnmappedModalBox.
3035
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  1252
        r := realized.
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  1253
    ] ifFalse:[
4407
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1254
        self unmarkAsUnmappedModalBox.
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1255
        r := realized := false. 
3035
3a4068306f55 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2936
diff changeset
  1256
    ].
4407
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1257
    super unmapped.
d0f371afaa58 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4362
diff changeset
  1258
    realized := r.
419
07b575e87a34 openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
  1259
07b575e87a34 openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
  1260
    "/
775
fbabce661c52 comment
Claus Gittinger <cg@exept.de>
parents: 761
diff changeset
  1261
    "/ unmap slaves and partners
419
07b575e87a34 openModal moved to SimpleView (can now open subviews modal)
Claus Gittinger <cg@exept.de>
parents: 416
diff changeset
  1262
    "/
658
ce56170b3fb1 renamed rerealize to remap
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
  1263
    self masterSlaveMessage:#unmap inGroup:windowGroup
157
claus
parents: 153
diff changeset
  1264
775
fbabce661c52 comment
Claus Gittinger <cg@exept.de>
parents: 761
diff changeset
  1265
    "Modified: 30.5.1996 / 09:37:22 / cg"
157
claus
parents: 153
diff changeset
  1266
! !
claus
parents: 153
diff changeset
  1267
1160
5eb12a5b8100 resource spec updated
Claus Gittinger <cg@exept.de>
parents: 966
diff changeset
  1268
!TopView class methodsFor:'documentation'!
135
claus
parents:
diff changeset
  1269
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
  1270
version
4798
096226757fdd + beScreenDialog
Michael Beyl <mb@exept.de>
parents: 4570
diff changeset
  1271
    ^ '$Header: /cvs/stx/stx/libview/TopView.st,v 1.115 2007-09-12 10:34:42 mb Exp $'
135
claus
parents:
diff changeset
  1272
! !
4079
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
  1273
8a66b0c94337 added new windowStyle: #undecorated.
Claus Gittinger <cg@exept.de>
parents: 4032
diff changeset
  1274
TopView initialize!