ProgressIndicator.st
author Claus Gittinger <cg@exept.de>
Mon, 06 Mar 2006 09:55:21 +0100
changeset 2931 74fc63bea835
parent 2921 1e8c394e895e
child 3425 20459e327062
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
62
claus
parents: 50
diff changeset
     1
"
claus
parents: 50
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents: 50
diff changeset
     3
	      All Rights Reserved
claus
parents: 50
diff changeset
     4
claus
parents: 50
diff changeset
     5
 This software is furnished under a license and may be used
claus
parents: 50
diff changeset
     6
 only in accordance with the terms of that license and with the
claus
parents: 50
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
claus
parents: 50
diff changeset
     8
 be provided or otherwise made available to, or used by, any
claus
parents: 50
diff changeset
     9
 other person.  No title to or ownership of the software is
claus
parents: 50
diff changeset
    10
 hereby transferred.
claus
parents: 50
diff changeset
    11
"
50
claus
parents:
diff changeset
    12
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    13
"{ Package: 'stx:libwidg2' }"
1789
99a33f0b2164 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1740
diff changeset
    14
50
claus
parents:
diff changeset
    15
View subclass:#ProgressIndicator
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
    16
	instanceVariableNames:'percentage showPercentage fgColor bgColor connectedTop
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    17
		connectedLabel collector finishAction closeTopWhenDone showBusy
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    18
		busyPosition busyDelta busyIndicationProcess'
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    19
	classVariableNames:''
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    20
	poolDictionaries:''
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    21
	category:'Views-Misc'
50
claus
parents:
diff changeset
    22
!
claus
parents:
diff changeset
    23
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
    24
!ProgressIndicator class methodsFor:'documentation'!
50
claus
parents:
diff changeset
    25
62
claus
parents: 50
diff changeset
    26
copyright
claus
parents: 50
diff changeset
    27
"
claus
parents: 50
diff changeset
    28
 COPYRIGHT (c) 1995 by Claus Gittinger
claus
parents: 50
diff changeset
    29
	      All Rights Reserved
claus
parents: 50
diff changeset
    30
claus
parents: 50
diff changeset
    31
 This software is furnished under a license and may be used
claus
parents: 50
diff changeset
    32
 only in accordance with the terms of that license and with the
claus
parents: 50
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
claus
parents: 50
diff changeset
    34
 be provided or otherwise made available to, or used by, any
claus
parents: 50
diff changeset
    35
 other person.  No title to or ownership of the software is
claus
parents: 50
diff changeset
    36
 hereby transferred.
claus
parents: 50
diff changeset
    37
"
claus
parents: 50
diff changeset
    38
!
claus
parents: 50
diff changeset
    39
50
claus
parents:
diff changeset
    40
documentation
claus
parents:
diff changeset
    41
"
claus
parents:
diff changeset
    42
    a view showing a rectangle filled according the percentage value.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    43
    Can be used as a progress indicator a la MSwindows;
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    44
    it can also be configured as a non-percentage busy indication
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    45
    via the showBusyIndication flag (a la netscape).
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    46
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
    47
    Can be used as a widget within an application, or
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
    48
    via the convenient #inBox: instance creation messages,
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
    49
    which shows a progressDisplay in a modalBox, while some
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
    50
    action is performed.
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
    51
    See examples.
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    52
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    53
    [author:]
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    54
	Claus Gittinger
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    55
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    56
    [see also:]
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    57
	ActionWaitBox AnimatedLabel
50
claus
parents:
diff changeset
    58
"
claus
parents:
diff changeset
    59
!
claus
parents:
diff changeset
    60
claus
parents:
diff changeset
    61
examples
claus
parents:
diff changeset
    62
"
62
claus
parents: 50
diff changeset
    63
    basic (internal) interface
claus
parents: 50
diff changeset
    64
    (if progress indicator is to be used in a complex box ...):
50
claus
parents:
diff changeset
    65
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    66
    Before you get frustrated - see the convenient-interface examples
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    67
    at the end ;-)
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
    68
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    69
									[exBegin]
50
claus
parents:
diff changeset
    70
      |top p h|
claus
parents:
diff changeset
    71
62
claus
parents: 50
diff changeset
    72
      top := ModalBox new.
50
claus
parents:
diff changeset
    73
      top extent:300@100.
claus
parents:
diff changeset
    74
      top label:'Progress'.
claus
parents:
diff changeset
    75
      p := ProgressIndicator in:top.
claus
parents:
diff changeset
    76
      p origin:(0.0@0.5) corner:(1.0@0.5).
claus
parents:
diff changeset
    77
      p level:-1.
62
claus
parents: 50
diff changeset
    78
      h := p preferredExtent y.
