[comp.sys.mac.programmer] Progress indicator/thermometers

mxmora@unix.sri.com (Matthew Xavier Mora) (06/05/91)

In the new finder, apple has included a color progress indicator. How is
this done? Is is a CDEF? Where do I get the colors to use?

I know how to do progress bars, I just want to make mine look like the
one the finder uses. 

Any Clues?

Thanks

mxm

gourdol@imag.imag.fr (Gourdol Arnaud) (06/05/91)

In article <25104@unix.SRI.COM> mxmora@unix.sri.com (Matthew Xavier Mora) writes:
>In the new finder, apple has included a color progress indicator. How is
>this done? Is is a CDEF? Where do I get the colors to use?

Yet another of these things Apple should made standard and include
in the ROM. Alas.

Try also to have the same outline than the one used in the Finder.
The Finder does not use a dialog box but a window (which is clever).
So you can pick the layout with ResEdit. However, doing a screen 
shot will do the trick.
Anyway, the gray used is (r,g,b) = (17408)^3 and the blue is 
(r,g,b) = (52224,52224,65535).

Here is a short Pascal asm routine to convert from 3 longs to
a RGBColor :

 procedure MakeRGBColor (red, green, blue: Longint;
       var aRGBColor: RGBColor);
 inline
  $2057,		{ move.l 4(a7),a0 }
  $30AF, 14, 		{ move.w 14(a7),(a0) }
  $316F, 10, 2, 	{ move.w 10(a7),2(a0) }
  $316F, 6, 4,		{ move.w 6(a7),4(a0) }
  $4FEF, 16;		{ lea	 16(sp),sp }
 

I also have a nice Object Pascal class TProgress that does all 
the work, including drawing the window after a given threshold,
drawing it semi-modal, allowing application switching, working 
in b&w and color, etc...
I can't post it now because I am on a sssslllllloooooowwwww
1200bps terminal, but as soon as I get close to something 
speedier, I'll post it (if there is any interest).

Arno.

-- 
    /=============================//===================================/
   / Arno Gourdol.               // On the Netland:  Gourdol@imag.fr  /
  / "A keyboard ! How quaint !"   -- Scott, Star Trek                /
 /=============================//===================================/

peirce@outpost.UUCP (Michael Peirce) (06/05/91)

In article <25104@unix.SRI.COM>, mxmora@unix.sri.com (Matthew Xavier Mora) writes:
> In the new finder, apple has included a color progress indicator. How is
> this done? Is is a CDEF? Where do I get the colors to use?
> 
> I know how to do progress bars, I just want to make mine look like the
> one the finder uses. 

Last time I did a progress dialog the bar was simply a user item.
You can draw anyway you want in it.  Pick a nice color and use the color
when the bit depth of device allows it and use a pattern when its
on a monochrome screen.

I also like to use the users hilight color rather than a color of
my choice.  With the hilight color I know the user likes that color.

Have fun.

--  Michael Peirce         --   outpost!peirce@claris.com
--  Peirce Software        --   Suite 301, 719 Hibiscus Place
--  Macintosh Programming  --   San Jose, California 95117
--           & Consulting  --   (408) 244-6554, AppleLink: PEIRCE

mlh1@gte.com (Michael Hackney) (06/06/91)

The System 7 Finder has 2 PICTs that are the blue and grey "candy stripes" 
used for the progress window.  To see these, I <HIGHLY> recommend making 
a copy of Finder and ResEdit the copy.  In System 7, resources can be
compressed to save disk space.  ResEdit will automatically uncompress
the resources but will not recompress them (maybe a feature for v3.0??).  
I don't know the PICT ids off hand, but they are easy to find.

I think the colors (blue and grey) map to black and white on monochrome (68000)
QuickDraw - check it out!

There are also some sources on America Online for Think C and Pascal that do
"thermometers".   The "candy stripes" are nice though because you do not have
to calculate the %time of the task your monitoring.

gourdol@imag.imag.fr (Gourdol Arnaud) (06/06/91)

In article <0B01FFFB.heus4c@outpost.UUCP> peirce@outpost.UUCP (Michael Peirce) writes:
>I also like to use the users hilight color rather than a color of
>my choice.  With the hilight color I know the user likes that color.

