public object CreateComponentRepresentation(IGuiControl control) { TabControl tc = (TabControl)control; IspisKomponenti.IspisiKartice(tc.Pages.Select(p => p.Name).ToList()); return("TabControl"); }
public IGuiControlBuilder CreateBuilder(IGuiControl control) { IGuiControlBuilder builder = null; switch (control.GetType().Name) { case "TextBox": builder = new ConsoleTextBoxBuilder(); break; case "Combobox": builder = new ConsoleComboboxBuilder(); break; case "Groupbox": builder = new ConsoleGroupboxBuilder(); break; case "Panel": builder = new ConsolePanelBuilder(); break; case "TabControl": builder = new ConsoleTabControlBuilder(); break; case "Table": builder = new ConsoleTableBuilder(); break; case "TabPage": builder = new ConsoleTabpageBuilder(); break; case "DateField": builder = new ConsoleDateFieldBuilder(); break; } if (builder != null) { return(builder); } throw new Exception(); }
public bool Focus(IGuiControl control) { FocusedControl?.InvokeFocusDeactivate(); FocusedControl = control; FocusedControl?.InvokeFocusActivate(); return(true); }
protected override void OnUpdate(GameTime gameTime) { base.OnUpdate(gameTime); var highlighted = Alex.GuiManager.FocusManager.HighlightedElement; if (_focusedControl != highlighted) { _focusedControl = highlighted; if (highlighted != null) { if (Descriptions.TryGetValue(highlighted, out var description)) { Description.Text = description; } else { Description.Text = DefaultDescription; } } else { Description.Text = DefaultDescription; } } }
public void ClearFocus(IGuiControl control) { if (FocusedControl == control) { FocusedControl?.InvokeFocusDeactivate(); FocusedControl = null; } }
public object StartTag(IGuiControl c) { TabControl tc = (TabControl)c; var kolone = tc.ChildControls.Select(p => p.Name).ToList(); PrintComponentsConsole.PrintTabs(kolone); return(""); }
public object CreateComponentRepresentation(IGuiControl control) { TabPage tp = control as TabPage; foreach (var tpChildControl in tp.ChildControls) { } return(null); }
public object CreateComponentRepresentation(IGuiControl control) { TabPage tp = control as TabPage; foreach (var tpChildControl in tp.ChildControls) { new GuiBuilderConsole().CreateBuilder(tpChildControl).CreateComponentRepresentation(tpChildControl); } return(null); }
/// <summary> /// Adds a GuiControl to the GuiController collection. /// </summary> /// <param name="control">A control to add to the form.</param> protected void AddGuiControl(IGuiControl control) { if (!controls.ContainsKey(control.ID)) { int tabIndex = 0; control.Left = 10; control.Width = this._width; if (FORM_WIDTH_OFFSET < control.Width) { control.Width = control.Width - FORM_WIDTH_OFFSET; } // If there are tabs, add this to the current tab if (this._tabs.Count > 0) { tabIndex = (this._tabs.Count - 1); if (TAB_WIDTH_OFFSET < control.Width) { control.Width = control.Width - TAB_WIDTH_OFFSET; } } ((GuiControl)control).TabStripIndex = tabIndex; GuiControl lastControl = getLastControlForTab(tabIndex); if (lastControl != null) { control.Top = lastControl.Top + lastControl.Height + 10; } else { control.Top = 10; } if (control is GuiLabel || control is GuiButton) { if (this.ForeColor != string.Empty) { control.ForeColor = this.ForeColor; } if (this.BackColor != string.Empty) { control.BackColor = this.BackColor; } } controls[control.ID] = control; orderedControls.Add(control); } else { throw new Exception("The control ID " + control.ID + " has already been taken by another control on the form."); } }
public void KreirajPredlogeKorisnickogInterfejsa() { List <IGuiControl> kontrole = new List <IGuiControl>(); foreach (var struktura in StruktureRecnika) { Console.WriteLine($"Predlog forme za unos {struktura.Naziv}:\n"); IGuiControl control = struktura.IspisiFormuZaUnos(); kontrole.Add(control); IGuiComponentsBuilder.kreirajPredlog(control as IContainer); Console.WriteLine("\n\n\n"); } }
public object CreateComponentRepresentation(IGuiControl control) { TabPage tp = control as TabPage; Console.WriteLine($"<div id=\"{control.Name}\" class=\"tabcontent\">"); foreach (var tpChildControl in tp.ChildControls) { new GuiBuilderHTML().CreateBuilder(tpChildControl).CreateComponentRepresentation(tpChildControl); } Console.WriteLine("</div>"); return(null); }
public object StartTag(IGuiControl c) { TabControl tc = (TabControl)c; Console.WriteLine("<div class=\"tab\">"); var kolone = tc.ChildControls.Select(p => p.Name).ToList(); foreach (var kolona in kolone) { Console.WriteLine($"<button class=\"tablinks\"\">{kolona}</button>"); } //IspisKomponenti.IspisiKartice(kolone); Console.WriteLine("</div>\r\n"); return(""); }
public IBuilder GetBuilder(IGuiControl control) { switch (control.GetType().Name) { case "TextBox": return(new ConsoleTextBoxBuilder()); case "Combobox": return(new ConsoleComboboxBuilder()); case "Groupbox": return(new ConsoleGroupboxBuilder()); case "Panel": return(new ConsolePanelBuilder()); case "TabControl": return(new ConsoleTabControlBuilder()); case "Table": return(new ConsoleTableBuilder()); case "Tabpage": return(new ConsoleTabpageBuilder()); } throw new Exception(); }
/// <summary> /// Adds a GuiControl to the GuiController collection. /// </summary> /// <param name="control">A control to add to the form.</param> protected void AddGuiControl(IGuiControl control) { if (!controls.ContainsKey(control.ID)) { int tabIndex = 0; control.Left = 10; control.Width = this._width; if (FORM_WIDTH_OFFSET < control.Width) { control.Width = control.Width - FORM_WIDTH_OFFSET; } // If there are tabs, add this to the current tab if (this._tabs.Count > 0) { tabIndex = (this._tabs.Count-1); if (TAB_WIDTH_OFFSET < control.Width) { control.Width = control.Width - TAB_WIDTH_OFFSET; } } ((GuiControl)control).TabStripIndex = tabIndex; GuiControl lastControl = getLastControlForTab(tabIndex); if (lastControl != null) { control.Top = lastControl.Top + lastControl.Height + 10; } else { control.Top = 10; } if (control is GuiLabel || control is GuiButton) { if (this.ForeColor != string.Empty) { control.ForeColor = this.ForeColor; } if (this.BackColor != string.Empty) { control.BackColor = this.BackColor; } } controls[control.ID] = control; orderedControls.Add(control); } else { throw new Exception("The control ID " + control.ID + " has already been taken by another control on the form."); } }
private void AddDescription(IGuiControl control, string title, string line1, string line2 = "") { Descriptions.Add(control, $"{TextColor.Bold}{title}:{TextColor.Reset}\n{line1}\n{line2}"); }
public object EndTag(IGuiControl p) { Console.WriteLine("End Panel"); return("End Panel"); }
public object CreateComponentRepresentation(IGuiControl control) { return("Table"); }
public static void MergeRow(IGuiControl row) { }
/// <summary> Sets the number of columns in the given table to the givne integer. </summary> /// <param name="Table">Table, in which the number of columns should be changed.</param> /// <param name="Value">Number of columns the table should have afterwards.</param> public static void SetTableColumnCount(IGuiControl Table, Integer Value) { }
public object CreateComponentRepresentation(IGuiControl control) { PrintComponentsConsole.PrintTable(((Table)control).Columns); return("Table"); }
public object CreateComponentRepresentation(IGuiControl control) { IspisKomponenti.IspisiTextbox(control.Name, ((TextBox)control).Required); return("TextBox"); }
public object CreateComponentRepresentation(IGuiControl control) { PrintComponentsConsole.PrintTextbox(control.Name, ((TextBox)control).Required); return("TextBox"); }
public static IGuiControl AddCell(IGuiControl row) { return null; }
public object EndTag(IGuiControl p) { return(null); }
public object CreateComponentRepresentation(IGuiControl p) { PrintComponentsConsole.PrintDateField(p.Name, ((DateField)p).Required); return(null); }
public object StartTag(IGuiControl p) { Console.WriteLine("Start Panel"); return("Start Panel"); }
public object EndTag(IGuiControl p) { //IspisKomponenti.PrintLine(); return(""); }
public static IGuiControl InsertCell(IGuiControl row, Integer Index) { return null; }
public object EndTag(IGuiControl p) { return(""); }
public object CreateComponentRepresentation(IGuiControl control) { return("Groupbox"); }
public static Integer ColumnSpan(IGuiControl Cell) { return null; }
public object CreateComponentRepresentation(IGuiControl control) { Console.WriteLine($"{control.Name} <input/>"); return("TextBox"); }
public static void MergeRow(IGuiControl row, Integer Start) { }
public object StartTag(IGuiControl p) { Console.WriteLine("<table>"); return(""); }
public static void SetColumnSpan(IGuiControl Cell, Integer Value) { }
public object EndTag(IGuiControl p) { Console.WriteLine("</table>"); return(""); }
/// <summary> Callculates the number of columns in the given table. </summary> /// <param name="Table">Table, in which the columns should be counted.</param> /// <returns>Number of columns in the given table.</returns> public static Integer TableColumnCount(IGuiControl Table) { return null; }
public object CreateComponentRepresentation(IGuiControl control) { IspisKomponenti.IspisiTabelu(((Table)control).Columns); return("Table"); }
public static IGuiControl AddRow(IGuiControl Table) { return null; }
public object StartTag(IGuiControl p) { return(""); }