50
claus
parents:
diff changeset
    79
      p topInset:(h // 2) negated; 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    80
	bottomInset:(h // 2) negated;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    81
	leftInset:5;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    82
	rightInset:5.
50
claus
parents:
diff changeset
    83
claus
parents:
diff changeset
    84
      [
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    85
	  1 to:100 do:[:val |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    86
	      (Delay forSeconds:0.05) wait.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    87
	      p percentage:val 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    88
	  ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    89
	  top hide.
62
claus
parents: 50
diff changeset
    90
      ] fork.
claus
parents: 50
diff changeset
    91
      top open.
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    92
									[exEnd]
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    93
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    94
    as a busy indicator
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
    95
									[exBegin]
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    96
      |top p h|
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    97
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    98
      top := ModalBox new.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
    99
      top extent:300@100.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   100
      top label:'Busy'.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   101
      p := ProgressIndicator in:top.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   102
      p origin:(0.0@0.5) corner:(1.0@0.5).
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   103
      p level:-1.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   104
      h := p preferredExtent y.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   105
      p topInset:(h // 2) negated; 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   106
	bottomInset:(h // 2) negated;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   107
	leftInset:5;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   108
	rightInset:5.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   109
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   110
      p showBusyIndication:true.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   111
      [
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   112
	  'do something here ....'.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   113
	  (Delay forSeconds:5) wait.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   114
	  top hide.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   115
      ] fork.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   116
      top open.
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   117
									[exEnd]
50
claus
parents:
diff changeset
   118
claus
parents:
diff changeset
   119
    changing colors, turning percentage display off:
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   120
									[exBegin]
50
claus
parents:
diff changeset
   121
      |top p h|
claus
parents:
diff changeset
   122
claus
parents:
diff changeset
   123
      top := StandardSystemView new.
claus
parents:
diff changeset
   124
      top extent:300@100.
claus
parents:
diff changeset
   125
      top label:'Progress'.
claus
parents:
diff changeset
   126
      p := ProgressIndicator in:top.
claus
parents:
diff changeset
   127
      p origin:(0.0@0.5) corner:(1.0@0.5).
claus
parents:
diff changeset
   128
      p level:-1.
claus
parents:
diff changeset
   129
      p showPercentage:false.
claus
parents:
diff changeset
   130
      p foregroundColor:(Color red).
claus
parents:
diff changeset
   131
      h := 10.
claus
parents:
diff changeset
   132
      p topInset:(h // 2) negated; 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   133
	bottomInset:(h // 2) negated;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   134
	leftInset:5;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   135
	rightInset:5.
50
claus
parents:
diff changeset
   136
      top open.
claus
parents:
diff changeset
   137
      [
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   138
	  1 to:100 do:[:val |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   139
	      (Delay forSeconds:0.05) wait.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   140
	      p percentage:val 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   141
	  ]
50
claus
parents:
diff changeset
   142
      ] fork
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   143
									[exEnd]
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   144
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   145
    as a busy indicator and percentage display (as in netscape)
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   146
									[exBegin]
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   147
      |top p h|
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   148
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   149
      top := ModalBox new.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   150
      top extent:300@60.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   151
      top label:'Busy'.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   152
      p := ProgressIndicator in:top.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   153
      p origin:(0.0@0.5) corner:(1.0@0.5).
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   154
      p level:-1.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   155
      p showPercentage:false.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   156
      p backgroundColor:(Color cyan).
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   157
      h := p preferredExtent y.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   158
      p topInset:(h // 3) negated; 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   159
	bottomInset:(h // 3) negated;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   160
	leftInset:5;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   161
	rightInset:5.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   162
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   163
      p showBusyIndication:true.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   164
      [
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   165
	  top label:'Busy'.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   166
	  1 to:100 do:[:i |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   167
	    (Delay forSeconds:0.05) wait.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   168
	  ].
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   169
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   170
	  top label:'Percentage'.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   171
	  p showBusyIndication:false.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   172
	  1 to:100 do:[:i |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   173
	    (Delay forSeconds:0.05) wait.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   174
	    p percentage:i. 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   175
	  ].
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   176
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   177
	  top hide.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   178
      ] fork.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   179
      top open.
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   180
									[exEnd]
50
claus
parents:
diff changeset
   181
claus
parents:
diff changeset
   182
    with border (2D look):
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   183
									[exBegin]
50
claus
parents:
diff changeset
   184
      |top p h|
claus
parents:
diff changeset
   185
claus
parents:
diff changeset
   186
      top := StandardSystemView new.
claus
parents:
diff changeset
   187
      top extent:300@100.
claus
parents:
diff changeset
   188
      top label:'Progress'.
claus
parents:
diff changeset
   189
      p := ProgressIndicator in:top.
claus
parents:
diff changeset
   190
      p origin:(0.0@0.5) corner:(1.0@0.5).
claus
parents:
diff changeset
   191
      p borderWidth:1.
62
claus
parents: 50
diff changeset
   192
      h := p preferredExtent y.
50
claus
parents:
diff changeset
   193
      p topInset:(h // 2) negated; 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   194
	bottomInset:(h // 2) negated;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   195
	leftInset:5;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   196
	rightInset:5.
50
claus
parents:
diff changeset
   197
      top open.
claus
parents:
diff changeset
   198
      [
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   199
	  1 to:100 do:[:val |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   200
	      (Delay forSeconds:0.05) wait.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   201
	      p percentage:val 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   202
	  ]
50
claus
parents:
diff changeset
   203
      ] fork
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   204
									[exEnd]
50
claus
parents:
diff changeset
   205
claus
parents:
diff changeset
   206
claus
parents:
diff changeset
   207
    getting progress from a model:
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   208
									[exBegin]
50
claus
parents:
diff changeset
   209
      |model top p h|
claus
parents:
diff changeset
   210
claus
parents:
diff changeset
   211
      model := 0 asValue.
claus
parents:
diff changeset
   212
claus
parents:
diff changeset
   213
      top := StandardSystemView new.
claus
parents:
diff changeset
   214
      top extent:300@100.
claus
parents:
diff changeset
   215
      top label:'Progress'.
claus
parents:
diff changeset
   216
      p := ProgressIndicator in:top.
claus
parents:
diff changeset
   217
      p model:model.
claus
parents:
diff changeset
   218
      p origin:(0.0@0.5) corner:(1.0@0.5).
claus
parents:
diff changeset
   219
      p level:-1.
62
claus
parents: 50
diff changeset
   220
      h := p preferredExtent y.
50
claus
parents:
diff changeset
   221
      p topInset:(h // 2) negated; 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   222
	bottomInset:(h // 2) negated;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   223
	leftInset:5;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   224
	rightInset:5.
50
claus
parents:
diff changeset
   225
      top open.
claus
parents:
diff changeset
   226
claus
parents:
diff changeset
   227
      [
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   228
	  1 to:100 do:[:val |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   229
	      (Delay forSeconds:0.05) wait.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   230
	      model value:val 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   231
	  ]
50
claus
parents:
diff changeset
   232
      ] fork
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   233
									[exEnd]
50
claus
parents:
diff changeset
   234
62
claus
parents: 50
diff changeset
   235
50
claus
parents:
diff changeset
   236
    concrete example:
claus
parents:
diff changeset
   237
      search all files in the source directory for a string
claus
parents:
diff changeset
   238
      using grep. Show progress while doing so.
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   239
									[exBegin]
50
claus
parents:
diff changeset
   240
      |top p h names done|
claus
parents:
diff changeset
   241
claus
parents:
diff changeset
   242
      top := StandardSystemView new.
claus
parents:
diff changeset
   243
      top extent:300@100.
claus
parents:
diff changeset
   244
      top label:'Searching ...'.
claus
parents:
diff changeset
   245
      p := ProgressIndicator in:top.
claus
parents:
diff changeset
   246
      p origin:(0.0@0.5) corner:(1.0@0.5).
claus
parents:
diff changeset
   247
      p level:-1.
62
claus
parents: 50
diff changeset
   248
      h := p preferredExtent y.
50
claus
parents:
diff changeset
   249
      p topInset:(h // 2) negated; 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   250
	bottomInset:(h // 2) negated;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   251
	leftInset:5;
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   252
	rightInset:5.
50
claus
parents:
diff changeset
   253
      top openWithPriority:(Processor activePriority + 1).
claus
parents:
diff changeset
   254
claus
parents:
diff changeset
   255
      names := 'source' asFilename directoryContents.
claus
parents:
diff changeset
   256
      done := 0.
claus
parents:
diff changeset
   257
      names do:[:aName |
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   258
	|fn stream line|
50
claus
parents:
diff changeset
   259
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   260
	p percentage:(done / names size * 100).
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   261
	fn := ('source/' , aName) asFilename.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   262
	fn isDirectory ifFalse:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   263
	    stream := fn readStream.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   264
	    [stream atEnd] whileFalse:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   265
		line := stream nextLine.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   266
		(line findString:'subclass:') ~~ 0 ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   267
		    Transcript showCR:line
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   268
		].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   269
	    ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   270
	    stream close.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   271
	].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   272
	done := done + 1
50
claus
parents:
diff changeset
   273
      ].
claus
parents:
diff changeset
   274
claus
parents:
diff changeset
   275
      top destroy
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   276
									[exEnd]
62
claus
parents: 50
diff changeset
   277
claus
parents: 50
diff changeset
   278
claus
parents: 50
diff changeset
   279
   using the convenient inBox-interface
claus
parents: 50
diff changeset
   280
claus
parents: 50
diff changeset
   281
   (this creates a box and an activity label and evaluates a block
claus
parents: 50
diff changeset
   282
    to indicate ...)
claus
parents: 50
diff changeset
   283
claus
parents: 50
diff changeset
   284
    basic interface demonstration:
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   285
									[exBegin]
62
claus
parents: 50
diff changeset
   286
      |p|
claus
parents: 50
diff changeset
   287
claus
parents: 50
diff changeset
   288
      p := ProgressIndicator 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   289
		inBoxWithLabel:'doing something  ...'
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   290
		abortable:true.
62
claus
parents: 50
diff changeset
   291
      p showProgressOf:
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   292
	    [:progressValue :currentAction |
62
claus
parents: 50
diff changeset
   293
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   294
	      1 to:100 do:[:val |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   295
		  (Delay forSeconds:0.05) wait.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   296
		  val == 25 ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   297
		      currentAction value:'still going ...'
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   298
		  ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   299
		  val == 50 ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   300
		      currentAction value:'halfway through ...'
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   301
		  ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   302
		  val == 75 ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   303
		      currentAction value:'almost finished ...'
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   304
		  ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   305
		  progressValue value:val 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   306
	      ]
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   307
	    ]
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   308
									[exEnd]
62
claus
parents: 50
diff changeset
   309
claus
parents: 50
diff changeset
   310
claus
parents: 50
diff changeset
   311
    above search example using this convenient interface:
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   312
									[exBegin]
62
claus
parents: 50
diff changeset
   313
      |p|
claus
parents: 50
diff changeset
   314
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   315
      p := ProgressIndicator 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   316
		inBoxWithLabel:'searching files ...'
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   317
		abortable:false.
62
claus
parents: 50
diff changeset
   318
      p showProgressOf:
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   319
	    [:progressValue :currentAction |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   320
		|names nDone|
62
claus
parents: 50
diff changeset
   321
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   322
		names := 'source' asFilename directoryContents.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   323
		nDone := 0.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   324
		names do:[:aName |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   325
		  |fn stream line|
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   326
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   327
		  progressValue value:(nDone / names size * 100).
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   328
		  currentAction value:'searching ' , 'source/' , aName , ' ...'.
62
claus
parents: 50
diff changeset
   329
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   330
		  fn := ('source/' , aName) asFilename.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   331
		  fn isDirectory ifFalse:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   332
		      stream := fn readStream.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   333
		      [stream atEnd] whileFalse:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   334
			  line := stream nextLine.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   335
			  (line findString:'subclass:') ~~ 0 ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   336
			      Transcript showCR:line
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   337
			  ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   338
		      ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   339
		      stream close.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   340
		  ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   341
		  nDone := nDone + 1
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   342
		].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   343
	    ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   344
									[exEnd]
62
claus
parents: 50
diff changeset
   345
claus
parents: 50
diff changeset
   346
claus
parents: 50
diff changeset
   347
    a nice example: copying files a la windows ...
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   348
    the following copies all files to /dev/null.
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   349
									[exBegin]
62
claus
parents: 50
diff changeset
   350
      |p|
claus
parents: 50
diff changeset
   351
claus
parents: 50
diff changeset
   352
      (ProgressIndicator 
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   353
		inBoxWithLabel:'copy files to /dev/null ...'
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   354
		abortable:true)
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   355
	 showProgressOf:
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   356
	    [:progressValue :currentAction |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   357
		|files nFiles nDone|
62
claus
parents: 50
diff changeset
   358
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   359
		files := '.' asFilename directoryContents.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   360
		nFiles := files size.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   361
		nDone := 0.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   362
		files do:[:aFileName |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   363
		    |percent|
50
claus
parents:
diff changeset
   364
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   365
		    nDone := nDone + 1.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   366
		    percent := nDone / nFiles * 100.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   367
		    progressValue value:percent. 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   368
		    aFileName asFilename isDirectory ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   369
			Transcript showCR:('skipping ' , aFileName , ' ...'). 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   370
			currentAction value:('skipping ' , aFileName , ' ...'). 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   371
		    ] ifFalse:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   372
			Transcript showCR:('copying ' , aFileName , ' ...').
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   373
			currentAction value:('copying ' , aFileName , ' ...').
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   374
			Object errorSignal handle:[:ex |
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   375
			    self warn:'an error occurred while copying ' , aFileName.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   376
			    ex return
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   377
			] do:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   378
			    aFileName asFilename copyTo:'/dev/null'.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   379
			]
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   380
		    ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   381
		].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   382
	    ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   383
									[exEnd]
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   384
"
50
claus
parents:
diff changeset
   385
! !
claus
parents:
diff changeset
   386
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   387
!ProgressIndicator class methodsFor:'instance creation'!
62
claus
parents: 50
diff changeset
   388
2850
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   389
displayBusyIndicator:aLabel at:aPoint during:aBlock
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   390
    "easy interface - show progress while evaluating aBlock.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   391
     The block is passed a valueHolder, which is to be set to values from
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   392
     startValue to endValue during the blocks evaluation.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   393
     This is scaled to 0..100% completion.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   394
     Set the valueHolder to nil, to get a busy-indicator"
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   395
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   396
    |p|
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   397
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   398
    p := self
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   399
            inBoxWithLabel:aLabel 
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   400
            icon:nil
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   401
            text:aLabel
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   402
            abortable:false
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   403
            view:nil
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   404
            closeWhenDone:true.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   405
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   406
    p showBusyIndication:true.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   407
    p showBusyIndicatorDuring:[
2931
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   408
        CannotReturnError catch:[
2850
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   409
            aBlock value.    
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   410
        ]
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   411
    ]
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   412
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   413
    "
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   414
     ProgressIndicator
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   415
        displayBusyIndicator:'doobidoobidoo...'
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   416
        at:(Screen default center)
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   417
        during:[
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   418
            200 to:400 by:5 do:[:i |
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   419
                Delay waitForSeconds:0.1.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   420
            ]
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   421
        ].
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   422
    "
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   423
!
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   424
1462
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   425
displayProgress:aLabel at:aPoint from:startValue to:endValue during:aBlock
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   426
    "easy interface - show progress while evaluating aBlock.
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   427
     The block is passed a valueHolder, which is to be set to values from
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   428
     startValue to endValue during the blocks evaluation.
2435
86d3ac1ebb76 busy indicator
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   429
     This is scaled to 0..100% completion.
86d3ac1ebb76 busy indicator
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   430
     Set the valueHolder to nil, to get a busy-indicator"
1462
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   431
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   432
    |p|
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   433
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   434
    p := self
2931
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   435
            inBoxWithLabel:aLabel 
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   436
            icon:nil
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   437
            text:aLabel
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   438
            abortable:false
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   439
            view:nil
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   440
            closeWhenDone:true.
1462
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   441
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   442
    p showProgressOf:[:progressValue :currentAction |
2931
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   443
        |scaler|
1463
741925565153 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1462
diff changeset
   444
2931
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   445
        scaler := [:scaledValue | 
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   446
                        |newPercentage oldPercentage oldLabel|
2435
86d3ac1ebb76 busy indicator
Claus Gittinger <cg@exept.de>
parents: 2404
diff changeset
   447
2931
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   448
                        scaledValue isNil ifTrue:[
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   449
                            p showBusyIndication:true
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   450
                        ] ifFalse:[
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   451
                            p showBusyIndication:false.
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   452
                            oldPercentage := progressValue value.
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   453
                            newPercentage := (scaledValue - startValue) / (endValue-startValue) * 100.
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   454
                            newPercentage ~= oldPercentage ifTrue:[
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   455
                                progressValue value:newPercentage.
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   456
                            ].
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   457
                            oldLabel := currentAction value.
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   458
                            oldLabel ~= aLabel ifTrue:[
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   459
                                currentAction value:aLabel.
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   460
                            ]
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   461
                        ]
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   462
                  ].
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   463
        CannotReturnError catch:[
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   464
            aBlock value:scaler.    
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   465
        ]
1462
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   466
    ]
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   467
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   468
    "
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   469
     ProgressIndicator
2931
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   470
        displayProgress:'doobidoobidoo...'
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   471
        at:(Screen default center)
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   472
        from:200
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   473
        to:400
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   474
        during:[:val |
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   475
            200 to:400 by:5 do:[:i |
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   476
                val value:i.
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   477
                Delay waitForSeconds:0.1.
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   478
            ]
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
   479
        ].
1462
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   480
    "
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   481
!
e3c0a367a7e8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1328
diff changeset
   482
62
claus
parents: 50
diff changeset
   483
inBox
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   484
    "create a topView containing an instance of myself,
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   485
     for later use with #showProgressOf:"
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   486
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   487
    ^ self inBoxWithLabel:'executing ...' abortable:false
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   488
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   489
    "Modified: 22.10.1997 / 21:08:37 / cg"
62
claus
parents: 50
diff changeset
   490
!
claus
parents: 50
diff changeset
   491
claus
parents: 50
diff changeset
   492
inBoxWithLabel:aLabel
claus
parents: 50
diff changeset
   493
    "create a topView containing an instance of myself,
claus
parents: 50
diff changeset
   494
     for later use with #showProgressOf:"
claus
parents: 50
diff changeset
   495
claus
parents: 50
diff changeset
   496
    ^ self inBoxWithLabel:aLabel abortable:false 
claus
parents: 50
diff changeset
   497
!
claus
parents: 50
diff changeset
   498
claus
parents: 50
diff changeset
   499
inBoxWithLabel:aLabel abortable:abortable
claus
parents: 50
diff changeset
   500
    "create a topView containing an instance of myself,
claus
parents: 50
diff changeset
   501
     for later use with #showProgressOf:"
claus
parents: 50
diff changeset
   502
219
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   503
    ^ self
634
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   504
	inBoxWithLabel:aLabel   
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   505
	text:''
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   506
	abortable:abortable
219
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   507
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   508
    "Modified: 17.7.1996 / 15:14:58 / cg"
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   509
!
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   510
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   511
inBoxWithLabel:aLabel icon:anIcon text:text abortable:abortable view:additionalView closeWhenDone:closeWhenDoneBoolean
219
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   512
    "create a topView containing an instance of myself,
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   513
     for later use with #showProgressOf:"
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   514
2436
6c0df331b7b1 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 2435
diff changeset
   515
    |top p l y y2|
62
claus
parents: 50
diff changeset
   516
claus
parents: 50
diff changeset
   517
    top := Dialog new.
claus
parents: 50
diff changeset
   518
    top label:aLabel.
claus
parents: 50
diff changeset
   519
    top cursor:(Cursor wait).
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   520
    y2 := 0.
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   521
    anIcon notNil ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   522
	y := top yPosition.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   523
	l := top addTextLabel:anIcon.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   524
	l borderWidth:0.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   525
	l adjust:#left.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   526
	l cursor:(Cursor wait).
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   527
	y2 := top yPosition.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   528
	top yPosition:y.
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   529
    ].
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   530
219
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   531
    l := top addTextLabel:text.
62
claus
parents: 50
diff changeset
   532
    l borderWidth:0.
74
claus
parents: 62
diff changeset
   533
    l adjust:#left.
62
claus
parents: 50
diff changeset
   534
    l cursor:(Cursor wait).
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   535
    anIcon notNil ifTrue: [l leftInset:(anIcon width + 10)].
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   536
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   537
    top yPosition:(top yPosition max:y2).
62
claus
parents: 50
diff changeset
   538
claus
parents: 50
diff changeset
   539
    top addVerticalSpace.
claus
parents: 50
diff changeset
   540
claus
parents: 50
diff changeset
   541
    p := ProgressIndicator new.
claus
parents: 50
diff changeset
   542
    p extent:(1.0 @ p preferredExtent y).
claus
parents: 50
diff changeset
   543
    p level:-1.
claus
parents: 50
diff changeset
   544
    p leftInset:5;
claus
parents: 50
diff changeset
   545
      rightInset:5.
claus
parents: 50
diff changeset
   546
    p cursor:(Cursor wait).
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   547
    p closeTopWhenDone:closeWhenDoneBoolean.
62
claus
parents: 50
diff changeset
   548
    p connectToTop:top label:l.
claus
parents: 50
diff changeset
   549
claus
parents: 50
diff changeset
   550
    top addComponent:p.
claus
parents: 50
diff changeset
   551
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   552
    additionalView notNil ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   553
	top addComponent:additionalView.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   554
	additionalView extent:(1.0 @ additionalView preferredExtent y).
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   555
    ].
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   556
62
claus
parents: 50
diff changeset
   557
    abortable ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   558
	top addVerticalSpace.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   559
	top addAbortButton
62
claus
parents: 50
diff changeset
   560
    ].
claus
parents: 50
diff changeset
   561
claus
parents: 50
diff changeset
   562
    ^ p
219
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   563
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   564
    "Created: 17.7.1996 / 15:14:33 / cg"
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
   565
    "Modified: 17.7.1996 / 15:16:58 / cg"
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   566
!
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   567
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   568
inBoxWithLabel:aLabel text:text abortable:abortable
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   569
    "create a topView containing an instance of myself,
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   570
     for later use with #showProgressOf:"
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   571
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   572
    ^ self
634
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   573
	inBoxWithLabel:aLabel 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   574
	text:text 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   575
	abortable:abortable 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   576
	view:nil
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   577
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   578
!
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   579
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   580
inBoxWithLabel:aLabel text:text abortable:abortable view:additionalView
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   581
    "create a topView containing an instance of myself,
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   582
     for later use with #showProgressOf:"
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   583
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   584
    ^ self
634
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   585
	inBoxWithLabel:aLabel 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   586
	text:text 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   587
	abortable:abortable 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   588
	view:additionalView 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   589
	closeWhenDone:true
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   590
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   591
!
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   592
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   593
inBoxWithLabel:aLabel text:text abortable:abortable view:additionalView closeWhenDone:closeWhenDoneBoolean
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   594
    "create a topView containing an instance of myself,
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   595
     for later use with #showProgressOf:"
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   596
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   597
    ^ self
634
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   598
	inBoxWithLabel:aLabel 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   599
	icon:nil
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   600
	text:text 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   601
	abortable:abortable 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   602
	view:additionalView 
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   603
	closeWhenDone:closeWhenDoneBoolean
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   604
1681
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   605
!
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   606
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   607
progressOpenOn:progressModel label:aLabel
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   608
    "create and open a progressIndicator dialog window,
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   609
     bit do not open it modal; instead, it is opened modeless
1834
ba170c21ed76 defaultExtent computation fixed
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
   610
     and control returns to the caller.
1681
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   611
     The models value is assumed to be 0..1 
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   612
     (which is for compatibility and different from ST/X's percentage use)
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   613
     Added for VW compatibility (RB)."
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   614
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   615
    |p ra|
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   616
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   617
    p := self
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   618
	    inBoxWithLabel:aLabel 
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   619
	    icon:nil
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   620
	    text:aLabel
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   621
	    abortable:false
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   622
	    view:nil
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   623
	    closeWhenDone:false.
1681
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   624
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   625
    ra := RangeAdaptor on:progressModel start:0 stop:0.01 grid:nil.
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   626
    p model:ra.
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   627
2132
fd5b29a20fe1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2082
diff changeset
   628
    p topView openModeless; waitUntilVisible.
1681
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   629
    ^ p.
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   630
9ef9e8ec0f43 progressOpenOn:label: for VW compatibility
Claus Gittinger <cg@exept.de>
parents: 1463
diff changeset
   631
    "Modified: / 4.2.2000 / 01:25:55 / cg"
62
claus
parents: 50
diff changeset
   632
! !
claus
parents: 50
diff changeset
   633
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   634
!ProgressIndicator methodsFor:'accessing'!
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   635
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   636
percentage:aNumber
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   637
    "set the percentage"
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
   638
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   639
    |newPercentage|
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   640
2040
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   641
    aNumber < 0 ifTrue:[
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   642
        newPercentage := -1.
2040
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   643
    ] ifFalse:[
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   644
        newPercentage := ((aNumber max:0) min:100) rounded.
2040
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   645
    ].
910
5c9592e782fd always repairNow (to make change visible immediately)
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   646
    newPercentage ~= percentage ifTrue:[
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   647
        percentage := newPercentage.
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   648
        self invalidateRepairNow:true.
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   649
    ]
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   650
910
5c9592e782fd always repairNow (to make change visible immediately)
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   651
    "Modified: / 6.6.1998 / 19:43:56 / cg"
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   652
!
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   653
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   654
showBusyIndication:aBooleanHolder
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   655
    "switch between percentage mode (if false) and busy indication (if true)"
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   656
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   657
    aBooleanHolder ~~ showBusy ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   658
	showBusy notNil ifTrue:[        
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   659
	    showBusy removeDependent:self.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   660
	].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   661
	showBusy := aBooleanHolder.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   662
	showBusy addDependent:self.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   663
	(showBusy value) ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   664
	    self startBusyIndicationProcess.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   665
	] ifFalse:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   666
	    self stopBusyIndicationProcess
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   667
	].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   668
	shown ifTrue:[self redraw]
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   669
    ].
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   670
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   671
    "Created: / 21.10.1998 / 17:35:16 / cg"
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   672
    "Modified: / 21.10.1998 / 18:03:06 / cg"
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   673
! !
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   674
2404
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   675
!ProgressIndicator methodsFor:'accessing-behavior'!
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   676
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   677
closeTopWhenDone:aBoolean
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   678
    "set/clear the close-topView-when-done flag"
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   679
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   680
    closeTopWhenDone := aBoolean
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   681
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   682
    "Created: 3.9.1996 / 14:22:03 / cg"
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   683
    "Modified: 29.3.1997 / 16:08:19 / cg"
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   684
!
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   685
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   686
finishAction:aBlock 
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   687
    "define an action to be performed when finished"
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   688
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   689
    finishAction := aBlock
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   690
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   691
    "Created: 3.9.1996 / 14:15:15 / cg"
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   692
    "Modified: 29.3.1997 / 16:08:35 / cg"
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   693
! !
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   694
2b7591c982ac category change
Claus Gittinger <cg@exept.de>
parents: 2403
diff changeset
   695
!ProgressIndicator methodsFor:'accessing-look'!
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   696
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   697
backgroundColor 
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   698
    "return the percentage displays background color"
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   699
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   700
    ^ bgColor
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   701
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   702
!
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   703
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   704
backgroundColor:aColor 
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   705
    "set the percentage displays background color"
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   706
993
6274668e8262 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
   707
    aColor ~= bgColor ifTrue:[
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   708
        bgColor := aColor.
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   709
        self invalidateRepairNow:true
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   710
    ].
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   711
993
6274668e8262 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
   712
    "Modified: / 20.7.1998 / 23:32:48 / cg"
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   713
!
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   714
335
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   715
foregroundColor 
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   716
    "return the percentage displays foreground color"
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   717
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   718
    ^ fgColor
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   719
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   720
    "Created: 29.3.1997 / 16:12:28 / cg"
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   721
!
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   722
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   723
foregroundColor:aColor 
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   724
    "set the percentage displays foreground color"
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   725
993
6274668e8262 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
   726
    aColor ~= fgColor ifTrue:[
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   727
        fgColor := aColor.
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   728
        self invalidateRepairNow:true
336
5199e2058981 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 335
diff changeset
   729
    ].
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   730
993
6274668e8262 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 910
diff changeset
   731
    "Modified: / 20.7.1998 / 23:27:47 / cg"
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   732
!
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   733
335
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   734
showPercentage
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   735
    "return the flag controlling if the percentage is to be shown numerically"
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   736
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   737
    ^ showPercentage
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   738
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   739
    "Created: 29.3.1997 / 16:12:39 / cg"
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   740
!
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   741
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   742
showPercentage:aBoolean
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   743
    "set/clear the flag controlling if the percentage is to be shown numerically"
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   744
336
5199e2058981 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 335
diff changeset
   745
    showPercentage := aBoolean.
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   746
    self invalidateRepairNow:true
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   747
910
5c9592e782fd always repairNow (to make change visible immediately)
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   748
    "Modified: / 6.6.1998 / 19:28:44 / cg"
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   749
! !
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   750
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   751
!ProgressIndicator methodsFor:'change & update'!
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   752
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   753
update:aspect with:aParameter from:changedObject
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   754
    "react upon value changes of my model"
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   755
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   756
    (aspect == aspectMsg
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   757
    and:[changedObject == model]) ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   758
	self percentage:(model perform:aspectMsg).
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   759
	^ self
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   760
    ].
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   761
    changedObject == showBusy ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   762
	self redraw.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   763
	^ self
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   764
    ].
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   765
    ^ super update:aspect with:aParameter from:changedObject
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   766
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   767
    "Modified: / 21.10.1998 / 18:01:52 / cg"
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   768
! !
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   769
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   770
!ProgressIndicator methodsFor:'drawing'!
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   771
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   772
redraw
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   773
    "redraw the percentage bar and optional percentage string"
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   774
2040
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   775
    |s lx rx sx sy sw m2 m w h doBusy|
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   776
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   777
    m := margin + 1.
863
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   778
    m2 := m*2.
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   779
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   780
    w := width - m2.
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   781
    h := height - m2.
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   782
910
5c9592e782fd always repairNow (to make change visible immediately)
Claus Gittinger <cg@exept.de>
parents: 865
diff changeset
   783
"/    self clear.
863
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   784
2040
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   785
    doBusy := showBusy value.
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   786
    doBusy ifFalse:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   787
	percentage value < 0 ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   788
	    self startBusyIndicationProcess.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   789
	    doBusy := true.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   790
	].        
2040
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   791
    ].
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   792
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   793
    doBusy ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   794
	self paint:bgColor.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   795
	self fillRectangleX:m y:m width:w height:h.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   796
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   797
	lx := (w * busyPosition / 100) rounded.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   798
	rx := (w * (busyPosition + 20) / 100) rounded.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   799
	rx := rx min:w.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   800
	lx := lx max:m.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   801
	self paint:fgColor.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   802
	self fillRectangleX:lx y:m width:(rx - lx) height:h.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   803
	^ self
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   804
    ].
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   805
2040
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   806
    self stopBusyIndicationProcess.
702df7addef9 busy indicator when percentage is negative
Claus Gittinger <cg@exept.de>
parents: 1935
diff changeset
   807
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   808
    rx := (w * percentage / 100) rounded.
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   809
    self paint:bgColor.
843
34de7f6bea2d do only draw what to draw
tz
parents: 826
diff changeset
   810
    self fillRectangleX:m+rx y:m width:w-rx height:h.
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   811
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   812
    showPercentage ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   813
	s := percentage printString , ' %'.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   814
	font := font onDevice:device.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   815
	sw := font widthOf:s .
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   816
	sx := (width - sw) // 2.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   817
	sy := height // 2 + font descent + 2.
347
3264e5caa799 fixed #fgColor;
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   818
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   819
	rx <= (sx+sw) ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   820
	    self paint:Color black.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   821
	    self displayString:s x:sx y:sy.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   822
	]
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   823
    ].
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   824
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   825
    self paint:fgColor.
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   826
    self fillRectangleX:m y:m width:rx height:h.
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   827
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   828
    showPercentage ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   829
	rx >= sx ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   830
	    self clippingRectangle:(m@m corner:rx+1 @ h).
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   831
	    self paint:Color white.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   832
	    self displayString:s x:sx y:sy.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   833
	    self clippingRectangle:nil
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   834
	]
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   835
    ]
