public KryptonTab(string name, string fpath) { this.FPath = fpath; TabTag = new ButtonSpecAny() { Text = name, Edge = PaletteRelativeEdgeAlign.Near, Checked = ButtonCheckState.Checked, ExtraText = " *" }; Container = new KryptonPanel(); Container.Dock = DockStyle.Fill; TabTag.Click += (ss, ee) => { if (TabTag.Checked == ButtonCheckState.Unchecked) { TabTag.Checked = ButtonCheckState.Checked; } else { if (OnSelecting != null) { OnSelecting(); } } }; }
/// <summary> /// Initialize a new instance of the DataGridViewButtonSpecClickEventArgs class. /// </summary> /// <param name="column">Reference to data grid view column.</param> /// <param name="cell">Reference to data grid view cell.</param> /// <param name="buttonSpec">Reference to button spec.</param> public DataGridViewButtonSpecClickEventArgs(DataGridViewColumn column, DataGridViewCell cell, ButtonSpecAny buttonSpec) { Column = column; Cell = cell; ButtonSpec = buttonSpec; }
/// <summary> /// Make a clone of this object. /// </summary> /// <returns>New instance.</returns> public override object Clone() { ButtonSpecAny clone = (ButtonSpecAny)base.Clone(); clone.Visible = Visible; clone.Enabled = Enabled; clone.Checked = Checked; clone.Type = Type; return(clone); }
/// <summary> /// Value copy form the provided source to ourself. /// </summary> /// <param name="source">Source instance.</param> public void CopyFrom(ButtonSpecAny source) { // Copy class specific values Visible = source.Visible; Enabled = source.Enabled; Checked = source.Checked; // Let base class copy the base values base.CopyFrom(source); }
private void buttonSpecsAdd_Click(object sender, EventArgs e) { foreach (KryptonPage page in kryptonDockingManager.Pages) { // Create a button spec and make it a random style so we get a random image ButtonSpecAny bs = new ButtonSpecAny(); bs.Type = _buttonSpecStyles[_random.Next(_buttonSpecStyles.Length)]; page.ButtonSpecs.Add(bs); } }
public frmImportaEscritorNfe() { InitializeComponent(); ButtonSpecAny btnPastaPadrao = new ButtonSpecAny(); btnPastaPadrao.UniqueName = "btnPastaPadrao"; btnPastaPadrao.Image = HLP.GeraXml.UI.Properties.Resources.Pasta; btnPastaPadrao.Style = ComponentFactory.Krypton.Toolkit.PaletteButtonStyle.InputControl; btnPastaPadrao.Click += new EventHandler(btnPastaPadrao_Click); txtXml.txt.ButtonSpecs.Add(btnPastaPadrao); }
private void addText_Click(object sender, EventArgs e) { if (kryptonNavigator.SelectedPage != null) { ButtonSpecAny bsa = new ButtonSpecAny(); bsa.Style = PaletteButtonStyle.Standalone; bsa.Text = DateTime.Now.Millisecond.ToString(); bsa.Tag = kryptonNavigator.SelectedPage; kryptonNavigator.SelectedPage.ButtonSpecs.Add(bsa); } }
private void addArrow_Click(object sender, EventArgs e) { if (kryptonNavigator.SelectedPage != null) { ButtonSpecAny bsa = new ButtonSpecAny(); bsa.Style = PaletteButtonStyle.Alternate; bsa.Type = PaletteButtonSpecStyle.ArrowRight; bsa.Tag = kryptonNavigator.SelectedPage; kryptonNavigator.SelectedPage.ButtonSpecs.Add(bsa); } }
private void frmConfiguracao_Load(object sender, EventArgs e) { try { ButtonSpecAny btnPastaPadrao = new ButtonSpecAny(); btnPastaPadrao.UniqueName = "btnPastaPadrao"; btnPastaPadrao.Image = HLP.GeraXml.UI.Properties.Resources.Pasta; btnPastaPadrao.Style = ComponentFactory.Krypton.Toolkit.PaletteButtonStyle.InputControl; btnPastaPadrao.Click += new System.EventHandler(btnPastas_Click); ButtonSpecAny btnPastaRelatorio = new ButtonSpecAny(); btnPastaRelatorio.UniqueName = "btnPastaRelatorio"; btnPastaRelatorio.Image = HLP.GeraXml.UI.Properties.Resources.Pasta; btnPastaRelatorio.Style = ComponentFactory.Krypton.Toolkit.PaletteButtonStyle.InputControl; btnPastaRelatorio.Click += new System.EventHandler(btnPastas_Click); ButtonSpecAny btnCaminhoLogo = new ButtonSpecAny(); btnCaminhoLogo.Image = HLP.GeraXml.UI.Properties.Resources.Pasta; btnCaminhoLogo.UniqueName = "btnCaminhoLogo"; btnCaminhoLogo.Style = ComponentFactory.Krypton.Toolkit.PaletteButtonStyle.InputControl; btnCaminhoLogo.Click += new System.EventHandler(btnPastas_Click); ButtonSpecAny btnCaminhoBanco = new ButtonSpecAny(); btnCaminhoBanco.UniqueName = "btnCaminhoBanco"; btnCaminhoBanco.Image = HLP.GeraXml.UI.Properties.Resources.Pasta; btnCaminhoBanco.Style = ComponentFactory.Krypton.Toolkit.PaletteButtonStyle.InputControl; btnCaminhoBanco.Click += new System.EventHandler(btnPastas_Click); ButtonSpecAny btnPastaPesquisar = new ButtonSpecAny(); btnPastaPadrao.UniqueName = "btnPastaPesquisar"; btnPastaPadrao.Image = HLP.GeraXml.UI.Properties.Resources.Pasta; btnPastaPadrao.Style = ComponentFactory.Krypton.Toolkit.PaletteButtonStyle.InputControl; btnPastaPadrao.Click += new System.EventHandler(btnPastas_Click); // txtCaminhoPadrao.txt.ReadOnly = true; txtCaminhoPadrao.txt.ButtonSpecs.Add(btnPastaPadrao); txtPastaEnviados.txt.ButtonSpecs.Add(btnPastaPadrao); //txtCaminhoPastaRelatorio.txt.ReadOnly = true; txtCaminhoPastaRelatorio.txt.ButtonSpecs.Add(btnPastaRelatorio); //txtCaminhoLogo.txt.ReadOnly = true; txtCaminhoLogo.txt.ButtonSpecs.Add(btnCaminhoLogo); //txtBancoDados.txt.ReadOnly = true; txtBancoDados.txt.ButtonSpecs.Add(btnCaminhoBanco); CarregarDados(); } catch (Exception ex) { new HLPexception(ex); } }
private void addContext_Click(object sender, EventArgs e) { if (kryptonNavigator.SelectedPage != null) { ButtonSpecAny bsa = new ButtonSpecAny(); bsa.Type = PaletteButtonSpecStyle.Context; bsa.Style = PaletteButtonStyle.Standalone; bsa.KryptonContextMenu = kryptonContextMenu; bsa.Tag = kryptonNavigator.SelectedPage; kryptonNavigator.SelectedPage.ButtonSpecs.Add(bsa); } }
private void frmSelecionaConfigs_Load(object sender, EventArgs e) { txtXmlConfig.txt.ReadOnly = true; if (Pastas.PASTA_XML_CONFIG != null) { txtXmlConfig.Text = Pastas.PASTA_XML_CONFIG.ToString(); } ButtonSpecAny btnPesquisar = new ButtonSpecAny(); btnPesquisar.Image = HLP.GeraXml.UI.Properties.Resources.Pasta; btnPesquisar.Style = ComponentFactory.Krypton.Toolkit.PaletteButtonStyle.InputControl; btnPesquisar.Click += new System.EventHandler(btnCaminhoXml_Click); txtXmlConfig.txt.ButtonSpecs.Add(btnPesquisar); CarregaNomeArquivos(); }
//public Log(String tabName, Delegate del) public Log(String tabName, int targetsNumber, Boolean preProcess, Boolean process, Boolean control) { _PreProcess = preProcess; _Process = process; _Control = control; _NavigatorTab = new KryptonPage(); _CloseButton = new ButtonSpecAny(); _NavigatorTab.Name = tabName + "Tab"; _NavigatorTab.Text = tabName; _CloseButton.Type = ComponentFactory.Krypton.Toolkit.PaletteButtonSpecStyle.PendantClose; _NavigatorTab.ButtonSpecs.AddRange(new ComponentFactory.Krypton.Toolkit.ButtonSpecAny[] { _CloseButton}); _NavigatorTab.ButtonSpecs[0].Tag = _NavigatorTab; _AddLogsGridViewDel = new processOnLog(AddLogsGridView); _SplitContainer = new KryptonSplitContainer(); _SplitContainer.Cursor = System.Windows.Forms.Cursors.Default; _SplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; _SplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; _SplitContainer.Location = new System.Drawing.Point(0, 0); _SplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; _SplitContainer.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalSystem; _SplitContainer.SplitterWidth = 0; _SplitContainer.SplitterDistance = 49; _SplitContainer.Panel1.Padding = new System.Windows.Forms.Padding(200, 15, 200, 15); _SplitContainer.Panel1.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalSystem; _SplitContainer.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalSystem; _SplitContainer.Panel2.PaletteMode = ComponentFactory.Krypton.Toolkit.PaletteMode.ProfessionalSystem; _SplitContainer.Panel2.Padding = new System.Windows.Forms.Padding(20, 10, 20, 20); _NavigatorTab.Controls.Add(_SplitContainer); _ComboBox = new KryptonComboBox(); _ComboBox.Dock = System.Windows.Forms.DockStyle.Fill; _SplitContainer.Panel1.Controls.Add(_ComboBox); _ComboBox.SelectedIndexChanged += new EventHandler(DisplayLogsGridView); _LogsGridViewList = new List<LogsGrid>(); }
/**************************************************************\ * Create a new tab (for editing, NORMAL mode) * * - Add the component. * * - Display the content of the xml * * - Manage the event when clicking on "Close". * \**************************************************************/ public void AddTab(String tabName, String path, string defaultMode) { KryptonPage navigatorTab = new KryptonPage(); ButtonSpecAny closeButton = new ButtonSpecAny(); XMLLoader.XMLForm XMLLoader = new XMLLoader.XMLForm(); if(defaultMode.Equals("CREATION")) { try { GC.Collect(); XMLLoader.Dock = DockStyle.Fill; XMLLoader.init(Properties.Settings.Default.interpretation_template, _ButtonHelp); XMLLoader.loadXML(path); XMLLoader.Tag = path; navigatorTab.Tag = true; navigatorTab.Controls.Add(XMLLoader); switchButtonSpec.ExtraText = "XML Mode"; EnableDisableAllProcessesButtonSpec.Enabled = ComponentFactory.Krypton.Toolkit.ButtonEnabled.True; } // If no connection, New tab (XML mode) catch (Exception ex) { var result = KryptonMessageBox.Show("Unable to access XML Template (maybe there is no network). No Creation Mode available.\n\n\n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); KryptonRichTextBox richTextBox = new KryptonRichTextBox(); richTextBox.Dock = System.Windows.Forms.DockStyle.Fill; richTextBox.Name = tabName + "RichTextBox"; richTextBox.Text = ""; richTextBox.Tag = path; navigatorTab.Tag = false; switchButtonSpec.ExtraText = "Creation Mode"; EnableDisableAllProcessesButtonSpec.Enabled = ComponentFactory.Krypton.Toolkit.ButtonEnabled.False; navigatorTab.Controls.Add(richTextBox); DisplayXml(richTextBox); } } else if (defaultMode.Equals("XML")) { KryptonRichTextBox richTextBox = new KryptonRichTextBox(); richTextBox.Dock = System.Windows.Forms.DockStyle.Fill; richTextBox.Name = tabName + "RichTextBox"; richTextBox.Text = ""; richTextBox.Tag = path; navigatorTab.Tag = false; switchButtonSpec.ExtraText = "Creation Mode"; EnableDisableAllProcessesButtonSpec.Enabled = ComponentFactory.Krypton.Toolkit.ButtonEnabled.False; navigatorTab.Controls.Add(richTextBox); DisplayXml(richTextBox); } navigatorTab.Name = tabName + "Tab"; navigatorTab.Text = tabName; closeButton.Type = ComponentFactory.Krypton.Toolkit.PaletteButtonSpecStyle.PendantClose; navigatorTab.ButtonSpecs.AddRange(new ComponentFactory.Krypton.Toolkit.ButtonSpecAny[] { closeButton}); navigatorTab.ButtonSpecs[0].Click += new EventHandler(CloseNavigatorTab); navigatorTab.ButtonSpecs[0].Tag = navigatorTab; NavigatorControl.Pages.Add(navigatorTab); }
private KryptonPage CreateNewMemo(string text, string description, string memo, bool loaded) { // Define page name and images KryptonPage page = new KryptonPage(); page.Text = text; page.TextTitle = description; page.TextDescription = description; page.ImageSmall = MemoEditor.Properties.Resources.note16; page.ImageMedium = MemoEditor.Properties.Resources.note24; page.ImageLarge = MemoEditor.Properties.Resources.note32; // Place border between page and internal controls page.Padding = new Padding(5); // Use the tag to remember if the page was loaded or is new page.Tag = loaded; // Create a close button for the page ButtonSpecAny bsa = new ButtonSpecAny(); bsa.Tag = page; bsa.Type = PaletteButtonSpecStyle.Close; bsa.Click += new EventHandler(OnClosePage); page.ButtonSpecs.Add(bsa); // We use the rich text box as the memo editor KryptonRichTextBox rtb = new KryptonRichTextBox(); rtb.StateCommon.Border.Draw = InheritBool.False; rtb.Dock = DockStyle.Fill; rtb.Text = memo; rtb.Tag = page; // Need to know when the user makes a change to the memo text rtb.TextChanged += new EventHandler(kryptonRichTextBox_TextChanged); // Add rich text box as content page.Controls.Add(rtb); return page; }