//Edit private void C_CustomStyle_Click(object sender, System.EventArgs e) { TreeNode node = this.C_AllStyles.SelectedNode; if (node == null) { return; } Styles.ExControlStyles style = node.Tag as Styles.ExControlStyles; if (style == null) { return; } this._CustomBuilderForm.BindStyles(style); if (this._CustomBuilderForm.ShowDialog(this) == DialogResult.OK) { if (this.C_AllStyles.SelectedNode.Index == 0) //current style node { return; } style.Save(this.GetStylesFilePath(style)); } if (node.Text == "Default") { style.Load(this.GetStylesFilePath(style)); } }
private void C_PreviewPic_Paint(object sender, PaintEventArgs e) { TreeNode node = this.C_AllStyles.SelectedNode; if (node == null) { return; } Styles.ExControlStyles style = node.Tag as Styles.ExControlStyles; if (style == null) { return; } Rectangle rect = e.ClipRectangle; Pen pen = new Pen(Color.Red, 1.0f); rect.Width--; rect.Height--; e.Graphics.DrawRectangle(pen, rect); }
//Add private void C_AddStyle_Click(object sender, System.EventArgs e) { this.CreateStylesFolder(); Styles.ExControlStyles style = new Styles.ExControlStyles(); this._CustomBuilderForm.BindStyles(style); if (this._SaveFileDialog.ShowDialog(this) == DialogResult.OK) { style.StyleName = this._SaveFileDialog.FileName; string strFile = this.GetStylesFilePath(style.StyleName); if (System.IO.File.Exists(strFile)) { if (MessageBox.Show(this, "The style file is exist , do you want overwrite it?", "Warnning", MessageBoxButtons.YesNo) == DialogResult.No) { return; } } style.Save(strFile); this.LoadStyles(style); } }
public override void UpdateView(Webb.Reports.ExControls.Views.ExControlView i_View) { if (this.C_AllStyles.Nodes.Count == 0) { return; } if (this.C_AllStyles.SelectedNode == null) { return; } Styles.ExControlStyles style = this.C_AllStyles.SelectedNode.Tag as Styles.ExControlStyles; if (style == null) { return; } if (i_View is Views.GroupView) { (i_View as Views.GroupView).Styles.ApplyStyle(style); } if (i_View is Views.GradingView) { (i_View as Views.GradingView).Styles.ApplyStyle(style); } if (i_View is Views.FieldPanelView) { (i_View as Views.FieldPanelView).Styles.ApplyStyle(style); } if (i_View is Views.GridView) { (i_View as Views.GridView).Styles.ApplyStyle(style); } if (i_View is Views.StatControlView) { (i_View as Views.StatControlView).Styles.ApplyStyle(style); } if (i_View is Views.SimpleGroupView) { (i_View as Views.SimpleGroupView).Styles.ApplyStyle(style); } if (i_View is Views.CompactGroupView) { (i_View as Views.CompactGroupView).Styles.ApplyStyle(style); } if (i_View is Views.MatrixGroupView) { (i_View as Views.MatrixGroupView).Styles.ApplyStyle(style); } this._CustomStyle.ApplyStyle(style); }
//ctor public MatrixGroupView(MatrixGroupControl i_Control) : base(i_Control as ExControl) { this._RootGroupInfo = new Webb.Reports.ExControls.Data.FieldGroupInfo(Webb.Data.PublicDBFieldConverter.AvialableFields[0].ToString()); this._RootGroupInfo.ColumnHeading = "New Group"; this._Fitler = new Webb.Data.DBFilter(); this._Styles = new ExControlStyles(); this._Styles.LoadDefaultStyle(); //08-14-2008@Scott this._ShowRowIndicators = false; this._CellSizeAutoAdapting = CellSizeAutoAdaptingTypes.OneLine; this._HaveHeader = true; this._HeightPerPage = 0; this._SectionRoot = false; }
public HolePanelView(HolePanel i_Control) : base(i_Control as ExControl) { this._RootGroupInfo = new FieldGroupInfo(Fields.CS_Hole); this._RootGroupInfo.SubGroupInfo = new FieldGroupInfo("Formation"); this._HolePanelInfo = new HolePanelInfo(this.RootGroupInfo); this._Filter = new Webb.Data.DBFilter(); this._Styles = new ExControlStyles(); this.Flip = false; this.arrHoleIDs = this.CreateHoleIDArray(); }
public ConfigExControlStyle() { // This call is required by the Windows Form Designer. InitializeComponent(); // TODO: Add any initialization after the InitializeComponent call this._ColumnSetupDialog = new ColumnSetupForm(); this._SaveFileDialog = new NameForm(); this._CustomBuilderForm = new StyleBuilderForm(); this._CustomStyle = new Webb.Reports.ExControls.Styles.ExControlStyles(); this.Load += new EventHandler(ConfigExControlStyle_Load); this.C_PreviewPic.Paint += new PaintEventHandler(C_PreviewPic_Paint); this.timer.Enabled = true; }
//ctor public SimpleGroupView(SimpleGroupingControl i_Control) : base(i_Control as ExControl) { this._RootGroupInfo = new Webb.Reports.ExControls.Data.FieldGroupInfo(Webb.Data.PublicDBFieldConverter.AvialableFields[0].ToString()); this._RootGroupInfo.ColumnHeading = "New Group"; this._Fitler = new Webb.Data.DBFilter(); this._Styles = new ExControlStyles(); this._Styles.LoadDefaultStyle(); //08-14-2008@Scott this._ShowRowIndicators = false; this._CellSizeAutoAdapting = CellSizeAutoAdaptingTypes.WordWrap; this._OneValuePerPage = false; this._HaveHeader = true; this._SizeSelfAdapting = false; this._TopCount = 0; this._Total = false; this._TotalTitle = "Total"; this._SectionTitle = string.Empty; this._SectionInOneRow = true; this._TotalColumns = new Int32Collection(); this._HeightPerPage = 0; }
//Delete private void C_DeleteStyle_Click(object sender, System.EventArgs e) { TreeNode node = this.C_AllStyles.SelectedNode; if (node == null || node.Index < 2) { return; //can't remove current style node and default style node //08-14-2008@Scott } Styles.ExControlStyles style = node.Tag as Styles.ExControlStyles; string strFilePath = this.GetStylesFilePath(style); if (MessageBox.Show(this, string.Format("Do you want to delete [{0}]?", style.StyleName), "Warnning", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (System.IO.File.Exists(strFilePath)) { System.IO.File.Delete(strFilePath); } this.C_AllStyles.Nodes.Remove(node); } }
private void LoadStyles(Styles.ExControlStyles selectedStyle) { this.C_AllStyles.Nodes.Clear(); this.LoadCurrentStyles(); this.LoadDefaultStyles(); string strFolder = this.GetStylesFileFolder(); if (!System.IO.Directory.Exists(strFolder)) { return; } string[] strFiles = System.IO.Directory.GetFiles(strFolder); foreach (string strFile in strFiles) { Styles.ExControlStyles style = new Styles.ExControlStyles(); style.Load(strFile); TreeNode node = new TreeNode(style.StyleName); node.Tag = style; this.C_AllStyles.Nodes.Add(node); if (selectedStyle != null && style.StyleName == selectedStyle.StyleName) { this.C_AllStyles.SelectedNode = node; } } if (this.C_AllStyles.Nodes.Count > 0 && selectedStyle == null) { this.C_AllStyles.SelectedNode = this.C_AllStyles.Nodes[0]; } }
private void C_RenameStyle_Click(object sender, System.EventArgs e) { TreeNode node = this.C_AllStyles.SelectedNode; if (node == null) { return; } Styles.ExControlStyles style = node.Tag as Styles.ExControlStyles; if (style == null) { return; } string strOldFile = this.GetStylesFilePath(style.StyleName); if (this._SaveFileDialog.ShowDialog(this) == DialogResult.OK) { style.StyleName = this._SaveFileDialog.FileName; string strFile = this.GetStylesFilePath(style.StyleName); if (System.IO.File.Exists(strFile)) { MessageBox.Show("The style file is exist"); } else { System.IO.File.Delete(strOldFile); style.Save(strFile); this.LoadStyles(style); } } }
/// <summary> /// Get complete file path from a style /// </summary> /// <param name="style">ExControlStyles</param> /// <returns>style file path</returns> private string GetStylesFilePath(Styles.ExControlStyles style) { return(this.GetStylesFilePath(style.StyleName)); }
public void BindStyles(Styles.ExControlStyles i_Styles) { this.C_StyleTree.Nodes.Clear(); //Root TreeNode rowsRoot = new TreeNode("Rows Style"); rowsRoot.Tag = this._RowsStyle; TreeNode colsRoot = new TreeNode("Columns Style"); colsRoot.Tag = this._ColumnsStyle; this.C_StyleTree.Nodes.Add(rowsRoot); this.C_StyleTree.Nodes.Add(colsRoot); //Rows //BandStyle TreeNode m_BandStyle = new TreeNode(); m_BandStyle.Text = "Band Style"; m_BandStyle.Tag = i_Styles.BandStyle; rowsRoot.Nodes.Add(m_BandStyle); //HanderStyle TreeNode m_HanderStyle = new TreeNode(); m_HanderStyle.Text = "Header Style"; m_HanderStyle.Tag = i_Styles.HeaderStyle; rowsRoot.Nodes.Add(m_HanderStyle); //RowsStyle TreeNode m_RowsStyle = new TreeNode(); m_RowsStyle.Text = "Rows Style"; m_RowsStyle.Tag = i_Styles.RowStyle; //RowsStyl-AlternateSyle TreeNode m_AlternateSyle = new TreeNode(); m_AlternateSyle.Text = "Alternate Rows Style"; m_AlternateSyle.Tag = i_Styles.AlternateStyle; m_RowsStyle.Nodes.Add(m_AlternateSyle); TreeNode m_AlternateInterval = new TreeNode(); m_AlternateInterval.Text = "AlternateRows Interval"; m_AlternateInterval.Tag = i_Styles.AlternateIntervals; m_RowsStyle.Nodes.Add(m_AlternateInterval); rowsRoot.Nodes.Add(m_RowsStyle); //SectionStyle TreeNode m_SectionStyle = new TreeNode(); m_SectionStyle.Text = "Section Style"; m_SectionStyle.Tag = i_Styles.SectionStyle; rowsRoot.Nodes.Add(m_SectionStyle); //SectionStyle TreeNode m_TotalStyle = new TreeNode(); m_TotalStyle.Text = "Total Style"; m_TotalStyle.Tag = i_Styles.TotalStyle; rowsRoot.Nodes.Add(m_TotalStyle); //Columns //RowIndicatorStyle TreeNode m_RowIndicator = new TreeNode(); m_RowIndicator.Text = "Row Numbering Style"; m_RowIndicator.Tag = i_Styles.RowIndicatorStyle; colsRoot.Nodes.Add(m_RowIndicator); //06-03-2008@Scott // //GroupStyle // TreeNode m_GroupStyle = new TreeNode(); // m_GroupStyle.Text = "Group Style"; // m_GroupStyle.Tag = i_Styles.GroupStyle; // colsRoot.Nodes.Add(m_GroupStyle); // //FreqencyStyle // TreeNode m_FreqencyStyle = new TreeNode(); // m_FreqencyStyle.Text = "Freqency Style"; // m_FreqencyStyle.Tag = i_Styles.FreqencyStyle; // colsRoot.Nodes.Add(m_FreqencyStyle); // //GroupStyle // TreeNode m_PercentStyle = new TreeNode(); // m_PercentStyle.Text = "Percent Style"; // m_PercentStyle.Tag = i_Styles.PercentStyle; // colsRoot.Nodes.Add(m_PercentStyle); // //TotalColStyle // TreeNode m_TotalColStyle = new TreeNode(); // m_TotalColStyle.Text = "Total Style"; // m_TotalColStyle.Tag = i_Styles.TotalColStyle; // colsRoot.Nodes.Add(m_TotalColStyle); // //AverageStyle // TreeNode m_AverageStyle = new TreeNode(); // m_AverageStyle.Text = "Average Style"; // m_AverageStyle.Tag = i_Styles.AverageStyle; // colsRoot.Nodes.Add(m_AverageStyle); // rowsRoot.Expand(); colsRoot.Expand(); this.C_StyleTree.SelectedNode = m_RowsStyle; this.C_StyleTree.Focus(); }
public GradingView(SerializationInfo info, StreamingContext context) : base(info, context) { try { _GradingSectionCollection = (Webb.Reports.ExControls.Data.GradingSectionCollection)info.GetValue("_GradingSectionCollection", typeof(Webb.Reports.ExControls.Data.GradingSectionCollection)); } catch { _GradingSectionCollection = new GradingSectionCollection(); } try { _RootGroupInfo = (Webb.Reports.ExControls.Data.GroupInfo)info.GetValue("_RootGroupInfo", typeof(Webb.Reports.ExControls.Data.GroupInfo)); } catch { _RootGroupInfo = new FieldGradingInfo(); } try { _CellSizeAutoAdapting = (Webb.Reports.ExControls.Views.CellSizeAutoAdaptingTypes)info.GetValue("_CellSizeAutoAdapting", typeof(Webb.Reports.ExControls.Views.CellSizeAutoAdaptingTypes)); } catch { _CellSizeAutoAdapting = CellSizeAutoAdaptingTypes.NotUse; } try { _Filter = (Webb.Data.DBFilter)info.GetValue("_Filter", typeof(Webb.Data.DBFilter)); } catch { _Filter = new Webb.Data.DBFilter(); } try { _TopCount = info.GetInt32("_TopCount"); } catch { _TopCount = 0; } try { _ShowRowIndicators = info.GetBoolean("_ShowRowIndicators"); } catch { _ShowRowIndicators = false; } try { _HaveHeader = info.GetBoolean("_HaveHeader"); } catch { _HaveHeader = true; } try { _SectionInOneRow = info.GetBoolean("_SectionInOneRow"); } catch { _SectionInOneRow = true; } try { _HeaderRows = (Webb.Collections.Int32Collection)info.GetValue("_HeaderRows", typeof(Webb.Collections.Int32Collection)); } catch { _HeaderRows = new Int32Collection(); } try { _SectionRows = (Webb.Collections.Int32Collection)info.GetValue("_SectionRows", typeof(Webb.Collections.Int32Collection)); } catch { _SectionRows = new Int32Collection(); } try { _TotalRows = (Webb.Collections.Int32Collection)info.GetValue("_TotalRows", typeof(Webb.Collections.Int32Collection)); } catch { _TotalRows = new Int32Collection(); } try { _ColumnsWidth = (Webb.Collections.Int32Collection)info.GetValue("_ColumnsWidth", typeof(Webb.Collections.Int32Collection)); } catch { _ColumnsWidth = new Int32Collection(); } try { _RowsHight = (Webb.Collections.Int32Collection)info.GetValue("_RowsHight", typeof(Webb.Collections.Int32Collection)); } catch { _RowsHight = new Int32Collection(); } try { _Styles = (Webb.Reports.ExControls.Styles.ExControlStyles)info.GetValue("_Styles", typeof(Webb.Reports.ExControls.Styles.ExControlStyles)); } catch { _Styles = new ExControlStyles(); } try { _HeadersData = (HeadersData)info.GetValue("_HeadersData", typeof(Webb.Reports.ExControls.Data.HeadersData)); } catch { _HeadersData = null; } try { _OurBordersSetting = (Webb.Reports.ExControls.Views.OurBordersSetting)info.GetValue("_OurBordersSetting", typeof(Webb.Reports.ExControls.Views.OurBordersSetting)); } catch { _OurBordersSetting = new OurBordersSetting(); } }