Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 1:28 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Progress Bar
PostPosted: August 10th, 2005, 2:29 pm 
Offline

Joined: January 10th, 2005, 11:08 am
Posts: 63
Location: Birmingham, United Kingdom
Opus: All between ver Pro XE 4.5 and Ver 9.62
OS: Windows XP Pro SP3
System: Intel Core2 Duo 2.67Ghz, Matrox Millennium G550 dual head graphics card
I thought I was about time I started to contribute to this forum, so here is my first offering.
A couple of our clients have asked for a progress bar at the bottom of the pages in each module of the production. We have, in the past, used a set of images placed on each page to accomplish this. This time, however, we decided to write a universal page script to carry this out.
Basically the page script will incrementally fill a text object called BAR on the page with a colour which advances from left to right. Both the first and last pages of the chapters are indicated with text.
I have commented the code to assist other developers.
Please feel free to improve on my offering if you would like to, but please post it back to benefit all.
Thanks to the Digital Workshop staff for their assistance with my coding.
Andy Thompson :)

// Get number of pages in the chapter
var pagecount = this.GetParent().GetNumberChildren()

//Set up the object called progress which is Linear and has an angle of 90 degrees
var progress=new Object()
progress.style="Linear"
progress.angle=90

//Create an array with an element for each page in the chapter
progress.colour=new Array(pagecount)

//Get current page number within the chapter
var pagenum = this

//Loop through all the pages in the chapter to find the current page number
// and set the position of the vertical bar
for (n=0;n<pagecount;n++)
{
var name = this.GetParent().GetChild(n)
progress.colour[n]=RGB(255,65,65) //build a red bar
if (name == pagenum)
{
var vert = n
var currentpage = n+1
}
}

//Loop through the positions up to the vertical bar and set all positions to the left green
for(p=0;p<vert;p++)
{
progress.colour[p] = RGB(0,255,0) //build a green bar
if(currentpage==pagecount) //if at the end of the module create an object filled with green
{
progress.colour=new Array(1)
progress.colour[0]=RGB(0,255,0)
}
}

//Set the colours of an object on the page called 'BAR'
BAR.SetBackground(progress)

/*Comment out these last statements if you are NOT using a text object*/

if(currentpage==pagecount)
{
BAR.ReplaceSelection("End of Module")
}

if(currentpage==1)
{
BAR.ReplaceSelection("Start of Module")
}


You do not have the required permissions to view the files attached to this post.


Top
 Profile Visit website  
 
 Post subject: Re: Progress Bar
PostPosted: August 10th, 2005, 3:42 pm 
Offline

Joined: November 5th, 2004, 6:54 am
Posts: 130
Location: Hengelo, The Netherlands
Opus: 8.5/9.0
OS: Windows 7 64-bits, Android 2.1, Android 4.1.2, iOS 7
System: Pentium 7i, 6GB RAM, 750GB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses
Hello Andy,

That's a nice application.
I looked at it for a few minutes.

I added a master page and deleted all the objects the other pages.
All pages are using the masterpage and it still works.

I attach my contribution.

Kind regards,


You do not have the required permissions to view the files attached to this post.

_________________
Oscar Nijst
ON Education & Consultancy
Hengelo, The Netherlands
OPUS Pro 9.5
Pentium 7i, 16GB RAM, 1 TB HD, DVD-RW (+/-), DV, 3TB EHD, 3D monitor without glasses


Last edited by osni on August 16th, 2005, 10:45 pm, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 11th, 2005, 9:46 am 
Offline

Joined: January 10th, 2005, 11:08 am
Posts: 63
Location: Birmingham, United Kingdom
Opus: All between ver Pro XE 4.5 and Ver 9.62
OS: Windows XP Pro SP3
System: Intel Core2 Duo 2.67Ghz, Matrox Millennium G550 dual head graphics card
Dear Oscar,

Nice improvement...brings the file size down a bit too.

Kind Regards
Andy Thompson. :D


Top
 Profile Visit website  
 
 Post subject: Nicely done!
PostPosted: August 11th, 2005, 12:10 pm 
Offline

Joined: November 3rd, 2004, 12:58 pm
Posts: 230
Location: Australia
Oscar
Nice job indeed!
I have been working in something like that but not as good as yours! I have been using pictures to produce the effect.
Congratulations!
German

_________________
German Silva
Senior Web & Multimedia Developer
E-solutions Inc
Pro version 8.10 user


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 50 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group