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