public Button(Texture2D aTexture, ControlCallback aCallback, string aName, int aID) : base(aCallback, aName, aID) { m_Text = string.Empty; m_Texture = aTexture; m_UsingTexture = false; }
public Control(ControlCallback aValueChanged) { m_ValueChanged = aValueChanged; m_Style = new GUIStyle(); m_Style.alignment = TextAnchor.MiddleCenter; m_Style.normal.textColor = Color.white; }
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; }
private void EndUpdate(Control tv) { if (tv.InvokeRequired) { ControlCallback d = new ControlCallback(EndUpdate); this.Invoke(d, new object[] { tv }); } else { ((TreeView)tv).EndUpdate(); } }
/// <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())); }
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); }
/// <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); }
/// <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); }
delegate void ControlCallback(); //无参数 public void PrepareUpdateNetPicture() { ControlCallback callBack = new ControlCallback(StartUpdateNetPicture); this.BeginInvoke(callBack); }
public void controlOptions(Control control, ControlCallback callback) { control.BeginInvoke(new MethodInvoker(() => callback(control))); }
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);
public Button(ControlCallback aCallback, string aName, int aID) : base(aCallback, aName, aID) { }
public Button(string aText, ControlCallback aCallback, string aName, int aID) : base(aCallback, aName, aID) { m_Text = aText; m_UsingTexture = false; }
public TextField(string aText, ControlCallback aCallback, string aName, int aID) : base(aCallback, aName, aID) { m_Text = aText; }
public Button(ControlCallback aCallback) : base(aCallback) { }
public TextField(ControlCallback aCallback, string aName, int aID) : base(aCallback, aName, aID) { }
public TextField(ControlCallback aCallback) : base(aCallback) { }
public Label(ControlCallback aCallback, string aName, int aID) : base(aCallback, aName, aID) { }
//无参数 public void PrepareUpdateNetPicture() { ControlCallback callBack = new ControlCallback(StartUpdateNetPicture); this.BeginInvoke(callBack); }
public Label(Color aColor, string aText, ControlCallback aCallback, string aName, int aID) : base(aCallback, aName, aID) { m_Text = aText; m_UsingTexture = false; }