public int Compare(DevComponents.AdvTree.Node node1, DevComponents.AdvTree.Node node2) { if (node1 == null && node2 == null) return 0; else if (node1 == null && node2 != null) return -1; else if (node1 != null && node2 == null) return 1; else { if (node1.Tag is ArchAngel.Interfaces.Template.File && node2.Tag is ArchAngel.Interfaces.Template.File) return ((ArchAngel.Interfaces.Template.File)node1.Tag).Name.CompareTo(((ArchAngel.Interfaces.Template.File)node2.Tag).Name); else if (node1.Tag is ArchAngel.Interfaces.Template.Folder && node2.Tag is ArchAngel.Interfaces.Template.Folder) return ((ArchAngel.Interfaces.Template.Folder)node1.Tag).Name.CompareTo(((ArchAngel.Interfaces.Template.Folder)node2.Tag).Name); else if (node1.Tag is ArchAngel.Interfaces.Template.StaticFile && node2.Tag is ArchAngel.Interfaces.Template.StaticFile) //return ((ArchAngel.Interfaces.Template.StaticFile)node1.Tag).Name.CompareTo(((ArchAngel.Interfaces.Template.StaticFile)node2.Tag).Name); return node1.Text.CompareTo(node2.Text); else { if (node1.Tag is ArchAngel.Interfaces.Template.Folder) return -1; else if (node1.Tag is ArchAngel.Interfaces.Template.StaticFile) return -1; else return 1; } //return node1.Tag is ArchAngel.Interfaces.Template.Folder ? -1 : 1; } }
public void DisplayLabelItems(DevComponents.DotNetBar.Controls.GroupPanel panel) { var itemlist = new ArrayList(); for (int i = 0; i < panel.Controls.Count; i++) { if (panel.Controls[i] is Label) { itemlist.Add(panel.Controls[i]); } } var values = new ArrayList { FormatNumber(Math.Round(Strategyperformance.EntireTradesSum, 2)), FormatNumber(Math.Round(Strategyperformance.ProfitTradesSum, 2)), FormatNumber(Math.Round(Strategyperformance.LossTradesSum, 2)), FormatNumber(Math.Round(Strategyperformance.Profitability, 2)), FormatNumber(Math.Round(Strategyperformance.ProfitFactor, 2)), FormatNumber(Math.Round(Strategyperformance.AverageTrade, 4)), Strategyperformance.EntireTradesCount, Strategyperformance.ProfitTradesCount, Strategyperformance.LossTradesCount, MinDt.ToString("dd/MM/yyyy"), MaxDt.ToString("dd/MM/yyyy") }; for (int i = values.Count - 1; i >= 0; i--) { MethodInvoker action = delegate { ((Label)itemlist[(values.Count - 1) - i]).Text = values[i].ToString(); }; ((Label)itemlist[(values.Count - 1) - i]).Invoke(action); //((Label)itemlist[(values.Count - 1) - i]).Text = values[i].ToString(); } }
public int Compare(DevComponents.AdvTree.Node node1, DevComponents.AdvTree.Node node2) { if (node1 == null && node2 == null) { return 0; } else if (node1 == null && node2 != null) { return (this._direction == SortDirection.Ascending) ? -1 : 1; } else if (node1 != null && node2 == null) { return (this._direction == SortDirection.Ascending) ? 1 : -1; } else { string node1Text = node1.Cells[ColumnIndex].Text; string node2Text = node2.Cells[ColumnIndex].Text; if (node1Text != node2Text) { // The names are not the same, so no need to check parameters return (this._direction == SortDirection.Ascending) ? node1Text.CompareTo(node2Text) : node2Text.CompareTo(node1Text); } else // The names are equal, so need to check data-type as well { return (this._direction == SortDirection.Ascending) ? node1Text.CompareTo(node2Text) : node2Text.CompareTo(node1Text); } } }
public FrmOutEarth(GSOGlobeControl globeControl, DevComponents.DotNetBar.Controls.DataGridViewX dataGridViewX11, ToolStripStatusLabel toolStripNumbers1) { InitializeComponent(); globeControl1 = globeControl; dataGridViewX1 = dataGridViewX11; toolStripNumbers = toolStripNumbers1; }
internal void ShowBorderForDragOver(DevComponents.DotNetBar.eBorderSide eSide) { this.panelEx1.Style.BorderWidth = 2; this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.Red; this.panelEx1.Style.BorderSide = eSide; }
public static void DrawRoundedRectangle(System.Drawing.Graphics g, Color color, DevComponents.DotNetBar.Rendering.LinearGradientColorTable fillColor, Rectangle bounds, int cornerSize) { using (Brush fill = CreateBrush(bounds, fillColor)) { using (Pen pen = new Pen(color)) DrawRoundedRectangle(g, pen, fill, bounds.X, bounds.Y, bounds.Width, bounds.Height, cornerSize); } }
public DataConverTool(DevComponents.DotNetBar.LabelX lab_progress, DevComponents.DotNetBar.LabelX lb, DevExpress.XtraEditors.MarqueeProgressBarControl progressBar, DevComponents.DotNetBar.Controls.RichTextBoxEx MessageShow,AxMapControl axMap) { this.axMapControl = axMap; this.lb = lb; this.lab_progress = lab_progress; this.progressBar = progressBar; this.MessageShow = MessageShow; }
/// <summary> /// pnl : 整個課表的 container /// schType : 課表類型 /// /// </summary> /// <param name="pnl"></param> /// <param name="schType"></param> public DecScheduler(DevComponents.DotNetBar.PanelEx pnl, SchedulerType schType) { this.pnlContainer = pnl; this.schType = schType; this.cells = new Dictionary<string, DevComponents.DotNetBar.PanelEx>(); this.decPeriods = new Dictionary<string, DecPeriod>(); this.headerCells = new Dictionary<string, DevComponents.DotNetBar.PanelEx>(); }
public static void SortNodes(DevComponents.AdvTree.AdvTree treeList, TreelistNodeComparer comparer) { treeList.Nodes.Sort((IComparer)comparer); foreach (DevComponents.AdvTree.Node subNode in treeList.Nodes) { SortSubNodes(subNode, comparer); } }
private static void SortSubNodes(DevComponents.AdvTree.Node node, TreelistNodeComparer comparer) { node.Nodes.Sort((IComparer)comparer); foreach (DevComponents.AdvTree.Node subNode in node.Nodes) { SortSubNodes(subNode, comparer); } }
private DevComponents.AdvTree.Node CreateChildNode(Framework.Entity.Module module, System.Drawing.Image image, DevComponents.DotNetBar.ElementStyle subItemStyle) { DevComponents.AdvTree.Node childNode = new DevComponents.AdvTree.Node(module.Title); childNode.Image = image; childNode.Cells.Add(new DevComponents.AdvTree.Cell(module.Title, subItemStyle)); childNode.Tag = module; childNode.NodeDoubleClick += new System.EventHandler(MnModify_Click); return childNode; }
private void cboMaTS_DataColumnCreated(object sender, DevComponents.DotNetBar.Controls.DataColumnEventArgs e) { DevComponents.AdvTree.ColumnHeader header = e.ColumnHeader; if (header.DataFieldName == "TEN_TS") { header.Width.Relative = 50; // 20% of available width } else { header.Width.Relative = 50; } }
/// <summary> /// Sets the visible property of DockContainerItem and hides the bar if the given item is the last visible item on the bar. /// It will also automatically display the bar if bar is not visible. /// </summary> /// <param name="item">DockContainerItem to set visibility for.</param> /// <param name="visible">Indicates the visibility of the item</param> public static void SetDockContainerVisible(DevComponents.DotNetBar.DockContainerItem item, bool visible) { if(item==null || item.Visible==visible) return; DevComponents.DotNetBar.Bar containerBar=item.ContainerControl as DevComponents.DotNetBar.Bar; if(containerBar==null) { // If bar has not been assigned yet just set the visible property and exit item.Visible=visible; return; } DotNetBarManager manager=containerBar.Owner as DotNetBarManager; if(manager!=null) manager.SuspendLayout=true; try { int visibleCount=containerBar.VisibleItemCount; if(visible) { item.Visible=true; if(!containerBar.AutoHide && !containerBar.Visible && visibleCount<=1) { containerBar.Visible=true; if(containerBar.PropertyBag.ContainsKey(BarPropertyBagKeys.AutoHideSetting)) { containerBar.PropertyBag.Remove(BarPropertyBagKeys.AutoHideSetting); containerBar.AutoHide=true; } } } else { if (visibleCount <= 1) { if (containerBar.PropertyBag.ContainsKey(BarPropertyBagKeys.AutoHideSetting)) containerBar.PropertyBag.Remove(BarPropertyBagKeys.AutoHideSetting); // Remember auto-hide setting if (containerBar.AutoHide) containerBar.PropertyBag.Add(BarPropertyBagKeys.AutoHideSetting, true); containerBar.CloseBar(); } item.Visible=false; } } finally { if(manager!=null) manager.SuspendLayout=false; containerBar.RecalcLayout(); } }
private void btnchedo_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e) { frmchedo fcd = new frmchedo(); panel_show.Show(); panel_show.Controls.Clear(); fcd.TopLevel = false; fcd.Dock = DockStyle.Fill; panel_show.Controls.Add(fcd); fcd.Show(); }
private void btndmk_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e) { frmdoimatkhau fdm = new frmdoimatkhau(); panel_show.Show(); panel_show.Controls.Clear(); fdm.TopLevel = false; fdm.Dock = DockStyle.Fill; panel_show.Controls.Add(fdm); fdm.Show(); }
public static void SetRowNum(DevComponents.DotNetBar.Controls.DataGridViewX dgv) { dgv.RowPostPaint += (s, e) => { using (SolidBrush b = new SolidBrush(Color.Black)) { e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, b, e.RowBounds.Location.X + 12, e.RowBounds.Location.Y + 6); } }; }
protected override void PaintButtonBackground(PaintInfo p, DevComponents.DotNetBar.Rendering.Office2007ButtonItemStateColorTable ct) { base.PaintButtonBackground(p, ct); if (this.Text.Length == 0 && this.Image == null) { using (SolidBrush brush = new SolidBrush(ct.Text)) p.Graphics.FillPolygon(brush, Office2007ButtonItemPainter.GetExpandPolygon(this.RenderBounds, ePopupSide.Default)); } }
private bool CheckPara( DevComponents .DotNetBar .TabItem lTab) { bool IsOK; IsOK = true; foreach (Control lText in lTab.AttachedControl.Controls) { if (lText.Name.ToUpper().StartsWith("TEXTBOX")) { switch (lText.Name.ToUpper()) { case "TEXTBOX1": case "TEXTBOX2": case "TEXTBOX3": case "TEXTBOX7": case "TEXTBOX6": //case "TEXTBOX5": // if (lText.Text.Length == 0) IsOK = false; // break; case "COMBOBOXEX1": if (lText.Text.Length == 0) IsOK = false; break; } if (IsOK == false) { switch (lText.Name.ToUpper()) { case "TEXTBOX1": case "TEXTBOX2": case "TEXTBOX3": case "TEXTBOX7": MessageBox.Show("请输入连接数据库的参数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); lText.Focus(); break; case "TEXTBOX6": //case "TEXTBOX5": // MessageBox.Show("请输入用户号和密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // lText.Focus(); // break; case "COMBOBOXEX1": MessageBox.Show("请输入用户号和密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); lText.Focus(); break; } break; } } } return IsOK; }
private void superTabControlRegion_SelectedTabChanging(object sender, DevComponents.DotNetBar.SuperTabStripSelectedTabChangingEventArgs e) { DevComponents.DotNetBar.SuperTabItem currentItem = e.NewValue as DevComponents.DotNetBar.SuperTabItem; RegionDataInfo regionData = currentItem.Tag as RegionDataInfo; if (!m_RegionControlCache[regionData.RegionID].LoadFinish) { //未加载 //需要进行数据加载 LazyLoadSingleRegion(regionData.RegionID); } }
private void ContextMenuBar_PopupOpen(object sender, DevComponents.DotNetBar.PopupOpenEventArgs e) { if (AdvTree.SelectedNode == null) { MnDelete.Enabled = false; MnModify.Enabled = false; } else { MnDelete.Enabled = true; MnModify.Enabled = true; } }
private void CreateChapter(int pid, DevComponents.AdvTree.Node rootNode) { System.Collections.ArrayList nodeList = contentService.GetChapterByPid(pid, Framework.Entity.Project.Type); foreach (Framework.Entity.Chapter child in nodeList) { DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node(child.Title); node.Cells.Add(new DevComponents.AdvTree.Cell(child.Description)); node.Cells.Add(new DevComponents.AdvTree.Cell(GetState(child.State))); node.Tag = child; node.Expanded = false; node.NodeDoubleClick += new System.EventHandler(MnModify_Click); rootNode.Nodes.Add(node); CreateChapter(child.Id, node); } }
private void checkso(DevComponents.DotNetBar.Controls.TextBoxX txtGia) { if (txtGia.Text != null) { try { string tam = txtGia.Text.Replace(",", ""); a = float.Parse(tam); } catch { MessageBox.Show("Không được điền chữ"); txtGia.Text = ""; } } }
private void advTree1_NodeClick(object sender, DevComponents.AdvTree.TreeNodeMouseEventArgs e) { UpdateDef(); object obj = e.Node.Tag; if (obj is Parser.QuestionGroup) { showQuestionGroupDefinition((Parser.QuestionGroup)obj); showPreview((Parser.QuestionGroup)obj); } else { showQuestionDefinition((Parser.Question)obj); } }
private void CreateChapterTree(int pid, DevComponents.AdvTree.Node rootNode) { System.Collections.ArrayList nodeList = contentService.GetChapterByPid(pid,Framework.Entity.Project.Type); foreach (Framework.Entity.Chapter child in nodeList) { DevComponents.AdvTree.Node node = new DevComponents.AdvTree.Node(child.Title); node.Tag = child; node.Expanded = false; node.NodeClick += new System.EventHandler(delegate(object o, System.EventArgs a) { RefreshList(); }); rootNode.Nodes.Add(node); CreateChapterTree(child.Id, node); } }
private void sgc_cli_RowClick(object sender, DevComponents.DotNetBar.SuperGrid.GridRowClickEventArgs e) { List<GridCell> row = sgc_cli.PrimaryGrid.GridPanel.GetSelectedRows().GetCells(); if (row.Count != 0) { tb_id.Text = row[0].Value.ToString(); tb_rs.Text = row[1].Value.ToString(); tb_rfc.Text = row[2].Value.ToString(); tb_ciudad.Text = row[3].Value.ToString(); tb_cp.Text = row[4].Value.ToString(); tb_direccion.Text = row[5].Value.ToString(); tb_tel.Text = row[6].Value.ToString(); tb_email.Text = row[7].Value.ToString(); } }
private void expandablePanel_Course_ExpandedChaning(object sender, DevComponents.DotNetBar.ExpandedChangeEventArgs e) { if (ExpandedChanging) return; this.ExpandedChanging = true; this.expandablePanel_Subject.Dock = DockStyle.Top; this.expandablePanel_Course.Dock = DockStyle.Fill; this.expandablePanel_Teacher.Dock = DockStyle.Bottom; this.expandablePanel_Case.Dock = DockStyle.Bottom; this.expandablePanel_Subject.Expanded = false; this.expandablePanel_Course.Expanded = true; this.expandablePanel_Teacher.Expanded = false; this.expandablePanel_Case.Expanded = false; this.ExpandedChanging = false; }
private void BB_Menu_Part_Click(object sender, DevComponents.DotNetBar.ClickEventArgs e) { Frm_Part Part = new Frm_Part(this); if (!layerAccess.IsCanRead(userID, Part.Name.ToString())) { clsWin.WarningMessage("You dont have permition to access this form, please contact your administrator", "Access Denied"); return; } if (!CheckForm(Part.Name)) { Part.MdiParent = this; Part.StartPosition = FormStartPosition.CenterScreen; Part.Show(); } }
/// <summary> /// 添加图层管理子按钮 /// </summary> /// <param name="LayerInfoList">图层信息list</param> /// <param name="layerBtn">图层管理主按钮</param> /// <param name="btnItemClickedEvent">按钮事件</param> public static void AddLayerNameButons(List<LayerInfo> LayerInfoList, DevComponents.DotNetBar.ButtonItem layerBtn, System.EventHandler btnItemClickedEvent) { try { //如果图层为空 if (LayerInfoList.Count == 0) { return; } foreach (LayerInfo layerInfo in LayerInfoList) { ButtonItem bi = AddLayerSubItem(layerInfo, btnItemClickedEvent); //取得按钮 layerBtn.SubItems.Add(bi); //添加按钮 } } catch { } }
protected override void PaintButtonBackground(PaintInfo p, DevComponents.DotNetBar.Rendering.Office2007ButtonItemStateColorTable ct) { base.PaintButtonBackground(p, ct); if (this.Text.Length == 0 && this.Image == null) { Point pt = new Point(RenderBounds.X + (RenderBounds.Width - 7) / 2, RenderBounds.Bottom - 6); using (SolidBrush brush = new SolidBrush(ct.Text)) { Size rs = new Size(2, 2); for (int i = 0; i < 3; i++) { p.Graphics.FillRectangle(brush, new Rectangle(pt, rs)); pt.X += rs.Width + 1; } } } }
/// <summary> /// 添加飞行子按钮 /// </summary> /// <param name="FlyPathList">飞行路径list</param> /// <param name="FlyButton">主按钮</param> /// <param name="btnItemClickEvent">按钮事件</param> public static void AddFlyPathButton(List<string> FlyPathList, DevComponents.DotNetBar.ButtonItem FlyButton, System.EventHandler btnItemClickEvent) { try { //如果路径为空 if (FlyPathList.Count == 0) { return; } foreach (string pathName in FlyPathList) { ButtonItem bi = AddSubItem(pathName, btnItemClickEvent); //新建按钮 FlyButton.SubItems.Add(bi); //添加为按钮 } } catch { } }