StandardSystemView.st
author Stefan Vogel <sv@exept.de>
Fri, 03 May 1996 23:06:39 +0200
changeset 641 f265a4c4785f
parent 625 4d8f6dc3af75
child 655 2a518e85793a
permissions -rw-r--r--
Must register drawableId in Lobby when physicalCreate'ing a window.
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
"
48194c26a46c Initial revision
claus
parents:
diff changeset
    12
135
claus
parents: 132
diff changeset
    13
TopView subclass:#StandardSystemView
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    14
	instanceVariableNames:'label icon iconView iconLabel minExtent maxExtent sizeFixed
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    15
		application windowEventsForApplication'
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    16
	classVariableNames:'DefaultIcon TakeFocusWhenMapped IncludeHostNameInLabel'
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    17
	poolDictionaries:''
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
    18
	category:'Views-Basic'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    19
!
48194c26a46c Initial revision
claus
parents:
diff changeset
    20
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    21
!StandardSystemView class methodsFor:'documentation'!
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    22
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    23
copyright
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    24
"
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    25
 COPYRIGHT (c) 1989 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
    26
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    27
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    28
 This software is furnished under a license and may be used
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    29
 only in accordance with the terms of that license and with the
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    31
 be provided or otherwise made available to, or used by, any
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    32
 other person.  No title to or ownership of the software is
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    33
 hereby transferred.
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    34
"
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    35
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    36
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    37
documentation
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
    38
