Home > Domino Tips > Developer > Domino > Leverage the progress bar within Notes
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DOMINO

Leverage the progress bar within Notes


Andrew Young
09.10.2003
Rating: -3.85- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


View member feedback to this tip.

First, I did not write all this code; I simply modified it to suit the immediate task. I have used it for a long time and do not recall the original source.

This class placed within a script library allows you to utilize a progress bar that displays percentage progress within a message box display, and disappears when the task is completed. You must reference the script library in the declarations section of whatever type of action you are using, then instantiate a new instance of the class as an object reference. You will need to progressively set the instance members of the class as your task completes.

For example, if you are using the progress bar to display the ongoing status of an archive of selected documents, you would set the range property to the count of the document collection. You would then increment the Progress or Pos property accordingly via a local count index passed continuously back to the progress bar class via your object reference. You would also set the Text property of the object, which would be the text displayed within the progress bar dialog.

Code

Declare Public Function NEMProgressBegin 
Lib "nnotesws.dll" (Byval wFlags As Integer) 
As Long
Declare Public Sub NEMProgressSetBarRange 
Lib "nnotesws.dll" (Byval hWnd As Long, 
Byval dwMax As Long)
Declare Public Sub NEMProgressDeltaPos
 Lib "nnotesws.dll" (Byval hWnd As Long, 
Byval dwIncrement As Long)
Declare Public Sub NEMProgressSetBarPos 
Lib "nnotesws.dll" (Byval hWnd As Long, 
Byval dwPos As Long)
Declare Public Sub NEMProgressSetText Lib
 "nnotesws.dll" (Byval hWnd As Long, Byval 
pcszLine1 As String, _
Byval pcszLine2 As String)
Declare Public Sub NEMProgressEnd Lib 
"nnotesws.dll" (Byval hWnd As Long)

Class CProgressBar
 
 Private hWnd As Long
 
 Property Set Range As Long
  NEMProgressSetBarRange hWnd, Range
 End Property
 
 Property Set Delta As Long
  NEMProgressDeltaPos hWnd, Delta
 End Property
 
 Property Set Pos As Long
  NEMProgressSetBarPos hWnd, Me.Pos
 End Property
 
 Property Set Text As String
  NemProgressSetText hWnd, Text, ""
 End Property
 
 Property Set Progress (Pos As Long) As 
String
  Me.Pos = Pos
  Text = Progress
 End Property
 
 Property Set ProgressBy (Delta As Long) 
As String
  Me.Delta = Delta
  Text = ProgressBy
 End Property
 
 Private Sub Init
  Range = 100
  Delta = 1
  Text = ""
  Pos = 0
 End Sub
 
 Sub New( Range As Long )
  Dim session As New NotesSession
  If session.GetEnvironmentValue
( "useProgressBar" ) = 1 Then
   hWnd = NEMProgressBegin( 2 ) 
' Const NPB_ONELINE = 2
   Init
   If Range <> 0 Then Me.Range = Range
  End If
 End Sub
 
 Sub Delay( Seconds As Integer )
  Dim Started
  Started = Now
  While (Now - Started) * 24 * 
60 * 60 < Seconds
        ' do nothing
  Wend
 End Sub
 
 Sub Delete
  NEMProgressEnd hWnd
 End Sub
 
End Class

MEMBER FEEDBACK TO THIS TIP

Could you please give me a good example how to call this routine in an LS agent? Thank you!

-- Vesa H.

Do you have comments on this tip? Let us know.


Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Domino
Mimic Lotus Notes Domino application functionality on the Web
A single form to view and edit any Lotus Notes document
DECS and DCR external data access considerations
How to create non-scrolling Lotus Domino view headers on the Web
Disabling the 'Submit' button on a form
An easier way to update a rich text field
Results from Default Notes Search have # of responses in brackets
Lotus Notes/Domino veteran offers comprehensive list of app dev tools
Notes to XML. . .and back again
Creating thumbnail images using LS2J in LotusScript

Web Development for Lotus Notes Domino
Trap JavaScript runtime errors in Domino Web apps
Write HTML and JavaScript in Notes view rows and columns on the Web
JavaScript detects Web browser type and version in Notes/Domino 8.0.2
Top 10 Lotus Notes/Domino coding and development tips of 2008
Top 10 issues when developing Lotus Notes Domino Internet applications
Top 10 Lotus Notes Domino programming and development tips of 2007
Programmatically copy and hide attachments in Lotus Notes rich-text fields
Programmatically edit a rich-text field table from within the Lotus Notes client
Troubleshooting Lotus Notes Domino tabbed table problems
How to validate Lotus Notes forms on a Domino server without losing entered data

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts