StandardSystemView.st
author Claus Gittinger <cg@exept.de>
Sun, 29 Jun 2014 16:17:45 +0200
changeset 6519 123f28fbb9a6
parent 6504 c5f5b4ae8195
child 6566 949689795584
child 6646 7eb10d85e589
permissions -rw-r--r--
class: StandardSystemView changed: #windowLabelFor:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     1
"
6
7ee0cfde237d *** empty log message ***
claus
parents: 5
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
     3
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     4
48194c26a46c Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
48194c26a46c Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
48194c26a46c Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
48194c26a46c Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
48194c26a46c Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
48194c26a46c Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
48194c26a46c Initial revision
claus
parents:
diff changeset
    11
"
3210
250f55f80683 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3152
diff changeset
    12
"{ Package: 'stx:libview' }"
250f55f80683 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3152
diff changeset
    13
135
claus
parents: 132
diff changeset
    14
TopView subclass:#StandardSystemView
1539
fcd8fc807c0c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1538
diff changeset
    15
	instanceVariableNames:'label icon iconView iconLabel minExtent maxExtent sizeFixed
3408
42384f123133 Add labelChannel and visibilityChannel to WindowSpec/StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 3393
diff changeset
    16
		application windowEventsForApplication deviceIcon labelChannel'
2326
c47b2c8f51dc moved TakeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents: 2303
diff changeset
    17
	classVariableNames:'DefaultIcon IncludeHostNameInLabel DefaultExtent
6047
d8080f253e26 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
    18
		WindowLabelFormat DefaultMinExtent TimedRaiseAction'
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    19
	poolDictionaries:''
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    20
	category:'Views-Basic'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    21
!
48194c26a46c Initial revision
claus
parents:
diff changeset
    22
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    23
!StandardSystemView class methodsFor:'documentation'!
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    24
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    25
copyright
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    26
"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    27
 COPYRIGHT (c) 1989 by Claus Gittinger
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    28
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    29
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    30
 This software is furnished under a license and may be used
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    31
 only in accordance with the terms of that license and with the
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    33
 be provided or otherwise made available to, or used by, any
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    34
 other person.  No title to or ownership of the software is
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    35
 hereby transferred.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    36