347
3264e5caa799 fixed #fgColor;
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   836
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   837
    "Modified: / 21.10.1998 / 18:01:58 / cg"
863
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   838
!
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   839
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   840
sizeChanged:how
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   841
    super sizeChanged:how.
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   842
    self invalidate
863
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   843
a401ecea61a3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 843
diff changeset
   844
    "Created: / 18.4.1998 / 02:34:37 / cg"
865
5c15ad847ad2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 863
diff changeset
   845
    "Modified: / 18.4.1998 / 14:09:40 / cg"
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   846
! !
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   847
2501
832cbac295b8 method category rename
Claus Gittinger <cg@exept.de>
parents: 2436
diff changeset
   848
!ProgressIndicator methodsFor:'initialization & release'!
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   849
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   850
destroy
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   851
    busyIndicationProcess notNil ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   852
	self stopBusyIndicationProcess
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   853
    ].
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   854
    super destroy.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   855
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   856
    "Created: / 21.10.1998 / 17:29:58 / cg"
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   857
    "Modified: / 21.10.1998 / 17:30:36 / cg"
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   858
!
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   859
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   860
initStyle
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   861
    "initialize styleSheet values"
335
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   862
575
9279151db8f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
   863
    <resource: #style (#'progressIndicator.viewBackground'