"
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    39
    I represent standard application topViews 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    40
    i.e. those views which have a title-label, an icon etc. 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    41
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    42
    The name `StandardSystemView' is probably misleading and
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    43
    results from ST-80 (rel2.x) compatibility reasons.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    44
    Thing of it as an ApplicationWindow.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    45
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    46
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    47
    In ST/X, StandardSystemViews were subclassed for special views
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    48
    in the past (for example: FileBrowser, ChangesBrowser etc.).
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    49
    Although this worked, it may lead to the following
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    50
    problems and inconveniences:
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    51
        - applications inherit a big number of methods through the
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    52
          SimpleView->View->TopView->StandardSystemView hierarchy.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    53
          There is quite a danger that by accident, some method gets
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    54
          redefined which is required by one of those classes.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    55
          (typical candidates are: terminate, destroy, open ...)
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    56
          This may lead to strange effects, which may not be obvious to
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    57
          non experts ...
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    58
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    59
        - applications with multiple topViews are difficult to implement
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    60
          and manage.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    61
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    62
        - use of a windowBuilder is difficult.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    63
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    64
    For all those reasons, we HIGHLY recommend to NOT define applications
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    65
    as subclasses of StandardSystemView, but instead base them on
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    66
    ApplicationModel, and reference the topView(s) as instance variables of
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    67
    if (if at all).
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    68
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    69
    [instance variables:]
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    70
        label                   <String>    the label in the windows title
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    71
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    72
        icon                    <Form>      the icon
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    73
                                            [ignored if the display does not 
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    74
                                             support icons]
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    75
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    76
        iconView                <View>      an optional icon-view (for animated icons)
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    77
                                            [ignored if the display does not
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    78
                                             supports this]
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    79
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    80
        iconLabel               <String>    the label in the icon
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    81
                                            [ignored if the display does not 
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    82
                                             support label-tabs with icons]
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    83
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    84
        minExtent               <Point>     the minimum size
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    85
                                            No limit, if nil
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    86
                                            [the window manager may have its own
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    87
                                             limit; typically some small area]
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    88
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    89
        maxExtent               <Point>     the maximum size
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    90
                                            No limit, if nil.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    91
                                            [the window manager may have its own
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    92
                                             limit; typically the screen size]
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    93
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    94
        sizeFixed               <Boolean>   prevents the view from resizing itself
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    95
                                            (especially to freeze a dialogs size)
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    96
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    97
        application             <AppModel>  if nonNil, thats the application
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    98
                                            Many requests (such as open/close etc.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    99
                                            are forwarded to it, if present.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   100
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   101
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
     [class variables:]
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   104
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   105
        DefaultIcon             <Form>      cached default icon
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   106
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   107
        TakeFocusWhenMapped     <Boolean>   if true, views grab the keyboard
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   108
                                            focus (convenient with some stupid
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   109
                                            windowManagers)
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   110
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   111
        IncludeHostNameInLabel  <Boolean>   if true, the windows title shall
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   112
                                            include the hostname.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   113
                                            (convenient if you have many remote
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   114
                                            views open simultaneously)
616
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
   115
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
   116
    [author:]
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
   117
        Claus Gittinger
56cf67c82664 documentation
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
   118
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   119
    [see also:]
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   120
        WindowGroup
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   121
        ApplicationModel
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   122
"
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   123
!
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   124
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   125
examples
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   126
"
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   127
    simple, empty topView:
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   128
                                                                        [exBegin]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   129
        |topView|
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   130
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   131
        topView := StandardSystemView new.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   132
        topView label:'my first view'.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   133
        topView extent:200 @ 200.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   134
        topView open.
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   135
                                                                        [exEnd]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   136
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   137
    with an icon & iconLabel:
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   138
                                                                        [exBegin]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   139
        |topView|
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   140
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   141
        topView := StandardSystemView extent:200 @ 200.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   142
        topView label:'Hello world'.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   143
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   144
        topView icon:(Image fromFile:'hello_world.icon').
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   145
        topView open.
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   146
                                                                        [exEnd]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   147
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   148
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   149
    with an animated iconView [not supported on all display devices]:
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   150
                                                                        [exBegin]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   151
        |iconView topView|
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   152
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   153
        iconView := ClockView new.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   154
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   155
        topView := StandardSystemView extent:200 @ 200.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   156
        topView label:'Hello world'.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   157
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   158
        topView iconView:iconView.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   159
        topView open.
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   160
                                                                        [exEnd]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   161
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   162
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   163
    placing a subView into it:
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   164
                                                                        [exBegin]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   165
        |topView button|
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   166
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   167
        topView := StandardSystemView new.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   168
        topView label:'my second view'.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   169
        topView extent:200 @ 200.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   170
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   171
        button := Button label:'close' in:topView.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   172
        button action:[topView destroy].
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   173
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   174
        topView open.
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   175
                                                                        [exEnd]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   176
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   177
    same, relative sized subview:
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   178
                                                                        [exBegin]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   179
        |topView button|
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   180
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   181
        topView := StandardSystemView new.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   182
        topView label:'my second view'.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   183
        topView extent:200 @ 200.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   184
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   185
        button := Button label:'close' in:topView.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   186
        button action:[topView destroy].
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   187
        button origin:0.25 @ 0.25 corner:0.75 @ 0.75.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   188
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   189
        topView open.
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   190
                                                                        [exEnd]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   191
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   192
    multiple buttons in a panel in a topView:
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   193
                                                                        [exBegin]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   194
        |topView panel button1 button2 button3|
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   195
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   196
        topView := StandardSystemView new.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   197
        topView label:'my second view'.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   198
        topView extent:200 @ 200.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   199
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   200
        panel := HorizontalPanelView origin:0.0@0.0 corner:1.0@1.0 in:topView.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   201
        panel inset:10.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   202
        panel level:-1.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   203
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   204
        button1 := Button label:'one' in:panel.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   205
        button1 action:[Transcript showCr:'one pressed'].
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   206
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   207
        button2 := Button label:'two' in:panel.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   208
        button2 action:[Transcript showCr:'two pressed'].
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   209
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   210
        button3 := Button label:'three' in:panel.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   211
        button3 action:[Transcript showCr:'three pressed'].
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   212
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   213
        topView open.
621
decaeae1910d examples
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   214
                                                                        [exEnd]
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   215
"
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   216
! !
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   217
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   218
!StandardSystemView class methodsFor:'instance creation'!
183
claus
parents: 181
diff changeset
   219
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   220
extent:anExtent label:aLabel icon:aForm
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   221
    "create a new topView and define its extent, label and icon"
180
claus
parents: 157
diff changeset
   222
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   223
    ^ self origin:nil extent:anExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   224
	   label:aLabel icon:aForm
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   225
	   minExtent:nil maxExtent:nil
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   226
!
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   227
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   228
extent:anExtent label:aLabel icon:aForm minExtent:minExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   229
    ^ self origin:nil extent:anExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   230
	   label:aLabel icon:aForm
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   231
	   minExtent:minExtent maxExtent:nil
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   232
!
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   233
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   234
extent:anExtent label:aLabel icon:aForm minExtent:minExtent maxExtent:maxExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   235
    ^ self origin:nil extent:anExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   236
	   label:aLabel icon:aForm
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   237
	   minExtent:minExtent maxExtent:maxExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   238
!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   239
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   240
extent:anExtent label:aLabel minExtent:minExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   241
    "create a new topView and define its extent, label and minumum extent"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   242
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   243
    ^ self origin:nil extent:anExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   244
	   label:aLabel icon:nil
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   245
	   minExtent:minExtent maxExtent:nil
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   246
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   247
48194c26a46c Initial revision
claus
parents:
diff changeset
   248
label:aLabel
48194c26a46c Initial revision
claus
parents:
diff changeset
   249
    "create a new topView and define its label"
48194c26a46c Initial revision
claus
parents:
diff changeset
   250
48194c26a46c Initial revision
claus
parents:
diff changeset
   251
    ^ self origin:nil extent:nil
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   252
	   label:aLabel icon:nil
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   253
	   minExtent:nil maxExtent:nil
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   254
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   255
48194c26a46c Initial revision
claus
parents:
diff changeset
   256
label:aLabel icon:aForm
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   257
    "create a new topView and define its label and icon"
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   258
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   259
    ^ self origin:nil extent:nil
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   260
	   label:aLabel icon:aForm
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   261
	   minExtent:nil maxExtent:nil
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   262
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   263
48194c26a46c Initial revision
claus
parents:
diff changeset
   264
label:aLabel icon:aForm minExtent:anExtent
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   265
    "create a new topView and define its label, icon and minumum extent"
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   266
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   267
    ^ self origin:nil extent:nil
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   268
	   label:aLabel icon:aForm
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   269
	   minExtent:anExtent maxExtent:nil
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   270
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   271
48194c26a46c Initial revision
claus
parents:
diff changeset
   272
label:aLabel icon:aForm minExtent:minExtent maxExtent:maxExtent
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   273
    "create a new topView and define its label, icon, min and max extents"
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   274
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   275
    ^ self origin:nil extent:nil
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   276
	   label:aLabel icon:aForm
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   277
	   minExtent:minExtent maxExtent:maxExtent
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   278
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   279
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   280
label:aLabel minExtent:anExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   281
    "create a new topView and define its label and minimum extent"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   282
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   283
    ^ self origin:nil extent:nil
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   284
	   label:aLabel icon:nil
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   285
	   minExtent:anExtent maxExtent:nil
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   286
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   287
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   288
model:aModel label:aLabel minimumSize:minExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   289
    "ST80-style instance creation"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   290
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   291
    |newView|
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   292
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   293
    newView := self origin:nil 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   294
		    extent:minExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   295
		     label:aLabel 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   296
		      icon:nil
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   297
		 minExtent:minExtent
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   298
		 maxExtent:nil.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   299
    newView model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   300
"/    newView controller:(self defaultControllerClass new view:newView).
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   301
    ^ newView
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   302
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   303
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   304
origin:anOrigin extent:anExtent label:aLabel
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   305
    "create a new topView and define its origin, extent and label"
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   306
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   307
    ^ self origin:anOrigin extent:anExtent
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   308
	   label:aLabel icon:nil
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   309
	   minExtent:nil maxExtent:nil
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   310
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   311
48194c26a46c Initial revision
claus
parents:
diff changeset
   312
origin:anOrigin label:aLabel icon:aForm
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   313
		minExtent:minExtent maxExtent:maxExtent
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   314
    "create a new topView and define its origin, extent, label, icon
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   315
     and extent-boundaries."
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   316
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   317
    ^ self origin:anOrigin extent:nil
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   318
	   label:aLabel icon:aForm
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   319
	   minExtent:minExtent maxExtent:maxExtent
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   320
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   321
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   322
!StandardSystemView class methodsFor:'defaults'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   323
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   324
defaultIcon
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   325
    "return the default icon for views.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   326
     This can be redefined in subclasses or overwritten in
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   327
     initialize methods."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   328
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   329
    DefaultIcon isNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   330
	DefaultIcon := Image fromFile:'SmalltalkX.xbm'.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   331
	DefaultIcon notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   332
	    DefaultIcon := DefaultIcon on:Display
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   333
	]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   334
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   335
    ^ DefaultIcon
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   336
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   337
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   338
defaultLabel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   339
    "return the default label for views of my kind.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   340
     This can be redefined in subclasses or overwritten in
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   341
     initialize methods."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   342
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   343
    ^ 'aView'
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   344
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   345
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   346
includeHostNameInLabel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   347
    "return the flag which controls if a views label should
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   348
     include the hostname.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   349
     This flag is usually set/cleared in your private.rc file;
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   350
     the default is false."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   351
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   352
    ^ IncludeHostNameInLabel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   353
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   354
    "Created: 10.9.1995 / 19:21:16 / claus"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   355
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   356
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   357
includeHostNameInLabel:aBoolean
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   358
    "set/clear the flag which controls if a views label should
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   359
     include the hostname - this is highly useful if you have 
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   360
     multiple smalltalks open simultaneously ...
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   361
     This flag is usually set/cleared in your private.rc file;
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   362
     the default is false."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   363
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   364
    IncludeHostNameInLabel := aBoolean
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   365
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   366
    "Modified: 24.4.1996 / 09:09:21 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   367
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   368
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   369
!StandardSystemView class methodsFor:'startup'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   370
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   371
open
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   372
    "create, realize the view - this topview and all its subviews will
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   373
     run as a separate process with its own windowGroup"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   374
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   375
    ^ self new open 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   376
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   377
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   378
start
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   379
    "create, realize the view - this topview and all its subviews will
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   380
     run as a separate process with its own windowGroup.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   381
     This method exists for backward compatibility - use open."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   382
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   383
    ^ self open
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   384
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   385
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   386
!StandardSystemView methodsFor:'accessing'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   387
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   388
application
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   389
    "return the topViews application.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   390
     This is new protocol for ST-80 compatibility and not yet fully supported"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   391
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   392
    ^ application
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   393
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   394
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   395
application:anApplicationModel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   396
    "set the topViews application.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   397
     This is new protocol for ST-80 compatibility and not yet fully supported"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   398
570
8a7c398caa94 preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   399
    application := anApplicationModel.
8a7c398caa94 preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   400
    anApplicationModel notNil ifTrue:[
8a7c398caa94 preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   401
        anApplicationModel window isNil ifTrue:[
8a7c398caa94 preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   402
            anApplicationModel window:self
8a7c398caa94 preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   403
        ]
8a7c398caa94 preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   404
    ]
8a7c398caa94 preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   405
8a7c398caa94 preset the applications window when my app is set
Claus Gittinger <cg@exept.de>
parents: 516
diff changeset
   406
    "Modified: 18.4.1996 / 14:55:44 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   407
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   408
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   409
name
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   410
    "return the topViews label"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   411
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   412
    ^ label
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   413
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   414
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   415
!StandardSystemView methodsFor:'accessing-behavior'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   416
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   417
bePartner
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   418
    "define me as a partner-View.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   419
     All partners within the applications windowGroup iconify/deiconify together."
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   420
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   421
    self setWindowGroupFromApplication.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   422
    super bePartner.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   423
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   424
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   425
     see example in TopView>>bePartner
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   426
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   427
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   428
    "Created: 22.9.1995 / 17:40:15 / claus"
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   429
    "Modified: 6.3.1996 / 16:16:42 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   430
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   431
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   432
beSlave
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   433
    "define me as a slave-View.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   434
     All slaves within the applications windowGroup iconify/deiconify with the masterView(s)"
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   435
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   436
    self setWindowGroupFromApplication.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   437
    super beSlave.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   438
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   439
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   440
     see example in TopView>>beSlave
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   441
    "
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   442
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   443
    "Created: 22.9.1995 / 17:40:15 / claus"
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   444
    "Modified: 6.3.1996 / 16:16:50 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   445
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   446
625
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   447
sendWindowEvents:collectionOfEventSymbols
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   448
    "define the events that are to be forwarded to the application.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   449
     This is being implemented ..."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   450
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   451
    windowEventsForApplication := collectionOfEventSymbols
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   452
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   453
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   454
sizeFixed:aBoolean
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   455
    "this prevents the view from resizing itself when realized.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   456
     For normal topViews, this is void, since they dont do this anyway.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   457
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   458
     However, modalBoxes (especially: DialogBoxes) typically resize themselfes 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   459
     to the preferredExtent of their components. In some cases, this behavior is 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   460
     not desired and it should be turned off by setting sizeFixed to true.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   461
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   462
     To avoid confusion:
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   463
	This does NOT prevent the window manager from resizing the view, 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   464
	instead it tells the view to NOT resize ITSELF."
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   465
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   466
    sizeFixed := aBoolean.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   467
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   468
    "example: dialog which resizes itself on #open: 
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   469
	      (thereby ignoring the 200@200 extent)
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   470
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   471
	|dialog|
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   472
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   473
	dialog := Dialog new.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   474
	dialog addInputFieldOn:'' asValue.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   475
	dialog addOkButton.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   476
	dialog extent:200@200.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   477
	dialog open.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   478
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   479
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   480
    using sizeFixed:
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   481
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   482
	|dialog|
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   483
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   484
	dialog := Dialog new.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   485
	dialog addInputFieldOn:'' asValue.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   486
	dialog addOkButton.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   487
	dialog extent:200@200; sizeFixed:true.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   488
	dialog open.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   489
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   490
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   491
    using openWithExtent (also sets sizeFixed):
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   492
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   493
	|dialog|
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   494
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   495
	dialog := Dialog new.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   496
	dialog addInputFieldOn:'' asValue.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   497
	dialog addOkButton.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   498
	dialog openWithExtent:200@200.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   499
    "
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   500
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   501
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   502
!StandardSystemView methodsFor:'accessing-dimensions'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   503
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   504
maxExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   505
    "return the views maximum allowed extent"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   506
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   507
    ^ maxExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   508
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   509
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   510
maxExtent:max
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   511
    "define the maximum extent the view may have -
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   512
     depends on good-will of window manager"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   513
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   514
    maxExtent := max.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   515
    (width notNil and:[height notNil]) ifTrue:[
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   516
	((width > (maxExtent x)) or:
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   517
	 [height > (maxExtent y)]) ifTrue: [
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   518
	    self extent:maxExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   519
	]
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   520
    ]
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   521
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   522
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   523
maximumSize:anExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   524
    "same as maxExtent: for ST-80 compatibility"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   525
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   526
    ^ self maxExtent:anExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   527
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   528
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   529
minExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   530
    "return the views minimum allowed extent"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   531
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   532
    ^ minExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   533
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   534
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   535
minExtent:min
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   536
    "define the minimum extent the view may have -
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   537
     depends on good-will of window manager"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   538
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   539
    minExtent := min.
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   540
    (width notNil and:[height notNil]) ifTrue:[
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   541
	((width < (minExtent x)) or:
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   542
	 [height < (minExtent y)]) ifTrue: [
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   543
	    self extent:minExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   544
	]
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   545
    ]
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   546
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   547
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   548
minimumSize
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   549
    "same as minExtent for ST-80 compatibility"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   550
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   551
    ^ self minExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   552
!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   553
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   554
minimumSize:anExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   555
    "same as minExtent: for ST-80 compatibility"
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   556
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   557
    ^ self minExtent:anExtent
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   558
! !
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   559
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   560
!StandardSystemView methodsFor:'accessing-look'!
4d8f6dc3af75 commentary & category changes
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   561
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   562
icon
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   563
    "return the form defined as icon"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   564
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   565
    ^ icon
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   566
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   567
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   568
icon:aForm
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   569
    "define the form (bitmap) used as icon"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   570
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   571
    |invertedIcon i|
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   572
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   573
    icon := aForm.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   574
    icon notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   575
	drawableId notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   576
	    icon depth ~~ 1 ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   577
		icon := icon asMonochromeFormOn:device.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   578
	    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   579
	    "icons assume 1s as black - invert icon if the device thinks different"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   580
	    (device depth == 1 and:[device whitepixel ~~ 0]) ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   581
		i := icon on:device.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   582
		i notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   583
		    invertedIcon := Form width:icon width height:icon height on:device.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   584
		    invertedIcon function:#copy.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   585
		    invertedIcon foreground:Color noColor background:Color allColor.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   586
		    invertedIcon copyFrom:i x:0 y:0 toX:0 y:0 width:icon width height:icon height.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   587
		    i := invertedIcon.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   588
		]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   589
	    ] ifFalse:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   590
		i := icon on:device.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   591
	    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   592
	    (i notNil and:[i id notNil]) ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   593
		device setWindowIcon:i in:drawableId
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   594
	    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   595
	]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   596
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   597
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   598
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   599
iconLabel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   600
    "return the name displayed in the icon"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   601
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   602
    ^ iconLabel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   603
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   604
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   605
iconLabel:aString
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   606
    "define the name to be displayed in the icon"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   607
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   608
    iconLabel := aString.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   609
    drawableId notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   610
	device setIconName:aString in:drawableId.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   611
	"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   612
	 unbuffered - to make it visible right NOW
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   613
	"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   614
	device flush.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   615
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   616
!
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   617
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   618
iconName:aString
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   619
    "this method will vanish soon ... - for backward compatibility"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   620
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   621
    self iconLabel:aString
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   622
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   623
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   624
iconView
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   625
    "return the view used as icon-view"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   626
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   627
    ^ iconView
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   628
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   629
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   630
iconView:aView
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   631
    "specify the view to be used as icon"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   632
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   633
    iconView := aView.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   634
    drawableId notNil ifTrue:[
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   635
        aView create.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   636
        device setWindowIconWindow:aView in:drawableId.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   637
        aView setRealized:true.
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   638
    ]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   639
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   640
    "Modified: 24.4.1996 / 10:30:12 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   641
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   642
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   643
label
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   644
    "return the views name in the title area"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   645
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   646
    ^ label
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   647
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   648
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   649
label:aString
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   650
    "define the views name in the windows title area.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   651
     If IncludeHostNameInLabel is true, prepend the hostname
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   652
     (you will appreciate this, if you are working on multiple
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   653
      machines simultaneously - as I do ...)"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   654
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   655
    |l|
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   656
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   657
    aString ~= label ifTrue:[
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   658
        label := aString.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   659
        drawableId notNil ifTrue: [
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   660
            IncludeHostNameInLabel == true ifTrue:[
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   661
                l := OperatingSystem getHostName , ': ' , aString.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   662
            ] ifFalse:[
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   663
                l := aString
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   664
            ].
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   665
            device setWindowName:l in:drawableId.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   666
            "
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   667
             unbuffered - to make it visible right NOW
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   668
            "
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   669
            device flush.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   670
        ]
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   671
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   672
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   673
    "Created: 8.9.1995 / 19:37:06 / claus"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   674
    "Modified: 8.9.1995 / 19:39:18 / claus"
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   675
    "Modified: 24.4.1996 / 09:09:17 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   676
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   677
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   678
label:labelString iconLabel:iconLabelString
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   679
    "set both the label and the iconLabel"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   680
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   681
    self label:labelString.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   682
    self iconLabel:iconLabelString
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   683
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   684
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   685
!StandardSystemView methodsFor:'destroying'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   686
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   687
closeRequest 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   688
    "programmatic close request"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   689
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   690
    ^ self terminate
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   691
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   692
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   693
destroy
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   694
    "destroy the view."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   695
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   696
    self removeFromCurrentProject.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   697
    windowGroup notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   698
	windowGroup focusSequence:nil.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   699
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   700
    application notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   701
	application windowEvent:(#close -> self) from:self
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   702
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   703
    super destroy.
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   704
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   705
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   706
saveAndTerminate
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   707
    "save & terminate request from the windowManager. The application should 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   708
     save its data/files/text etc. somehow and close.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   709
     If there is an application, let it decide how do do that.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   710
     Otherwise, forward it to superclasses which knows how to do this.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   711
     (it defaults to a terminate there).
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   712
     Notice, that not all windowmanagers are nice enough
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   713
     to send this request; some simply distroy the view."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   714
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   715
    application notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   716
	application saveAndTerminateRequest
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   717
    ] ifFalse:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   718
	super saveAndTerminate
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   719
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   720
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   721
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   722
terminate
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   723
    "terminate request from the windowManager. If there is an application,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   724
     let it decide if it really wants to be close. Otherwise, forward it to
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   725
     superclasses terminate which knows how to do this.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   726
     Notice, that not all windowmanagers are nice enough
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   727
     to send this request; some simply distroy the view."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   728
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   729
    application notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   730
	application closeRequest
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   731
    ] ifFalse:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   732
	super terminate
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   733
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   734
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   735
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   736
!StandardSystemView methodsFor:'event handling'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   737
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   738
focusIn
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   739
    "the view got the keyboard focus (via the window manager)"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   740
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   741
    |v|
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   742
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   743
    windowGroup notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   744
	(v := windowGroup focusView) notNil ifTrue:[
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   745
	    v showFocus:false.
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   746
	    ^ self
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   747
	]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   748
    ].
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   749
    delegate notNil ifTrue:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   750
	delegate showFocus:false.
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   751
    ]
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   752
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   753
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   754
focusOut
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   755
    "the view lost keyboard focus (via the window manager)"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   756
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   757
    |v|
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   758
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   759
    windowGroup notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   760
	(v := windowGroup focusView) notNil ifTrue:[
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   761
	    v showNoFocus:false.
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   762
	    ^ self
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   763
	]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   764
    ].
385
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   765
    delegate notNil ifTrue:[
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   766
	delegate showNoFocus:false.
15fd1c806d2a pass info if focus change was explicit (i.e. Tab-key) or by window manager.
Claus Gittinger <cg@exept.de>
parents: 328
diff changeset
   767
    ]
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   768
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   769
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   770
mapped
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   771
    "the view got mapped"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   772
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   773
    super mapped.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   774
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   775
     ask for the focus - this avoids having to click on the
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   776
     view with WM's which need an explicit click.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   777
     Q: is this a good idea ?
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   778
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   779
    TakeFocusWhenMapped == true ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   780
	self getKeyboardFocus.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   781
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   782
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   783
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   784
showActivity:someMessage
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   785
    "some activityNotification shalt be communicated to
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   786
     the user. Forward it to my application (if any).
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   787
     (that one should know how to deal with it).
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   788
     Otherwise, simply ignore it."
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   789
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   790
    application notNil ifTrue:[
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   791
        application showActivity:someMessage
328
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   792
    ]
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   793
7bbe05da5769 activity notification added
Claus Gittinger <cg@exept.de>
parents: 298
diff changeset
   794
    "Created: 16.12.1995 / 18:40:44 / cg"
597
958e2673ca11 commentary
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   795
    "Modified: 23.4.1996 / 21:38:11 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   796
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
   797
48194c26a46c Initial revision
claus
parents:
diff changeset
   798
!StandardSystemView methodsFor:'initialization'!
48194c26a46c Initial revision
claus
parents:
diff changeset
   799
48194c26a46c Initial revision
claus
parents:
diff changeset
   800
addToCurrentProject
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   801
    "add the receiver (a topview) to the current projects set-of-views.
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   802
     (If there is a current project)"
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   803
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   804
    |p|
69
04d0949dc053 *** empty log message ***
claus
parents: 54
diff changeset
   805
04d0949dc053 *** empty log message ***
claus
parents: 54
diff changeset
   806
    "
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   807
     the following check allows systems
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   808
     without projects and changeSets
69
04d0949dc053 *** empty log message ***
claus
parents: 54
diff changeset
   809
    "
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   810
    (Project notNil and:[(p := Project current) notNil]) ifTrue:[
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   811
	p addView: self
69
04d0949dc053 *** empty log message ***
claus
parents: 54
diff changeset
   812
    ]
04d0949dc053 *** empty log message ***
claus
parents: 54
diff changeset
   813
!
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   814
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   815
defaultControllerClass
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   816
    "for ST-80 compatibility only - not used in ST/X"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   817
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   818
    ^ nil "/ StandardSystemController
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   819
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   820
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   821
initEvents
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   822
    super initEvents.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   823
    self enableFocusEvents.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   824
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   825
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   826
initialize
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   827
    super initialize.
69
04d0949dc053 *** empty log message ***
claus
parents: 54
diff changeset
   828
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   829
    borderWidth := 2.         "- notice: many window managers ignore this"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   830
    minExtent := 10 @ 10.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   831
    maxExtent := (device width) @ (device height).
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   832
    label isNil ifTrue:[label := self class defaultLabel].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   833
    icon isNil ifTrue:[icon := self class defaultIcon].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   834
    name := self class name.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   835
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   836
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   837
reAdjustGeometry
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   838
    "sent as a final step when an image is restarted.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   839
     when we come up on a smaller display, 
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   840
     make certain, that the receiver is visible"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   841
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   842
    |dX dY limitRight limitBottom|
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   843
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   844
    dX := (device horizontalPixelPerMillimeter * 20) rounded.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   845
    dY := (device verticalPixelPerMillimeter * 20) rounded.
69
04d0949dc053 *** empty log message ***
claus
parents: 54
diff changeset
   846
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   847
    limitRight := device width - dX.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   848
    limitBottom := device height - dY.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   849
    ((self left > limitRight) or:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   850
      self top > limitBottom]) ifTrue:[
516
9e18a818f069 use inforPrint instead of errorPrint
Claus Gittinger <cg@exept.de>
parents: 515
diff changeset
   851
        'STDSYSVIEW: moving view into visible area' infoPrintNL.
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   852
        self origin:limitRight @ limitBottom
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   853
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   854
516
9e18a818f069 use inforPrint instead of errorPrint
Claus Gittinger <cg@exept.de>
parents: 515
diff changeset
   855
    "Modified: 7.3.1996 / 19:29:12 / cg"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   856
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   857
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   858
reinitialize
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   859
    "reopen the receiver if if was visible before.
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   860
     This is called right after snapIn; Notice, that all instance variables
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   861
     (such as shown, realized etc.) are left-overs from the time the snapout
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   862
     was done. Remap the receiver, if it was mapped at snapout time"
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   863
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   864
    |myController|
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   865
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   866
    "if I have already been reinited - return"
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   867
    drawableId notNil ifTrue:[
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   868
	^ self
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   869
    ].
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   870
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   871
    "have to kludge with the controller 
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   872
     - otherwise its startup performs unwanted actions ..."
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   873
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   874
    myController := controller.
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   875
    controller := nil.
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   876
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   877
    "physically create the view & subviews"
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   878
    self recreate.
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   879
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   880
    "if I was mapped, do it again"
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   881
    realized ifTrue:[
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   882
	"if it was iconified, try to remap iconified"
89
ea2bf46eb669 *** empty log message ***
claus
parents: 82
diff changeset
   883
	device mapView:self id:drawableId iconified:(shown not) 
ea2bf46eb669 *** empty log message ***
claus
parents: 82
diff changeset
   884
		   atX:left y:top width:width height:height.
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   885
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   886
	"and restart the window-group process"
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   887
	windowGroup notNil ifTrue:[
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   888
	    windowGroup restart
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   889
	]
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   890
    ].
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   891
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   892
    "restore controller"
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   893
    controller := myController
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   894
!
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   895
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   896
removeFromCurrentProject
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   897
    "remove the receiver (a topview) from the current projects set-of-views.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   898
     (If there is a current project)"
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
   899
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   900
    |p|
12
9f0995fac1fa *** empty log message ***
claus
parents: 6
diff changeset
   901
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   902
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   903
     the following check allows systems
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   904
     without projects and changeSets
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   905
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   906
    (Project notNil and:[(p := Project current) notNil]) ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   907
	p removeView:self
89
ea2bf46eb669 *** empty log message ***
claus
parents: 82
diff changeset
   908
    ]
ea2bf46eb669 *** empty log message ***
claus
parents: 82
diff changeset
   909
!
ea2bf46eb669 *** empty log message ***
claus
parents: 82
diff changeset
   910
140
claus
parents: 135
diff changeset
   911
restarted
claus
parents: 135
diff changeset
   912
    "sent by my windowGroup, when restarted from an image.
claus
parents: 135
diff changeset
   913
     Nothing done here, but can be redefined to perform any actions
claus
parents: 135
diff changeset
   914
     required to reset the application after an image-restart.
claus
parents: 135
diff changeset
   915
     (for example: check if application files are still around, restart
claus
parents: 135
diff changeset
   916
     subprocesses etc.)."
claus
parents: 135
diff changeset
   917
claus
parents: 135
diff changeset
   918
    application notNil ifTrue:[
claus
parents: 135
diff changeset
   919
	application restarted
claus
parents: 135
diff changeset
   920
    ].
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   921
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
   922
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   923
!StandardSystemView methodsFor:'printing & storing'!
142
claus
parents: 141
diff changeset
   924
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   925
displayString
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   926
    "just for your convenience in inspectors ...
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   927
     ... add the views label to the displayString."
142
claus
parents: 141
diff changeset
   928
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   929
    |s|
142
claus
parents: 141
diff changeset
   930
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   931
    s := super displayString.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   932
    label notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   933
	s := s , '(' , label , ')'
157
claus
parents: 153
diff changeset
   934
    ].
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   935
    ^ s
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   936
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
   937
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   938
!StandardSystemView methodsFor:'private'!
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   939
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   940
convertedIcon
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   941
    "make certain, that the icon is a b&w bitmap;
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   942
     do so by converting if required.
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   943
     Will add a device supportsDeepIcons and only convert when needed;
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   944
     for now, we always have to convert (since there are only Xdisplays)."
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   945
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   946
    |deviceIcon|
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   947
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   948
    icon isNil ifTrue:[^ nil].
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   949
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   950
    device supportsDeepIcons ifFalse:[
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   951
	icon depth ~~ 1 ifTrue:[
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   952
	    "
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   953
	     dither to monochrome
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   954
	    "
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   955
	    deviceIcon := icon asMonochromeFormOn:device.
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   956
	] ifFalse:[
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   957
	    deviceIcon := icon
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   958
	]
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   959
    ].
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   960
    deviceIcon notNil ifTrue:[
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   961
	"
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   962
	 get device pixmap (i.e. allocate colors & resource)
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   963
	"
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
   964
	deviceIcon := deviceIcon on:device
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   965
    ].
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   966
    ^ deviceIcon
193
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   967
!
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   968
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   969
setWindowGroupFromApplication
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   970
    "get the applications topView and set my windowGroup to its wg."
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   971
193
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   972
    |win|
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   973
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   974
    windowGroup isNil ifTrue:[
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   975
        application notNil ifTrue:[
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   976
            (win := application window) notNil ifTrue:[
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   977
                windowGroup := win windowGroup.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   978
            ]
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   979
        ]
193
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   980
    ].
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   981
Claus Gittinger <cg@exept.de>
parents: 183
diff changeset
   982
    "Created: 22.9.1995 / 17:40:36 / claus"
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   983
    "Modified: 6.3.1996 / 16:17:32 / cg"
24
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   984
! !
e810b1be068b *** empty log message ***
claus
parents: 21
diff changeset
   985
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   986
!StandardSystemView methodsFor:'queries'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   987
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   988
focusSequence
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   989
    "return a sequence which defines the order in which the focus
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   990
     is passed for FocusNext and FocusPrevious keys.
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   991
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   992
     All views which like to support these keys should either redefine
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   993
     this method and return a collection of (sub-) views.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   994
     Or, if the model is some applicationModel, it may itself define
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   995
     the focusSequence.
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   996
     Or, somehow let me (via focusSequence:) know about the order.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   997
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   998
     Notice: I dont think this is good style: the focusSequence seems
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
   999
     to belong into the controller, ..."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1000
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1001
    "/
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1002
    "/ if I have an application, its supposed to
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1003
    "/ know about the focusSequence
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1004
    "/
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1005
    application notNil ifTrue:[
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1006
        ^ application focusSequence
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1007
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1008
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1009
    (model notNil
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1010
    and:[(model respondsTo:#focusSequence)
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1011
    and:[model ~~ self]]) ifTrue:[
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1012
        ^ model focusSequence
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1013
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1014
    ^ nil
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1015
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1016
    "Modified: 6.3.1996 / 16:14:20 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1017
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1018
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
  1019
isModal
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1020
    "return true, if the receiver has been opened modal"
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1021
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
  1022
    windowGroup isNil ifTrue:[^ false].
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
  1023
    ^ windowGroup isModal
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
  1024
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
  1025
    "Created: 10.12.1995 / 13:11:17 / cg"
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1026
    "Modified: 24.4.1996 / 09:46:31 / cg"
298
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
  1027
!
37bc0d73346f documentation update
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
  1028
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1029
processName
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1030
    "return a string to be shown for my process in the
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1031
     process monitor. This has no semantic meaning, but exists
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1032
     for your convenience only."
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1033
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1034
    application notNil ifTrue:[
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1035
        ^ application processName
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1036
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1037
    label notNil ifTrue:[^ label].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1038
    ^ super processName
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1039
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1040
    "Modified: 24.4.1996 / 09:47:01 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1041
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1042
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1043
!StandardSystemView methodsFor:'realization'!
48194c26a46c Initial revision
claus
parents:
diff changeset
  1044
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1045
create
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1046
    "create - make certain that icon is available"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1047
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1048
    icon := self convertedIcon.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1049
    super create.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1050
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1051
    iconView notNil ifTrue:[
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1052
        iconView create.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1053
        device setWindowIconWindow:iconView in:drawableId.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1054
        iconView setRealized:true.
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1055
    ].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1056
    iconLabel notNil ifTrue:[
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1057
        device setIconName:iconLabel in:drawableId
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1058
    ]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1059
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1060
    "Modified: 24.4.1996 / 10:29:53 / cg"
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1061
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1062
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1063
physicalCreate
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1064
    "common code for create & recreate"
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1065
183
claus
parents: 181
diff changeset
  1066
    |l|
claus
parents: 181
diff changeset
  1067
claus
parents: 181
diff changeset
  1068
    IncludeHostNameInLabel == true ifTrue:[
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1069
        l := OperatingSystem getHostName , ': ' , label.
183
claus
parents: 181
diff changeset
  1070
    ] ifFalse:[
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1071
        l := label
183
claus
parents: 181
diff changeset
  1072
    ].
claus
parents: 181
diff changeset
  1073
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1074
    drawableId := device 
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1075
                      createWindowFor:self 
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1076
                      origin:(left @ top)
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1077
                      extent:(width @ height)
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1078
                      minExtent:minExtent
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1079
                      maxExtent:maxExtent
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1080
                      borderWidth:borderWidth
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1081
                      subViewOf:nil 
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1082
                      onTop:(self isPopUpView)
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1083
                      inputOnly:(self inputOnly)
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1084
                      label:l
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1085
                      cursor:cursor
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1086
                      icon:icon
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1087
                      iconView:iconView.
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1088
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1089
    Lobby registerChange:self.
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1090
    extentChanged := false.
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1091
    originChanged := false.
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1092
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1093
    (borderColor notNil and:[borderColor ~~ Black]) ifTrue:[
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1094
        borderColor := borderColor on:device.
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1095
        self setBorderColor
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
  1096
    ].
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1097
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1098
"/  (viewGravity notNil "and:[viewGravity ~~ #NorthWest]") ifTrue:[
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1099
"/        device setWindowGravity:viewGravity in:drawableId
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1100
"/  ].
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1101
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1102
"/  (bitGravity notNil "and:[bitGravity ~~ #NorthWest]") ifTrue:[
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1103
"/      device setBitGravity:bitGravity in:drawableId
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
  1104
"/  ].
72
3e84121988c3 *** empty log message ***
claus
parents: 69
diff changeset
  1105
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1106
    borderShape notNil ifTrue:[
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1107
        device setWindowBorderShape:(borderShape id) in:drawableId
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1108
    ].
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1109
    viewShape notNil ifTrue:[
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1110
        device setWindowShape:(viewShape id) in:drawableId
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1111
    ].
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1112
    (backed notNil and:[backed ~~ false]) ifTrue:[
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1113
        device setBackingStore:backed in:drawableId
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1114
    ].
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1115
    saveUnder ifTrue:[
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1116
        device setSaveUnder:true in:drawableId
46
7b331e9012fd *** empty log message ***
claus
parents: 24
diff changeset
  1117
    ].
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1118
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1119
    "Modified: 3.5.1996 / 15:55:13 / stefan"
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1120
!
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1121
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1122
realize
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1123
    "realize the view i.e. make it visible."
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1124
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1125
    super realize.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1126
    windowGroup notNil ifTrue:[
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1127
        "/
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1128
        "/ have to wait till now with focus-setting, 
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1129
        "/ up to now, I may have had no windowGroup (its set in realize)
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1130
        "/
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1131
        "/
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1132
        "/ no longer donw here - wg asks for the sequence
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1133
"/        windowGroup focusSequence:self focusSequence.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1134
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1135
        "/
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1136
        "/ let the application add its views to the current project
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1137
        "/
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1138
        application notNil ifTrue:[
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1139
            application opened.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1140
        ] ifFalse:[
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1141
            self addToCurrentProject.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1142
        ].
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1143
    ]
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1144
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1145
    "Modified: 6.3.1996 / 16:18:14 / cg"
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1146
!
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1147
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1148
recreate
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1149
    "recreate the view after a snap-in"
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1150
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1151
    icon := self convertedIcon.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1152
    super recreate.
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1153
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1154
    iconView notNil ifTrue:[
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1155
        iconView create.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1156
        device setWindowIconWindow:iconView in:drawableId.
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1157
        iconView setRealized:true.
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1158
    ] ifFalse:[
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1159
        (icon notNil and:[icon id notNil]) ifTrue:[
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1160
            device setWindowIcon:icon in:drawableId
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1161
        ].
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1162
    ].
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1163
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1164
    iconLabel notNil ifTrue:[
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1165
        device setIconName:iconLabel in:drawableId
504
bc7734000bd3 windowGroup pulls focusSequence from topView (used to be pushed into it)
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
  1166
    ]
604
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1167
672ecb7ec347 fixed iconView handling (thought it was not realized); comments & docu
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1168
    "Modified: 24.4.1996 / 10:30:04 / cg"
141
claus
parents: 140
diff changeset
  1169
! !
claus
parents: 140
diff changeset
  1170
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1171
!StandardSystemView class methodsFor:'documentation'!
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1172
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 264
diff changeset
  1173
version
641
f265a4c4785f Must register drawableId in Lobby when physicalCreate'ing a window.
Stefan Vogel <sv@exept.de>
parents: 625
diff changeset
  1174
    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.50 1996-05-03 21:06:39 stefan Exp $'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
  1175
! !