×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Pune, India
    Posts
    94

    Continuous Progress Bar

    Hi All,

    Thanks in advance.

    I am new to Symbian UI, and want to create Custom Continuous Progress bar like the one used for internet connections etc.
    I have gone through the progress bar example in sdk,Can anybody provide the custom sample application for the same?
    Also a sample example for the custom progress bar which "incereemets with every download percentage of data" will be appreciated.
    Regards,
    Amey

  2. #2
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Continuous Progress Bar

    Hi,

    Perhaps you could try this approach you will need
    1. RWsSprite
    2. You will set of bitmaps it depends how smooth you would need the animation
    then you could try this code

    Assumption you have your control derived from ccoecontrol
    Code:
    RWindow& window = Window()
    iSprite.Construct( window, Rect().iTl, ESpriteNoShadows );
    
    for() // Filling sprite members
    {
    TSpriteMember  spriteMember;
    spriteMember.iBitmap = iArray[i].iBitmap;
    spriteMember.iMask = iArray[i].iMask;
    spriteMember.iInterval = TTimeIntervalMicroseconds32( 50 );
    spriteMember.iOffset = TPoint(0,0);
    iSprite.AppendMember( spriteMember ); 
    }
    
    iSprite.Activate();
    I hope this is what you are looking at. Good luck
    Regards,
    Sriky

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,685

    Re: Continuous Progress Bar

    That may be a wait note what you want. Search for wait note in the Wiki (if you want a progress bar, searching for progress should reveal some articles).

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Continuous Progress Bar

    But could he set his own custom bitmaps in it. Of course wiki is the best place to start with.
    Regards,
    Sriky

  5. #5
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Pune, India
    Posts
    94

    Re: Continuous Progress Bar

    Thanks sriky27 & wizard_hu_ for reply.

    As you mentioned i have derived my control from CCoeControl.

    I have few questions related to the code given by you.

    1. Will i have to create array of TSpriteMember.
    2. What is the data type of iArray[i]?
    3. What is the for loop iterating over?
    4. And would i have to put any code in Draw() method of my control in this case to create Custom Progress Bar?
    5. Also is the code using direct instance of RWsSprite an instance of custom application?

    Could you please give the exact code for drawing custom progress bar or an application for it.

    Thanks again.
    Regards,
    Amey

  6. #6
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Continuous Progress Bar

    Quote Originally Posted by ameybarve View Post
    Thanks sriky27 & wizard_hu_ for reply.

    As you mentioned i have derived my control from CCoeControl.

    I have few questions related to the code given by you.

    1. Will i have to create array of TSpriteMember.
    2. What is the data type of iArray[i]?
    3. What is the for loop iterating over?
    4. And would i have to put any code in Draw() method of my control in this case to create Custom Progress Bar?
    5. Also is the code using direct instance of RWsSprite an instance of custom application?

    Could you please give the exact code for drawing custom progress bar or an application for it.

    Thanks again.
    Hi,

    I hope you were talking about waiting dialog which has a animation going on if so

    1. Yes
    2. iArray is of type RArray of class

    class TBitmapMask {
    public:

    CFbsBitmap* iBitmap;
    CFbsBitmap* iMask;
    }

    3. The loop is for filling the TSpriteMember
    4. In your Draw you have draw the background of your control rest is taken care by RWsSprite.
    5. Yes

    There should be a timer too or callback for destructing your control in my case it was a timer

    Code:
    void CControl::ConstructL()
    {
    	RWindow& window = Window();
    	User::LeaveIfError(iSprite.Construct(window,Rect().iTl,ESpriteNoShadows));
    	
    	TSize sizeOfSprite( Rect().Size() );
    	
    	for ( TInt index = 0; index < iArray.Count(); index++ )
    		{
    		// Adding the members of the animation
     	      TSpriteMember  spriteMember;
    	      spriteMember.iBitmap = iArray[ index ].iBitmap;
    		spriteMember.iMaskBitmap = iArray[ index ].iMask;
    		spriteMember.iInterval = TTimeIntervalMicroSeconds32(50); 
    		spriteMember.iOffset = TPoint(0,0);
    		iSprite.AppendMember(spriteMember);
    		}
    
    	iSprite.Activate();
    	iTimer->After(KSelfDestTime);
    }
    
    void CControl::Draw( ..)
    {
    // Draw your background
    }
    Regards,
    Sriky

  7. #7
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Pune, India
    Posts
    94

    Re: Continuous Progress Bar

    Hi sriky27,

    Thanks for reply and code.
    I am looking for a proper progress bar that is displayed during installation of certain software.
    There are 2 types of it
    1) Continuous moving progress bar.
    2) The percentage of installation with its correesponding display in the progress bar.

    Does your code show any of the two?

    Besides that thanks for introducing RWsSprite class, i wasn't aware of it.
    Regards,
    Amey

  8. #8
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Continuous Progress Bar

    Yes my code talks about type 1.
    Regards,
    Sriky

  9. #9
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Pune, India
    Posts
    94

    Re: Continuous Progress Bar

    Hi sriky27,

    I will try the code given by you.
    Thanks again.
    Regards,
    Amey

  10. #10
    Regular Contributor
    Join Date
    Nov 2007
    Location
    Pune, India
    Posts
    94

    Re: Continuous Progress Bar

    Hi All,

    I have been able to develop continuous as well as Percentage custom progress bar. I have divided width of rectangle by (say) 10 and added the resultant value to display continuous progress bar.

    But now i want to display the individual rectangles, those obtained by dividing 10.I want to display gap between 2 consecutive rectangles, but i m not able to calculate the offset value for placing rectangles.

    Can anybody tell me how to calculate the value for drawing next and subsequent rectangles?
    Any sample code would be helpful.
    Regards,
    Amey

Similar Threads

  1. Trying to Link Progress bar with an Active object
    By ahkhan in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-08-12, 17:20
  2. Drawing Progress Bar?
    By SymbieRahul in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-08-07, 08:57
  3. Handling Progress Bar on Socket Connection
    By amitaggarwal in forum Symbian
    Replies: 2
    Last Post: 2004-09-30, 19:36
  4. Progress Bar - How to calculate the time?
    By ashbhatia in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-05-28, 12:18
  5. Progress Bar - How to calculate the time?
    By ashbhatia in forum Symbian
    Replies: 0
    Last Post: 2002-12-06, 07:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×