Hello David,

Tuesday, December 2, 2003, 4:52:14 PM, you wrote:

DB> What's the best way to make a progress bar for my application when it does

DB> something that takes a long time? I couldn't see a standard control in
DB> PilRC designer, so I assume its not a standard control. Is anyone willing
DB> to share some code?

DB> Dave Bartlett

DB> Please note: The contents of this email contains information
DB> that is Glidepath's Intellectual Property, Proprietary and/or
DB> Information confidential to the named recipient. This information
DB> is not to be used by or forwarded to any other person and/or
DB> organization unless as agreed by Glidepath in writing.  If you
DB> have received this email in error please destroy the original and
DB> notify us by return. Thank you

DB> 
#####################################################################################
DB> This e-mail message has been scanned for Viruses and Content and cleared
DB> by MailMarshal
DB> For more information please visit www.marshalsoftware.com
DB> 
#####################################################################################


I use this:

        rec.topLeft.x = 5;
        rec.topLeft.y = 25;
        rec.extent.y  = 8;
        rec.extent.x  = 120;
                
        WinDrawRectangleFrame(simpleFrame,&rec);

        rec.extent.x = (value) * 120) / maxValue;
        WinFillRectangle (&rec,0);

You can use WinDrawRectangle instead of WinFillRectangle, but using
the Fill function you can use a pattern.
I like this pattern

{0xE1,0xC3,0x87,0x0F,0x1E,0x3C,0x78,0xF0}

that draws diagonal lines and each time you update the Bar you can use
this function to animate the bar:

      static void BarAnimate ()
      {
        CustomPatternType       pattern;
        int                     i;
        UInt8                   pat;
        
        WinGetPattern(&pattern);
        
        for (i = 0; i < 8; i++)
        {
           pat = (pattern[i] & 0x07) << 5;
           pattern[i] = (pattern[i] >> 3) | pat;
        }
        WinSetPattern(&pattern);
      }

Sebastian



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to