2921
1e8c394e895e resource directive
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   864
                       #'progressIndicator.foregroundColor')>
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   865
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   866
    super initStyle.
335
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   867
347
3264e5caa799 fixed #fgColor;
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   868
    self is3D ifTrue:[
2921
1e8c394e895e resource directive
Claus Gittinger <cg@exept.de>
parents: 2878
diff changeset
   869
        self level:-1
347
3264e5caa799 fixed #fgColor;
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   870
    ].
3264e5caa799 fixed #fgColor;
Claus Gittinger <cg@exept.de>
parents: 336
diff changeset
   871
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   872
    bgColor := styleSheet colorAt:'progressIndicator.viewBackground' default:Color white.
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   873
    fgColor := styleSheet colorAt:'progressIndicator.foregroundColor' default:Color blue.
335
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   874
    fgColor := fgColor onDevice:device.
6f007bdeae94 resource-tag & access methods.
Claus Gittinger <cg@exept.de>
parents: 334
diff changeset
   875
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   876
    showPercentage := true.
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   877
!
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   878
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   879
initialize
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   880
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   881
    super initialize.
826
d8470e26754d revised for the docu (step 4)
tz
parents: 634
diff changeset
   882
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   883
    percentage := 0.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   884
    showBusy := false.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   885
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   886
    "Modified: / 21.10.1998 / 17:33:02 / cg"
