static IHtmlControl UserField(string name, HLabel valueLabel) { return(new HPanel( new HLabel(name).VAlign(true).Width(105).Padding(5, 10), valueLabel.Padding(5, 10).BorderLeft(Decor.columnBorder) ).Border("1px solid #fff")); }
/// <summary> /// Применить актуальный размер шрифта /// </summary> public void FitFont() { if (_state == true) { _fontActual = HLabel.FitFont(this.CreateGraphics(), Text, ClientSize, new SizeF(0.95F, 0.95F), 0.05F); setFont((!(_fontActual == null)) ? _fontActual : _fontDefault, _color); } else { ; } }
static HLabel ValueLabel(string value) { if (StringHlp.IsEmpty(value)) { value = "не указано"; } HLabel valueLabel = new HLabel(value); if (StringHlp.IsEmpty(value)) { valueLabel.Color(Decor.minorColor); } return(valueLabel); }
private void labelFitFont() { Font font = null; if (!(m_label == null)) { font = HLabel.FitFont(m_label.CreateGraphics(), m_label.Text, m_label.ClientSize, new SizeF(0.95F, 0.95F), 0.05F); m_label.Font = new Font( font.Name , font.Size , FontStyle.Bold , font.Unit , font.GdiCharSet ); } else { ; } }
public static IHtmlControl GetMenuItem(SiteState state, LightSection section, string url, bool isSelected) { HLabel label = new HLabel(section.NameInMenu, new HHover().TextDecoration("none")) .Padding(10, 17, 12, 17).TextDecoration("underline"); if (!isSelected) { label.Color(Decor.menuColor); } else { label.Color(Decor.menuSelectedColor).FontBold().Background(Decor.menuSelectedBackground); } return(new HPanel( //new HLink(UrlHlp.ShopUrl("page", section.Id), new HLink(url, label ) ).InlineBlock()); }
static IHtmlControl JumpElement(string urlWithoutPageIndex, int pageIndex, bool isSelected, bool isFirst) { IHtmlControl jumpItem = null; if (!isSelected) { jumpItem = new HLink(JumpPageUrl(urlWithoutPageIndex, pageIndex), (pageIndex + 1).ToString()); } else { jumpItem = new HLabel(pageIndex + 1).FontBold(); } HPanel jumpElement = new HPanel( !isFirst ? new HLabel(" | ").MarginLeft(5).MarginRight(5) : null, jumpItem ).InlineBlock(); //if (!isFirst) // jumpElement.BorderLeft("1px solid #000"); return(jumpElement); }
/// <summary> /// Обязательный метод для поддержки конструктора - не изменяйте /// содержимое данного метода при помощи редактора кода. /// </summary> private void InitializeComponent() { components = new System.ComponentModel.Container(); m_dictLabelVal = new Dictionary <int, System.Windows.Forms.Label> (); dtCurrDate = new DateTimePicker(); m_arLabel = new System.Windows.Forms.Label [(int)INDEX_LABEL.VALUE_TM_SN + 1]; dgvSNHour = new HDataGridViewTecSobstvNyzhdy(BackColor); this.Dock = DockStyle.Fill; this.SuspendLayout(); this.m_zedGraphHours = new HZedGraphControlSNHours(m_tecView.m_lockValue); this.m_zedGraphHours.MouseUpEvent += new ZedGraph.ZedGraphControl.ZedMouseEventHandler(this.zedGraphHours_MouseUpEvent); this.m_zedGraphHours.PointValueEvent += new ZedGraph.ZedGraphControl.PointValueHandler(this.zedGraphHours_PointValueEvent); //this.m_zedGraphHours.DoubleClickEvent += new ZedGraph.ZedGraphControl.ZedMouseEventHandler(this.zedGraphHours_DoubleClickEvent); this.m_zedGraphHours.ContextMenuStrip.Items [(int)StatisticCommon.HZedGraphControl.INDEX_CONTEXTMENU_ITEM.VISIBLE_TABLE].Click += new System.EventHandler(отобразитьВТаблицеToolStripMenuItem_Click); //this.m_zedGraphHours.InitializeEventHandler(this.эксельToolStripMenuItemHours_Click, this.sourceDataHours_Click); this.m_zedGraphHours.InitializeEventHandler(this.эксельToolStripMenuItemHours_Click, null); dtCurrDate.Value = DateTime.Now; dtCurrDate.Dock = DockStyle.Fill; dtCurrDate.ValueChanged += new EventHandler(dtCurrDate_ChangeValue); int i = -1; for (i = (int)StatisticCommon.HZedGraphControl.INDEX_CONTEXTMENU_ITEM.AISKUE_PLUS_SOTIASSO; i < (int)StatisticCommon.HZedGraphControl.INDEX_CONTEXTMENU_ITEM.VISIBLE_TABLE; i++) { m_zedGraphHours.ContextMenuStrip.Items [i].Visible = false; } dgvSNHour.Dock = DockStyle.Fill; dgvSNHour.MultiSelect = false; dgvSNHour.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dgvSNHour.ReadOnly = true; dgvSNHour.AllowUserToResizeRows = false; dgvSNHour.AllowUserToResizeColumns = false; dgvSNHour.AllowUserToDeleteRows = false; dgvSNHour.Columns.Add("Hour", "Час"); dgvSNHour.Columns ["Hour"].Width = 45; dgvSNHour.Columns.Add("Value", "Значение"); dgvSNHour.Columns ["Value"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; dgvSNHour.RowHeadersVisible = false; dgvSNHour.AllowUserToAddRows = false; dgvSNHour.MouseUp += new MouseEventHandler(this.dgvSNHour_SelectionChanged); //Свойства колонок this.ColumnCount = 6; this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 17)); this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 17)); this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 17)); this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 17)); this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 17)); this.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 17)); //Видимая граница для отладки this.BorderStyle = BorderStyle.FixedSingle; //BorderStyle.None; string text = string.Empty; i = (int)INDEX_LABEL.NAME; text = m_tecView.m_tec.name_shr; m_arLabel [i] = HLabel.createLabel(text, PanelSobstvNyzhdy.s_arLabelStyles [i]); ////Предусмотрим обработчик при изменении значения //if (i == (int)INDEX_LABEL.VALUE_TOTAL) // m_arLabel[i].TextChanged += new EventHandler(PanelTecCurPower_TextChangedValue); //else // ; //this.Controls.Add(m_arLabel[i], 0, i); //this.SetRowSpan(m_arLabel[i], COUNT_FIXED_ROWS); this.Controls.Add(m_arLabel [i], 0, i); this.SetRowSpan(m_arLabel [i], COUNT_FIXED_ROWS); this.SetColumnSpan(m_arLabel [i], 3); //Наименование ТЭЦ, Дата/время, Значение для всех ГТП/ТГ for (i = (int)INDEX_LABEL.DATETIME_TM_SN; i < (int)INDEX_LABEL.VALUE_TM_SN + 1; i++) { switch (i) { case (int)INDEX_LABEL.DATETIME_TM_SN: text = @"--:--:--"; break; case (int)INDEX_LABEL.VALUE_TM_SN: text = @"---"; break; default: break; } m_arLabel [i] = HLabel.createLabel(text, PanelSobstvNyzhdy.s_arLabelStyles [i]); } this.Controls.Add(m_arLabel [(int)INDEX_LABEL.DATETIME_TM_SN], 3, 1); this.SetRowSpan(m_arLabel [(int)INDEX_LABEL.DATETIME_TM_SN], 1); this.SetColumnSpan(m_arLabel [(int)INDEX_LABEL.DATETIME_TM_SN], 2); this.Controls.Add(m_arLabel [(int)INDEX_LABEL.VALUE_TM_SN], 5, 1); this.SetRowSpan(m_arLabel [(int)INDEX_LABEL.VALUE_TM_SN], 1); this.SetColumnSpan(m_arLabel [(int)INDEX_LABEL.VALUE_TM_SN], 1); this.Controls.Add(dtCurrDate, 3, 0); this.SetRowSpan(dtCurrDate, 1); this.SetColumnSpan(dtCurrDate, 3); this.RowCount = COUNT_FIXED_ROWS; //Свойства зафиксированных строк for (i = 0; i < COUNT_FIXED_ROWS; i++) { this.RowStyles.Add(new RowStyle(SizeType.Percent, 5)); } this.Controls.Add(m_zedGraphHours, 0, COUNT_FIXED_ROWS); this.SetColumnSpan(m_zedGraphHours, this.ColumnCount); this.RowStyles.Add(new RowStyle(SizeType.Percent, 90)); this.ResumeLayout(false); this.PerformLayout(); }