예제 #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>
        public virtual void load(FCNative native, String xmlName, String windowName)
        {
            Native = native;
            String xmlPath = DataCenter.getAppPath() + "\\config\\" + xmlName + ".html";

            Script = new FaceCatScript(this);
            loadFile(xmlPath, null);
            m_window      = findControl(windowName) as WindowEx;
            m_invokeEvent = new FCInvokeEvent(invoke);
            m_window.addEvent(m_invokeEvent, FCEventID.INVOKE);
            //注册点击事件
            registerEvents(m_window);
        }
예제 #3
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         if (m_window != null)
         {
             m_invokeEvent = null;
             m_window.close();
             m_window.delete();
             m_window = null;
         }
         base.delete();
     }
 }
예제 #4
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         if (m_winForm != null && m_winForm.Window != null)
         {
             m_winForm.Window = null;
             m_winForm.Close();
             m_winForm = null;
         }
         if (m_window != null)
         {
             m_window.removeEvent(m_invokeEvent, FCEventID.INVOKE);
             m_invokeEvent = null;
             m_window.close();
             m_window.delete();
             m_window = null;
         }
         base.delete();
     }
 }