Exemple #1
0
        /// <summary>
        /// 获取调用者
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        public double GETSENDER(CVariable var)
        {
            GaiaScript gaiaScript = m_xml.Script as GaiaScript;
            String     text       = gaiaScript.GetSender();
            CVariable  newVar     = new CVariable(m_indicator);

            newVar.m_expression = "'" + text + "'";
            m_indicator.SetVariable(var.m_parameters[0], newVar);
            return(0);
        }
Exemple #2
0
        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double SETPROPERTY(CVariable var)
        {
            GaiaScript gaiaScript    = m_xml.Script as GaiaScript;
            String     name          = m_indicator.GetText(var.m_parameters[0]);
            String     propertyName  = m_indicator.GetText(var.m_parameters[1]);
            String     propertyValue = m_indicator.GetText(var.m_parameters[2]);

            gaiaScript.SetProperty(name, propertyName, propertyValue);
            return(0);
        }
Exemple #3
0
        /// <summary>
        /// 获取属性
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        public double GETPROPERTY(CVariable var)
        {
            GaiaScript gaiaScript   = m_xml.Script as GaiaScript;
            String     name         = m_indicator.GetText(var.m_parameters[1]);
            String     propertyName = m_indicator.GetText(var.m_parameters[2]);
            String     text         = gaiaScript.GetProperty(name, propertyName);
            CVariable  newVar       = new CVariable(m_indicator);

            newVar.m_expression = "'" + text + "'";
            m_indicator.SetVariable(var.m_parameters[0], newVar);
            return(0);
        }
Exemple #4
0
        /// <summary>
        /// 加载界面
        /// </summary>
        public virtual void Load(INativeBase native, String xmlName, String windowName)
        {
            Native = native;
            String xmlPath = DataCenter.GetAppPath() + "\\config\\" + xmlName + ".html";

            Script = new GaiaScript(this);
            LoadFile(xmlPath, null);
            m_window      = FindControl(windowName) as WindowEx;
            m_invokeEvent = new ControlInvokeEvent(Invoke);
            m_window.RegisterEvent(m_invokeEvent, EVENTID.INVOKE);
            //注册点击事件
            RegisterEvents(m_window);
        }
Exemple #5
0
        /// <summary>
        /// 显示右键菜单
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double SHOWRIGHTMENU(CVariable var)
        {
            GaiaScript  gaiaScript = m_xml.Script as GaiaScript;
            INativeBase native     = m_xml.Native;
            ControlA    control    = m_xml.FindControl(gaiaScript.GetSender());
            int         clientX    = native.ClientX(control);
            int         clientY    = native.ClientY(control);
            MenuA       menu       = m_xml.GetMenu(m_indicator.GetText(var.m_parameters[0]));

            menu.Location = new POINT(clientX, clientY + control.Height);
            menu.Visible  = true;
            menu.Focused  = true;
            menu.BringToFront();
            native.Invalidate();
            return(0);
        }