Example #1
0
        public object CreateComponentRepresentation(IGuiControl control)
        {
            TabControl tc = (TabControl)control;

            IspisKomponenti.IspisiKartice(tc.Pages.Select(p => p.Name).ToList());
            return("TabControl");
        }
Example #2
0
        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();
        }
Example #3
0
 public bool Focus(IGuiControl control)
 {
     FocusedControl?.InvokeFocusDeactivate();
     FocusedControl = control;
     FocusedControl?.InvokeFocusActivate();
     return(true);
 }
Example #4
0
        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;
                }
            }
        }
Example #5
0
 public void ClearFocus(IGuiControl control)
 {
     if (FocusedControl == control)
     {
         FocusedControl?.InvokeFocusDeactivate();
         FocusedControl = null;
     }
 }
Example #6
0
        public object StartTag(IGuiControl c)
        {
            TabControl tc     = (TabControl)c;
            var        kolone = tc.ChildControls.Select(p => p.Name).ToList();

            PrintComponentsConsole.PrintTabs(kolone);
            return("");
        }
Example #7
0
        public object CreateComponentRepresentation(IGuiControl control)
        {
            TabPage tp = control as TabPage;

            foreach (var tpChildControl in tp.ChildControls)
            {
            }
            return(null);
        }
Example #8
0
        public object CreateComponentRepresentation(IGuiControl control)
        {
            TabPage tp = control as TabPage;

            foreach (var tpChildControl in tp.ChildControls)
            {
                new GuiBuilderConsole().CreateBuilder(tpChildControl).CreateComponentRepresentation(tpChildControl);
            }
            return(null);
        }
Example #9
0
        /// <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.");
            }
        }
Example #10
0
        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");
            }
        }
Example #11
0
        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.");
			}
		}
Example #15
0
 private void AddDescription(IGuiControl control, string title, string line1, string line2 = "")
 {
     Descriptions.Add(control, $"{TextColor.Bold}{title}:{TextColor.Reset}\n{line1}\n{line2}");
 }
Example #16
0
 public object EndTag(IGuiControl p)
 {
     Console.WriteLine("End Panel");
     return("End Panel");
 }
Example #17
0
 public object CreateComponentRepresentation(IGuiControl control)
 {
     return("Table");
 }
Example #18
0
 public static void MergeRow(IGuiControl row) { }
Example #19
0
 /// <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) { }
Example #20
0
 public object CreateComponentRepresentation(IGuiControl control)
 {
     PrintComponentsConsole.PrintTable(((Table)control).Columns);
     return("Table");
 }
Example #21
0
 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");
 }
Example #23
0
 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);
 }
Example #26
0
 public object StartTag(IGuiControl p)
 {
     Console.WriteLine("Start Panel");
     return("Start Panel");
 }
 public object EndTag(IGuiControl p)
 {
     //IspisKomponenti.PrintLine();
     return("");
 }
Example #28
0
 public static IGuiControl InsertCell(IGuiControl row, Integer Index) { return null; }
Example #29
0
 public object EndTag(IGuiControl p)
 {
     return("");
 }
Example #30
0
 public object CreateComponentRepresentation(IGuiControl control)
 {
     return("Groupbox");
 }
Example #31
0
 public static Integer ColumnSpan(IGuiControl Cell) { return null; }
Example #32
0
 public object CreateComponentRepresentation(IGuiControl control)
 {
     Console.WriteLine($"{control.Name} <input/>");
     return("TextBox");
 }
Example #33
0
 public static void MergeRow(IGuiControl row, Integer Start) { }
Example #34
0
 public object StartTag(IGuiControl p)
 {
     Console.WriteLine("<table>");
     return("");
 }
Example #35
0
 public static void SetColumnSpan(IGuiControl Cell, Integer Value) { }
Example #36
0
 public object EndTag(IGuiControl p)
 {
     Console.WriteLine("</table>");
     return("");
 }
Example #37
0
 /// <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; }
Example #38
0
 public object CreateComponentRepresentation(IGuiControl control)
 {
     IspisKomponenti.IspisiTabelu(((Table)control).Columns);
     return("Table");
 }
Example #39
0
 public static IGuiControl AddRow(IGuiControl Table) { return null; }
Example #40
0
 public object StartTag(IGuiControl p)
 {
     return("");
 }