OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Fastest way to disable all controls in dialog

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Marinus
OOo Advocate
OOo Advocate


Joined: 07 Nov 2004
Posts: 261

PostPosted: Sat Jun 18, 2005 7:16 pm    Post subject: Fastest way to disable all controls in dialog Reply with quote

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
View user's profile Send private message Visit poster's website
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Jun 20, 2005 7:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Marinus
OOo Advocate
OOo Advocate


Joined: 07 Nov 2004
Posts: 261

PostPosted: Mon Jun 20, 2005 7:58 am    Post subject: Reply with quote

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? Laughing

Marinus.
Back to top
View user's profile Send private message Visit poster's website
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Mon Jun 20, 2005 8:10 am    Post subject: Reply with quote

Marinus wrote:
Are you ever at those OOo conferences so I can buy you a beer/coffe? Laughing

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
View user's profile Send private message
Marinus
OOo Advocate
OOo Advocate


Joined: 07 Nov 2004
Posts: 261

PostPosted: Mon Jun 20, 2005 2:17 pm    Post subject: Reply with quote

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.. Smile
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
View user's profile Send private message Visit poster's website
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Tue Jun 21, 2005 7:33 am    Post subject: Reply with quote

Marinus wrote:
Do you know how to test if a dialog is Visible or being Executed?

Not off the top of my head.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group