1935
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   887
!
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   888
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   889
mapped
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   890
    super mapped.
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   891
    (showBusy value) ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   892
	self startBusyIndicationProcess.
1935
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   893
    ].
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   894
!
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   895
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   896
unmapped
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   897
    super unmapped.
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   898
    (showBusy value) ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   899
	self stopBusyIndicationProcess.
1935
a2338e64cf2f terminate/recreate busyIndicator-animation process if unmapped/mapped
frank
parents: 1852
diff changeset
   900
    ].
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   901
! !
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   902
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   903
!ProgressIndicator methodsFor:'private'!
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   904
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   905
connectToTop:top label:label
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   906
    connectedTop := top.
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   907
    connectedLabel := label
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   908
!
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   909
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   910
startBusyIndicationProcess
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   911
    busyIndicationProcess isNil ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   912
	busyPosition := 0.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   913
	busyDelta := 5.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   914
	busyIndicationProcess := [
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   915
				    [self realized] whileTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   916
					Delay waitForSeconds:0.2.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   917
					self shown ifTrue:[
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   918
					    self updateBusyIndicatorPosition.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   919
					]
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   920
				    ].
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   921
				    busyIndicationProcess := nil.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   922
				 ] fork.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   923
    ].
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   924
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   925
    "Created: / 21.10.1998 / 18:02:35 / cg"
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   926
    "Modified: / 21.10.1998 / 18:03:49 / cg"
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   927
!
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   928
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   929
stopBusyIndicationProcess
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   930
    busyIndicationProcess notNil ifTrue:[
2563
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   931
	busyIndicationProcess terminate.
b04147223487 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2509
diff changeset
   932
	busyIndicationProcess := nil
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   933
    ].
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   934
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   935
    "Created: / 21.10.1998 / 17:30:19 / cg"
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   936
!
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   937
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   938
updateBusyIndicatorPosition
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   939
    busyPosition := busyPosition + busyDelta.
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   940
    busyPosition >= 80 ifTrue:[
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   941
        busyDelta > 0 ifTrue:[
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   942
            busyDelta := busyDelta negated.
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   943
        ]
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   944
    ] ifFalse:[
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   945
        busyPosition <= 0 ifTrue:[
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   946
            busyDelta < 0 ifTrue:[
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   947
                busyDelta := busyDelta negated.
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   948
            ]
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   949
        ]
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   950
    ].