Sorry Mike, but this is not because I like one color to 
hilite my text that I want to use it everywhere. 
Why don't you use the colors used by the Finder for the progress 
bar? They are light subtle colors and certainly can't annoy 
a user. Besides, because it looks like the Finder one, I 
can easily say it is a progress bar and more easily see 
what's happening if I'm far away from my screen. (Can you 
say CONSISTENT). BTW, please, use the Finder layout for your
progress bar. It really helps the user to know what's going on.
Of course, if Apple had the clever idea to do some nice
traps to do all this...

Arno.
-- 
    /=============================//===================================/
   / Arno Gourdol.               // On the Netland:  Gourdol@imag.fr  /
  / "A keyboard ! How quaint !"   -- Scott, Star Trek                /
 /=============================//===================================/

peterc@sugar.hackercorp.com (Peter Creath) (06/06/91)

Yes, another article from me with strange subject lines.  Anyway, how do
I change the width and font of a pop-up menu?  Not the little box that
sits there (I can draw that), but how do I tell the menu manager to use
a specific width and font when doing PopUpMenuSelect()?
 
Once again, please send replies in E-mail, as my news system is a little
bit strange.
 
peterc@sugar.neosoft.com           "Listen, there's a hell of a good
peterc@sugar.hackercorp.com         universe next door.  Let's go!"
(take your pick)                                      -e e cummings

-- 

greggor@Apple.COM (Greg L. Anderson) (06/06/91)

In article <0B01FFFB.heus4c@outpost.UUCP> peirce@outpost.UUCP (Michael Peirce) writes:
[...when drawing a progress bar]
>I also like to use the users hilight color rather than a color of
>my choice.  With the hilight color I know the user likes that color.

Speaking strictly as a user, there are two things I don't like about
this practice:

	1.	When I see my hilight color, I expect it to mean
		that something has been hilighted.

	2.	I like bright hilight colors, but I would prefer
		other colored objects to be a little softer.  The
		colors the finder uses for the progress bar are
		good examples.

These are my opinions only; I don't know if there are any HIGs that
apply.

-- 
-----------------	----------------------
Greg Anderson		User Programming Group	    ()    "Ponnuki
greggor@apple.com	Apple Computer, Inc.	  ()  ()   is ideal
-----------------	----------------------	    ()     shape."

sho@gibbs.physics.purdue.edu (Sho Kuwamoto) (06/06/91)

In article <22272@imag.imag.fr> gourdol@imag.imag.fr (Gourdol Arnaud) writes:
>Of course, if Apple had the clever idea to do some nice
>traps to do all this...

Hear, hear.  It seems to me that all Apple had to do was to include a 
new CDEF for us to use.  It would save the trouble of creating your
own UserItem and trying desperately to get the same shape and colors...

I *am* thankful for the new popup menu CDEF.  I'd written a CDEF to do
exactly this about three years ago, but it's nice to use an officially
sanctioned one.  This way, when Apple changes their interface (like the
new down-arrow in the popup box) we don't have to worry about it.

-Sho
-- 
sho@physics.purdue.edu

peirce@outpost.UUCP (Michael Peirce) (06/06/91)

In article <22272@imag.imag.fr>, gourdol@imag.imag.fr (Gourdol Arnaud) writes:
> 
> In article <0B01FFFB.heus4c@outpost.UUCP> peirce@outpost.UUCP (Michael Peirce) writes:
> >I also like to use the users hilight color rather than a color of
> >my choice.  With the hilight color I know the user likes that color.
> 
> Sorry Mike, but this is not because I like one color to 
> hilite my text that I want to use it everywhere. 
> Why don't you use the colors used by the Finder for the progress 
> bar? They are light subtle colors and certainly can't annoy 
> a user. Besides, because it looks like the Finder one, I 
> can easily say it is a progress bar and more easily see 
> what's happening if I'm far away from my screen. (Can you 
> say CONSISTENT). BTW, please, use the Finder layout for your
> progress bar. It really helps the user to know what's going on.
> Of course, if Apple had the clever idea to do some nice
> traps to do all this...

