fenêtre d'état d'avancement

Forum destiné aux questions sur le développement : Formules, LotusScript, Java ...

fenêtre d'état d'avancement

Messagepar OLIV' » 10 Avr 2003 à 15:58

bjr,lançant un agent (en lotus script) long à s'exécuter, je voudrais faire apparaître une fenetre montrant l'avancement de ma tache (en fonction du nbre de dos traités par ex)au pire, j'aimerais afficher un pop-up sans que celui-ci ne bloque l'éxécution de mon codemerci de votre aide
OLIV'
 

Re: fenêtre d'état d'avancement

Messagepar philippeG » 11 Avr 2003 à 08:44

BonjourL'instruction print en script te permet d'afficher un message en bas de l'écranPar exemplefor i = 1 to 10print Cstr(i) + "documents traités"next
philippeG
 

Re: fenêtre d'état d'avancement

Messagepar OLIV' » 11 Avr 2003 à 09:16

salut,en fait, je voudrais un truc dans le style mais que mon message s'affiche dans une fenêtre ou un pop uple problème c'est que les msgbox, prompt, dialogbox stoppent le déroulement du scriptmerci quand même de ta réponse
OLIV'
 

Re: fenêtre d'état d'avancement

Messagepar philippeG » 11 Avr 2003 à 10:06

Je n'ai pas trouver d'autre méthode que le printsi tu trouev je suis interessé par la solution
philippeG
 

Re: fenêtre d'état d'avancement

Messagepar yop » 11 Avr 2003 à 10:11

je vois pas non plus. excepté un plug-in au client.en V6, les agents sont désormais background. on peut donc faire autre chose pdt l'exécution d'un agent (on est plus bloqué à attendre) et on peut lancer plusieurs agents simultanément (le pied !)
yop
 

Re: fenêtre d'état d'avancement

Messagepar Sylvain » 11 Avr 2003 à 12:39