2659
3af857eb52fb invalidate checks itself for shown-flag
Claus Gittinger <cg@exept.de>
parents: 2563
diff changeset
   951
    self invalidate
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   952
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   953
    "Created: / 21.10.1998 / 17:33:28 / cg"
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
   954
    "Modified: / 21.10.1998 / 17:58:58 / cg"
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   955
! !
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   956
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   957
!ProgressIndicator methodsFor:'queries'!
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   958
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   959
preferredExtent
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   960
    "return my preferred extent"
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   961
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   962
    preferredExtent notNil ifTrue:[
634
cee0d1f706e1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 575
diff changeset
   963
	^ preferredExtent
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   964
    ].
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   965
    ^ 100 @ (font height + font descent + ((margin + 1) * 2))
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
   966
574
be7f980eb6dc commentary
Claus Gittinger <cg@exept.de>
parents: 347
diff changeset
   967
    "Modified: 22.10.1997 / 21:07:17 / cg"
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   968
! !
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
   969
62
claus
parents: 50
diff changeset
   970
!ProgressIndicator methodsFor:'showing progress'!
claus
parents: 50
diff changeset
   971
2850
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   972
showBusyIndicatorDuring:aBlock
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   973
    "show progress, while evaluating aBlock.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   974
     If the receiver has been created with inBox, show the
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   975
     box centered on the screen. If not, the view is assumed to
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   976
     be contained in another view, and no special startup actions
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   977
     are performed.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   978
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   979
     Caveat: cannot (currently) suppress close of the box ..."
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   980
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   981
    |labelValue p|
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   982
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   983
    connectedLabel notNil ifTrue:[
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   984
        labelValue := (connectedLabel label ? '') asValue.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   985
        connectedLabel 
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   986
            model:labelValue;
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   987
            aspect:#value;
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   988
            labelMessage:#value.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   989
    ] ifFalse:[
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   990
        labelValue := '' asValue.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   991
    ].
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   992
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   993
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   994
    "/ the worker process
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   995
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   996
    p := [
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   997
        [
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   998
            WindowGroup windowGroupQuerySignal handle:[:ex |
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
   999
                ex proceedWith:self topView windowGroup
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1000
            ] do:[
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1001
                aBlock value
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1002
            ]
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1003
        ] ensure:[
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1004
            p := nil.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1005
            closeTopWhenDone ifTrue:[
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1006
                connectedTop hide
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1007
            ].
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1008
            finishAction value
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1009
        ]
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1010
    ] newProcess.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1011
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1012
    Processor activeProcess 
