// Executors private static Window GetLoadingWindow(string path) { var window = new Window("window_loading", Path.Combine(path, @"generic/bg.raw")); var progressBar = new ProgressBarImages("bar", path, 80, 100) { Percent = 0, Text = "Идет загрузка редактора методик", TextColor = { B = 1, R = 1, G = 1 } }; window.AddChild(progressBar); mMeasureController.SetProgresbarData = (percent, message) => { progressBar.Percent = (uint)percent; progressBar.Text = message; window.Invalidate(); }; return(window); }
private static IWidget CreateWindow6_1(string path) { var window = new Window("window6_1", Path.Combine(path, @"generic/bg.raw")); // {Description = {Text = "Измерение потенциала системы с пробой"}}; window.AddChild(new TextArea("window6_1_title", null, 10, 215, 400) { Color = { B = 1, G = 1, R = 1 }, Text = "Идет измерение потенциала", Size = 16 }); var progressArea = new ProgressBarImages("bar", path, 10, 10) { Percent = 100, Text = "", TextColor = { B = 1, R = 1, G = 1 } }; window.AddChild(progressArea); const int btnsX = 350; const int btnsYBase = 100; const int btnsYStep = 70; window.AddChild(new RawButton("window_6_1_graphic", Path.Combine(path, "RawButtons/bt_graphic.raw"), Path.Combine(path, "RawButtons/bt_graphic_pr.raw"), btnsX, ToVgY(btnsYBase)) { OnRelease = () => mMeasureController.ShowSampleGraphic() }); var table = new TextTable("window6_1.table", 15, 60, new[] { 210, 100 }, TextTable.CreateOffset(5, 22), new[] { 4, 4 }, null, 16); table.Cells[0, 0].Text = "Потенциал"; table.Cells[0, 1].Text = "Тип активности"; table.Cells[0, 2].Text = "Стабильность потенциала"; table.Cells[0, 3].Text = "Времени затрачено"; table.Cells[0, 4].Text = "Времени осталось"; window.AddChild(table); mMeasureController.Window61DataAction = (percent, status, potential, temperature, activity, stability, time, left) => { progressArea.Percent = percent; progressArea.Text = status; table.Cells[1, 0].Text = potential; table.Cells[1, 1].Text = activity; table.Cells[1, 2].Text = stability; table.Cells[1, 3].Text = time; table.Cells[1, 4].Text = left; window.Invalidate(); }; const int popupX = 40; const int popupY = 30; #region acceptPopup var acceptPopup = new ModalWindow("", path); acceptPopup.TextLines[1].Text = " Принять текущее значение потенциала?"; acceptPopup.TextLines[1].Size = 16; acceptPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_yes.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_yes_pr.raw"), popupX + 280, popupY) { OnRelease = () => { mMeasureController.StopSampleMeasure(); acceptPopup.IsVisible = false; window.Invalidate(); } }); acceptPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_no.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_no_pr.raw"), popupX + 20, popupY) { OnRelease = () => { acceptPopup.IsVisible = false; window.Invalidate(); } }); window.AddPopup(acceptPopup); #endregion window.AddChild(new RawButton("window_6_1_accept", Path.Combine(path, "RawButtons/bt_accept.raw"), Path.Combine(path, "RawButtons/bt_accept_pr.raw"), btnsX, 5) { OnRelease = () => { acceptPopup.IsVisible = true; window.Invalidate(); } }); #region stopPopup var stopPopup = new ModalWindow("", path); stopPopup.TextLines[1].Text = " Вы действительно хотите остановить"; stopPopup.TextLines[1].Size = 16; stopPopup.TextLines[2].Text = " исследование?"; stopPopup.TextLines[2].Size = 16; stopPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_yes.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_yes_pr.raw"), popupX + 280, popupY) { OnRelease = () => { mMeasureController.OnStopSampleMeasure(); stopPopup.IsVisible = false; window.Invalidate(); } }); stopPopup.AddChild(new RawButton("", Path.Combine(path, "generic/modals/RawButtons/bt_no.raw"), Path.Combine(path, "generic/modals/RawButtons/bt_no_pr.raw"), popupX + 20, popupY) { OnRelease = () => { stopPopup.IsVisible = false; window.Invalidate(); } }); window.AddPopup(stopPopup); #endregion window.AddChild(new RawButton("window_6_1_stop", Path.Combine(path, "RawButtons/bt_stop.raw"), Path.Combine(path, "RawButtons/bt_stop_pr.raw"), btnsX, ToVgY(btnsYBase + btnsYStep)) { OnRelease = () => { stopPopup.IsVisible = true; window.Invalidate(); } }); window.OnShow = () => { acceptPopup.IsVisible = false; stopPopup.IsVisible = false; }; return(window); }