Dialog: Hide a control by C++ code
Michael Stahl
mstahl at redhat.com
Mon Jan 5 13:25:43 PST 2015
On 05.01.2015 21:56, jan wrote:
> Hi,
>
> it seems that in Basic I can hide a control in a dialog simply with
>
> oControl.Visible=false
>
> But I am totally at a loss on how to do this from a C++ extension?
>
> Reference< XControl > c_1 =
> xControlContainer->getControl(OU("txt_ActionParameter1"));
> c_1->Visible = false; // doesn't exist
> c_1>setVisible(false); // doesn't exist
>
> I can't find this "Visible" property in the API documentation of XControl,
> either!
BASIC does some magic with identifiers, it uses reflection to look for
methods like "getVisible" and "setVisible" on the component.
probably it is finding com::sun::star::awt;:XWindow::setVisible() in
this case. something like this may work:
Reference<XWindow> xWindow(c_1, uno::UNO_QUERY);
xWindow->setVisible(false);
More information about the LibreOffice
mailing list