2878
6a88c8ffeb14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1013
        withHigherPriorityDo:
6a88c8ffeb14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1014
            [
6a88c8ffeb14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1015
                p resume.
6a88c8ffeb14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1016
                self topView show.
6a88c8ffeb14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1017
            ].
2850
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1018
    p notNil ifTrue:[p terminate].
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1019
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1020
    "
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1021
      |p|
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1022
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1023
      p := ProgressIndicator inBox.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1024
      p showBusyIndication:true.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1025
      p showProgressOf:
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1026
            [:progressValue :currentAction |
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1027
                1 to:200 do:[:percent |
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1028
                    (Delay forSeconds:0.05) wait.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1029
                    progressValue value:percent 
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1030
                ].
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1031
            ].
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1032
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1033
      'it can be reused ...'.  
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1034
      p showBusyIndication:false.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1035
      p showProgressOf:
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1036
            [:progressValue :currentAction |
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1037
                1 to:100 by:5 do:[:percent |
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1038
                    (Delay forSeconds:0.05) wait.
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1039
                    progressValue value:percent 
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1040
                ].
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1041
            ].
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1042
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1043
    "
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1044
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1045
    "Modified: / 21.10.1998 / 17:37:00 / cg"
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1046
!
4e58a7e9c323 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2837
diff changeset
  1047
