| View previous topic :: View next topic |
| Author |
Message |
Marinus OOo Advocate

Joined: 07 Nov 2004 Posts: 261
|
Posted: Sat Jun 18, 2005 7:16 pm Post subject: Fastest way to disable all controls in dialog |
|
|
Hi,
who knows what the most elegant/fastest way is to disable all controls in a dialog?
My goal is to disable all controls while I populate all comboboxes. A percentage-complete indicator label will be the only control that's enabled so a strategy of disable all, enable one is what I'm looking for.
Ofcourse, I could simply .Enabled = false all of them but that looks awful.
To avoid having users wonder why they are looking at a gray rectangle, I would love to have it just disabled until it's ready.
Thanks for your help,
Marinus. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Mon Jun 20, 2005 7:35 am Post subject: |
|
|
The dialog model has an Enabled property. You could probably set this to False to disable the entire dialog.
(See this for explanation of model vs. the control...)
Of course, this probably disables your progress bar control as well.
You could create a subroutine with a general-purpose loop that disables all controls, except perhaps for one certian named control.
| Code: | | DisableAllControlsExcept( "cntProgressBar" ) |
Maybe better is to simply create a new dialog, a general purpose dialog that has ONLY....
1. a Progress bar
2. some text labels
Then create a few general purpose, reusable subroutines that put up a Progress dialog. Anytime you need a progress dialog, you call the routine to create your new dialog. Adjust its progress. Then dispose of it.
While the progress dialog is displayed, the user is unable to interact with your dialog that is behind it. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
Marinus OOo Advocate

Joined: 07 Nov 2004 Posts: 261
|
Posted: Mon Jun 20, 2005 7:58 am Post subject: |
|
|
Hi Danny,
thanks for you insight.
I probably will go for a combination of the two.
At this moment, the
dialog
is finished and on a P4 2800 it takes about 20 ms to initialize so there really is not a big time issue there.
On slow machines, a tiny progress-bar only dialog would help.
I'll report back if the dialog.model.enable = false works, no time now.
Are you ever at those OOo conferences so I can buy you a beer/coffe?
Marinus. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
Posted: Mon Jun 20, 2005 8:10 am Post subject: |
|
|
| Marinus wrote: | Are you ever at those OOo conferences so I can buy you a beer/coffe? |
Nope.
And it would have to be Diet Coke.
Don't drink alcohol. (Well, a tiny bit, once in a while, like new years eve.)
Diet Coke instead of coffee, since I somehow never quite managed to grow up. _________________ Want to make OOo Drawings like the colored flower design to the left? |
|
| Back to top |
|
 |
Marinus OOo Advocate

Joined: 07 Nov 2004 Posts: 261
|
Posted: Mon Jun 20, 2005 2:17 pm Post subject: |
|
|
Hi Danny,
Dialog.model.enabled = false works; it simply makes the dialog inaccessable. You still see all objects in the .enabled state though, but as I can use this for another occasion this is a great find.
Do you know how to test if a dialog is Visible or being Executed?
Setting the .model.enabled to false if there is no dialog doesn't work..
I cannot find a testproperty in the Dialogdocumentation for that.
Not even here
Right now I'm using a 'dialogtracker' which works perfect but it would be nice to do a direct test.
I'll remember the diet coke, it's a small world..
Marinus. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
|