NOW it might be advisable to use the Finder's scheme, but before System
7.0, the Finder didn't use anything besides grey patterns.

I used the hilight color in Public Folder's progress dialog and didn't
get any complaints from people.  Maybe they all hated it, but nobody
spoke up.


--  Michael Peirce         --   outpost!peirce@claris.com
--  Peirce Software        --   Suite 301, 719 Hibiscus Place
--  Macintosh Programming  --   San Jose, California 95117
--           & Consulting  --   (408) 244-6554, AppleLink: PEIRCE

mxmora@unix.SRI.COM (Matt Mora) (06/07/91)

In article <11326@bunny.GTE.COM> mlh1@gte.com (Michael Hackney) writes:
>
>There are also some sources on America Online for Think C and Pascal that do
>"thermometers".   The "candy stripes" are nice though because you do not have
>to calculate the %time of the task your monitoring.

Then what's the point of displaying candy stripes? That's kind of silly
to bring up a window just to display an indicator that indicates nothing!
Why don't you just spin the beach ball?

Anyway, I wasn't asking about the "candy stripes". I was asking about the 
progress bar that is used when you copy a file. 

Are there any finder engineers on the net? Does anybody have a email address
for one? I think this is a Human Interface issue that Apple should solve.

Let me know how to get the colors and I will write a cdef to do it.

Maybe I should send a letter to Tog about this.

mxm

-- 
___________________________________________________________
Matthew Mora                |   my Mac  Matt_Mora@sri.com
SRI International           |  my unix  mxmora@unix.sri.com
___________________________________________________________

gourdol@imag.imag.fr (Gourdol Arnaud) (06/07/91)

In article <5232@dirac.physics.purdue.edu> sho@gibbs.physics.purdue.edu (Sho Kuwamoto) writes:
>Hear, hear.  It seems to me that all Apple had to do was to include a 
>new CDEF for us to use.  It would save the trouble of creating your
>own UserItem and trying desperately to get the same shape and colors...

Hmmm, no it's a little more than just a CDEF. Of course, a CDEF
would be nice (altough other nice CDEFs would be those 
little up/down arrow used in the color picker to change the 
amount of red/green/blue or to change the month/day/year in 
the general control panel (worst, I'm sure that those CDEFs 
do exist, but we just can't use it because they are not 
documented, arghhh)).

So I want more than a CDEF, I also want something that does 
make the semi-modal dialog, put the Stop or Cancel button
at the right place, displays and truncate the text if 
needed at the right place, works with arabic or 
japanes systems as well and displays only if a 
given amount of time elapses. And BTW, I would also 
like it to display the candy stripes if I can't tell 
how long my work will take. So that's definitely 
more than a CDEF. I'd rather see like some kind of 
GetFile, you see. Actually, a whole trap is not 
necessary. A selector in a PACK would be enough :-)

Arno.

-- 
    /=============================//===================================/
   / Arno Gourdol.               // On the Netland:  Gourdol@imag.fr  /
  / "A keyboard ! How quaint !"   -- Scott, Star Trek                /
 /=============================//===================================/

mxmora@unix.SRI.COM (Matt Mora) (06/07/91)

In article <0B01FFFB.hhghhm@outpost.UUCP> peirce@outpost.UUCP (Michael Peirce) writes:

>I used the hilight color in Public Folder's progress dialog and didn't
>get any complaints from people.  Maybe they all hated it, but nobody
>spoke up.


Michael,

I actually thought that was a nice touch. It made the program more
professional looking.





-- 
___________________________________________________________
Matthew Mora                |   my Mac  Matt_Mora@sri.com
SRI International           |  my unix  mxmora@unix.sri.com
___________________________________________________________

lim@iris.ucdavis.edu (Lloyd Lim) (06/08/91)

In article <22309@imag.imag.fr> gourdol@imag.imag.fr (Gourdol Arnaud) writes:
>Hmmm, no it's a little more than just a CDEF. Of course, a CDEF
>would be nice (altough other nice CDEFs would be those 
>little up/down arrow used in the color picker to change the 
>amount of red/green/blue or to change the month/day/year in 
>the general control panel (worst, I'm sure that those CDEFs 
>do exist, but we just can't use it because they are not 
>documented, arghhh)).