62
claus
parents: 50
diff changeset
  1048
showProgressOf:aBlock
claus
parents: 50
diff changeset
  1049
    "show progress, while evaluating aBlock.
claus
parents: 50
diff changeset
  1050
     If the receiver has been created with inBox, show the
claus
parents: 50
diff changeset
  1051
     box centered on the screen. If not, the view is assumed to
claus
parents: 50
diff changeset
  1052
     be contained in another view, and no special startup actions
claus
parents: 50
diff changeset
  1053
     are performed.
claus
parents: 50
diff changeset
  1054
claus
parents: 50
diff changeset
  1055
     The block is passed two arguments, the progressValue,
claus
parents: 50
diff changeset
  1056
     which should be set to the percentage from time-to-time
claus
parents: 50
diff changeset
  1057
     within the block and an action value, which should be set to
claus
parents: 50
diff changeset
  1058
     the currently performed action (a string) from time to time.
claus
parents: 50
diff changeset
  1059
     The second valueHolder can be left unchanged.
claus
parents: 50
diff changeset
  1060
claus
parents: 50
diff changeset
  1061
     Caveat: cannot (currently) suppress close of the box ..."
claus
parents: 50
diff changeset
  1062
221
976e5a608dfb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 220
diff changeset
  1063
    |progressValue labelValue p|
62
claus
parents: 50
diff changeset
  1064
claus
parents: 50
diff changeset
  1065
    progressValue := 0 asValue.
claus
parents: 50
diff changeset
  1066
claus
parents: 50
diff changeset
  1067
    connectedLabel notNil ifTrue:[
2837
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1068
        labelValue := (connectedLabel label ? '') asValue.
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1069
        connectedLabel 
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1070
            model:labelValue;
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1071
            aspect:#value;
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1072
            labelMessage:#value.
1834
ba170c21ed76 defaultExtent computation fixed
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
  1073
    ] ifFalse:[
2837
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1074
        labelValue := '' asValue.
62
claus
parents: 50
diff changeset
  1075
    ].
claus
parents: 50
diff changeset
  1076
1834
ba170c21ed76 defaultExtent computation fixed
Claus Gittinger <cg@exept.de>
parents: 1789
diff changeset
  1077
62
claus
parents: 50
diff changeset
  1078
    self model:progressValue.
claus
parents: 50
diff changeset
  1079
221
976e5a608dfb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 220
diff changeset
  1080
    "/ the worker process
976e5a608dfb *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 220
diff changeset
  1081
62
claus
parents: 50
diff changeset
  1082
    p := [
2837
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1083
        [
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1084
            WindowGroup windowGroupQuerySignal handle:[:ex |
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1085
                ex proceedWith:self topView windowGroup
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1086
            ] do:[
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1087
                aBlock value:progressValue value:labelValue
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1088
            ]
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1089
        ] ensure:[
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1090
            p := nil.
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1091
            closeTopWhenDone ifTrue:[
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1092
                connectedTop hide
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1093
            ].
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1094
            finishAction value
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1095
        ]
1850
e22e95d8f184 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1835
diff changeset
  1096
    ] newProcess.
62
claus
parents: 50
diff changeset
  1097
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1098
    Processor activeProcess 
2878
6a88c8ffeb14 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2850
diff changeset
  1099
        withHigherPriorityDo:[
2837
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1100
            p resume.
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1101
            self topView show.
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1102
        ].
237
ecea4b3a34ce more interfaces
Claus Gittinger <cg@exept.de>
parents: 221
diff changeset
  1103
    p notNil ifTrue:[p terminate].
62
claus
parents: 50
diff changeset
  1104
claus
parents: 50
diff changeset
  1105
    "
claus
parents: 50
diff changeset
  1106
      |p|
claus
parents: 50
diff changeset
  1107
claus
parents: 50
diff changeset
  1108
      p := ProgressIndicator inBox.
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
  1109
      p showBusyIndication:true.
62
claus
parents: 50
diff changeset
  1110
      p showProgressOf:
2837
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1111
            [:progressValue :currentAction |
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1112
                1 to:200 do:[:percent |
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1113
                    (Delay forSeconds:0.05) wait.
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1114
                    progressValue value:percent 
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1115
                ].
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1116
            ].
62
claus
parents: 50
diff changeset
  1117
claus
parents: 50
diff changeset
  1118
      'it can be reused ...'.  
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
  1119
      p showBusyIndication:false.
62
claus
parents: 50
diff changeset
  1120
      p showProgressOf:
2837
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1121
            [:progressValue :currentAction |
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1122
                1 to:100 by:5 do:[:percent |
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1123
                    (Delay forSeconds:0.05) wait.
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1124
                    progressValue value:percent 
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1125
                ].
d788335f2010 code cleanup
Claus Gittinger <cg@exept.de>
parents: 2659
diff changeset
  1126
            ].
62
claus
parents: 50
diff changeset
  1127
claus
parents: 50
diff changeset
  1128
    "
219
44246b9b4288 use new windowGroupQuery for background process
Claus Gittinger <cg@exept.de>
parents: 201
diff changeset
  1129
1168
35e46761842f added showBusyIndication mode
Claus Gittinger <cg@exept.de>
parents: 993
diff changeset
  1130
    "Modified: / 21.10.1998 / 17:37:00 / cg"
62
claus
parents: 50
diff changeset
  1131
! !
claus
parents: 50
diff changeset
  1132
334
8af14110efdb comments & category changes
Claus Gittinger <cg@exept.de>
parents: 237
diff changeset
  1133
!ProgressIndicator class methodsFor:'documentation'!
50
claus
parents:
diff changeset
  1134
183
c63a4f284a6d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 86
diff changeset
  1135
version
2931
74fc63bea835 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2921
diff changeset
  1136
    ^ '$Header: /cvs/stx/stx/libwidg2/ProgressIndicator.st,v 1.52 2006-03-06 08:55:21 cg Exp $'
50
claus
parents:
diff changeset
  1137
! !