Пример #1
0
        /// <summary>
        /// 重置缩放尺寸
        /// </summary>
        /// <param name="clientSize">客户端大小</param>
        public void resetScaleSize(FCSize clientSize)
        {
            FCNative native = Native;

            if (native != null)
            {
                FCHost        host         = native.Host;
                FCSize        nativeSize   = native.DisplaySize;
                List <FCView> controls     = native.getControls();
                int           controlsSize = controls.Count;
                for (int i = 0; i < controlsSize; i++)
                {
                    FCWindowFrame frame = controls[i] as FCWindowFrame;
                    if (frame != null)
                    {
                        WindowEx window = frame.getControls()[0] as WindowEx;
                        if (window != null && !window.AnimateMoving)
                        {
                            FCPoint location = window.Location;
                            if (location.x < 10 || location.x > nativeSize.cx - 10)
                            {
                                location.x = 0;
                            }
                            if (location.y < 30 || location.y > nativeSize.cy - 30)
                            {
                                location.y = 0;
                            }
                            window.Location = location;
                        }
                    }
                }
                native.ScaleSize = new FCSize((int)(clientSize.cx * m_scaleFactor), (int)(clientSize.cy * m_scaleFactor));
                native.update();
            }
        }
Пример #2
0
        /// <summary>
        /// 窗体关闭事件
        /// </summary>
        /// <param name="e"></param>
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);
            List <FCView> controls       = m_native.getControls();
            List <FCView> removeControls = new List <FCView>();
            int           controlsSize   = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                removeControls.Add(controls[i]);
            }
            for (int i = 0; i < controlsSize; i++)
            {
                m_native.removeMirror(removeControls[i]);
            }
            removeControls.Clear();
            if (m_native != null)
            {
                m_native.delete();
                m_native = null;
            }
            if (m_window != null)
            {
                WindowXmlEx window = m_window;
                m_window = null;
                window.close();
            }
        }
Пример #3
0
        /// <summary>
        /// 窗体关闭事件
        /// </summary>
        /// <param name="e"></param>
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            base.OnFormClosing(e);
            List <FCView> controls     = m_native.getControls();
            int           controlsSize = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                m_native.removeMirror(controls[i]);
            }
            if (m_native != null)
            {
                m_native.delete();
                m_native = null;
            }
        }
Пример #4
0
 /// <summary>
 /// 激活镜像
 /// </summary>
 public override void activeMirror()
 {
     if (m_native.MirrorMode != FCMirrorMode.None)
     {
         ArrayList <FCView> controls = m_native.getControls();
         int controlsSize            = controls.size();
         for (int i = 0; i < controlsSize; i++)
         {
             FCView control = controls.get(i);
             if (control.Native != m_native)
             {
                 control.Native = m_native;
             }
         }
     }
 }