public virtual XFixedText CreateFixedLabel(String text, int _nPosX, int _nPosY, int _nWidth, int _nHeight, int _nStep, XMouseListener _xMouseListener, String sName = "")
        {
            if (MXMcf == null) return null;
            XFixedText xFixedText = null;
            try
            {
                // create a unique id by means of an own implementation...
                if (String.IsNullOrWhiteSpace(sName)) sName = createUniqueName(MXDlgModelNameContainer, "TEXT_FIXED");
                else sName = createUniqueName(MXDlgModelNameContainer, sName);

               
                // create a controlmodel at the multiservicefactory of the dialog model...
                Object oFTModel = MXMcf.createInstanceWithContext(OO.Services.AWT_CONTROL_TEXT_FIXED_MODEL, MXContext);
                Object xFTControl = MXMcf.createInstanceWithContext(OO.Services.AWT_CONTROL_TEXT_FIXED, MXContext);
                
                XMultiPropertySet xFTModelMPSet = (XMultiPropertySet)oFTModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!

                xFTModelMPSet.setPropertyValues(
                        new String[] { "Height", "Name", "PositionX", "PositionY", "Step", "Width", "Label" },
                        Any.Get(new Object[] { _nHeight, sName, _nPosX, _nPosY, _nStep, _nWidth, text }));

                if (oFTModel != null && xFTControl != null && xFTControl is XControl)
                {
                    ((XControl)xFTControl).setModel(oFTModel as XControlModel);
                }

                xFixedText = xFTControl as XFixedText;
                if (_xMouseListener != null && xFTControl is XWindow)
                {
                    XWindow xWindow = (XWindow)xFTControl;
                    xWindow.addMouseListener(_xMouseListener);
                }
            }
            catch (unoidl.com.sun.star.uno.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("uno.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("System.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            return xFixedText;
        }
 /// <summary>
 /// Inserts a fixed text label.
 /// Properties: Height, Name, PositionX, PositionY, Step, TabIndex, Tag, Width, Align, BackgroundColor, Border, BorderColor, Enabled, FontDescriptor, FontEmphasisMark, FontRelief, HelpText, HelpURL, Label, MultiLine, Printable, TextColor, TextLineColor, VerticalAlign
 /// </summary>
 /// <param name="name">The base name of the element - will be set to a unique one by this function.</param>
 /// <param name="text">The text that should be insert.</param>
 /// <param name="_nPosX">The x position of the element.</param>
 /// <param name="_nPosY">The y posistion of the elemnt.</param>
 /// <param name="_nWidth">The width of the element.</param>
 /// <param name="_xMouseListener">A mouse listener.</param>
 /// <returns>XFixedText object</returns>
 public virtual XFixedText InsertFixedLabel(String text, int _nPosX, int _nPosY, int _nWidth, XMouseListener _xMouseListener, String sName = "") { return InsertFixedLabel(text, _nPosX, _nPosY, _nWidth, 8, 0, _xMouseListener, sName); }
        /// <summary>
        /// Inserts a fixed text label.
        /// Properties: Height, Name, PositionX, PositionY, Step, TabIndex, Tag, Width, Align, BackgroundColor, Border, BorderColor, Enabled, FontDescriptor, FontEmphasisMark, FontRelief, HelpText, HelpURL, Label, MultiLine, Printable, TextColor, TextLineColor, VerticalAlign
        /// </summary>
        /// <param name="name">The base name of the element - will be set to a unique one by this function.</param>
        /// <param name="text">The text that should be insert.</param>
        /// <param name="_nPosX">The x position of the element.</param>
        /// <param name="_nPosY">The y posistion of the elemnt.</param>
        /// <param name="_nWidth">The width of the element.</param>
        /// <param name="_nHeight">The Height of the element.</param>
        /// <param name="_nStep">The step index.</param>
        /// <param name="_xMouseListener">A mouse listener.</param>
        /// <returns>XFixedText object</returns>
        public virtual XFixedText InsertFixedLabel(String text, int _nPosX, int _nPosY, int _nWidth, int _nHeight, int _nStep, XMouseListener _xMouseListener, String sName ="" )
        {
            XFixedText xFixedText = null;
            try
            {
                // create a unique name by means of an own implementation...
                if (String.IsNullOrWhiteSpace(sName)) sName = createUniqueName(MXDlgModelNameContainer, "TEXT_FIXED");
                else sName = createUniqueName(MXDlgModelNameContainer, sName);

                // create a controlmodel at the multiservicefactory of the dialog model...
                Object oFTModel = MXMcf.createInstanceWithContext(OO.Services.AWT_CONTROL_TEXT_FIXED_MODEL, MXContext);
                XMultiPropertySet xFTModelMPSet = (XMultiPropertySet)oFTModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!

                String[] valueNames = new String[] { "Height", "Name", "PositionX", "PositionY", "Step", "Width", "Label" };
                var valueVals = Any.Get(new Object[] { _nHeight, sName, _nPosX, _nPosY, _nStep, _nWidth, text });

                xFTModelMPSet.setPropertyValues(
                        valueNames,valueVals
                       );
                // add the model to the NameContainer of the dialog model
                MXDlgModelNameContainer.insertByName(sName, Any.Get(oFTModel));

                var element = MXDlgModelNameContainer.getByName(sName).Value;
                if (element != null)
                {

                    OoUtils.SetProperty(element, "PositionX", _nPosX);
                    OoUtils.SetProperty(element, "PositionY", _nPosY);
                    OoUtils.SetProperty(element, "Width", _nWidth);
                    //if (element is XControl)
                    //{
                    //    ((XControl)element).getModel();
                    //}
                    //if (element is XMultiPropertySet)
                    //{
                    //    ((XMultiPropertySet)element).setPropertyValues(valueNames, valueVals);
                    //}
                }


                // reference the control by the Name
                XControl xFTControl = GetControlByName(sName);
                xFixedText = (XFixedText)xFTControl;
                if (_xMouseListener != null)
                {
                    XWindow xWindow = (XWindow)xFTControl;
                    xWindow.addMouseListener(_xMouseListener);
                }
            }
            catch (unoidl.com.sun.star.uno.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("uno.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("System.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            return xFixedText;
        }
        public virtual XFixedText CreateFixedLabel(String text, int _nPosX, int _nPosY, int _nWidth, int _nHeight, int _nStep, XMouseListener _xMouseListener, String sName = "")
        {
            if (MXMcf == null)
            {
                return(null);
            }
            XFixedText xFixedText = null;

            try
            {
                // create a unique id by means of an own implementation...
                if (String.IsNullOrWhiteSpace(sName))
                {
                    sName = createUniqueName(MXDlgModelNameContainer, "TEXT_FIXED");
                }
                else
                {
                    sName = createUniqueName(MXDlgModelNameContainer, sName);
                }


                // create a controlmodel at the multiservicefactory of the dialog model...
                Object oFTModel   = MXMcf.createInstanceWithContext(OO.Services.AWT_CONTROL_TEXT_FIXED_MODEL, MXContext);
                Object xFTControl = MXMcf.createInstanceWithContext(OO.Services.AWT_CONTROL_TEXT_FIXED, MXContext);

                XMultiPropertySet xFTModelMPSet = (XMultiPropertySet)oFTModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!

                xFTModelMPSet.setPropertyValues(
                    new String[] { "Height", "Name", "PositionX", "PositionY", "Step", "Width", "Label" },
                    Any.Get(new Object[] { _nHeight, sName, _nPosX, _nPosY, _nStep, _nWidth, text }));

                if (oFTModel != null && xFTControl != null && xFTControl is XControl)
                {
                    ((XControl)xFTControl).setModel(oFTModel as XControlModel);
                }

                xFixedText = xFTControl as XFixedText;
                if (_xMouseListener != null && xFTControl is XWindow)
                {
                    XWindow xWindow = (XWindow)xFTControl;
                    xWindow.addMouseListener(_xMouseListener);
                }
            }
            catch (unoidl.com.sun.star.uno.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("uno.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("System.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            return(xFixedText);
        }
        /// <summary>
        /// Inserts a fixed text label.
        /// Properties: Height, Name, PositionX, PositionY, Step, TabIndex, Tag, Width, Align, BackgroundColor, Border, BorderColor, Enabled, FontDescriptor, FontEmphasisMark, FontRelief, HelpText, HelpURL, Label, MultiLine, Printable, TextColor, TextLineColor, VerticalAlign
        /// </summary>
        /// <param name="name">The base name of the element - will be set to a unique one by this function.</param>
        /// <param name="text">The text that should be insert.</param>
        /// <param name="_nPosX">The x position of the element.</param>
        /// <param name="_nPosY">The y posistion of the elemnt.</param>
        /// <param name="_nWidth">The width of the element.</param>
        /// <param name="_nHeight">The Height of the element.</param>
        /// <param name="_nStep">The step index.</param>
        /// <param name="_xMouseListener">A mouse listener.</param>
        /// <returns>XFixedText object</returns>
        public virtual XFixedText InsertFixedLabel(String text, int _nPosX, int _nPosY, int _nWidth, int _nHeight, int _nStep, XMouseListener _xMouseListener, String sName = "")
        {
            XFixedText xFixedText = null;

            try
            {
                // create a unique name by means of an own implementation...
                if (String.IsNullOrWhiteSpace(sName))
                {
                    sName = createUniqueName(MXDlgModelNameContainer, "TEXT_FIXED");
                }
                else
                {
                    sName = createUniqueName(MXDlgModelNameContainer, sName);
                }

                // create a controlmodel at the multiservicefactory of the dialog model...
                Object            oFTModel      = MXMcf.createInstanceWithContext(OO.Services.AWT_CONTROL_TEXT_FIXED_MODEL, MXContext);
                XMultiPropertySet xFTModelMPSet = (XMultiPropertySet)oFTModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!

                String[] valueNames = new String[] { "Height", "Name", "PositionX", "PositionY", "Step", "Width", "Label" };
                var      valueVals  = Any.Get(new Object[] { _nHeight, sName, _nPosX, _nPosY, _nStep, _nWidth, text });

                xFTModelMPSet.setPropertyValues(
                    valueNames, valueVals
                    );
                // add the model to the NameContainer of the dialog model
                MXDlgModelNameContainer.insertByName(sName, Any.Get(oFTModel));

                var element = MXDlgModelNameContainer.getByName(sName).Value;
                if (element != null)
                {
                    OoUtils.SetProperty(element, "PositionX", _nPosX);
                    OoUtils.SetProperty(element, "PositionY", _nPosY);
                    OoUtils.SetProperty(element, "Width", _nWidth);
                    //if (element is XControl)
                    //{
                    //    ((XControl)element).getModel();
                    //}
                    //if (element is XMultiPropertySet)
                    //{
                    //    ((XMultiPropertySet)element).setPropertyValues(valueNames, valueVals);
                    //}
                }


                // reference the control by the Name
                XControl xFTControl = GetControlByName(sName);
                xFixedText = (XFixedText)xFTControl;
                if (_xMouseListener != null)
                {
                    XWindow xWindow = (XWindow)xFTControl;
                    xWindow.addMouseListener(_xMouseListener);
                }
            }
            catch (unoidl.com.sun.star.uno.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("uno.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("System.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            return(xFixedText);
        }
 /// <summary>
 /// Inserts a fixed text label.
 /// Properties: Height, Name, PositionX, PositionY, Step, TabIndex, Tag, Width, Align, BackgroundColor, Border, BorderColor, Enabled, FontDescriptor, FontEmphasisMark, FontRelief, HelpText, HelpURL, Label, MultiLine, Printable, TextColor, TextLineColor, VerticalAlign
 /// </summary>
 /// <param name="name">The base name of the element - will be set to a unique one by this function.</param>
 /// <param name="text">The text that should be insert.</param>
 /// <param name="_nPosX">The x position of the element.</param>
 /// <param name="_nPosY">The y posistion of the elemnt.</param>
 /// <param name="_nWidth">The width of the element.</param>
 /// <param name="_xMouseListener">A mouse listener.</param>
 /// <returns>XFixedText object</returns>
 public virtual XFixedText InsertFixedLabel(String text, int _nPosX, int _nPosY, int _nWidth, XMouseListener _xMouseListener, String sName = "")
 {
     return(InsertFixedLabel(text, _nPosX, _nPosY, _nWidth, 8, 0, _xMouseListener, sName));
 }
        protected virtual XFixedText CreateFixedLabel(String text, int _nPosX, int _nPosY, int _nWidth, int _nHeight, int _nStep, XMouseListener _xMouseListener, String sName = "")
        {
            XFixedText xFixedText = null;
            try
            {

                // create a controlmodel at the multiservicefactory of the dialog model...
                Object oFTModel = OO.GetMultiServiceFactory().createInstance(OO.Services.AWT_CONTROL_TEXT_FIXED_MODEL);
                Object xFTControl = OO.GetMultiServiceFactory().createInstance(OO.Services.AWT_CONTROL_TEXT_FIXED);
                XMultiPropertySet xFTModelMPSet = (XMultiPropertySet)oFTModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!

                xFTModelMPSet.setPropertyValues(
                        new String[] { "Height", "Name", "PositionX", "PositionY", "Step", "Width", "Label" },
                        Any.Get(new Object[] { _nHeight, sName, _nPosX, _nPosY, _nStep, _nWidth, text }));

                if (oFTModel != null && xFTControl != null && xFTControl is XControl)
                {
                    ((XControl)xFTControl).setModel(oFTModel as XControlModel);
                }

                xFixedText = xFTControl as XFixedText;
                if (_xMouseListener != null && xFTControl is XWindow)
                {
                    XWindow xWindow = (XWindow)xFTControl;
                    xWindow.addMouseListener(_xMouseListener);
                }
            }
            catch (unoidl.com.sun.star.uno.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("uno.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("System.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            return xFixedText;
        }
        protected virtual XFixedText CreateFixedLabel(String text, int _nPosX, int _nPosY, int _nWidth, int _nHeight, int _nStep, XMouseListener _xMouseListener, String sName = "")
        {
            XFixedText xFixedText = null;

            try
            {
                // create a controlmodel at the multiservicefactory of the dialog model...
                Object            oFTModel      = OO.GetMultiServiceFactory().createInstance(OO.Services.AWT_CONTROL_TEXT_FIXED_MODEL);
                Object            xFTControl    = OO.GetMultiServiceFactory().createInstance(OO.Services.AWT_CONTROL_TEXT_FIXED);
                XMultiPropertySet xFTModelMPSet = (XMultiPropertySet)oFTModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!

                xFTModelMPSet.setPropertyValues(
                    new String[] { "Height", "Name", "PositionX", "PositionY", "Step", "Width", "Label" },
                    Any.Get(new Object[] { _nHeight, sName, _nPosX, _nPosY, _nStep, _nWidth, text }));

                if (oFTModel != null && xFTControl != null && xFTControl is XControl)
                {
                    ((XControl)xFTControl).setModel(oFTModel as XControlModel);
                }

                xFixedText = xFTControl as XFixedText;
                if (_xMouseListener != null && xFTControl is XWindow)
                {
                    XWindow xWindow = (XWindow)xFTControl;
                    xWindow.addMouseListener(_xMouseListener);
                }
            }
            catch (unoidl.com.sun.star.uno.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("uno.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("System.Exception:");
                System.Diagnostics.Debug.WriteLine(ex);
            }
            return(xFixedText);
        }