Пример #1
0
 public Button(Texture2D aTexture, ControlCallback aCallback, string aName, int aID)
     : base(aCallback, aName, aID)
 {
     m_Text = string.Empty;
     m_Texture = aTexture;
     m_UsingTexture = false;
 }
Пример #2
0
 public Control(ControlCallback aValueChanged)
 {
     m_ValueChanged = aValueChanged;
     m_Style = new GUIStyle();
     m_Style.alignment = TextAnchor.MiddleCenter;
     m_Style.normal.textColor = Color.white;
 }
Пример #3
0
 public Control(ControlCallback aValueChanged, string aName, int aID)
 {
     m_ValueChanged = aValueChanged;
     m_Name = aName;
     m_ID = aID;
     m_Style = new GUIStyle();
     m_Style.alignment = TextAnchor.MiddleCenter;
     m_Style.normal.textColor = Color.white;
 }
Пример #4
0
 private void EndUpdate(Control tv)
 {
     if (tv.InvokeRequired)
     {
         ControlCallback d = new ControlCallback(EndUpdate);
         this.Invoke(d, new object[] { tv });
     }
     else
     {
         ((TreeView)tv).EndUpdate();
     }
 }
Пример #5
0
        /// <summary>
        /// Constructor
        /// </summary>
        internal MainWindowView(MainWindowModel m, SettingsCallback settings, ControlCallback control, UnityAction close) : base(
                CommonWindowProperties.mainListMinWidth + 20, // min width
                CommonWindowProperties.mainListMinHeight,     // min height
                CommonWindowProperties.mainWindowSpacing,     // spacing
                CommonWindowProperties.mainElementPadding,    // padding
                TextAnchor.UpperLeft                          // text anchor
                )
        {
            model            = m;
            settingsCallback = settings;
            controlCallback  = control;
            closeCallback    = close;

            // Filter
            AddChild(new DialogGUIHorizontalLayout(
                         new DialogGUIToggle(model.GetActiveControllersToggleState(), Localizer.Format("#LOC_BV_ActiveControllers"), model.ActiveControllersChecked, 140f),
                         new DialogGUIToggle(model.GetDisabledControllersToggleState(), Localizer.Format("#LOC_BV_DisabledControllers"), model.DisabledControllersChecked, 140f),
                         new DialogGUIFlexibleSpace(),
                         new DialogGUIButton(model.GetControlButtonText, ToggleControl, model.ControlButtonCanBeEnabled, 150f, CommonWindowProperties.buttonHeight, false, CommonWindowProperties.ActiveSkin.button)
                         ));

            // Column headers
            AddChild(new DialogGUIHorizontalLayout(
                         new DialogGUISpace(0f),
                         new DialogGUILabel(Localizer.Format("#LOC_BV_ColumnHeader_Name"), 150f)
            {
                guiStyle = CommonWindowProperties.Style_Label_Bold_Left
            },
                         new DialogGUISpace(10f),
                         new DialogGUILabel(Localizer.Format("#LOC_BV_ColumnHeader_Status"), 70f)
            {
                guiStyle = CommonWindowProperties.Style_Label_Bold_Center
            },
                         new DialogGUISpace(10f),
                         new DialogGUILabel(Localizer.Format("#LOC_BV_ColumnHeader_Body"), 60f)
            {
                guiStyle = CommonWindowProperties.Style_Label_Bold_Center
            },
                         new DialogGUISpace(10f),
                         new DialogGUILabel(Localizer.Format("#LOC_BV_ColumnHeader_Speed"), 60f)
            {
                guiStyle = CommonWindowProperties.Style_Label_Bold_Center
            },
                         new DialogGUISpace(10f),
                         new DialogGUILabel(Localizer.Format("#LOC_BV_ColumnHeader_Distance"), 90f)
            {
                guiStyle = CommonWindowProperties.Style_Label_Bold_Center
            }
                         ));

            AddChild(new DialogGUIScrollList(new Vector2(CommonWindowProperties.mainListMinWidth, CommonWindowProperties.mainListMinHeight + 220), false, true, model.GetVesselListLayout()));
        }
