List Info

Thread: check visible state of a control




check visible state of a control
user name
2006-11-27 16:14:15
Hi *,

I know how to set the visible sate of a control:

     oControlModel = oDocDlg.GetControl(sName)
     oControlModel.setVisible (sYesNo)

but cannot find a methode (with xRay / API IDL) to check if
a control is 
visible ...

Any hints welcome
& Thanks,
Cor


-- 

Cor Nouws
Arnhem - Netherlands
nl.OpenOffice.org - marketing contact

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

check visible state of a control
user name
2006-11-27 18:40:42
Cor Nouws wrote:
> I know how to set the visible state of a control:
Possibly not unimportant: the control is a textbox.

> 
>     oControlModel = oDocDlg.GetControl(sName)
>     oControlModel.setVisible (sYesNo)
> 
> but cannot find a methode (with xRay / API IDL) to
check if a control is 
> visible ...



-- 

Cor Nouws
Arnhem - Netherlands
nl.OpenOffice.org - marketing contact

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

check visible state of a control
user name
2006-11-27 19:25:12
Hi Cor;

the only thing to check the visibility of a control I could
figure out 
was the AccessibleStateType which holds values for certain
states.

One of them is the constant VISIBLE with the value 30.

After all this code works for me:

Dim bVisible As Boolean
a() = oControl.AccessibleContext.AccessibleStateSet.States
For i = 0 To UBound(a())
	If a(i) = 30 Then
		bVisible = True
		Exit For
	End If
Next i
MsgBox bVisible


Hope that helps
Christoph



Cor Nouws schrieb:
> 
> Cor Nouws wrote:
>> I know how to set the visible state of a control:
> Possibly not unimportant: the control is a textbox.
> 
>>
>>     oControlModel = oDocDlg.GetControl(sName)
>>     oControlModel.setVisible (sYesNo)
>>
>> but cannot find a methode (with xRay / API IDL) to
check if a control 
>> is visible ...
> 
> 
> 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

check visible state of a control
user name
2006-11-27 20:27:01
Hi Christoph,

Christoph Jopp wrote:

> the only thing to check the visibility of a control I
could figure out 
> was the AccessibleStateType which holds values for
certain states.
Thanks, that did it.
How did you find out? Just digging in a various places or
rather experience?

I use the trick when generating documents from a dialog:
For different document types, different txtFields are
vissible.
Contents of txtFields has to be put in userfields in the
document.
I use the same names for userfields and txtFields, so use a
loop to fill 
all userfields 
Works great, but if for one reason or another, a txtField is
hidden but 
not empty, the userfield may not be filled. So I needed a
check on 
visibility of the txtField. Thanks for that.

I'll find me some time later (...) to make some
code-snippits for the 
snippet-base.

Regards,
Cor


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

check visible state of a control
user name
2006-11-27 20:41:12
Hi Cor,


> How did you find out? Just digging in a various places
or rather 
> experience?
> 
No, it was just digging the IDL reference.

Ciao
Christoph

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

check visible state of a control
user name
2006-11-28 06:59:38
Hi Cor,

> I know how to set the visible sate of a control:
> 
>      oControlModel = oDocDlg.GetControl(sName)
>      oControlModel.setVisible (sYesNo)
> 
> but cannot find a methode (with xRay / API IDL) to
check if a control is 
> visible ...

That's not possible, AFAIK, except with the (potentially
expensive)
Accessibility workaround mentioned by Christoph. I would
like to
encourage you to submit an issue for this missing API 

Ciao
Frank


-- 
- Frank Schönheit, Software Engineer        
frank.schoenheitsun.com -
- Sun Microsystems                      http://www.sun.com/star
office -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

check visible state of a control
user name
2006-11-28 08:13:04
Hi Frank,

Frank Schönheit - Sun Microsystems Germany wrote:

> That's not possible, AFAIK, except with the
(potentially expensive)
> Accessibility workaround mentioned by Christoph.
I'm aware of the greedy nature of the present solution, but
in my tests 
it did work OK.

> I would like to
> encourage you to submit an issue for this missing API

I thought about that. But I'm a little afraid that one issue
is so 
isolated, only one fragment, since there probably will be
quite some 
missing methods for various controls...

Regards,
Cor

-- 

Cor Nouws
Arnhem - Netherlands
nl.OpenOffice.org - marketing contact

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

check visible state of a control
user name
2006-11-28 08:26:37
Hi Cor,

>>I would like to
>>encourage you to submit an issue for this missing
API 
> 
> I thought about that. But I'm a little afraid that one
issue is so 
> isolated, only one fragment, since there probably will
be quite some 
> missing methods for various controls...

Well, yes, might be. I just thought visibility in general is
badly
covered, for instance, models are missing a visibility
property, so it
could have justified a dedicated issue.

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer        
frank.schoenheitsun.com -
- Sun Microsystems                      http://www.sun.com/star
office -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

check visible state of a control
user name
2006-11-28 08:42:26
Bonjour Cor Nouws
Message du 2006-11-27 21:27:
> 
> I use the trick when generating documents from a
dialog:
> For different document types, different txtFields are
vissible.
> Contents of txtFields has to be put in userfields in
the document.
> I use the same names for userfields and txtFields, so
use a loop to fill 
> all userfields 
> Works great, but if for one reason or another, a
txtField is hidden but 
> not empty, the userfield may not be filled. So I needed
a check on 
> visibility of the txtField. Thanks for that.
> 

For problems like this, I would use the Tag property of the
model of the 
control to memorize information. This property is a string,
you can 
store various data in it.

myControl.Visible = False
myControl.Model.Tag = "NotUsed"
. . .
if myControl.Model.Tag = "NotUsed"  then ... else
...

    Bernard

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )