• Anonymous
  • Login
  • Register
Data Moving Animal - Feature Request: Enhancement for Progressbar (Switch it off if in debug mode)


Dear David,

I extended the Script-Library PROGRESSBAR by a little Function which determines if you are running in Debug-Mode. If you do so - the Progressbar is switched off. Perhaps something for 1.3.
Code below:

'------------------ Progress Bar in the C Windows API ------------------
Declare Public Function NEMProgressBegin Lib "nnotesws.dll" ( Byval wFlags As Integer ) As Long
Declare Public Sub NEMProgressDeltaPos Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwIncrement As Long )
Declare Public Sub NEMProgressEnd Lib "nnotesws.dll" ( Byval hwnd As Long )
Declare Public Sub NEMProgressSetBarPos Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwPos As Long)
Declare Public Sub NEMProgressSetBarRange Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwMax As Long )
Declare Public Sub NEMProgressSetText Lib "nnotesws.dll" ( Byval hwnd As Long, Byval pcszLine1 As String, Byval pcszLine2 As String )

Const NPB_TWOLINE = 3
Const NPB_ONELINE = 2

Public Class LNProgressbar

hwnd As Long
DebugMode As Integer

Sub New(SecondLineVisible As Integer)
'Set-up the progress bar on the screen
DebugMode=IsDebugMode
If Not DebugMode Then
If SecondLineVisible Then
hwnd = NEMProgressBegin(NPB_TWOLINE)
Else
hwnd = NEMProgressBegin(NPB_ONELINE)
End If
End If
End Sub

Sub SetText(FirstLineText As String,SecondLineText As String)
If Not DebugMode Then
'Display the text in progress bar
NemProgressSetText hwnd, FirstLineTExt,SecondLineText
End If
End Sub

Sub SetProgressPos(Progresspos As Long)
If Not DebugMode Then
NEMProgressSetBarPos hwnd, ProgressPos
End If
End Sub

Sub SetProgressRange(ProgressMaxElements As Long)
'Set-up the max elements in the progress bar, if you have
'a list with 230 elements then set the MAX to 230 elements.
'For every element you proceed increase the SetProgressPos
'by one to reached 230

If Not DebugMode Then
NEMProgressSetBarRange hwnd, ProgressMaxElements
End If
End Sub

Sub DeltaPos(DPos As Long)
' This function adds the number in DPOS to the current ProgressPos
If Not DebugMode Then
NEMProgressDeltaPos hwnd, DPos
End If
End Sub

Sub Delete
'Terminate the progress bar on the screen
If Not DebugMode Then
NEMProgressEnd hwnd
End If
End Sub

Public Function IsDebugMode() As Integer
Dim start As Variant
start = Getthreadinfo(6) ' LSI_THREAD_TICKS
Stop
If Getthreadinfo(6) - start > 100 Then IsDebugMode = True
' If you debug the application you will not be able to press the CONTINUE-Buton
' within less then 100 milliseconds, otherwise the STOP-statement is not in function
' and you will always be quicker then 100 milliseconds
End Function
End Class



Taken Actions by Owners



Documents
In this field you can enter the actual request.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.

Please note that the first time you use the new UI your description is converted from rich text to MIME. You might want to copy and paste the raw plain text from the old UI in the new UI so that you don't loose information.
In this field owners can describe what they have done or want to do.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.

Please note that the first time you use the new UI your description is converted from rich text to MIME. You might want to copy and paste the raw plain text from the old UI in the new UI so that you don't loose information.