コード例 #1
0
 /// <summary>
 /// Inserts s horizontal scroll bar.
 /// </summary>
 /// <param id="_nPosX">The X position.</param>
 /// <param id="_nPosY">The Y position.</param>
 /// <param id="_nWidth">Width of the Scrollbar.</param>
 /// <param id="sName">Name of the XControl - can be empty.</param>
 private XScrollBar insertHorizontalScrollBar(XAdjustmentListener _xAdjustmentListener, int _nPosX, int _nPosY, int _nWidth, String sName = "")
 {
     try
     {
         // create a unique id by means of an own implementation...
         if (String.IsNullOrWhiteSpace(sName))
         {
             sName = AbstactUnoDialogBase.createUniqueName(MXDlgModelNameContainer, "HORIZONTAL_SCROLLBAR");
         }
         else
         {
             sName = AbstactUnoDialogBase.createUniqueName(MXDlgModelNameContainer, sName);
         }
         return(insertScrollBar(_xAdjustmentListener, _nPosX, _nPosY, defaultScrollBarwidth, _nWidth, unoidl.com.sun.star.awt.ScrollBarOrientation.HORIZONTAL, sName));
     }
     catch { }
     return(null);
 }
コード例 #2
0
        /// <summary>
        /// Inserts the scroll bar.
        /// </summary>
        /// <param id="_nPosX">The X position.</param>
        /// <param id="_nPosY">The Y position.</param>
        /// <param id="_nHeight">Height of the Scrollbar.</param>
        /// <param id="_nWidth">Width of the Scrollbar.</param>
        /// <param id="sName">Name of the XControl - can be empty.</param>
        private XScrollBar insertScrollBar(XAdjustmentListener _xAdjustmentListener, int _nPosX, int _nPosY, int _nHeight, int _nWidth, int orientation = unoidl.com.sun.star.awt.ScrollBarOrientation.VERTICAL, String sName = "", bool liveScroll = true)
        {
            try
            {
                // create a unique id by means of an own implementation...
                if (String.IsNullOrWhiteSpace(sName))
                {
                    sName = AbstactUnoDialogBase.createUniqueName(MXDlgModelNameContainer, "SCROLLBAR");
                }
                else
                {
                    sName = AbstactUnoDialogBase.createUniqueName(MXDlgModelNameContainer, sName);
                }

                // create a control model at the multiservicefactory of the dialog model...
                Object            oSBModel = parentMCF.createInstanceWithContext(OO.Services.AWT_CONTROL_SCROLLBAR_MODEL, _mXContext);
                XMultiPropertySet xRBMPSet = (XMultiPropertySet)oSBModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!
                xRBMPSet.setPropertyValues(
                    new String[] { "BlockIncrement", "Height", "LineIncrement", "LiveScroll", "Name", "Orientation", "PositionX", "PositionY", "Width" },
                    Any.Get(new Object[] { 30, _nHeight, 10, liveScroll, sName, orientation, _nPosX, _nPosY, _nWidth }));
                // add the model to the NameContainer of the dialog model
                MXDlgModelNameContainer.insertByName(sName, Any.Get(oSBModel));

                XControl xSBControl = (parentCnt != null) ? parentCnt.getControl(sName) : null;

                if (xSBControl != null && xSBControl is XScrollBar && _xAdjustmentListener != null)
                {
                    ((XScrollBar)xSBControl).addAdjustmentListener(_xAdjustmentListener);
                }

                return(xSBControl as XScrollBar);
            }
            catch { }

            return(null);
        }
コード例 #3
0
        /// <summary>
        /// Inserts the scroll bar.
        /// </summary>
        /// <param name="_nPosX">The X position.</param>
        /// <param name="_nPosY">The Y position.</param>
        /// <param name="_nHeight">Height of the Scrollbar.</param>
        /// <param name="_nWidth">Width of the Scrollbar.</param>
        /// <param name="sName">Name of the XControl - can be empty.</param>
        private XScrollBar insertScrollBar(XAdjustmentListener _xAdjustmentListener, int _nPosX, int _nPosY, int _nHeight, int _nWidth, int orientation = unoidl.com.sun.star.awt.ScrollBarOrientation.VERTICAL, String sName = "", bool liveScroll = true)
        {
            try
            {
                // create a unique name by means of an own implementation...
                if (String.IsNullOrWhiteSpace(sName)) sName = createUniqueName(MXDlgModelNameContainer, "SCROLLBAR");
                else sName = createUniqueName(MXDlgModelNameContainer, sName);

                // create a controlmodel at the multiservicefactory of the dialog model...
                Object oSBModel = MXMcf.createInstanceWithContext(OO.Services.AWT_CONTROL_SCROLLBAR_MODEL, MXContext);
                XMultiPropertySet xRBMPSet = (XMultiPropertySet)oSBModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!
                xRBMPSet.setPropertyValues(
                        new String[] { "Height", "LiveScroll", "Name", "Orientation", "PositionX", "PositionY", "Width" },
                        Any.Get(new Object[] { _nHeight, liveScroll, sName, orientation, _nPosX, _nPosY, _nWidth }));
                // add the model to the NameContainer of the dialog model
                MXDlgModelNameContainer.insertByName(sName, Any.Get(oSBModel));
                XControl xSBControl = GetControlByName(sName);

                //System.Diagnostics.Debug.WriteLine("Scrollbar XControl ______");
                //util.Debug.GetAllProperties(xSBControl);
                //util.Debug.GetAllInterfacesOfObject(xSBControl);

                if (xSBControl != null && xSBControl is XScrollBar && _xAdjustmentListener != null)
                {
                    ((XScrollBar)xSBControl).addAdjustmentListener(_xAdjustmentListener);
                }

                return xSBControl as XScrollBar;

            }
            catch { }

            return null;
        }
