Doing a custom progress dialog in OpenOffice.org Basic

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Will Pittenger
Posts: 45
Joined: Tue Dec 14, 2010 10:43 am
Location: Morton, IL

Doing a custom progress dialog in OpenOffice.org Basic

Post by Will Pittenger »

Unfortunately, since com.sun.star.awt.XDialog doesn't return until the dialog is closed (which makes the dialog a modal dialog) the calling function can't execute code. I would use event handlers in the dialog, but there don't appear to be any timer related stuff in there. Any ideas?
Will Pittenger
I currently use OpenOffice 4.0 32-bit on Windows 7 64-bit (as of August 7th, 2013)
User avatar
JohnSUN-Pensioner
Volunteer
Posts: 876
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: Doing a custom progress dialog in OpenOffice.org Basic

Post by JohnSUN-Pensioner »

Please see the file from this message.
The last procedures in the module (with ProgBar in name) control the progress bar in dialog.
I hope this code will help you
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Will Pittenger
Posts: 45
Joined: Tue Dec 14, 2010 10:43 am
Location: Morton, IL

Re: Doing a custom progress dialog in OpenOffice.org Basic

Post by Will Pittenger »

Well, it might help, but do you have a simpler example? It will be a while before I find what I'm looking for in that.
Will Pittenger
I currently use OpenOffice 4.0 32-bit on Windows 7 64-bit (as of August 7th, 2013)
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Doing a custom progress dialog in OpenOffice.org Basic

Post by hanya »

Try css.awt.AsyncCallback service.
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
User avatar
JohnSUN-Pensioner
Volunteer
Posts: 876
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: Doing a custom progress dialog in OpenOffice.org Basic

Post by JohnSUN-Pensioner »

Sorry for the delay in response. Simple examples I have of course somewhere in the archives there, but I could not find them. Because I write a new example. (I hope you will excuse me for a small number comments in the code.)

The hardest thing was to come up with a slow process... :lol:
Attachments
Sample of ProgressBars.ods
(21.11 KiB) Downloaded 815 times
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
User avatar
Charlie Young
Volunteer
Posts: 1559
Joined: Fri May 14, 2010 1:07 am

Re: Doing a custom progress dialog in OpenOffice.org Basic

Post by Charlie Young »

JohnSUN-Pensioner wrote:Sorry for the delay in response. Simple examples I have of course somewhere in the archives there, but I could not find them. Because I write a new example. (I hope you will excuse me for a small number comments in the code.)

The hardest thing was to come up with a slow process... :lol:
Nice example, but JohnSUN accidentally left the Forms Controls in Design Mode, so do View > Toolbars > Form Controls and toggle Design Mode off, or else the buttons will be selected instead of running the macros.
Apache OpenOffice 4.1.1
Windows XP
Will Pittenger
Posts: 45
Joined: Tue Dec 14, 2010 10:43 am
Location: Morton, IL

Re: Doing a custom progress dialog in OpenOffice.org Basic

Post by Will Pittenger »

I still can't find the relevant code.It doesn't help that the dialog is read-only. I can't access the properties. And I don't know what Charlie means by "Design Mode". Please note I'm working on a Writer document, not Calc.
Will Pittenger
I currently use OpenOffice 4.0 32-bit on Windows 7 64-bit (as of August 7th, 2013)
User avatar
JohnSUN-Pensioner
Volunteer
Posts: 876
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: Doing a custom progress dialog in OpenOffice.org Basic

Post by JohnSUN-Pensioner »

OK. From example code get line

Code: Select all

oProgrBar = oDoc.getCurrentController().getFrame().createStatusIndicator()
It create progress bar in status bar.
Use metod .start() of this object to set text and max value of indicator.
Use metod .setValue() of this object to set new length of indicator.
Use metod .end() of this object to close indicator.
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Will Pittenger
Posts: 45
Joined: Tue Dec 14, 2010 10:43 am
Location: Morton, IL

Re: Doing a custom progress dialog in OpenOffice.org Basic

Post by Will Pittenger »

JohnSUN-Pensioner wrote:OK. From example code get line

Code: Select all

oProgrBar = oDoc.getCurrentController().getFrame().createStatusIndicator()
It create progress bar in status bar.
Use metod .start() of this object to set text and max value of indicator.
Use metod .setValue() of this object to set new length of indicator.
Use metod .end() of this object to close indicator.
Well, I think a dialog would be better for my needs. The dialog I have laid out shows overall progress, progress of the current step, number of terms found, number of use cases found, and more.
Will Pittenger
I currently use OpenOffice 4.0 32-bit on Windows 7 64-bit (as of August 7th, 2013)
Post Reply