private void CreateToolBarButtons() { try { PanelToolButton.Children.Clear(); CToolButtonItem toolItem; ToggleButton toggleBtn; for (int i = 0; i < _mListPanels.Count; i++) { PanelItem item = _mListPanels[i]; if (!item.CanClose) { continue; } toolItem = new CToolButtonItem(); toolItem.Name = "TB" + item.Name; toolItem.Display = item.Title; toolItem.Tip = item.Title; toolItem.Icon = item.Icon; toggleBtn = new ToggleButton(); toggleBtn.Click += PanelToggleButton_Click; toggleBtn.DataContext = toolItem; toggleBtn.IsChecked = item.IsVisible; toggleBtn.SetResourceReference(StyleProperty, "ToolBarToggleBtnStyle"); PanelToolButton.Children.Add(toggleBtn); } } catch (Exception ex) { UMPApp.ShowExceptionMessage(ex.Message); } }
private void InitPanels() { try { _mListPanels.Clear(); PanelItem panelItem = new PanelItem(); panelItem.PanelId = S3603Consts.PANEL_ID_EXAMINFO; panelItem.Name = S3603Consts.PANEL_NAME_EXAMINFO; panelItem.ContentId = S3603Consts.PANEL_CONTENTID_EXAMINFO; panelItem.Title = "Question Category"; panelItem.Icon = "Images/00005.png"; panelItem.IsVisible = true; panelItem.CanClose = true; _mListPanels.Add(panelItem); panelItem = new PanelItem(); panelItem.PanelId = S3603Consts.PANEL_ID_PAPER; panelItem.Name = S3603Consts.PANEL_NAME_PAPER; panelItem.ContentId = S3603Consts.PANEL_CONTENTID_PAPER; panelItem.Title = "Question Category"; panelItem.Icon = "Images/00005.png"; panelItem.IsVisible = true; panelItem.CanClose = true; _mListPanels.Add(panelItem); } catch (Exception ex) { UMPApp.ShowExceptionMessage(ex.Message); } }
public void addButton(string title, int width, buttonClickHandler buttonClick) { Button btn = new Button(); BGPanel.Controls.Add(btn); btn.Dock = DockStyle.Left; btn.BringToFront(); btn.Width = width; btn.Name = title; btn.Text = title; btn.BackColor = Color.Transparent; btn.FlatStyle = FlatStyle.Flat; btn.FlatAppearance.BorderSize = 2; btn.FlatAppearance.BorderColor = borderColor; btn.FlatAppearance.MouseOverBackColor = Color.ForestGreen; btn.Font = new Font("微软雅黑", 10, FontStyle.Bold); btn.ForeColor = Color.SeaShell; btn.Click += Btn_Click; PanelItem newItem = new PanelItem(); newItem.button = btn; newItem.isButton = true; newItem.buttonClick = buttonClick; items.Add(newItem); }
// ------------------------- обработчики событий ------------------------- /// <summary> /// Технология завершила обработку данных /// </summary> /// <param name="sender">Источник события</param> /// <param name="e">Аргументы события</param> private void Technology_onComplete(object sender, EventArgs e) { try { if (NShow) { if (Interlocked.Read(ref initialized) == 1) { if (items != null) { foreach (VPanelParameter item in items) { if (item != null && item.Tag != null) { Parameter parameter = _app.GetParameter(item.Identifier); if (parameter != null) { PanelItem panel_item = item.Tag as PanelItem; if (panel_item != null) { panel_item.Value = parameter.FormattedCaclulatedValue; } } } } } panel.Redraw(); } } } catch (Exception ex) { ErrorHandler.WriteToLog(this, new ErrorArgs(ex.Message, ErrorType.NotFatal)); } }
/// <summary> /// Актуализировать параметры цифровой панели /// </summary> public override void Actualize() { try { GPanel_1.Actualize(_app); GPanel_2.Actualize(_app); GPanel_3.Actualize(_app); if (items != null) { foreach (VPanelParameter item in items) { if (item != null) { Parameter p_item = _app.GetParameter(item.Identifier); if (p_item != null) { PanelItem panel_item = item.Tag as PanelItem; if (panel_item != null) { string total = Regex.Replace(p_item.Name, @"(?<=\[).+(?=\])", string.Empty); panel_item.Description = total.Replace("[]", String.Empty); if (p_item.Units != string.Empty) { panel_item.Description += "(" + p_item.Units + ")"; } } } } } } } catch { } }
private void SetColorByCode_Click(object sender, RoutedEventArgs e) { var black = (Brush)this.FindResource("MyBlackBrush"); var white = (Brush)this.TryFindResource("MyWhiteBrush") ?? new SolidColorBrush(Colors.Red); if (SetColorByCodeItem.Foreground.Equals(black)) { SetColorByCodeItem.Foreground = white; SetColorByCodeItem.Background = black; } else { SetColorByCodeItem.Foreground = black; SetColorByCodeItem.Background = white; } if (SetColorByCodeItem.Foreground.Equals(black)) { PanelItem.SetResourceReference(ForegroundProperty, "MyWhiteBrush"); PanelItem.SetResourceReference(BackgroundProperty, "MyBlackBrush"); } else { PanelItem.SetResourceReference(ForegroundProperty, "MyBlackBrush"); PanelItem.SetResourceReference(BackgroundProperty, "MyWhiteBrush"); } }
public void Add(ItemViewModel itemViewModel) { PanelItem panelItem = new PanelItem(PanelModel, itemViewModel.ItemModel); panelItem.Quantity = itemViewModel.Quantity; PanelModel.PanelItems.Add(panelItem); ItemViewModels.Add(ItemViewModelFactory.GetItemViewModel(panelItem)); }
public ConceptDatasetSqlSet(Panel panel, SubPanel subpanel, PanelItem panelitem, CompilerOptions comp) : base(panel, subpanel, panelitem, comp) { Panel = panel; SubPanel = subpanel; PanelItem = panelitem; CompilerOptions = comp; SetSelect(); }
private static double CalculateSegmentWidth(PanelItem panelItem) { if (!panelItem.Depth.HasValue || IsEqual(panelItem.Depth.Value, 0)) { return(0); } return(Math.Abs(panelItem.Area.GetValueOrDefault() / panelItem.Depth.GetValueOrDefault())); }
private void CreatePanelControls() { panelList.LayoutCell = new LayoutCell { Alignment = Alignment.Center, }; panelList.Changed += () => { RefreshUsedCommands(); usedCommands.ScrollPosition = usedCommands.MinScrollPosition; foreach (var item in panelList.Items.Cast <ListBox.ListBoxItem>()) { if (item.Widget is PanelItem row) { row.StopEdit(); } } }; foreach (var row in toolbarModel.Rows) { panelList.AddItem(new RowItem(row)); foreach (var panel in row.Panels) { var panelRow = new PanelItem(panel); var item = panelList.AddItem(panelRow); item.DoubleClicked += () => panelRow.StartEdit(); } } if (panelList.Items.Count > 0) { panelList.Items.RemoveAt(0); } panelList.SelectedIndex = 0; AddNode(new Widget { Layout = new HBoxLayout { Spacing = 5 }, LayoutCell = new LayoutCell { StretchY = 0 }, Nodes = { new Widget { Layout = new VBoxLayout(), Nodes = { CreateButton("Preferences.AddPanel", "Add panel", AddPanel, panelList), CreateButton("Preferences.RemovePanel", "Remove panel", RemovePanelOrRow, panelList), CreateButton("Preferences.MoveUp", "Move panel up", () => MovePanel(-1), panelList), CreateButton("Preferences.MoveDown", "Move panel down", () => MovePanel(1), panelList), CreateButton("Preferences.AddRow", "Add row", AddRow, panelList), } }, panelList } }); }
public PanelItemSqlSet(Panel panel, SubPanel subpanel, PanelItem panelitem, CompilerOptions comp) { this.panel = panel; this.subpanel = subpanel; this.panelitem = panelitem; this.compilerOptions = comp; base.Alias = Alias; concept = panelitem.Concept; Configure(); }
private static Segment CreateSegment(PanelItem panelItem) { return(new Segment { Width = CalculateSegmentWidth(panelItem), Area = panelItem.Area.GetValueOrDefault(), //TODO: AQ-19384 - Throw if this is null Velocity = panelItem.MeanVelocity.GetValueOrDefault(), //TODO: AQ-19384 - Throw if this is null Discharge = panelItem.Flow.GetValueOrDefault(), //TODO: AQ-19384 - Throw if this is null IsDischargeEstimated = false }); }
private void OnSelectionChanged(object sender, SelectionChangedEventArgs selectionChangedEventArgs) { PanelItem item = (PanelItem)SelectedItem; Action a = () => { if (item == null) return; ((LineStudy)item.LineStudy.Target).EnsureVisible(LineStudy.EnsureVisibilityPosition.Middle); }; _chartPanel.MoreIndicatorPanelItemSelected(true, a); }
protected override void SetTooltip(PanelItem toolInfo) { var info = toolInfo as ProgramViewItem; if (info.TitleDrawErr == false && Settings.Instance.EpgToolTipNoViewOnly == true) { return; } Tooltip.ToolTip = ViewUtil.GetTooltipBlockStandard(CommonManager.ConvertProgramText(info.Data, Settings.Instance.EpgExtInfoTooltip == true ? EventInfoTextMode.All : EventInfoTextMode.BasicText)); }
private float GetPanelScale() { PanelItem panelBody = PanelBody.ActiveBody; if (PanelItem.None == panelBody) { return(0.18f); } else { return(1.00f); } }
public void Activate(PanelItem panelItem) { gameObject.SetActive(true); foreach (var panelBody in _panelBodys.Values) { panelBody.SetActive(false); } if (_panelBodys.ContainsKey(panelItem)) { _panelBodys[panelItem].SetActive(true); } }
/// <summary> /// Add /// </summary> /// <param name="obj"></param> /// <returns></returns> public PanelItem AddPanel(int id, string name, UserControl obj) { if (Panels == null) { Panels = new ObservableCollection <PanelItem>(); } PanelItem panel = new PanelItem(id, name, obj); Panels.Add(panel); SelectIndex = Panels.Count(); return(panel); }
protected override Pen BorderPen(PanelItem info) { if (((ReserveViewItem)info).Data.IsWatchMode == false) { return(null); } var pen = new Pen(info.BackColor, borderMax) { DashStyle = Settings.BrushCache.TunerDashStyle }; pen.Freeze(); return(pen); }
private static Vertical CreateVertical(PanelItem panelItem) { return(new Vertical { SequenceNumber = panelItem.VerticalNumber.GetValueOrDefault(), //TODO: AQ-19384 - Throw if this is null VerticalType = VerticalType.MidRiver, MeasurementConditionData = new OpenWaterData(), FlowDirection = FlowDirectionType.Normal, TaglinePosition = panelItem.Distance.GetValueOrDefault(), //TODO: AQ-19384 - Throw if this is null SoundedDepth = panelItem.Depth.GetValueOrDefault(), //TODO: AQ-19384 - Throw if this is null IsSoundedDepthEstimated = false, EffectiveDepth = panelItem.Depth.GetValueOrDefault() //TODO: AQ-19384 - Throw if this is null }); }
public void SetSate(T itemMember, FnStateEnum status) { var item = Items.Where(i => i.ItemMember.Equals(itemMember)).FirstOrDefault(); if (item == null) { item = new PanelItem <T>() { ItemMember = itemMember }; Items.Add(item); } item.FnState = status; }
public void Build(PanelItem panelItem, Interactable selected) { if (selected.Type == InteractableType.Bundle) { PanelBodyBundle.Build(selected); } else if (selected.Type == InteractableType.Package) { PanelBodyPackage.Build(selected); } else if (selected.Type == InteractableType.CompilationUnit) { PanelBodyClass.Build(selected); } }
public void PanelItemsAreCorrectTest(PanelItem panelItem) { var panelElement = _claimsPage.IsPanelElementPresent(panelItem.Title); panelElement.ShouldBeTrue($"It was not possible to find panel item : {panelItem.Title} on UI"); _claimsPage.ClickPaneITitleByName(panelItem.Title); var content = _claimsPage.GetPanelContent(panelItem.Title); panelItem.Content.ShouldBe(content, $"It was not possible to find expected content for : {panelItem.Title} on UI"); // close item panel _claimsPage.ClickPaneITitleByName(panelItem.Title); }
public void addBlank(int width) { Panel panel = new Panel(); BGPanel.Controls.Add(panel); panel.Dock = DockStyle.Left; panel.BringToFront(); panel.BackColor = Color.Transparent; panel.Width = width; PanelItem newItem = new PanelItem(); newItem.isButton = false; newItem.blank = panel; items.Add(newItem); }
private VelocityObservation CreateVelocityObservation(DeploymentMethodType deploymentMethod, PanelItem panelItem, MeterDetailsItem meterDetails) { var velocityObservation = new VelocityObservation { MeterCalibration = _meterCalibrationMapper.Map(meterDetails), VelocityObservationMethod = DetermineVelocityObservationMethodFromVerticals(panelItem.Verticals), DeploymentMethod = deploymentMethod, MeanVelocity = panelItem.MeanVelocity.GetValueOrDefault(), //TODO: AQ-19384 - Throw if this is null }; foreach (var observation in panelItem.Verticals.Select(CreateVelocityDepthObservation)) { velocityObservation.Observations.Add(observation); } return(velocityObservation); }
protected override void SetPopup(PanelItem item) { //この番組だけのEpgViewPanelをつくる PopPanel.ExtInfoMode = Settings.Instance.EpgExtInfoPopup; SetPopPanel(item); popupItemBorder.Visibility = Visibility.Collapsed; popupItemFillOnly.Visibility = Visibility.Collapsed; if (popInfoRes != null) { popupItemBorder.Visibility = Visibility.Visible; if (Settings.Instance.ReserveRectFillWithShadow == false) { popupItemFillOnly.Visibility = Visibility.Visible; } SetReserveBorderColor(popInfoRes, popupItemBorder, Settings.Instance.ReserveRectFillWithShadow ? null : popupItemFillOnly); } }
protected override void SetPopupItemEx(PanelItem item) { (PopPanel.Item as ProgramViewItem).DrawHours |= (item as ProgramViewItem).DrawHours; (PopPanel.Item as ProgramViewItem).EpgSettingIndex = (item as ProgramViewItem).EpgSettingIndex; (PopPanel.Item as ProgramViewItem).ViewMode = (item as ProgramViewItem).ViewMode; //(PopPanel.Item as ProgramViewItem).Filtered = (item as ProgramViewItem).Filtered;//ポップアップ時は通常表示 popupItemBorder.Visibility = Visibility.Collapsed; popupItemFillOnly.Visibility = Visibility.Collapsed; if (popInfoRes != null) { popupItemBorder.Visibility = Visibility.Visible; if (this.EpgStyle().ReserveRectFillWithShadow == false) { popupItemFillOnly.Visibility = Visibility.Visible; } SetReserveBorderColor(popInfoRes, popupItemBorder, this.EpgStyle().ReserveRectFillWithShadow ? null : popupItemFillOnly); } }
void PanelToggleButton_Click(object sender, RoutedEventArgs e) { var toggleBtn = e.Source as ToggleButton; if (toggleBtn != null) { CToolButtonItem item = toggleBtn.DataContext as CToolButtonItem; if (item != null) { PanelItem panelItem = _mListPanels.FirstOrDefault(p => string.Format("TB{0}", p.Name) == item.Name); if (panelItem == null) { return; } panelItem.IsVisible = toggleBtn.IsChecked == true; } SetPanelVisible(); } }
protected override void SetTooltip(PanelItem toolInfo) { var info = toolInfo as ProgramViewItem; if (info.TitleDrawErr == false && this.EpgStyle().EpgToolTipNoViewOnly == true) { return; } string text = CommonManager.ConvertProgramText(info.Data, EventInfoTextMode.BasicInfo) + CommonManager.ConvertProgramText(info.Data, EventInfoTextMode.BasicText); if (this.EpgStyle().EpgExtInfoTooltip) { text += CommonManager.TrimHyphenSpace(CommonManager.ConvertProgramText(info.Data, EventInfoTextMode.ExtendedText)) + CommonManager.ConvertProgramText(info.Data, EventInfoTextMode.PropertyInfo); } Tooltip.ToolTip = ViewUtil.GetTooltipBlockStandard(text.TrimEnd()); }
private void AddPanel() { var panel = GetSelectedPanel(); var row = panel?.Parent ?? toolbarModel.Rows[0]; var newPanel = new ToolbarModel.ToolbarPanel() { Title = "Panel", Index = panel?.Index ?? 0 }; var panelRow = new PanelItem(newPanel); var index = panelList.SelectedIndex; index = index < 0 ? 0 : index; panelList.SelectedItem = panelList.InsertItem(index, panelRow); panelList.SelectedItem.DoubleClicked += () => panelRow.StartEdit(); toolbarModel.InsertPanel(row, newPanel, newPanel.Index); RefreshUsedCommands(); TangerineApp.Instance.Toolbar.Rebuild(); }
private void addDateItem(DateTime fecha) { int panelItemsCount = FechasPanel.Controls.Count; PanelDateItem item = new PanelDateItem(fecha, panelItemsCount); item.TopLevel = false; item.AutoScroll = true; item.Size = new Size(this.FechasPanel.Size.Width, 37); item.Location = new Point(0, item.Size.Height * panelItemsCount + 1); item.onCheckedChange += this.onItemCheckChange; item.onDateChange += this.onDateChange; FechasPanel.Controls.Add(item); item.Show(); PanelItem panelItem = new PanelItem(FechasPanel.Controls.IndexOf(item), item); panelItem.fecha = fecha; items.Add(panelItem); }