Tu peux utiliser des méthodes de la dll : nnotesws.dllRegarde la méthode NEMProgress. Je sais pas si ça va bien rendre dans le message :Calling Functions from NNOTESWS.DLLThe Dynamic Link Library (DLL) NNOTESWS.DLL is part of the Lotus Notes software and handles the interface side of the Notes client. Available within this DLL are a number of functions that can be called from LotusScript to provide functionality not normally available to a developer.Be aware that Lotus doesn't support these function calls and maintains the right to change the DLLs' structure and the calling convention in each new version of Notes and Domino.Following is a list of the functions we've successfully called and a brief description of each function. In the sidebar below, you'll see examples of the calling convention for each function.NEMGetFile — displays Windows Common File Open dialog boxNEMPutFile — displays Windows Common File Save dialog boxNEMMessageBox — displays Windows message box (similar to the Messagebox function)NEMGetCurrentSubprogramWindow — returns handle of the currently active windowNEMStopSubprogramWindow — closes window by passing window handleNEMEnableWaitCursor — displays cursor as an hourglassNEMDisableWaitCursor — stops displaying cursor as an hourglassNEMDisplayMessage — displays a message from NSTRINGS.DLL based on numberNEMDisplayError — displays an error message from NSTRINGS.DLL based on numberNEMDisplayError1 — displays an error message from NSTRINGS.DLL based on number and places additional text at the end of the messageNEMBeep — beeps the PC speakerDeskLocateOrAddEntry — adds a Notes database icon to the workspace and updates DESKTOP.DSK fileNEMPostStatus — places text in status bar of Notes clientNEMProgress — includes calls to display the Notes progress bars (windowed and status-line versions)Examples of How to Use Each FunctionNEMGetFileDeclare Function NEMGetFile Lib "nnotesws" ( wHandle As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As IntegerSub Click(Source As Button)'Declare variables...Dim szFileName As String*256Dim szTitle As StringDim szFilter As StringDim szSelectedFile as String'Set values...szFilename = Chr(0)szTitle = "Open File"szFilter = "All Files |*.*|Word Document |*.doc|Text Files|*.txt|"If NEMGetFile( 0, szFileName, szFilter, szTitle) <> 0 ThenszSelectedFile = szFileNameEnd IfEnd SubNEMPutFileDeclare Function NEMPutFile Lib "nnotesws" ( wHandle As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As IntegerSub Click(Source As Button)'Declare variables...Dim szFileName As String*256Dim szTitle As StringDim szFilter As StringDim szSaveFile as String'Set values...szFilename = Chr(0)szTitle = "Save File"szFilter = "All Files |*.*|Word Document |*.doc|Text Files|*.txt|"If NEMPutFile( 0, szFileName, szFilter, szTitle) <> 0 ThenszSaveFile = szFileNameEnd IfEnd SubNEMMessageBoxDeclare Function NEMMessageBox Lib "nnotesws" ( wHandle As Integer, Byval szMessage As String, Byval szTitle As String, Byval wType As Integer) As IntegerSub Click(Source As Button)'wType follows the same construct as the messagebox LotusScript function'0 = OK, 20 = YesNO, 17 = OK and Cancel and so on...Call NEMMessageBox(0, "Message to display", "Title of Message box", 19)End SubNEMGetCurrentSubprogramWindow and NEMStopSubprogramWindowDeclare Function NEMGetCurrentSubprogramWindow Lib "nnotesws.dll" () As LongDeclare Function NEMStopSubprogramWindow Lib "nnotesws.dll" (Byval wHandle As Long) As IntegerSub Click(Source As Button)'Declare variables...Dim wHandle As Long' Get window handle...wHandle = NEMGetCurrentSubprogramWindow' Close current window...Call NEMStopSubprogramWindow(wHandle)End SubNEMEnableWaitCursorDeclare Function NEMEnableWaitCursor Lib "nnotesws.dll" () As LongSub Click(Source As Button)Call NEMEnableWaitCursorEnd SubNEMDisableWaitCursorDeclare Function NEMDisableWaitCursor Lib "nnotesws.dll" () As LongSub Click(Source As Button)Call NEMDisableWaitCursorEnd SubNEMDisplayMessageDeclare Function NEMDisplayMessage Lib "nnotesws" (Byval wMessageNumber As Integer) As IntegerSub Click(Source As Button)Call NEMDisplayMessage(19) 'Loads a string resource from NSTRINGS.DLL and displays messagebox...End SubNEMDisplayErrorDeclare Function NEMDisplayError Lib "nnotesws" (Byval wType As Integer) As IntegerSub Click(Source As Button)Call NEMDisplayError(24) 'Loads a string resource from NSTRINGS.DLL and displays error box...End SubNEMDisplayError1Declare Function NEMDisplayError1 Lib "nnotesws" (Byval wType As Integer, Byval szMessage As String) As IntegerSub Click(Source As Button)'Loads a string resource from NSTRINGS.DLL, appends text and displays error box...Call NEMDisplayError1(24, "Primeapple Software")End SubNEMBeepDeclare Function NEMBeep Lib "nnotesws" () As IntegerSub Click(Source As Button)Call NEMBeepEnd SubDeskLocateOrAddEntryDeclare Function DeskLocateOrAddEntry Lib "nnotesws" (Byval szPath As String) As IntegerSub Click(Source As Button)'Declare variables...Dim iRetVal As Integer'Add icons to desktop - Note structure for server based and local databases...iRetVal = DeskLocateOrAddEntry("log.nsf")iRetVal = DeskLocateOrAddEntry("PrimeServer1!!products\riodb.nsf")'Display error message if appropriate - useful demo of NEMDisplayError function call...If iRetVal <>0 Then NEMDisplayError(iRetVal)End SubNEMPostStatusDeclare Function NEMPostStatus Lib "nnotesws.dll" (Byval szText As String) As LongSub Click(Source As Button)Call NEMPostStatus("Primeapple Software is cool")End SubNEMProgress...Const NPB_TWOLINE% = 1Const NPB_STATUSBAR% = 32Declare Function NEMProgressBegin Lib "nnotesws.dll" ( Byval wFlags As Integer ) As LongDeclare Sub NEMProgressDeltaPos Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwIncrement As Long )Declare Sub NEMProgressEnd Lib "nnotesws.dll" ( Byval hwnd As Long )Declare Sub NEMProgressSetBarPos Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwPos As Long)Declare Sub NEMProgressSetBarRange Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwMax As Long )Declare Sub NEMProgressSetText Lib "nnotesws.dll" ( Byval hwnd As Long, Byval pcszLine1 As String, Byval pcszLine2 As String )Sub Click(Source As Button)'Declare variables...Dim hwnd As LongDim i As LongDim j As Long'Create the progress bar...hwnd = NEMProgressBegin( NPB_TWOLINE )'Set the bar range - the default is 100...NEMProgressSetBarRange hwnd, 200'Display some text on the dialog. The second line is ignored if NPB_TWOLINE not specified...NemProgressSetText hwnd, "Calculating..", "Start"For i = 0 To 200'Simple delay loop to give us time to see whats going on...For j = 0 To 5000Next'Update the bar position - we could also use NEMProgressDeltaPos hwnd, 1 here...NEMProgressSetBarPos hwnd, i'Update the text at halfway...If i = 100 ThenNEMProgressSetText hwnd, "Calculating", "Half way"End IfNext'Destroy the dialog when we're done...NEMProgressEnd hwndEnd SubNEMProgress... (Declared as a Class)The class LNProgressbar should be pasted into the Declarations in a Lotus script library.Declare Public Function NEMProgressBegin Lib "nnotesws.dll" ( Byval wFlags As Integer ) As LongDeclare 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 = 3Const NPB_ONELINE = 2Public Class LNProgressbarhwnd As LongSub New(SecondLineVisible As Integer)'Set-up the progress bar on the screenIf SecondLineVisible Thenhwnd = NEMProgressBegin(NPB_TWOLINE)Elsehwnd = NEMProgressBegin(NPB_ONELINE)End IfEnd SubSub SetText(FirstLineText As String,SecondLineText As String)'Display the text in progress barNemProgressSetText hwnd, FirstLineTExt,SecondLineTextEnd SubSub SetProgressPos(Progresspos As Long)NEMProgressSetBarPos hwnd, ProgressPosEnd SubSub 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 230NEMProgressSetBarRange hwnd, ProgressMaxElementsEnd SubSub DeltaPos(DPos As Long)' This function adds the number in DPOS to the current ProgressPosNEMProgressDeltaPos hwnd, DPosEnd SubSub Delete'Terminate the progress bar on the screenNEMProgressEnd hwndEnd SubEnd Class'Sample to test the code. You can paste this code into the click event of a button'We need two lines on the progress barDim pb As New LNProgressBar(True)Dim i As LongCall pb.SetText("This is line one","This is line two")'We set the range to 200 elementsCall pb.SetProgressRange(200)For i=1 To 200'we process the elementsCall pb.SetProgressPos(i)Next'Terminate the progress barDelete pb[%sig%]
Avatar de l’utilisateur
Sylvain
Maître-posteur
Maître-posteur
 
Message(s) : 473
Inscrit(e) le : 16 Déc 2004 à 00:20
Localisation : Rennes


Retour vers Développement

cron