No, those up/down arrows are PICTs.  That's the way I do it too.  You just
enable the item and check whether the mouse is in the top or bottom half.

John Cavallino also released three controls not too long ago.  One of them,
Thumbwheel, implements this up/down arrow.  But with modal dialogs, this
CDEF doesn't have any advantages over PICTs because you can't retrieve the
part code easily.  (You could do it in the filterProc I guess but that sort
of defeats the purpose of a CDEF.  There could be some way I'm missing.)
The package of controls should be archived on rascal and sumex.

+++
Lloyd Lim     Internet: lim@iris.eecs.ucdavis.edu
              America Online: LimUnltd
              Compuserve: 72647,660
              US Mail: 215 Lysle Leach Hall, U.C. Davis, Davis, CA 95616

shores@fergvax.unl.edu (Shores) (06/11/91)

In comp.sys.mac.programmer you write:
 
>Yet another of these things Apple should made standard and include
>in the ROM. Alas.
 
Yep.  If Apple insists that we do things their way, they should either
build it into the System or provide code for it.  A thing that comes to
mind is the discussion about the "Save Changes" dialog in Inside Mac 6.
If they want the buttons exactly 13.00000000 pixels from the border and
so on, why not whip up a small sample code note with the dialog
resources for us?  I'd be much more willing to conform if canned code
were already available.  Same thing for their font sizing dialog on page
2-34.


   Tom... Tommy... Thomas... the Tom-ster, the Tom-boy, the Tomminator...
   ... Tom Shores, Department of Mathematics, University of Nebraska.
   ... shores@fergvax.unl.edu

keith@Apple.COM (Keith Rollin) (06/12/91)

In article <shores.676625735@fergvax> shores@fergvax.unl.edu (Shores) writes:
>In comp.sys.mac.programmer you write:
> 
>>Yet another of these things Apple should made standard and include
>>in the ROM. Alas.
> 
>Yep.  If Apple insists that we do things their way, they should either
>build it into the System or provide code for it.  A thing that comes to
>mind is the discussion about the "Save Changes" dialog in Inside Mac 6.
>If they want the buttons exactly 13.00000000 pixels from the border and
>so on, why not whip up a small sample code note with the dialog
>resources for us?  I'd be much more willing to conform if canned code
>were already available.  Same thing for their font sizing dialog on page
>2-34.

Such samples came on the 7.0 CD. I expect them to show up at APDA
sometime as part of the rest of DTS's sample code. I'm not sure,
but they may be on Apple's ftp site, as well.

-- 
------------------------------------------------------------------------------
Keith Rollin  ---  Apple Computer, Inc. 
INTERNET: keith@apple.com
    UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith
"But where the senses fail us, reason must step in."  - Galileo

murat@farcomp.UUCP (Murat Konar) (06/13/91)

In article <25175@unix.SRI.COM> mxmora@unix.sri.com (Matt Mora) writes:
>Anyway, I wasn't asking about the "candy stripes". I was asking about the 
>progress bar that is used when you copy a file. 
>
>Are there any finder engineers on the net? Does anybody have a email address
>for one? I think this is a Human Interface issue that Apple should solve.
>
>Let me know how to get the colors and I will write a cdef to do it.
>

Beat you to it.  Below is a System 7 style progress indicator 
CDEF.  Using it is pretty strightforward.  Set the min to 0 
and max to 100 (actually, you can use any values you want). 
Use SetCtlValue to change how much of the mercury in the 
thermometer.  Note that this CDEF assumes a horizontal 
orientation.  

Enjoy!

(This file must be converted with BinHex 4.0)
:#d*KFN0%48BZFfPd!&0*9#&6593K!!!!!!68!!!!!!rC8dP8)3!"!!!%e(*-BA8
"!!!!!!!!!!)!"d*KFN0%48B!0J"h-U*!JX''3),"N!"!JX'J2`!!!rrD9m"%!"e
!!(FbZ!"dHNB!GjcN!q3"#`!N!!%!!!"h-Y*bFh*M8P0&4!%!T(aC-U4m@6-!!!9
d!!!!!!!!"%i!!!!!5J%!!!!!!!!!!+&Q!!!%#!LJ!)f!"!i'""+3!-'`#9,+c#P
#*JdG%&$NP$&64U1E-4)&%*3c4mkB!d,#b"P#T)J4N3&*QT3bT3L4J3$3!!"%%-#
%0M&,MU&T%kG1RMf6+Je)LNm@'8S,d"'J5H!5HJ+A!YK!d''&+@MHb+%cTJiG94J
eF[3)FJj-!"Nh$M%E!LFRR!3Gr1MCJ&Y!"dN4Z!QS!!!T(PMSN!"+NkD#eXG*QhJ
6k#36J!%VGQ8&3!!''-!!@,S-8%pT%(hrh)9!PX!CQ-[#4(`"m398#LI4C0-'T3+
h%bX"33aQ-%3I!!P`&)$)&JAC2hj1[0#'mX3*Y"5TBZ6)%30%NcTb`PadiJ,%NMG
Z9,)!%B30'a"5dTa"3fF1I)NGlC3KmcXeNR-"))$#B!K8mF3,,!$J3#TKq2#"J9N
mB5###UB#"J`I3(+%$#cmJiiNE2a$6K9"""2-AK-QZ+!B''USKJ"%!,%A+QQJ`NB
2A`$!!"2I3!")G#jmiN3GrI(b!J-$!S!!#'`SL"%F!%#!3T3--252'3'K%J3lriJ
cK$XHLS#0Q%LiiH%22!L%TN#ST")%Q1Kmq3miBSSj)301k2+2&aK#BkBk23#4@Jp
QJLN1+Tl!%F),!+!L"K)K(KS+!i-0a-!E&%3)k6r-U$*$QIpSS`S0S)T+!DMSE)S
0+U93QY@P&QJDSM5HJNV0U,DU3J%B"X$K!D11JJU1UU`U#U`B+(`4(@eF9!G0IqJ
)Tk1Fk05*$DUS`!%U1pP+#`'ebbfhl"I8@IGE3%FQbF#4U-3"+@IY*MYZZFm#"d#
k"%D)#MBTI2%208U`mUm9`"!"3!F--C!!!4m#r510[&i%1@4ra2`h!!j*)J""Kq&
-!F!CHU8C`*&jqX2*D`#J%k%U-T!!m-A++CM`"DJ94dUbRNaJmF5Era!M*jeMBL-
%5Lii,)3Vrk)-#3K6J+#6"4Ma-#8)"JV,0")kL3$UUUSSmF%CC&4YjV"QVQS+""p
iI)B4%"3YMGSL61K!R[rSi-%(5Ka`aUPQ1S2+4Afr-#8',a40$5VFj(d'"P[Il!m
p`[hMM1!!-&if+YqmX)!U-IaJ`-hpF"1KjUUX)$-)#f$jMaX[+-#jiK38rQrNN`q
1Z1b(Cm-M"m!!+5549[c$cRq9Cfa#N`KS[ZQKhk5`K*)mBJ#!la2E5c`''HI!"a&
%F+Sppj*rhcddfM2$M--jc2U[p[qdEmh#!,52$IcYCd0rU2G[FcmhphGc[cIhq`D
6R!5&)+"$582JNMLX"3+'!8!!MS!!"*!!!)JU!H!(9bJB!$)JU("%EhS4qpe[r-'
-&k$N%)968*li)B-Ac%e2@S#"#h3%"JLiX'3@!!2KA[J2%06`$1kS!K$1))mbNI#
'ZZ#("9T`"!$%ESB[j)F!A2#"F6hK(6Ub6N$`BK#%+!3!$,P#'J#K!#83K!-!J%T
S@Q)%JLL!0%Zj`MEid)#8b!%%5A"$4FBJ(V%!K+%!!!:


-- 
____________________________________________________________________
Have a day. :^|             
Murat N. Konar	
murat@farcomp.UUCP             -or-          farcomp!murat@apple.com