コード例 #4
0
 /// <summary>
 /// Inserts s horizontal scroll bar.
 /// </summary>
 /// <param name="_nPosX">The X position.</param>
 /// <param name="_nPosY">The Y position.</param>
 /// <param name="_nWidth">Width of the Scrollbar.</param>
 /// <param name="sName">Name of the XControl - can be empty.</param>
 private XScrollBar insertHorizontalScrollBar(XAdjustmentListener _xAdjustmentListener, int _nPosX, int _nPosY, int _nWidth, String sName = "")
 {
     try
     {
         // create a unique name by means of an own implementation...
         if (String.IsNullOrWhiteSpace(sName)) sName = createUniqueName(MXDlgModelNameContainer, "HORIZONTAL_SCROLLBAR");
         else sName = createUniqueName(MXDlgModelNameContainer, sName);
         return insertScrollBar(_xAdjustmentListener, _nPosX, _nPosY, defaultScrollBarwidth, _nWidth, unoidl.com.sun.star.awt.ScrollBarOrientation.HORIZONTAL, sName);
     }
     catch { }
     return null;
 }
        /// <summary>
        /// Inserts the scroll bar.
        /// </summary>
        /// <param id="_nPosX">The X position.</param>
        /// <param id="_nPosY">The Y position.</param>
        /// <param id="_nHeight">Height of the Scrollbar.</param>
        /// <param id="_nWidth">Width of the Scrollbar.</param>
        /// <param id="sName">Name of the XControl - can be empty.</param>
        private XScrollBar insertScrollBar(XAdjustmentListener _xAdjustmentListener, int _nPosX, int _nPosY, int _nHeight, int _nWidth, int orientation = unoidl.com.sun.star.awt.ScrollBarOrientation.VERTICAL, String sName = "", bool liveScroll = true)
        {
            try
            {
                // create a unique id by means of an own implementation...
                if (String.IsNullOrWhiteSpace(sName)) sName = AbstactUnoDialogBase.createUniqueName(MXDlgModelNameContainer, "SCROLLBAR");
                else sName = AbstactUnoDialogBase.createUniqueName(MXDlgModelNameContainer, sName);

                // create a control model at the multiservicefactory of the dialog model...
                Object oSBModel = parentMCF.createInstanceWithContext(OO.Services.AWT_CONTROL_SCROLLBAR_MODEL, _mXContext);
                XMultiPropertySet xRBMPSet = (XMultiPropertySet)oSBModel;
                // Set the properties at the model - keep in mind to pass the property names in alphabetical order!
                xRBMPSet.setPropertyValues(
                        new String[] { "BlockIncrement", "Height", "LineIncrement", "LiveScroll", "Name", "Orientation", "PositionX", "PositionY", "Width" },
                        Any.Get(new Object[] { 30, _nHeight, 10, liveScroll, sName, orientation, _nPosX, _nPosY, _nWidth }));
                // add the model to the NameContainer of the dialog model
                MXDlgModelNameContainer.insertByName(sName, Any.Get(oSBModel));

                XControl xSBControl = (parentCnt != null) ? parentCnt.getControl(sName) : null;

                if (xSBControl != null && xSBControl is XScrollBar && _xAdjustmentListener != null)
                {
                    ((XScrollBar)xSBControl).addAdjustmentListener(_xAdjustmentListener);
                }

                return xSBControl as XScrollBar;

            }
            catch { }

            return null;
        }
        /// <summary>
        /// Inserts a vertical scroll bar.
        /// </summary>
        /// <param id="_nPosX">The X position.</param>
        /// <param id="_nPosY">The Y position.</param>
        /// <param id="_nHeight">Height of the Scrollbar.</param>
        /// <param id="sName">Name of the XControl - can be empty.</param>
        private XScrollBar insertVerticalScrollBar(XAdjustmentListener _xAdjustmentListener, int _nPosX, int _nPosY, int _nHeight, String sName = "")
        {
            try
            {
                // create a unique id by means of an own implementation...
                if (String.IsNullOrWhiteSpace(sName)) sName = AbstactUnoDialogBase.createUniqueName(MXDlgModelNameContainer, "VERTICAL_SCROLLBAR");
                else sName = AbstactUnoDialogBase.createUniqueName(MXDlgModelNameContainer, sName);

                return insertScrollBar(_xAdjustmentListener, _nPosX, _nPosY, _nHeight, defaultScrollBarwidth, unoidl.com.sun.star.awt.ScrollBarOrientation.VERTICAL, sName);

            }
            catch { }
            return null;

        }