/// <summary>
 ///   coordinater for controls on the form
 /// </summary>
 /// <param name = "lg"></param>
 internal EditorSupportingCoordinator(LogicalControl lg)
     : base(lg, ((BasicControlsManager)lg.ContainerManager).LogicalControlsContainer)
 {
     _staticControlsManager = (BasicControlsManager)lg.ContainerManager;
     lg.StyleChanged       += lg_OnStyleChanged;
     lg.BorderTypeChanged  += lg_OnBorderTypeChanged;
 }
Beispiel #2
0
 /// <summary>
 ///   invaldate control
 /// </summary>
 internal virtual void Invalidate(bool wholeParent)
 {
     if (ContainerManager is BasicControlsManager)
     {
         BasicControlsManager staticControlsManager = (BasicControlsManager)ContainerManager;
         if (staticControlsManager != null)
         {
             if (wholeParent)
             {
                 //invalidate all container control - to remove reminders of old line
                 _containerControl.Invalidate();
                 InvalidateSemiTransparentControls(_containerControl, null);
             }
             else
             {
                 Point     offset = staticControlsManager.ContainerOffset();
                 Rectangle rect   = getRectangle();
                 rect.Offset(offset.X, offset.Y);
                 _containerControl.Invalidate(rect);
                 InvalidateSemiTransparentControls(_containerControl, (Rectangle?)rect);
             }
         }
     }
     else if (ContainerManager is TableManager)
     {
         _containerControl.Invalidate(getRectangle());
     }
 }
Beispiel #3
0
        /// <summary>
        ///   ofset static controls according to container's offset
        /// </summary>
        /// <param name = "rect"></param>
        internal void offsetStaticControlRect(ref Rectangle rect)
        {
            BasicControlsManager staticControlsManager = ContainerManager as BasicControlsManager;

            if (staticControlsManager != null)
            {
                Point offset = staticControlsManager.ContainerOffset();
                rect.Offset(offset.X, offset.Y);
            }
        }
Beispiel #4
0
        /// <summary>
        /// return static control manager of container, null if staticControlsManager is not found
        /// this is relevant for client panel of form, client panel of tab or groupbox
        /// </summary>
        /// <param name="mainControl"></param>
        /// <returns></returns>
        BasicControlsManager findStaticControlManager(Control mainControl)
        {
            BasicControlsManager staticControlsManager = null;

            if (mainControl.Tag != null && ((TagData)mainControl.Tag).ContainerManager is BasicControlsManager)
            {
                staticControlsManager = (BasicControlsManager)(((TagData)mainControl.Tag).ContainerManager);
            }

            return(staticControlsManager);
        }
Beispiel #5
0
        /// <summary>
        /// Return LogicalControlsContainer for a container control
        /// </summary>
        /// <param name="container"></param>
        /// <returns></returns>
        protected override LogicalControlsContainer GetLogicalControlsContainer(Control container)
        {
            LogicalControlsContainer logicalControlsContainer = null;

            BasicControlsManager staticControlsManager = findStaticControlManager(container);

            if (staticControlsManager != null)
            {
                logicalControlsContainer = staticControlsManager.LogicalControlsContainer;
            }

            return(logicalControlsContainer);
        }
Beispiel #6
0
        /// <summary>
        /// paint line control
        /// </summary>
        /// <param name="g"></param>
        internal override void paintForeground(Graphics g, Rectangle rect, Color fgColor)
        {
            if (!Visible)
            {
                return;
            }

            Point pt1 = new Point(X1, Y1);
            Point pt2 = new Point(X2, Y2);

#if PocketPC
            BasicControlsManager staticControlsManager = ContainerManager as BasicControlsManager;
            if (staticControlsManager != null)
            {
                Point offset = staticControlsManager.ContainerOffset();
                pt1.Offset(offset.X, offset.Y);
                pt2.Offset(offset.X, offset.Y);
            }
#endif
            ControlRenderer.PaintLineForeGround(g, fgColor, LineHelper.Style, LineHelper.LineWidth, LineHelper.LineStyle, pt1, pt2);
        }