"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    37
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    38
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    39
documentation
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    40
"
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
    41
    I represent standard application topViews
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
    42
    i.e. those views which have a title-label, an icon etc.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    43
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    44
    The name `StandardSystemView' is probably misleading and
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    45
    results from ST-80 (rel2.x) compatibility reasons.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    46
    Think of it as an ApplicationWindow.
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    47
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    48
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    49
    In ST/X, StandardSystemViews were subclassed for special views
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    50
    in the past (for example: FileBrowser, ChangesBrowser etc.).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    51
    Although this worked, it may lead to the following
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    52
    problems and inconveniences:
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    53
	- applications inherit a big number of methods through the
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    54
	  SimpleView->View->TopView->StandardSystemView hierarchy.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    55
	  There is quite a danger that by accident, some method gets
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    56
	  redefined which is required by one of those classes.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    57
	  (typical candidates are: terminate, destroy, open ...)
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    58
	  This may lead to strange effects, which may not be obvious to
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    59
	  non experts ...
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    60
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    61
	- applications with multiple topViews are difficult to implement
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    62
	  and manage.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    63
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    64
	- use of a windowBuilder is difficult.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    65
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    66
    For all those reasons, we HIGHLY recommend to NOT define applications
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    67
    as subclasses of StandardSystemView, but instead base them on
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    68
    ApplicationModel, and reference the topView(s) as instance variables of
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    69
    if (if at all).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    70
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    71
    [instance variables:]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    72
	label                   <String>    the label in the windows title
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    73
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    74
	icon                    <Form>      the icon
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
    75
					    [ignored if the display does not
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    76
					     support icons]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    77
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    78
	iconView                <View>      an optional icon-view (for animated icons)
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    79
					    [ignored if the display does not
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    80
					     supports this]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    81
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    82
	iconLabel               <String>    the label in the icon
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
    83
					    [ignored if the display does not
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    84
					     support label-tabs with icons]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    85
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    86
	minExtent               <Point>     the minimum size
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    87
					    No limit, if nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    88
					    [the window manager may have its own
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    89
					     limit; typically some small area]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    90
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    91
	maxExtent               <Point>     the maximum size
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    92
					    No limit, if nil.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    93
					    [the window manager may have its own
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    94
					     limit; typically the screen size]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    95
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    96
	sizeFixed               <Boolean>   prevents the view from resizing itself
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    97
					    (especially to freeze a dialogs size)
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    98
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
    99
	application             <AppModel>  if nonNil, thats the application
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   100
					    Many requests (such as open/close etc.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   101
					    are forwarded to it, if present.
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   102
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   103
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   104
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   105
     [class variables:]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   106
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   107
	DefaultIcon             <Form>      cached default icon
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   108
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   109
	TakeFocusWhenMapped     <Boolean>   if true, views grab the keyboard
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   110
					    focus (convenient with some stupid
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   111
					    windowManagers)
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   112
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   113
	IncludeHostNameInLabel  <Boolean>   if true, the windows title shall
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   114
					    include the hostname.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   115
					    (convenient if you have many remote
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   116
					    views open simultaneously)
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   117
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   118
	WindowLabelFormat       <Boolean>   specifies the format for windowLabels
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   119
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   120
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   121
    [author:]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   122
	Claus Gittinger
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   123
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   124
    [see also:]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   125
	WindowGroup
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   126
	ApplicationModel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   127
"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   128
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   129
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   130
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   131
examples
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   132
"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   133
    simple, empty topView:
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   134
									[exBegin]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   135
	|topView|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   136
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   137
	topView := StandardSystemView new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   138
	topView label:'my first view'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   139
	topView extent:200 @ 200.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   140
	topView open.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   141
									[exEnd]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   142
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   143
    with an icon & iconLabel:
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   144
									[exBegin]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   145
	|topView|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   146
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   147
	topView := StandardSystemView extent:200 @ 200.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   148
	topView label:'Hello world'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   149
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   150
	topView icon:(Image fromFile:'hello_world.icon').
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   151
	topView open.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   152
									[exEnd]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   153
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   154
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   155
    with an animated iconView [not supported on all display devices]:
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   156
									[exBegin]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   157
	|iconView topView|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   158
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   159
	iconView := ClockView new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   160
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   161
	topView := StandardSystemView extent:200 @ 200.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   162
	topView label:'Hello world'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   163
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   164
	topView iconView:iconView.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   165
	topView open.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   166
									[exEnd]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   167
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   168
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   169
    placing a subView into it:
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   170
									[exBegin]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   171
	|topView button|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   172
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   173
	topView := StandardSystemView new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   174
	topView label:'my second view'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   175
	topView extent:200 @ 200.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   176
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   177
	button := Button label:'close' in:topView.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   178
	button action:[topView destroy].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   179
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   180
	topView open.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   181
									[exEnd]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   182
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   183
    same, relative sized subview:
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   184
									[exBegin]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   185
	|topView button|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   186
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   187
	topView := StandardSystemView new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   188
	topView label:'my second view'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   189
	topView extent:200 @ 200.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   190
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   191
	button := Button label:'close' in:topView.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   192
	button action:[topView destroy].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   193
	button origin:0.25 @ 0.25 corner:0.75 @ 0.75.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   194
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   195
	topView open.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   196
									[exEnd]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   197
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   198
    multiple buttons in a panel in a topView:
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   199
									[exBegin]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   200
	|topView panel button1 button2 button3|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   201
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   202
	topView := StandardSystemView new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   203
	topView label:'my second view'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   204
	topView extent:200 @ 200.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   205
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   206
	panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:topView.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   207
	panel inset:10.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   208
	panel level:-1.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   209
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   210
	button1 := Button label:'one' in:panel.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   211
	button1 action:[Transcript showCR:'one pressed'].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   212
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   213
	button2 := Button label:'two' in:panel.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   214
	button2 action:[Transcript showCR:'two pressed'].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   215
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   216
	button3 := Button label:'three' in:panel.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   217
	button3 action:[Transcript showCR:'three pressed'].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   218
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   219
	topView open.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   220
									[exEnd]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   221
"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   222
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   223
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   224
!StandardSystemView class methodsFor:'instance creation'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   225
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   226
extent:anExtent label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   227
    "create a new topView and define its extent, label and icon"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   228
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   229
    ^ self origin:nil extent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   230
	   label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   231
	   minExtent:nil maxExtent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   232
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   233
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   234
extent:anExtent label:aLabel icon:aForm minExtent:minExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   235
    ^ self origin:nil extent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   236
	   label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   237
	   minExtent:minExtent maxExtent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   238
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   239
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   240
extent:anExtent label:aLabel icon:aForm minExtent:minExtent maxExtent:maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   241
    ^ self origin:nil extent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   242
	   label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   243
	   minExtent:minExtent maxExtent:maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   244
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   245
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   246
extent:anExtent label:aLabel minExtent:minExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   247
    "create a new topView and define its extent, label and minumum extent"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   248
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   249
    ^ self origin:nil extent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   250
	   label:aLabel icon:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   251
	   minExtent:minExtent maxExtent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   252
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   253
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   254
label:aLabel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   255
    "create a new topView and define its label"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   256
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   257
    ^ self origin:nil extent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   258
	   label:aLabel icon:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   259
	   minExtent:nil maxExtent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   260
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   261
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   262
label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   263
    "create a new topView and define its label and icon"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   264
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   265
    ^ self origin:nil extent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   266
	   label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   267
	   minExtent:nil maxExtent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   268
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   269
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   270
label:aLabel icon:aForm minExtent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   271
    "create a new topView and define its label, icon and minumum extent"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   272
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   273
    ^ self origin:nil extent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   274
	   label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   275
	   minExtent:anExtent maxExtent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   276
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   277
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   278
label:aLabel icon:aForm minExtent:minExtent maxExtent:maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   279
    "create a new topView and define its label, icon, min and max extents"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   280
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   281
    ^ self origin:nil extent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   282
	   label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   283
	   minExtent:minExtent maxExtent:maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   284
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   285
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   286
label:aLabel minExtent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   287
    "create a new topView and define its label and minimum extent"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   288
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   289
    ^ self origin:nil extent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   290
	   label:aLabel icon:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   291
	   minExtent:anExtent maxExtent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   292
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   293
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   294
model:aModel label:aLabel minimumSize:minExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   295
    "ST80-style instance creation"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   296
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   297
    |newView|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   298
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   299
    newView := self origin:nil
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   300
		    extent:minExtent
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   301
		     label:aLabel
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   302
		      icon:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   303
		 minExtent:minExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   304
		 maxExtent:nil.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   305
    newView model:aModel.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   306
"/    newView controller:(self defaultControllerClass new view:newView).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   307
    ^ newView
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   308
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   309
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   310
origin:anOrigin extent:anExtent label:aLabel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   311
    "create a new topView and define its origin, extent and label"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   312
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   313
    ^ self origin:anOrigin extent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   314
	   label:aLabel icon:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   315
	   minExtent:nil maxExtent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   316
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   317
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   318
origin:anOrigin label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   319
		minExtent:minExtent maxExtent:maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   320
    "create a new topView and define its origin, extent, label, icon
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   321
     and extent-boundaries."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   322
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   323
    ^ self origin:anOrigin extent:nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   324
	   label:aLabel icon:aForm
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   325
	   minExtent:minExtent maxExtent:maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   326
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   327
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   328
!StandardSystemView class methodsFor:'Compatibility-VW'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   329
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   330
promptForOpen:aBoolean
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   331
    "not implemented here"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   332
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   333
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   334
!StandardSystemView class methodsFor:'class initialization'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   335
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   336
initialize
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   337
    IncludeHostNameInLabel := false.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   338
    WindowLabelFormat := self defaultWindowLabelFormat.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   339
6369
b799ac38af53 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6283
diff changeset
   340
    TakeFocusWhenMapped := (Screen notNil and:[Screen isWindowsPlatform]).
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   341
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   342
    "Created: / 20.8.1997 / 14:16:32 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   343
    "Modified: / 24.8.1998 / 17:16:33 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   344
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   345
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   346
!StandardSystemView class methodsFor:'defaults'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   347
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   348
defaultExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   349
    "return a standardSystemViews default window extent"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   350
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   351
    DefaultExtent notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   352
	^ DefaultExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   353
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   354
    ^ super defaultExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   355
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   356
    "Created: 15.8.1997 / 01:36:21 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   357
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   358
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   359
defaultIcon
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   360
    "return a topViews default window icon"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   361
4800
bab1343e2fa3 icon resource
Claus Gittinger <cg@exept.de>
parents: 4735
diff changeset
   362
    <resource: #programImage>
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   363
    <resource: #style (#ICON #ICON_FILE)>
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   364
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   365
    |n nm i|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   366
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   367
    (i := DefaultIcon) isNil ifTrue:[
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   368
	i := self classResources at:'ICON' default:nil.
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   369
	i isNil ifTrue:[
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   370
"/            OperatingSystem platformName == #win32 ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   371
"/                n := 'stx_16x16.xpm'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   372
"/            ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   373
"/                n := 'SmalltalkX.xbm'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   374
"/            ].
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   375
	    nm := ClassResources at:'ICON_FILE' default:n.
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   376
	    nm notNil ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   377
		i := Smalltalk imageFromFileNamed:nm inPackage:'stx:libtool'.
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   378
	    ].
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   379
	    i isNil ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   380
		i := self defaultSTXIcon
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   381
	    ].
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   382
	].
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   383
	i notNil ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   384
	    DefaultIcon := i := i onDevice:Display
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   385
	]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   386
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   387
    ^ i
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   388
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   389
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   390
     DefaultIcon := nil.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   391
     self defaultIcon inspect
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   392
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   393
4800
bab1343e2fa3 icon resource
Claus Gittinger <cg@exept.de>
parents: 4735
diff changeset
   394
    "Modified: / 17-09-2007 / 11:36:25 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   395
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   396
4975
9e899aca8597 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 4837
diff changeset
   397
defaultIconForAboutBox
9e899aca8597 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 4837
diff changeset
   398
    ^ self defaultIcon
9e899aca8597 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 4837
diff changeset
   399
!
9e899aca8597 allow for different icon to be used for about boxes
Claus Gittinger <cg@exept.de>
parents: 4837
diff changeset
   400
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   401
defaultLabel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   402
    "return the default label for views of my kind.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   403
     This can be redefined in subclasses or overwritten in
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   404
     initialize methods."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   405
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   406
    ^ self nameWithoutPrefix. "/ 'aView'
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   407
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   408
    "Modified: / 27.9.1999 / 11:38:57 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   409
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   410
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   411
defaultWindowLabelFormat
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   412
    "%2 is the hostName;
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   413
     %1 is the actual window label."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   414
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   415
    "/ ^ '%2:%1'.    "/ the old format
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   416
    "/ ^ '%1 @ %2'.
5771
a4b190ff55e7 changed: #defaultWindowLabelFormat
Claus Gittinger <cg@exept.de>
parents: 5743
diff changeset
   417
    ^ '%1 (%5@%2)'.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   418
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   419
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   420
includeHostNameInLabel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   421
    "return the flag which controls if a views label should
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   422
     include the hostname.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   423
     This flag is usually set/cleared in your private.rc file;
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   424
     the default is false."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   425
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   426
    ^ IncludeHostNameInLabel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   427
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   428
    "Created: 10.9.1995 / 19:21:16 / claus"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   429
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   430
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   431
includeHostNameInLabel:aBoolean
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   432
    "set/clear the flag which controls if a views label should
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   433
     include the hostname - this is highly useful if you have
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   434
     multiple smalltalks open simultaneously ...
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   435
     This flag is usually set/cleared in your private.rc file;
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   436
     the default is false."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   437
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   438
    IncludeHostNameInLabel := aBoolean
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   439
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   440
    "Modified: 24.4.1996 / 09:09:21 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   441
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   442
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   443
takeFocusWhenMapped
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   444
    ^ TakeFocusWhenMapped
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   445
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   446
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   447
     StandardSystemView takeFocusWhenMapped
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   448
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   449
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   450
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   451
updateStyleCache
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   452
    "extract values from the styleSheet and cache them in class variables"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   453
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   454
    <resource: #style (#'standardSystemView.defaultExtent')>
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   455
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   456
    DefaultExtent := StyleSheet at:'standardSystemView.defaultExtent' default:nil.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   457
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   458
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   459
     self updateStyleCache
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   460
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   461
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   462
    "Modified: 31.8.1995 / 03:01:14 / claus"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   463
    "Created: 15.8.1997 / 01:34:37 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   464
    "Modified: 20.10.1997 / 15:13:50 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   465
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   466
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   467
windowLabelFormat
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   468
    ^ WindowLabelFormat
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   469
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   470
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   471
windowLabelFormat:aFormatString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   472
    WindowLabelFormat := aFormatString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   473
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   474
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   475
!StandardSystemView class methodsFor:'image specs'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   476
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   477
defaultSTXIcon
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   478
    <resource: #programImage>
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   479
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   480
    ^ self defaultSTXIcon3.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   481
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   482
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   483
defaultSTXIcon1
6480
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   484
    <resource: #image>
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   485
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   486
     by the ImageEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   487
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   488
     the ImageEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   489
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   490
     self defaultSTXIcon1 inspect
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   491
     ImageEditor openOnClass:self andSelector:#defaultSTXIcon1
6480
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   492
     Icon flushCachedIcons"
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   493
    
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   494
    ^ Icon constantNamed:#'StandardSystemView class defaultSTXIcon1'
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   495
        ifAbsentPut:[
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   496
            (Depth2Image new)
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   497
                width:16;
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   498
                height:16;
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   499
                photometric:(#palette);
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   500
                bitsPerSample:(#[ 2 ]);
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   501
                samplesPerPixel:(1);
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   502
                bits:(ByteArray 
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   503
                            fromPackedString:'@@@@@@@@@@@@E@@@@AP@D@@V@D@@APF@@@F&@@@AV@@@@&@@@@%P@@@&F@@@VBP@@V@I@@V@@P@@@@@@@@@@@@@a');
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   504
                colorMapFromArray:#[ 0 0 0 0 127 127 184 231 231 ];
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   505
                mask:((ImageMask new)
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   506
                            width:16;
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   507
                            height:16;
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   508
                            bits:(ByteArray 
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   509
                                        fromPackedString:'@@@@@@X@A PGB@LX@_@A8@G@@<@GX@9 GC@8D@@@@@@b');
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   510
                            yourself);
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   511
                yourself
065e6f5dbfbb Change images to use ImageMask instances instead of Depth1Image instances as
Stefan Vogel <sv@exept.de>
parents: 6369
diff changeset
   512
        ]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   513
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   514
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   515
defaultSTXIcon2
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   516
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   517
     by the ImageEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   518
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   519
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   520
     the ImageEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   521
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   522
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   523
     self defaultSTXIcon2 inspect
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   524
     ImageEditor openOnClass:self andSelector:#defaultSTXIcon2
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   525
     Icon flushCachedIcons
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   526
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   527
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   528
    <resource: #image>
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   529
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   530
    ^Icon
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   531
	constantNamed:#'StandardSystemView class defaultSTXIcon2'
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   532
	ifAbsentPut:[(Depth8Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   533
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@HB@@@@@@@@@@@@@@@@@@@B@ @@@@@@@@H@@@@@@@@@@ H@@@@@@@H@@@@@@@@@@@@B@ @@
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   534
@@H@@@@@@@@@@@@@@@H@@@H@@@@@@@@@@@@@@@@B@ H@@@@@@@@@@@@@@@@@@@H@@@@@@@@@@@@@@@@@@@HB@ @@@@@@@@@@@@@@@@H@@@H@@@@@@@@@@@@@
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   535
@ H@@@@@@ @@@@@@@@@@@ H@@@@@@@@B@@@@@@@@@ H@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[184 231 231 63 63 63 0 127 127]; yourself]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   536
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   537
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   538
defaultSTXIcon3
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   539
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   540
     by the ImageEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   541
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   542
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   543
     the ImageEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   544
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   545
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   546
     self defaultSTXIcon3 inspect
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   547
     ImageEditor openOnClass:self andSelector:#defaultSTXIcon3
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   548
     Icon flushCachedIcons
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   549
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   550
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   551
    <resource: #image>
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   552
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   553
    ^Icon
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   554
	constantNamed:#'StandardSystemView class defaultSTXIcon3'
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   555
	ifAbsentPut:[(Depth2Image new) width: 16; height: 16; photometric:(#palette); bitsPerSample:(#[2]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@E@@@@AP@D@@V@D@@APF@@@FF@@@AV@@@@&@@@@%P@@@$F@@@T@X@@T@I@@T@@P@@@@@@@@@@@@@a') ; colorMapFromArray:#[0 0 0 0 204 51 0 112 0]; yourself]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   556
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   557
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   558
!StandardSystemView class methodsFor:'startup'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   559
6073
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   560
cancelAutoRaise
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   561
    "cancel any schedule autoraise action"
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   562
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   563
    |b|
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   564
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   565
    (b := TimedRaiseAction) notNil ifTrue:[
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   566
        TimedRaiseAction := nil.
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   567
        Processor removeTimeoutWithID:b.
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   568
    ].
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   569
!
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
   570
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   571
start
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   572
    "create, realize the view - this topview and all its subviews will
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   573
     run as a separate process with its own windowGroup.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   574
     This method exists for backward compatibility - use open."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   575
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   576
    ^ self open
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   577
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   578
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   579
!StandardSystemView methodsFor:'Compatibility-ST80'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   580
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   581
maximumSize
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   582
    "same as maxExtent; for ST-80 compatibility"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   583
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   584
    ^ self maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   585
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   586
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   587
maximumSize:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   588
    "same as maxExtent; for ST-80 compatibility"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   589
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   590
    ^ self maxExtent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   591
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   592
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   593
menuBar
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   594
    "return my menuBar or nil if I have none.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   595
     This is only valid for topViews which were built with the UIBuilder."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   596
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   597
    ^ application builder menuBar
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   598
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   599
    "Created: / 27.10.1997 / 16:23:13 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   600
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   601
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   602
minimumSize
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   603
    "same as minExtent; for ST-80 compatibility"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   604
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   605
    ^ self minExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   606
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   607
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   608
minimumSize:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   609
    "same as minExtent; for ST-80 compatibility"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   610
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   611
    ^ self minExtent:anExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   612
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   613
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   614
quit
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   615
    "same as closeRequest
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   616
     (but sometimes sent via the sensors event queue from VW programs)"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   617
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   618
    self closeRequest
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   619
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   620
    "Created: / 30.10.1997 / 19:23:01 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   621
    "Modified: / 3.8.1998 / 20:04:22 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   622
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   623
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   624
!StandardSystemView methodsFor:'accessing'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   625
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   626
application
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   627
    "return the topViews application.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   628
     This is new protocol for ST-80 compatibility and not yet fully supported"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   629
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   630
    ^ application
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   631
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   632
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   633
application:anApplicationModel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   634
    "set the topViews application.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   635
     This is new protocol for ST-80 compatibility and not yet fully supported"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   636
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   637
    application := anApplicationModel.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   638
    anApplicationModel notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   639
	anApplicationModel window isNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   640
	    anApplicationModel window:self
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   641
	]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   642
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   643
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   644
    "Modified: 18.4.1996 / 14:55:44 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   645
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   646
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   647
!StandardSystemView methodsFor:'accessing-behavior'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   648
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   649
bePartner
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   650
    "define me as a partner-View.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   651
     All partners within the applications windowGroup iconify/deiconify together."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   652
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   653
    self setWindowGroupFromApplication.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   654
    super bePartner.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   655
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   656
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   657
     see example in TopView>>bePartner
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   658
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   659
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   660
    "Created: 22.9.1995 / 17:40:15 / claus"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   661
    "Modified: 6.3.1996 / 16:16:42 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   662
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   663
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   664
beSlave
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   665
    "define me as a slave-View.
6122
3d48897de0c7 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6101
diff changeset
   666
     All slaves within the application's windowGroup iconify/deiconify with the masterView(s)
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   667
     (i.e. they follow their master(s))"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   668
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   669
    self setWindowGroupFromApplication.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   670
    super beSlave.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   671
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   672
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   673
     see example in TopView>>beSlave
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   674
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   675
6122
3d48897de0c7 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6101
diff changeset
   676
    "Created: / 22-09-1995 / 17:40:15 / claus"
3d48897de0c7 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6101
diff changeset
   677
    "Modified: / 06-03-1996 / 16:16:50 / cg"
3d48897de0c7 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6101
diff changeset
   678
    "Modified (comment): / 28-08-2013 / 21:27:46 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   679
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   680
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   681
sendWindowEvents:collectionOfEventSymbols
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   682
    "define the events that are to be forwarded to the application.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   683
     This is being implemented ..."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   684
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   685
    windowEventsForApplication := collectionOfEventSymbols
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   686
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   687
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   688
sizeFixed:aBoolean
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   689
    "this prevents the view from resizing itself when realized.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   690
     For normal topViews, this is void, since they dont do this anyway.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   691
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   692
     However, modalBoxes (especially: DialogBoxes) typically resize themselfes
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   693
     to the preferredExtent of their components. In some cases, this behavior is
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   694
     not desired and it should be turned off by setting sizeFixed to true.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   695
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   696
     To avoid confusion:
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   697
	This does NOT prevent the window manager from resizing the view,
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   698
	instead it tells the view to NOT resize ITSELF."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   699
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   700
    sizeFixed := aBoolean.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   701
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   702
    "example: dialog which resizes itself on #open:
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   703
	      (thereby ignoring the 200@200 extent)
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   704
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   705
	|dialog|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   706
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   707
	dialog := Dialog new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   708
	dialog addInputFieldOn:'' asValue.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   709
	dialog addOkButton.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   710
	dialog extent:200@200.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   711
	dialog open.
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   712
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   713
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   714
    using sizeFixed:
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   715
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   716
	|dialog|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   717
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   718
	dialog := Dialog new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   719
	dialog addInputFieldOn:'' asValue.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   720
	dialog addOkButton.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   721
	dialog extent:200@200; sizeFixed:true.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   722
	dialog open.
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   723
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   724
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   725
    using openWithExtent (also sets sizeFixed):
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   726
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   727
	|dialog|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   728
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   729
	dialog := Dialog new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   730
	dialog addInputFieldOn:'' asValue.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   731
	dialog addOkButton.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   732
	dialog openWithExtent:200@200.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   733
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   734
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   735
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   736
!StandardSystemView methodsFor:'accessing-channels'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   737
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   738
labelChannel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   739
    "return the labelChannel - or nil"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   740
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   741
    ^ labelChannel.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   742
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   743
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   744
labelChannel:aValueHolder
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   745
    "set the labelChannel - a valueHolder holding a string
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   746
     which is shown as title bar"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   747
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   748
    |prev|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   749
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   750
    prev := labelChannel.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   751
    labelChannel := aValueHolder.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   752
    self setupChannel:aValueHolder for:nil withOld:prev.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   753
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   754
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   755
!StandardSystemView methodsFor:'accessing-dimensions'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   756
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   757
maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   758
    "return the views maximum allowed extent"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   759
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   760
    ^ maxExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   761
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   762
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   763
maxExtent:max
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   764
    "define the maximum extent the view may have -
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   765
     depends on good-will of window manager"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   766
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   767
    maxExtent ~= max ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   768
        maxExtent := max.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   769
        maxExtent x isNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   770
            maxExtent := 99999 @ maxExtent y.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   771
        ].
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   772
        maxExtent y isNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   773
            maxExtent := maxExtent x @ 99999.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   774
        ].
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   775
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   776
        self drawableId notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   777
            self graphicsDevice setWindowMinExtent:nil maxExtent:max in:self drawableId
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   778
        ].
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   779
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   780
        "/ if my current extent is larger than the new
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   781
        "/ maxExtent, adjust.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   782
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   783
        (width notNil and:[height notNil]) ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   784
            ((width > (max x)) or:
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   785
             [height > (max y)]) ifTrue: [
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   786
                self extent:(max min:self extent)
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   787
            ]
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   788
        ]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   789
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   790
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   791
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   792
minExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   793
    "return the views minimum allowed extent"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   794
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   795
    ^ minExtent
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   796
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   797
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   798
minExtent:min
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   799
    "define the minimum extent the view may have -
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   800
     depends on good-will of window manager"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   801
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   802
    minExtent ~= min ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   803
        minExtent := min.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   804
        self drawableId notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   805
            self graphicsDevice setWindowMinExtent:min maxExtent:nil in:self drawableId
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   806
        ].
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   807
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   808
        "/ if my current extent is smaller than the new
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   809
        "/ minExtent, adjust.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   810
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   811
        (width notNil and:[height notNil]) ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   812
            ((width < (min x)) or:
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   813
             [height < (min y)]) ifTrue: [
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   814
                self extent:(min max:self extent)
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   815
            ]
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   816
        ]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   817
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   818
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   819
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   820
!StandardSystemView methodsFor:'accessing-look'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   821
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   822
icon
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   823
    "return the form defined as icon"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   824
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   825
    ^ icon value
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   826
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   827
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   828
icon:aFormOrImage
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   829
    "define the form or image (bitmap) used as icon"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   830
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   831
    |i m iconValue|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   832
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   833
    icon := aFormOrImage.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   834
    iconValue := icon value.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   835
    iconValue notNil ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   836
        self drawableId notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   837
            i := self graphicsDevice convertedIcon:iconValue.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   838
            (i notNil and:[i id notNil]) ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   839
                (m := iconValue mask) notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   840
                    m := self graphicsDevice convertedIconMask:m.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   841
                ].
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   842
                self graphicsDevice setWindowIcon:i mask:m in:self drawableId
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   843
            ]
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   844
        ]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   845
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   846
4814
4204263d3ab3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4812
diff changeset
   847
    "Modified: / 30-10-2007 / 16:39:15 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   848
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   849
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   850
iconLabel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   851
    "return the name displayed in the icon"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   852
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   853
    ^ iconLabel
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   854
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   855
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   856
iconLabel:aString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   857
    "define the name to be displayed in the icon"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   858
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   859
    |newLabel|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   860
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   861
    (newLabel := aString string) ~= iconLabel ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   862
        iconLabel := newLabel.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   863
        self drawableId notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   864
            self graphicsDevice setIconName:newLabel in:self drawableId.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   865
            "
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   866
             unbuffered - to make it visible right NOW
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   867
            "
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   868
            self flush.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   869
        ]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   870
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   871
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   872
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   873
iconMask
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   874
    "return the form defined as iconMask.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   875
     Notice, that many windowManagers ignore this mask
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   876
     (usually, only managers which place icons on the background desktop
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   877
      care for an icon - if at all ...)"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   878
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   879
    |mask|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   880
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   881
    "/ only images possibly have iconMasks
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   882
    icon notNil ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   883
        (mask := icon value mask) notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   884
            ^ self graphicsDevice convertedIconMask:mask
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   885
        ]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   886
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   887
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   888
    ^ nil
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   889
4815
77b9f37c9e10 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4814
diff changeset
   890
    "Modified: / 30-10-2007 / 20:59:40 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   891
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   892
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   893
iconName:aString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   894
    "this method will vanish soon ... - for backward compatibility"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   895
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   896
    <resource:#obsolete>
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   897
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   898
    self obsoleteMethodWarning:'use #iconLabel:'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   899
    self iconLabel:aString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   900
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   901
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   902
iconView
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   903
    "return the view used as icon-view"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   904
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   905
    ^ iconView
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   906
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   907
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   908
iconView:aView
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   909
    "specify the view to be used as icon.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   910
     This may not be supported on all display types"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   911
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   912
    iconView := aView.
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   913
    self drawableId notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   914
        aView create.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   915
        self graphicsDevice setWindowIconWindow:aView in:self drawableId.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   916
        aView setRealized:true.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   917
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   918
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   919
    "Modified: 4.4.1997 / 16:21:37 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   920
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   921
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   922
label
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   923
    "return the views name in the title area"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   924
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   925
    ^ label
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   926
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   927
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   928
label:aString
6245
d0c50dd22b30 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6228
diff changeset
   929
    "define the view's name in the window's title area.
d0c50dd22b30 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6228
diff changeset
   930
     If IncludeHostNameInLabel is true, prepend the hostname - now done in windowLabelFor:
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   931
     (you will appreciate this, if you are working on multiple
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   932
      machines simultaneously - as I do ...)"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   933
5066
c166f0bf72ed *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
   934
    |newLabel expandedLabel|
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   935
4633
53643adff205 care for nil label-arg
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
   936
    newLabel := aString.
53643adff205 care for nil label-arg
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
   937
    newLabel notNil ifTrue:[newLabel := newLabel string].
53643adff205 care for nil label-arg
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
   938
    newLabel ~= label ifTrue:[
6079
e0678a4293b1 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6073
diff changeset
   939
        label := newLabel.
6248
c5ae82e874cf class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6245
diff changeset
   940
        "/ fix: cg: realized is a bad test here - could still be unmapped...
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
   941
        self drawableId notNil "realized" ifTrue: [
6079
e0678a4293b1 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6073
diff changeset
   942
            expandedLabel := self windowLabelFor:label.
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
   943
            self windowName:(expandedLabel ? '').
6079
e0678a4293b1 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6073
diff changeset
   944
            shown ifTrue:[
e0678a4293b1 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6073
diff changeset
   945
                "
e0678a4293b1 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6073
diff changeset
   946
                 unbuffered - to make it visible right NOW
e0678a4293b1 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6073
diff changeset
   947
                "
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
   948
                self flush.
6079
e0678a4293b1 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6073
diff changeset
   949
            ]
e0678a4293b1 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6073
diff changeset
   950
        ]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   951
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   952
4633
53643adff205 care for nil label-arg
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
   953
    "Created: / 08-09-1995 / 19:37:06 / claus"
53643adff205 care for nil label-arg
Claus Gittinger <cg@exept.de>
parents: 4566
diff changeset
   954
    "Modified: / 06-10-2006 / 11:55:06 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   955
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   956
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   957
label:labelString iconLabel:iconLabelString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   958
    "set both the label and the iconLabel"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   959
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   960
    self label:labelString.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   961
    self iconLabel:iconLabelString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   962
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   963
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   964
!StandardSystemView methodsFor:'change & update'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   965
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   966
update:something with:aParameter from:changedObject
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   967
    "the MVC way of changing the label ..."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   968
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   969
    changedObject notNil ifTrue:[
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   970
	changedObject == labelChannel ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   971
	    self label:labelChannel value.
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   972
	    ^ self
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   973
	].
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   974
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   975
    ^ super update:something with:aParameter from:changedObject
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   976
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   977
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   978
!StandardSystemView methodsFor:'destroying'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   979
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   980
release
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   981
    self removeFromCurrentProject.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   982
    labelChannel notNil ifTrue:[
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   983
	labelChannel removeDependent:self.
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   984
	labelChannel := nil.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   985
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   986
    windowGroup notNil ifTrue:[
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   987
	windowGroup focusSequence:nil.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   988
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   989
    super release.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   990
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   991
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   992
saveAndTerminate
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
   993
    "save & terminate request from the windowManager. The application should
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   994
     save its data/files/text etc. somehow and close.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   995
     If there is an application, let it decide how do do that.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   996
     Otherwise, forward it to superclasses which knows how to do this.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   997
     (it defaults to a terminate there).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   998
     Notice, that not all windowmanagers are nice enough
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
   999
     to send this request; some simply distroy the view."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1000
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1001
    application notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1002
	application saveAndTerminateRequestFor:self
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1003
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1004
	super saveAndTerminate
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1005
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1006
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1007
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1008
terminate
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1009
    "terminate request from the windowManager. If there is an application,
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1010
     let it decide if it really wants to be close. Otherwise, forward it to
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1011
     superclasses terminate which knows how to do this.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1012
     Notice, that not all windowmanagers are nice enough
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1013
     to send this request; some simply distroy the view."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1014
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1015
    application notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1016
	application closeRequestFor:self
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1017
    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1018
	self closeRequest.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1019
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1020
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1021
    "Modified: / 3.8.1998 / 19:49:45 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1022
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1023
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1024
!StandardSystemView methodsFor:'event handling'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1025
6048
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1026
autoRaise
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1027
    "called with a delay by the focusIn code, iff the userPref setting is active.
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1028
     Some (a small number only) may want to prevent autoraise in certain situations
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1029
     - for example, if one view is controlling another. These get a chance to redefine this
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1030
     method"
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1031
6073
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1032
    |wg app|
6049
9e2da07eefa9 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6048
diff changeset
  1033
6071
536027b2080b class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6049
diff changeset
  1034
    "/ not, if my windowGroup is in a modal or popup action
6073
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1035
    ((wg := self windowGroup) notNil
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1036
    and:[ wg isInModalLoop not
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1037
    and:[ wg mainGroup isInModalLoop not
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1038
    and:[ self isModal not ]]]) ifTrue:[
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1039
        self sensor anyButtonPressed ifFalse:[
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1040
            "/ if I have an application, let it decide
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1041
            (app := self application) notNil ifTrue:[
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1042
                app autoRaise:self
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1043
            ] ifFalse:[
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1044
                self raise.
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1045
            ].
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1046
        ]
6071
536027b2080b class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6049
diff changeset
  1047
    ]
6048
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1048
!
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1049
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1050
focusIn
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1051
    "the view got the keyboard focus (via the window manager).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1052
     I.e. the mouse was moved out into the topView area - restore the
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1053
     focus to the previous focusView.."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1054
6047
d8080f253e26 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1055
    |v ms|
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1056
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1057
    windowGroup notNil ifTrue:[
5675
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1058
        "/ I got the focus - tell the current focus-windowgroup
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1059
        "/ that its focus is gone elsewhere ...
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1060
"/ 'focusIn ' print. windowGroup process name printCR.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1061
"/ 'focusView is ' print. windowGroup focusView printCR.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1062
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1063
        WindowGroup takeFocusFromDevice:self graphicsDevice.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1064
5675
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1065
        v := windowGroup focusView.
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1066
        v isNil ifTrue:[
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1067
            UserPreferences current focusFollowsMouse ~~ false ifTrue:[
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1068
                v := windowGroup pointerView.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1069
"/ 'pointerView is ' print. v printCR.
5675
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1070
                (v notNil
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1071
                and:[v isKeyboardConsumer not
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1072
                and:[v wantsFocusWithPointerEnter not]]) ifTrue:[
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1073
                    "/ no - not this one
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1074
"/ 'not a kbdConsumer' printCR.
5675
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1075
                    v := nil.
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1076
                ]
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1077
            ]
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1078
        ].
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1079
        v isNil ifTrue:[
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1080
            self assignInitialKeyboardFocus.
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1081
        ] ifFalse:[
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1082
            "/ v requestFocus.  - will be denied; but we must force it here
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1083
            "/ to force a change...
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1084
            windowGroup setFocusView:nil.
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1085
            windowGroup focusView:v byTab:nil.
6047
d8080f253e26 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1086
        ].
d8080f253e26 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1087
d8080f253e26 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1088
        "/ optionally bring the window to the front after some delay.
6071
536027b2080b class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6049
diff changeset
  1089
        "/ but not, if my windowGroup is in a modal or popup action
6047
d8080f253e26 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1090
        (ms := UserPreferences current autoRaiseOnFocusInDelay) notNil ifTrue:[
6073
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1091
            self scheduleAutoRaiseAfter:ms
6047
d8080f253e26 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1092
        ].
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1093
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1094
    super focusIn
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1095
5675
51d438d3033c changed: #focusIn
Claus Gittinger <cg@exept.de>
parents: 5659
diff changeset
  1096
    "Modified: / 20-01-2011 / 20:51:20 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1097
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1098
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1099
focusOut
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1100
    "the top-view lost the keyboard focus (via the window manager).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1101
     I.e. the mouse was moved out of the topView area."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1102
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1103
    |v|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1104
6148
6ba6f49e0a8d class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1105
    "/ 'fout ' print. self printCR.
6ba6f49e0a8d class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1106
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1107
    windowGroup notNil ifTrue:[
6148
6ba6f49e0a8d class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1108
        "/ '  fout-focusView: ' print. windowGroup focusView printCR.
6ba6f49e0a8d class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1109
        (v := windowGroup focusView) notNil ifTrue:[
6ba6f49e0a8d class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1110
            v showNoFocus:(windowGroup explicitFocusView == v).
6ba6f49e0a8d class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1111
            "/ '  send-has-nofocus to: ' print. v printCR.
6ba6f49e0a8d class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1112
            v hasKeyboardFocus:false.
6ba6f49e0a8d class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6122
diff changeset
  1113
        ]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1114
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1115
    super focusOut
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1116
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1117
    "Modified: 25.2.1997 / 23:19:46 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1118
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1119
6100
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1120
processShortcut:aKeyEvent
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1121
    "a shortcut key event as forwarded from the keyboardProcessor - if there is the
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1122
     shortcut key defined, process the shortcut and return true - otherwise false."
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1123
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1124
    application notNil ifTrue:[
6101
ea437d17677d Fix in StandardSystemView>>#processShortcut:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6100
diff changeset
  1125
        (application processShortcut:aKeyEvent) ifTrue:[ ^ true ]
ea437d17677d Fix in StandardSystemView>>#processShortcut:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6100
diff changeset
  1126
    ].
ea437d17677d Fix in StandardSystemView>>#processShortcut:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6100
diff changeset
  1127
    ^super processShortcut:aKeyEvent
6100
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1128
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1129
    "Created: / 23-07-2013 / 18:15:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6101
ea437d17677d Fix in StandardSystemView>>#processShortcut:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6100
diff changeset
  1130
    "Modified: / 23-07-2013 / 23:57:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6100
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1131
!
409e2909e130 Added StandardSystemView>>#processShortcut: to allow per-application
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 6079
diff changeset
  1132
6073
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1133
scheduleAutoRaiseAfter:ms
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1134
    "bring the window to the front after some delay.
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1135
     but not, if my windowGroup is in a modal or popup action"
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1136
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1137
    |wg actionID|
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1138
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1139
    ((wg := self windowGroup) notNil
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1140
    and:[ wg isInModalLoop not
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1141
    and:[ wg mainGroup isInModalLoop not
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1142
    and:[ self isModal not ]]]) ifTrue:[
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1143
        TimedRaiseAction notNil ifTrue:[
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1144
            Processor removeTimeoutWithID:TimedRaiseAction.
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1145
        ].
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1146
        TimedRaiseAction := actionID := Processor 
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1147
                                addTimedBlock:
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1148
                                    [
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1149
                                        TimedRaiseAction == actionID ifTrue:[
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1150
                                            TimedRaiseAction := nil.
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1151
                                            self sensor 
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1152
                                                pushUserEvent: #autoRaise 
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1153
                                                for: self 
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1154
                                        ].     
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1155
                                    ]
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1156
                                afterMilliseconds:ms.
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1157
    ]                         
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1158
!
2983eb433ed6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6071
diff changeset
  1159
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1160
showActivity:someMessage
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1161
    "some activityNotification shalt be communicated to
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1162
     the user. Forward it to my application (if any).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1163
     (that one should know how to deal with it).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1164
     Otherwise, simply ignore it."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1165
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1166
    application notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1167
	application showActivity:someMessage
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1168
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1169
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1170
    "Created: 16.12.1995 / 18:40:44 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1171
    "Modified: 23.4.1996 / 21:38:11 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1172
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1173
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1174
!StandardSystemView methodsFor:'initialization & release'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1175
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1176
addToCurrentProject
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1177
    "add the receiver (a topview) to the current projects set-of-views.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1178
     (If there is a current project)"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1179
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1180
    |p|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1181
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1182
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1183
     the following check allows systems
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1184
     without projects and changeSets
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1185
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1186
    (Project notNil and:[(p := Project current) notNil]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1187
	p addView: self
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1188
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1189
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1190
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1191
defaultControllerClass
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1192
    "for ST-80 compatibility only - not used in ST/X"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1193
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1194
    ^ nil "/ StandardSystemController
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1195
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1196
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1197
initEvents
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1198
    super initEvents.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1199
    self enableFocusEvents.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1200
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1201
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1202
initialize
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1203
    super initialize.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1204
5388
10a240c6365a changed:
Claus Gittinger <cg@exept.de>
parents: 5349
diff changeset
  1205
    "/ self setBorderWidth:2.         "- notice: many window managers ignore this"
6369
b799ac38af53 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6283
diff changeset
  1206
    self graphicsDevice isWindowsPlatform ifTrue:[
5942
e9fa762f18a3 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 5771
diff changeset
  1207
        minExtent := 0 @ 0.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1208
    ] ifFalse:[
5942
e9fa762f18a3 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 5771
diff changeset
  1209
        minExtent := 10 @ 10.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1210
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1211
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1212
    label isNil ifTrue:[label := self class defaultLabel].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1213
    icon isNil ifTrue:[icon := self class defaultIcon].
5942
e9fa762f18a3 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 5771
diff changeset
  1214
    sizeFixed := false.
e9fa762f18a3 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 5771
diff changeset
  1215
e9fa762f18a3 changed: #initialize
Claus Gittinger <cg@exept.de>
parents: 5771
diff changeset
  1216
    "Modified: / 27-10-2012 / 12:16:39 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1217
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1218
5659
0c6fa789e7f0 oops - mapping
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1219
mapped
0c6fa789e7f0 oops - mapping
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1220
    super mapped.
6369
b799ac38af53 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6283
diff changeset
  1221
    self graphicsDevice isWindowsPlatform ifTrue:[
5743
112d5f35a625 changed: #mapped
Stefan Vogel <sv@exept.de>
parents: 5735
diff changeset
  1222
        "don't do this in X11 - switching between 
112d5f35a625 changed: #mapped
Stefan Vogel <sv@exept.de>
parents: 5735
diff changeset
  1223
         virtual desktops would change the window stacking all the time"
112d5f35a625 changed: #mapped
Stefan Vogel <sv@exept.de>
parents: 5735
diff changeset
  1224
        self setForegroundWindow.
112d5f35a625 changed: #mapped
Stefan Vogel <sv@exept.de>
parents: 5735
diff changeset
  1225
        self activate.
112d5f35a625 changed: #mapped
Stefan Vogel <sv@exept.de>
parents: 5735
diff changeset
  1226
    ].
5659
0c6fa789e7f0 oops - mapping
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1227
0c6fa789e7f0 oops - mapping
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1228
    "Created: / 01-12-2010 / 15:57:22 / cg"
0c6fa789e7f0 oops - mapping
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1229
!
0c6fa789e7f0 oops - mapping
Claus Gittinger <cg@exept.de>
parents: 5624
diff changeset
  1230
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1231
reAdjustGeometry
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1232
    "sent as a final step when an image is restarted.
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1233
     when we come up on a smaller display,
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1234
     make certain, that the receiver is visible"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1235
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1236
    |dX dY limitRight limitBottom graphicsDevice|
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1237
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1238
    graphicsDevice := self graphicsDevice.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1239
    dX := (graphicsDevice horizontalPixelPerMillimeter * 20) rounded.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1240
    dY := (graphicsDevice verticalPixelPerMillimeter * 20) rounded.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1241
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1242
    limitRight := graphicsDevice usableWidth - dX.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1243
    limitBottom := graphicsDevice usableHeight - dY.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1244
    ((self left > limitRight) or:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1245
      self top > limitBottom]) ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1246
        'StandardSystemView [info]: moving view into visible area' infoPrintCR.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1247
        self origin:limitRight @ limitBottom
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1248
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1249
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1250
    "Modified: 10.1.1997 / 15:12:19 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1251
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1252
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1253
reinitialize
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1254
    "reopen the receiver if if was visible before.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1255
     This is called right after snapIn; Notice, that all instance variables
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1256
     (such as shown, realized etc.) are left-overs from the time the snapout
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1257
     was done. Remap the receiver, if it was mapped at snapout time"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1258
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1259
    |myController|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1260
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1261
    "if I have already been reinited - return"
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1262
    self drawableId notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1263
        ^ self
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1264
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1265
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1266
    "have to kludge with the controller
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1267
     - otherwise its startup performs unwanted actions ..."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1268
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1269
    myController := controller.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1270
    controller := nil.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1271
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1272
    "physically create the view & subviews"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1273
    self recreate.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1274
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1275
    "if I was iconified (not realized), remap iconified"
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1276
    self graphicsDevice
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1277
        mapView:self id:self drawableId iconified:(realized "shown" not)
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1278
        atX:left y:top width:width height:height
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1279
        minExtent:minExtent maxExtent:maxExtent.
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
  1280
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1281
    "and restart the window-group process"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1282
    windowGroup notNil ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1283
        windowGroup restart
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1284
    ].
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
  1285
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1286
    "restore controller"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1287
    controller := myController
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1288
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1289
    "Modified: / 6.5.1999 / 09:50:13 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1290
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1291
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1292
removeFromCurrentProject
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1293
    "remove the receiver (a topview) from the current projects set-of-views.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1294
     (If there is a current project)"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1295
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1296
    |p|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1297
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1298
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1299
     the following check allows systems
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1300
     without projects and changeSets
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1301
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1302
    (Project notNil and:[(p := Project current) notNil]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1303
	p removeView:self
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1304
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1305
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1306
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1307
restarted
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1308
    "sent by my windowGroup, when restarted from an image.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1309
     Nothing done here, but can be redefined to perform any actions
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1310
     required to reset the application after an image-restart.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1311
     (for example: check if application files are still around, restart
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1312
     subprocesses etc.)."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1313
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1314
    application notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1315
	application restarted
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1316
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1317
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1318
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1319
!StandardSystemView methodsFor:'printing & storing'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1320
5233
fb88be5a3dea define #printOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 5086
diff changeset
  1321
printOn:aStream
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1322
    "just for your convenience in inspectors ...
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1323
     ... add the views label to the displayString."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1324
5233
fb88be5a3dea define #printOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents: 5086
diff changeset
  1325
    super printOn:aStream.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1326
    label notNil ifTrue:[
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1327
	aStream nextPut:$(.  label printOn:aStream. aStream nextPut:$).
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1328
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1329
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1330
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1331
!StandardSystemView methodsFor:'private'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1332
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1333
convertedIcon
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1334
    "make certain, that the icon is compatible with my device;
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1335
     this means converting it to a format (typically: monochrome) which
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1336
     the device supports. Return a compatible version of the icon."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1337
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1338
    ^ self graphicsDevice convertedIcon:icon
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1339
4814
4204263d3ab3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4812
diff changeset
  1340
    "Modified: / 30-10-2007 / 16:39:55 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1341
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1342
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1343
convertedIcon:iconArg
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1344
    "make certain, that the image argument is compatible with my device;
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1345
     this means converting it to a format (typically: monochrome) which
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1346
     the device supports. Return a compatible version of the icon."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1347
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1348
    ^ self graphicsDevice convertedIcon:iconArg
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1349
4814
4204263d3ab3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4812
diff changeset
  1350
    "Modified: / 30-10-2007 / 16:37:31 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1351
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1352
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1353
convertedIconMask:aMask
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1354
    "return a version of the argument which can be used as an iconMask
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1355
     on my device. Typically, this means conversion to a monochrome
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1356
     mask - future versions may add alpha channel masks, if the device supports
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1357
     them ..."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1358
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1359
    ^ self graphicsDevice convertedIconMask:aMask
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1360
4814
4204263d3ab3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4812
diff changeset
  1361
    "Modified: / 30-10-2007 / 16:38:58 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1362
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1363
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1364
setWindowGroupFromApplication
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1365
    "get the applications topView and set my windowGroup to its wg."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1366
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1367
    |win master|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1368
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1369
    windowGroup isNil ifTrue:[
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1370
	application notNil ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1371
	    (win := application window) notNil ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1372
		win ~~ self ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1373
		    windowGroup := win windowGroup.
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1374
		    ^ self
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1375
		].
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1376
		(master := application masterApplication) notNil ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1377
		    (win := master window) notNil ifTrue:[
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1378
			windowGroup := win windowGroup.
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1379
			^ self
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1380
		    ].
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1381
		].
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1382
	    ]
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1383
	]
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1384
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1385
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1386
    "Created: 22.9.1995 / 17:40:36 / claus"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1387
    "Modified: 6.3.1996 / 16:17:32 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1388
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1389
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1390
windowLabelFor:labelString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1391
    "return an expanded labelString, according to the hostName-in-window setting.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1392
     The labelString may include positional parameters:
6504
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1393
        %1 - the actual label
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1394
        %2 - the hostname
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1395
        %3 - the userName
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1396
        %4 - the processId
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1397
        %5 - the TOP-directories name
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1398
        %6 - the TOP-directories path
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1399
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1400
6504
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1401
    |wg proc id pidString lbl windowLabelFormat stxPackageDirectory topDirectory|
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1402
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1403
    (IncludeHostNameInLabel == true
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1404
    and:[(windowLabelFormat := self class windowLabelFormat) notNil]) ifTrue:[
6504
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1405
        (wg := self windowGroup) notNil ifTrue:[
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1406
            (proc := wg process) notNil ifTrue:[
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1407
                (id := proc id) notNil ifTrue:[
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1408
                    pidString := id printString
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1409
                ]
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1410
            ]
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1411
        ].
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1412
        stxPackageDirectory := Smalltalk getPackageDirectoryForPackage:'stx'.
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1413
        stxPackageDirectory isNil ifTrue:[
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1414
            'StdSysView [info]: cannot figure out stx package directory.' infoPrintCR.
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1415
            stxPackageDirectory := OperatingSystem pathOfSTXExecutable asFilename.
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1416
        ].
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1417
        stxPackageDirectory isNil ifTrue:[
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1418
            topDirectory := OperatingSystem getHomeDirectory asFilename.
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1419
        ] ifFalse:[
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1420
            topDirectory := stxPackageDirectory directory.
6519
123f28fbb9a6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6504
diff changeset
  1421
            "/ a hack to make it look nicer on mac... (shows Packages otherwise)
123f28fbb9a6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6504
diff changeset
  1422
            topDirectory baseName = 'Packages' ifTrue:[
123f28fbb9a6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6504
diff changeset
  1423
                topDirectory := topDirectory directory
123f28fbb9a6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6504
diff changeset
  1424
            ].
6504
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1425
        ].
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1426
        lbl := windowLabelFormat
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1427
                bindWith:labelString
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1428
                with:[OperatingSystem getHostName]
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1429
                with:[OperatingSystem getLoginName]
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1430
                with:pidString
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1431
                with:[topDirectory baseName]
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1432
                with:[topDirectory pathName].
c5f5b4ae8195 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6480
diff changeset
  1433
        ^ lbl
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1434
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1435
    ^ labelString
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1436
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1437
    "Created: / 22-09-1997 / 10:10:32 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1438
    "Modified: / 22-08-2006 / 11:42:53 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1439
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1440
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1441
!StandardSystemView methodsFor:'queries'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1442
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1443
processName
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1444
    "return a string to be shown for my process in the
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1445
     process monitor. This has no semantic meaning, but exists
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1446
     for your convenience only."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1447
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1448
    application notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1449
	^ application processName
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1450
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1451
    label notNil ifTrue:[^ label].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1452
    ^ super processName
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1453
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1454
    "Modified: 24.4.1996 / 09:47:01 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1455
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1456
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1457
!StandardSystemView methodsFor:'realization'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1458
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1459
collapse
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1460
    "iconify the receiver"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1461
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1462
    shown ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1463
        self unmap.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1464
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1465
        "if it was iconified, try to remap iconified"
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1466
        self graphicsDevice
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1467
            mapView:self id:self drawableId iconified:true
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1468
            atX:left y:top width:width height:height
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1469
            minExtent:minExtent maxExtent:maxExtent.
5086
0a18f82d02ec sending of visibility-change fixed
Claus Gittinger <cg@exept.de>
parents: 5066
diff changeset
  1470
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1471
        shown ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1472
            shown := false.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1473
            self changed:#visibility.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1474
        ].
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1475
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1476
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1477
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1478
     |top|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1479
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1480
     top := StandardSystemView new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1481
     top label:'hello'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1482
     top openAndWait.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1483
     Delay waitForSeconds:2.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1484
     top collapse.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1485
     Delay waitForSeconds:2.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1486
     top expand.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1487
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1488
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1489
    "Modified: 24.7.1997 / 12:32:17 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1490
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1491
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1492
create
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1493
    "create - make certain that icon is available"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1494
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1495
    super create.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1496
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1497
    iconView notNil ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1498
        iconView create.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1499
        self graphicsDevice setWindowIconWindow:iconView in:self drawableId.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1500
        iconView setRealized:true.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1501
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1502
    iconLabel notNil ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1503
        self graphicsDevice setIconName:iconLabel string in:self drawableId
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1504
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1505
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1506
    "Modified: 10.6.1996 / 20:14:50 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1507
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1508
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1509
expand
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1510
    "de-iconify the receiver at its old position"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1511
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1512
    shown ifFalse:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1513
        self unmap.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1514
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1515
        "if it was iconified, try to remap iconified"
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1516
        self graphicsDevice
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1517
            mapView:self id:self drawableId iconified:false
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1518
            atX:left y:top width:width height:height
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1519
            minExtent:minExtent maxExtent:maxExtent.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1520
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1521
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1522
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1523
     |top|
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1524
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1525
     top := StandardSystemView new.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1526
     top label:'hello'.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1527
     top openAndWait.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1528
     top collapse.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1529
     Delay waitForSeconds:5.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1530
     top expand.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1531
    "
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1532
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1533
    "Modified: / 3.2.1998 / 16:02:56 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1534
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1535
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1536
physicalCreate
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1537
    "common code for create & recreate"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1538
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1539
    |dev lbl iconValue icn icnMask windowClassNameString org devBounds windowNameString|
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1540
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1541
    dev := self device.
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1542
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1543
    UserPreferences current forceWindowsIntoMonitorBounds ifTrue:[
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1544
        "/ MULTI SCREEN support
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1545
        devBounds := dev monitorBoundsAt:( left @ top ).
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1546
        "/ adjust origin, if too large
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1547
        left + width > devBounds right ifTrue:[
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1548
            left := devBounds right - width.
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1549
        ].
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1550
        top + height > devBounds bottom ifTrue:[
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1551
            top := devBounds bottom - height.
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1552
        ].
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1553
        top  := top  max:(devBounds top).
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1554
        left := left max:(devBounds left).
5532
b804c55e232f changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5418
diff changeset
  1555
    ].
b804c55e232f changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5418
diff changeset
  1556
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1557
    org := (left @ top) rounded.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1558
    lbl := self windowLabelFor:label.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1559
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1560
    icon notNil ifTrue:[
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1561
        iconValue := icon value.
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1562
        icn := dev convertedIcon:iconValue.
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1563
        (icnMask := iconValue mask) notNil ifTrue:[
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1564
            icnMask := dev convertedIconMask:icnMask
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1565
        ].
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1566
        deviceIcon := icn.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1567
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1568
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1569
    "/ give global eventListeners a chance to intercept windowCreation
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1570
    "/ and provide another origin (by payching my origin via setOrigin:).
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1571
    WindowSensor preViewCreateNotification:self.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1572
6283
03b901746708 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6278
diff changeset
  1573
    gc
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1574
      createWindowFor:self
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1575
      type:(self windowType)
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1576
      origin:org
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1577
      extent:(width @ height)
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1578
      minExtent:minExtent
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1579
      maxExtent:maxExtent
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1580
      borderWidth:0 "self borderWidth"
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1581
      subViewOf:nil
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1582
      style:(self windowStyle)
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1583
      inputOnly:(self isInputOnly)
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1584
      label:lbl
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1585
      owner:nil
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1586
      icon:icn iconMask:icnMask
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1587
      iconView:iconView.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1588
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1589
    Lobby registerChange:self.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1590
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1591
    "/ give global listeners a chance to track views
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1592
    WindowSensor postViewCreateNotification:self.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1593
5556
dc9e29cb26b4 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5537
diff changeset
  1594
    self originChangedFlag:false extentChangedFlag:false.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1595
5388
10a240c6365a changed:
Claus Gittinger <cg@exept.de>
parents: 5349
diff changeset
  1596
"/    (borderColor notNil and:[borderColor ~= Black]) ifTrue:[
10a240c6365a changed:
Claus Gittinger <cg@exept.de>
parents: 5349
diff changeset
  1597
"/        self setBorderColor
10a240c6365a changed:
Claus Gittinger <cg@exept.de>
parents: 5349
diff changeset
  1598
"/    ].
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1599
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1600
"/  (viewGravity notNil "and:[viewGravity ~~ #NorthWest]") ifTrue:[
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1601
"/        super viewGravity:viewGravity
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1602
"/  ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1603
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1604
"/  (bitGravity notNil "and:[bitGravity ~~ #NorthWest]") ifTrue:[
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1605
"/      super bitGravity:bitGravity
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1606
"/  ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1607
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1608
    viewShape notNil ifTrue:[
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1609
        self setViewShape
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1610
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1611
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1612
    (backed notNil and:[backed ~~ false]) ifTrue:[
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1613
        self backingStore:backed.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1614
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1615
    self saveUnder ifTrue:[
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1616
        self saveUnder:true.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1617
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1618
    cursor notNil ifTrue:[
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1619
        self setCursor
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1620
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1621
5975
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1622
    "/JV@2012-11-11: Updated to be ICCCM 2.0 Compliant - some modern Window managers
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1623
    "/               provide better UX when application behave nicely. Being
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1624
    "/               conformant should not hurt as St/X don't depend on X resources anyway :-)
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1625
    "/               See:
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1626
    "/  
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1627
    "/               http://tronche.com/gui/x/icccm/sec-4.html
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1628
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1629
    (UserPreferences current icccm20Compliant) ifTrue:[
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1630
        "/ICCCM 2.0 compliant name & class. See ICCCM 2.0 section 4.1.2.5.
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1631
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1632
        | lastSepIndex |
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1633
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1634
        lastSepIndex := Smalltalk commandName lastIndexOf: Filename separator.
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1635
        windowNameString := Smalltalk commandName copyFrom: lastSepIndex + 1.
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1636
        windowClassNameString := windowNameString capitalized.
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1637
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1638
        "/ Also, set _NET_WM_PID
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1639
        self setWindowPid: nil.
5039
9ac48dce073b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5005
diff changeset
  1640
    ] ifFalse:[
5975
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1641
        "/ Old code..."
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1642
        application notNil ifTrue:[
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1643
            windowClassNameString := application class name.
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1644
        ] ifFalse:[
5975
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1645
            (self class == StandardSystemView and:[subViews size == 1]) ifTrue:[
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1646
                "This is a subclass of SimpleView wrapped into a StandardSystemView"
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1647
                windowClassNameString := subViews first class name.
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1648
            ] ifFalse:[
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1649
                windowClassNameString := self class name.
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1650
            ]
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1651
        ].
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1652
        windowClassNameString := 'Stx.', windowClassNameString.
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1653
        windowNameString := 'main'.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1654
    ].
5975
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1655
6228
0d2c822acecd class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6203
diff changeset
  1656
    self windowClass:windowClassNameString name:windowNameString.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1657
4807
62e7832829b7 icon conversion code moved to device
Claus Gittinger <cg@exept.de>
parents: 4800
diff changeset
  1658
    "Modified: / 14-06-1996 / 17:14:25 / stefan"
5624
79cd17085999 changed: #physicalCreate
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  1659
    "Modified: / 22-10-2010 / 11:01:35 / cg"
5975
3d74c7895143 ICCCM 2.0 Compliancy: correctly set NET_WM_CLASS and _NET_WM_PID properties
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 5942
diff changeset
  1660
    "Modified: / 04-01-2013 / 16:13:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1661
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1662
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1663
postRealize
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1664
    "postRealize actions - tell the application (if any)."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1665
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1666
    super postRealize.
6245
d0c50dd22b30 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6228
diff changeset
  1667
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1668
    "/
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1669
    "/ let the application add its views to the current project
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1670
    "/
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1671
    application notNil ifTrue:[
6245
d0c50dd22b30 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6228
diff changeset
  1672
        application opened:self.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1673
    ] ifFalse:[
6245
d0c50dd22b30 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6228
diff changeset
  1674
        self addToCurrentProject.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1675
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1676
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1677
    "Created: 24.7.1997 / 18:11:26 / cg"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1678
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1679
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1680
preRealize
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1681
    "invoked right before the view is realized.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1682
     preRealize actions - tell the application (if any)."
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1683
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1684
    super preRealize.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1685
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1686
    application notNil ifTrue:[
5613
7ab31f02f7d1 Multi Screen Support
Michael Beyl <mb@exept.de>
parents: 5556
diff changeset
  1687
	application aboutToOpen:self.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1688
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1689
!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1690
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1691
recreate
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1692
    "recreate the view after a snap-in or a migration"
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1693
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1694
    super recreate.
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1695
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1696
    iconView notNil ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1697
        iconView recreate.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1698
        self graphicsDevice setWindowIconWindow:iconView in:self drawableId.
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1699
        iconView setRealized:true.
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1700
    ] ifFalse:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1701
        icon notNil ifTrue:[
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1702
            self icon:(self graphicsDevice convertedIcon:icon).
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1703
        ].
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1704
    ].
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1705
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1706
    iconLabel notNil ifTrue:[
6278
0d9ffed76629 class: StandardSystemView
Stefan Vogel <sv@exept.de>
parents: 6248
diff changeset
  1707
        self graphicsDevice setIconName:iconLabel in:self drawableId
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1708
    ]
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1709
4814
4204263d3ab3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4812
diff changeset
  1710
    "Modified: / 30-10-2007 / 16:39:42 / cg"
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1711
! !
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1712
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1713
!StandardSystemView class methodsFor:'documentation'!
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1714
6048
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1715
version
6519
123f28fbb9a6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6504
diff changeset
  1716
    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.222 2014-06-29 14:17:45 cg Exp $'
6048
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1717
!
25578230982a class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6047
diff changeset
  1718
5388
10a240c6365a changed:
Claus Gittinger <cg@exept.de>
parents: 5349
diff changeset
  1719
version_CVS
6519
123f28fbb9a6 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 6504
diff changeset
  1720
    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.222 2014-06-29 14:17:45 cg Exp $'
4566
Claus Gittinger <cg@exept.de>
parents: 4560
diff changeset
  1721
! !
3746
d9dccd3a4a41 beSlave: also try masterApp in setWGFromApplication
Claus Gittinger <cg@exept.de>
parents: 3706
diff changeset
  1722
6047
d8080f253e26 class: StandardSystemView
Claus Gittinger <cg@exept.de>
parents: 5975
diff changeset
  1723
1878
76e9bc8e1b9c new hostName in label format
Claus Gittinger <cg@exept.de>
parents: 1865
diff changeset
  1724
StandardSystemView initialize!