Пример #6
0
        public AnalyzerForm(string PortName, int BaudRate, SerialComm Api)
        {
            InitializeComponent();

            addSpfToApi     += new ControlCallback(addSerialPacketFieldApi);
            addSpfToMachine += new ControlCallback(addSerialPacketFieldMachine);

            MachineBaudrate = BaudRate;
            MachinePortName = PortName;
            SerialPort machine = new SerialPort(PortName, BaudRate);

            initAnalyzers();

            hub = new eApi.Analyzer.Hub.ComportHub(machine, MachineAnalyzer, ApiAnalyzer, Api);
        }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        /// <param name="code"></param>
        /// <param name="callback"></param>
        /// <returns></returns>
        public static string RegisterControl(this ICodeButton control, long code, ControlCallback callback)
        {
            string strCode = code.ToString();

            if (ControlsDictionary.ContainsKey(strCode))
            {
                throw new ArgumentException("Элемент с кодом '" + strCode + "' уже зарегистрирован");
            }

            ControlsDictionary.Add(strCode, control);
            ControlsCallbacks.Add(strCode, callback);
            (control as ICodeButton).ButtonClick += (s, e) =>
                                                    callback.Invoke(strCode);
            ;

            return(strCode);
        }
Пример #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        /// <param name="callback"></param>
        /// <returns></returns>
        public static string RegisterControl(this ICodeButton control, ControlCallback callback)
        {
            string strCode = GenerateCode().ToString();
            long   counter = 0;

            while (ControlsDictionary.ContainsKey(strCode))
            {
                if (counter >= END_RANGE)
                {
                    break;
                }
                strCode = GenerateCode().ToString();
                counter++;
            }
            ControlsDictionary.Add(strCode, control);
            ControlsCallbacks.Add(strCode, callback);
            (control as ICodeButton).ButtonClick += (s, e) =>
                                                    callback.Invoke(strCode);
            ;

            return(strCode);
        }
Пример #9
0
        delegate void ControlCallback(); //无参数

        public void PrepareUpdateNetPicture()
        {
            ControlCallback callBack = new ControlCallback(StartUpdateNetPicture);

            this.BeginInvoke(callBack);
        }
Пример #10
0
 public void controlOptions(Control control, ControlCallback callback)
 {
     control.BeginInvoke(new MethodInvoker(() => callback(control)));
 }
Пример #11
0
 public Label(ControlCallback aCallback)
     : base(aCallback)
 {
 }
 internal static extern uint RegisterTraceGuidsW([In] ControlCallback cbFunc, [In] IntPtr context, [In] ref Guid providerGuid, [In] int taskGuidCount, [In, Out] ref TRACE_GUID_REGISTRATION taskGuids, [In] string mofImagePath, [In] string mofResourceName, out ulong regHandle);
Пример #13
0
 public Button(ControlCallback aCallback, string aName, int aID)
     : base(aCallback, aName, aID)
 {
 }
Пример #14
0
 public Button(string aText, ControlCallback aCallback, string aName, int aID)
     : base(aCallback, aName, aID)
 {
     m_Text = aText;
     m_UsingTexture = false;
 }
Пример #15
0
 public TextField(string aText, ControlCallback aCallback, string aName, int aID)
     : base(aCallback, aName, aID)
 {
     m_Text = aText;
 }
Пример #16
0
 public Button(ControlCallback aCallback)
     : base(aCallback)
 {
 }
Пример #17
0
 public TextField(ControlCallback aCallback, string aName, int aID)
     : base(aCallback, aName, aID)
 {
 }
Пример #18
0
 public TextField(ControlCallback aCallback)
     : base(aCallback)
 {
 }
Пример #19
0
 public Label(ControlCallback aCallback, string aName, int aID)
     : base(aCallback, aName, aID)
 {
 }
Пример #20
0
 //无参数
 public void PrepareUpdateNetPicture()
 {
     ControlCallback callBack = new ControlCallback(StartUpdateNetPicture);
     this.BeginInvoke(callBack);
 }
Пример #21
0
 public Label(Color aColor, string aText, ControlCallback aCallback, string aName, int aID)
     : base(aCallback, aName, aID)
 {
     m_Text = aText;
     m_UsingTexture = false;
 }