public override void InitMenu() { base.InitMenu(); #region Loanee Value Field Setup LoaneeNameValue = new ColorableTextField("Type Name of Loanee...", ControlsFontColor, ControlsBorderColor, false) { ResetAfterFirstWrite = true, SelectedIndex = Vector2.Zero, TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black), EraseTextOnSelect = true }; LoaneeNameValue.BorderStyle(BorderArea.Horizontal, '~'); LoaneeNameValue.Position = new Vector2(Vector2.CenterX(LoaneeNameValue.Size.x), HeaderPosY + HeaderOffset); GetMenu.Controls.AddControl(LoaneeNameValue); #endregion #region Loanee Value Field Setup LoaneeEmailValue = new ColorableTextField("Type Email for Loanee...", ControlsFontColor, ControlsBorderColor, false) { ResetAfterFirstWrite = true, SelectedIndex = new Vector2(0, 1), TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black), EraseTextOnSelect = true }; LoaneeEmailValue.Position = new Vector2(Vector2.CenterX(LoaneeEmailValue.Size.x), LoaneeNameValue.Position.y + 3); GetMenu.Controls.AddControl(LoaneeEmailValue); #endregion #region Create Button Setup ColorableOption createButton = new ColorableOption("Create New", ControlsFontColor, ControlsBorderColor, false); createButton.Position = new Vector2(Vector2.CenterX(createButton.Size.x), LoaneeEmailValue.Position.y + 3); createButton.SelectedIndex = new Vector2(0, 2); createButton.OnSelect += CreateButtonAction; GetMenu.Controls.AddControl(createButton); #endregion #region Nav Button Setup NavButtonAction = (s) => { instance.LoaneeNameValue.Text = "Type Name of Loanee..."; instance.LoaneeEmailValue.Text = "Type Email for Loanee..."; LoaneesMenu.Instance.GetMenu.Show(); Instance.ResetSelection(); Instance.GetMenu.Show(false); }; #endregion SetupNavButton(); }
public override void InitMenu() { base.InitMenu(); #region Search By Setup searchByLabel = new ColorableOption("Search By", ControlsFontColor, ControlsBorderColor, false) { SelectedIndex = Vector2.Zero }; searchByLabel.OnSelect += SwitchSearchByButtonAction; searchByValue = new ColorableLabel("ISBN Code", ControlsFontColor, ControlsBorderColor, false) { TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black) }; searchByLabel.Position = new Vector2(Vector2.CenterX(searchByLabel.Size.x + searchByValue.Size.x), HeaderPosY + HeaderOffset); searchByValue.Position = new Vector2(searchByLabel.Position.x + searchByLabel.Size.x - 1, searchByLabel.Position.y); GetMenu.Controls.AddControl(searchByLabel); GetMenu.Controls.AddControl(searchByValue); #endregion #region Search Button Setup searchKeyValue = new ColorableTextField("Type Search key here...", ControlsFontColor, ControlsBorderColor, false) { SelectedIndex = new Vector2(0, 1), TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black), EraseTextOnSelect = true, ResetAfterFirstWrite = true }; searchKeyValue.Position = new Vector2(Vector2.CenterX(searchKeyValue.Size.x), searchByValue.Position.y + 3); searchKeyValue.OnSelect += SearchLoaneeButton; GetMenu.Controls.AddControl(searchKeyValue); #endregion #region Nav Button Setup NavButtonAction = (s) => { instance.searchKeyValue.Text = "Type Search key here..."; BooksMenu.Instance.GetMenu.Show(); Instance.ResetSelection(); Instance.GetMenu.Show(false); }; #endregion SetupNavButton(); instance.ResetSelection(); }
static void Main(string[] args) { #region Engine Setup Console.SetWindowSize(60, 30); ColorRenderer renderer = new ColorRenderer(); renderer.DefaultColor = new RenderColor(ConsoleColor.Red, ConsoleColor.Black); OiskiEngine.ChangeRenderer(renderer); OiskiEngine.Run(); #endregion RenderColor textColor = new RenderColor(ConsoleColor.Cyan, ConsoleColor.Black); RenderColor borderColor = new RenderColor(ConsoleColor.DarkBlue, ConsoleColor.Black); FitnessCalc fitness = new FitnessCalc(); Menu mainMenu = new Menu(); Menu dataMenu = new Menu(); Menu resultMenu = new Menu(); #region Main Menu #region Header ColorableLabel mainHeader = new ColorableLabel("Oiski's Fitness Calculator", textColor, borderColor, _attachToEngine: false); mainHeader.Position = new Vector2(Vector2.CenterX(mainHeader.Size.x), 5); mainMenu.Controls.AddControl(mainHeader); #endregion #region Data Menu Button ColorableOption toDataMenu = new ColorableOption("Data Collection", textColor, borderColor, _attachToEngine: false) { SelectedIndex = Vector2.Zero }; toDataMenu.Position = new Vector2(Vector2.CenterX(toDataMenu.Size.x), mainHeader.Position.y + 6); toDataMenu.BorderStyle(BorderArea.Horizontal, '~'); toDataMenu.OnSelect += (s) => { #region Hide Main Menu OiskiEngine.Input.ResetInput(); OiskiEngine.Input.ResetSlection(); s.BorderStyle(BorderArea.Horizontal, '-'); mainMenu.Show(false); #endregion dataMenu.Controls.GetSelectableControls[0].BorderStyle(BorderArea.Horizontal, '~'); dataMenu.Show(); }; mainMenu.Controls.AddControl(toDataMenu); #endregion #region Result Menu Button ColorableOption toResultMenu = new ColorableOption("Results", textColor, borderColor, _attachToEngine: false) { SelectedIndex = new Vector2(0, 1) }; toResultMenu.Position = new Vector2(Vector2.CenterX(toResultMenu.Size.x), toDataMenu.Position.y + 3); toResultMenu.OnSelect += (s) => { #region Hide Main Menu OiskiEngine.Input.ResetInput(); OiskiEngine.Input.ResetSlection(); s.BorderStyle(BorderArea.Horizontal, '-'); mainMenu.Show(false); #endregion resultMenu.Controls.GetSelectableControls[0].BorderStyle(BorderArea.Horizontal, '~'); resultMenu.Show(); }; mainMenu.Controls.AddControl(toResultMenu); #endregion #region Exit Button ColorableOption exitButton = new ColorableOption("Exit ", textColor, borderColor, _attachToEngine: false) { SelectedIndex = new Vector2(0, 2) }; exitButton.Position = new Vector2(Vector2.CenterX(exitButton.Size.x), toResultMenu.Position.y + 3); exitButton.OnSelect += (s) => { Environment.Exit(0); }; mainMenu.Controls.AddControl(exitButton); #endregion mainMenu.Show(); #endregion #region Data Menu #region Header ColorableLabel dataHeader = new ColorableLabel("Oiski's Data", textColor, borderColor, _attachToEngine: false); dataHeader.Position = new Vector2(Vector2.CenterX(dataHeader.Size.x), 5); dataMenu.Controls.AddControl(dataHeader); #endregion #region Weight decimal weight = 0; ColorableLabel weightLabel = new ColorableLabel("Weight", textColor, borderColor, _attachToEngine: false); weightLabel.Position = new Vector2(15, dataHeader.Position.y + 6); dataMenu.Controls.AddControl(weightLabel); ColorableTextField weightText = new ColorableTextField("Type Weight...", new RenderColor(ConsoleColor.Green, ConsoleColor.Black), borderColor, _attachToEngine: false) { SelectedIndex = Vector2.Zero, ResetAfterFirstWrite = false, EraseTextOnSelect = true }; weightText.Position = new Vector2(weightLabel.Position.x + weightLabel.Size.x - 1, weightLabel.Position.y); weightText.BorderStyle(BorderArea.Horizontal, '~'); weightText.OnSelect += (s) => { if (!OiskiEngine.Input.CanWrite) { if (!decimal.TryParse(weightText.Text, out weight)) { weightText.TextColor = new RenderColor(ConsoleColor.Red, ConsoleColor.Black); weightText.Text = "Invalid Input"; } } else { weightText.TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black); } }; dataMenu.Controls.AddControl(weightText); #endregion #region Resting Heart Rate int restingHeartRate = 0; ColorableLabel restingHeartRateLabel = new ColorableLabel("R-Heart Rate (BPM)", textColor, borderColor, _attachToEngine: false); restingHeartRateLabel.Position = new Vector2(15, weightLabel.Position.y + 3); dataMenu.Controls.AddControl(restingHeartRateLabel); ColorableTextField restingHeartRateText = new ColorableTextField("Type Rate...", new RenderColor(ConsoleColor.Green, ConsoleColor.Black), borderColor, _attachToEngine: false) { SelectedIndex = new Vector2(0, 1), ResetAfterFirstWrite = false, EraseTextOnSelect = true }; restingHeartRateText.Position = new Vector2(restingHeartRateLabel.Position.x + restingHeartRateLabel.Size.x - 1, restingHeartRateLabel.Position.y); restingHeartRateText.OnSelect += (s) => { if (!OiskiEngine.Input.CanWrite) { if (!int.TryParse(restingHeartRateText.Text, out restingHeartRate)) { restingHeartRateText.TextColor = new RenderColor(ConsoleColor.Red, ConsoleColor.Black); restingHeartRateText.Text = "Invalid Input"; } } else { restingHeartRateText.TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black); } }; dataMenu.Controls.AddControl(restingHeartRateText); #endregion #region Max Heart Rate int maxHeartRate = 0; ColorableLabel maxHeartRateLabel = new ColorableLabel("M-Heart Rate (BPM)", textColor, borderColor, _attachToEngine: false); maxHeartRateLabel.Position = new Vector2(15, restingHeartRateLabel.Position.y + 3); dataMenu.Controls.AddControl(maxHeartRateLabel); ColorableTextField maxHeartRateText = new ColorableTextField("Type Rate...", new RenderColor(ConsoleColor.Green, ConsoleColor.Black), borderColor, _attachToEngine: false) { SelectedIndex = new Vector2(0, 2), ResetAfterFirstWrite = false, EraseTextOnSelect = true }; maxHeartRateText.Position = new Vector2(maxHeartRateLabel.Position.x + maxHeartRateLabel.Size.x - 1, maxHeartRateLabel.Position.y); maxHeartRateText.OnSelect += (s) => { if (!OiskiEngine.Input.CanWrite) { if (!int.TryParse(maxHeartRateText.Text, out maxHeartRate)) { maxHeartRateText.TextColor = new RenderColor(ConsoleColor.Red, ConsoleColor.Black); maxHeartRateText.Text = "Invalid Input"; } } else { maxHeartRateText.TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black); } }; dataMenu.Controls.AddControl(maxHeartRateText); #endregion #region Back Button ColorableOption dataMenuBackButton = new ColorableOption("Back ", textColor, borderColor, _attachToEngine: false) { SelectedIndex = new Vector2(0, 3) }; dataMenuBackButton.Position = new Vector2(Vector2.CenterX(dataMenuBackButton.Size.x), maxHeartRateLabel.Position.y + 3); dataMenuBackButton.OnSelect += (s) => { #region Hide Data Menu OiskiEngine.Input.ResetInput(); OiskiEngine.Input.ResetSlection(); s.BorderStyle(BorderArea.Horizontal, '-'); dataMenu.Show(false); #endregion fitness.Weight = weight; fitness.RestingHeartRate = restingHeartRate; fitness.MaxHeartRate = maxHeartRate; mainMenu.Controls.GetSelectableControls[0].BorderStyle(BorderArea.Horizontal, '~'); mainMenu.Show(); }; dataMenu.Controls.AddControl(dataMenuBackButton); #endregion #endregion #region Result Menu #region Header ColorableLabel resultHeader = new ColorableLabel("Oiski's Results", textColor, borderColor, _attachToEngine: false); resultHeader.Position = new Vector2(Vector2.CenterX(resultHeader.Size.x), 5); resultMenu.Controls.AddControl(resultHeader); #endregion #region Weight ColorableLabel weightResultLabel = new ColorableLabel("Weight (kg)", textColor, borderColor, _attachToEngine: false); weightResultLabel.Position = new Vector2(10, resultHeader.Position.y + 5); resultMenu.Controls.AddControl(weightResultLabel); ColorableLabel weightResultText = new ColorableLabel(fitness.Weight.ToString(), new RenderColor(ConsoleColor.Green, ConsoleColor.Black), borderColor, _attachToEngine: false); weightResultText.Position = new Vector2(weightResultLabel.Position.x + weightResultLabel.Size.x - 1, weightResultLabel.Position.y); weightResultText.OnUpdate += (c) => { weightResultText.Text = fitness.Weight.ToString(); }; resultMenu.Controls.AddControl(weightResultText); #endregion #region Resting Heart Rate ColorableLabel restingHeartRateResultLabel = new ColorableLabel("R-Heart Rate (BPM)", textColor, borderColor, _attachToEngine: false); int positionX = weightResultLabel.Position.x + weightResultLabel.Size.x + weightResultText.Size.x + 2; restingHeartRateResultLabel.Position = new Vector2(positionX, weightResultLabel.Position.y); resultMenu.Controls.AddControl(restingHeartRateResultLabel); ColorableLabel restingHeartRateResultText = new ColorableLabel(fitness.RestingHeartRate.ToString(), new RenderColor(ConsoleColor.Green, ConsoleColor.Black), borderColor, _attachToEngine: false); restingHeartRateResultText.Position = new Vector2(restingHeartRateResultLabel.Position.x + restingHeartRateResultLabel.Size.x - 1, restingHeartRateResultLabel.Position.y); restingHeartRateResultText.OnUpdate += (c) => { restingHeartRateResultText.Text = fitness.RestingHeartRate.ToString(); }; resultMenu.Controls.AddControl(restingHeartRateResultText); #endregion #region Max Heart Rate ColorableLabel maxHeartRateResultLabel = new ColorableLabel("M-Heart Rate (BPM)", textColor, borderColor, _attachToEngine: false); maxHeartRateResultLabel.Position = new Vector2(weightResultLabel.Position.x, weightResultLabel.Position.y + 3); resultMenu.Controls.AddControl(maxHeartRateResultLabel); ColorableLabel maxHeartRateResultText = new ColorableLabel(fitness.MaxHeartRate.ToString(), new RenderColor(ConsoleColor.Green, ConsoleColor.Black), borderColor, _attachToEngine: false); maxHeartRateResultText.Position = new Vector2(maxHeartRateResultLabel.Position.x + maxHeartRateResultLabel.Size.x - 1, maxHeartRateResultLabel.Position.y); maxHeartRateResultText.OnUpdate += (c) => { maxHeartRateResultText.Text = fitness.MaxHeartRate.ToString(); }; resultMenu.Controls.AddControl(maxHeartRateResultText); #endregion #region Fitness Level ColorableLabel fitnessLabel = new ColorableLabel("Fitness Level", textColor, borderColor, _attachToEngine: false); fitnessLabel.Position = new Vector2(weightResultLabel.Position.x, restingHeartRateLabel.Position.y + 2); resultMenu.Controls.AddControl(fitnessLabel); ColorableLabel fitnessLevelText = new ColorableLabel("Error", new RenderColor(ConsoleColor.Red, ConsoleColor.Black), borderColor, _attachToEngine: false); fitnessLevelText.Position = new Vector2(fitnessLabel.Position.x + fitnessLabel.Size.x - 1, fitnessLabel.Position.y); fitnessLevelText.OnUpdate += (c) => { try { fitnessLevelText.TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black); fitnessLevelText.Text = fitness.GetFitnessLevel().ToString(); } catch (DivideByZeroException) { fitnessLevelText.TextColor = new RenderColor(ConsoleColor.Red, ConsoleColor.Black); fitnessLevelText.Text = "Error"; } }; resultMenu.Controls.AddControl(fitnessLevelText); #endregion #region VO2 Max ColorableLabel vO2Label = new ColorableLabel("VO2 Max Score", textColor, borderColor, _attachToEngine: false); vO2Label.Position = new Vector2(weightResultLabel.Position.x, fitnessLabel.Position.y + 2); resultMenu.Controls.AddControl(vO2Label); ColorableLabel vO2Text = new ColorableLabel("Error", new RenderColor(ConsoleColor.Red, ConsoleColor.Black), borderColor, _attachToEngine: false); vO2Text.Position = new Vector2(vO2Label.Position.x + vO2Label.Size.x - 1, vO2Label.Position.y); vO2Text.OnUpdate += (c) => { try { vO2Text.TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black); vO2Text.Text = $"{fitness.GetVO2Max():0.0}"; } catch (DivideByZeroException) { vO2Text.TextColor = new RenderColor(ConsoleColor.Red, ConsoleColor.Black); vO2Text.Text = "Error"; } }; resultMenu.Controls.AddControl(vO2Text); #endregion #region Back Button ColorableOption resultMenuBackButton = new ColorableOption("Back ", textColor, borderColor, _attachToEngine: false) { SelectedIndex = Vector2.Zero }; resultMenuBackButton.Position = new Vector2(Vector2.CenterX(resultMenuBackButton.Size.x), vO2Label.Position.y + 4); resultMenuBackButton.OnSelect += (s) => { #region Hide Data Menu OiskiEngine.Input.ResetInput(); OiskiEngine.Input.ResetSlection(); s.BorderStyle(BorderArea.Horizontal, '-'); resultMenu.Show(false); #endregion mainMenu.Controls.GetSelectableControls[0].BorderStyle(BorderArea.Horizontal, '~'); mainMenu.Show(); }; resultMenu.Controls.AddControl(resultMenuBackButton); #endregion #endregion }
public override void InitMenu() { base.InitMenu(); #region Book Title Value Field Setup TitleValue = new ColorableTextField("Type Title of Book...", ControlsFontColor, ControlsBorderColor, false) { ResetAfterFirstWrite = true, SelectedIndex = Vector2.Zero, TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black), EraseTextOnSelect = true }; TitleValue.BorderStyle(BorderArea.Horizontal, '~'); TitleValue.Position = new Vector2(Vector2.CenterX(TitleValue.Size.x), HeaderPosY + HeaderOffset); GetMenu.Controls.AddControl(TitleValue); #endregion #region Book Author Value Field Setup AuthorValue = new ColorableTextField("Type Author of Book...", ControlsFontColor, ControlsBorderColor, false) { ResetAfterFirstWrite = true, SelectedIndex = new Vector2(0, 1), TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black), EraseTextOnSelect = true }; AuthorValue.Position = new Vector2(Vector2.CenterX(AuthorValue.Size.x), TitleValue.Position.y + 3); GetMenu.Controls.AddControl(AuthorValue); #endregion #region Book ISBN Code Value Field Setup ISBNCodeValue = new ColorableTextField("Type ISBN Code For Book...", ControlsFontColor, ControlsBorderColor, false) { ResetAfterFirstWrite = true, SelectedIndex = new Vector2(0, 2), TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black), EraseTextOnSelect = true }; ISBNCodeValue.Position = new Vector2(Vector2.CenterX(ISBNCodeValue.Size.x), AuthorValue.Position.y + 3); GetMenu.Controls.AddControl(ISBNCodeValue); #endregion #region Book Category Value Field Setup CategoryValue = new ColorableTextField("Type Category for Book...", ControlsFontColor, ControlsBorderColor, false) { ResetAfterFirstWrite = true, SelectedIndex = new Vector2(0, 3), TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black), EraseTextOnSelect = true }; CategoryValue.Position = new Vector2(Vector2.CenterX(CategoryValue.Size.x), ISBNCodeValue.Position.y + 3); GetMenu.Controls.AddControl(CategoryValue); #endregion #region Create Button Setup ColorableOption createButton = new ColorableOption("Create New", ControlsFontColor, ControlsBorderColor, false); createButton.Position = new Vector2(Vector2.CenterX(createButton.Size.x), CategoryValue.Position.y + 3); createButton.SelectedIndex = new Vector2(0, 4); createButton.OnSelect += CreateButtonAction; GetMenu.Controls.AddControl(createButton); #endregion #region Nav Button Setup NavButtonAction = (s) => { instance.TitleValue.Text = "Type Title of Book..."; instance.TitleValue.EraseTextOnSelect = true; instance.AuthorValue.Text = "Type Author of Book..."; instance.AuthorValue.EraseTextOnSelect = true; instance.ISBNCodeValue.Text = "Type ISBN Code For Book..."; instance.ISBNCodeValue.EraseTextOnSelect = true; instance.CategoryValue.Text = "Type Category For Book..."; instance.CategoryValue.EraseTextOnSelect = true; BooksMenu.Instance.GetMenu.Show(); Instance.ResetSelection(); Instance.GetMenu.Show(false); }; #endregion SetupNavButton(); }
/// <summary> /// Initiate the <see cref="Menu"/> <see cref="Control"/>s. (<strong>NOTE:</strong> should only be called once to avoid duplicate <see cref="Control"/>s) /// </summary> public override void InitMenu() { base.InitMenu(); #region Author Setup authorLabel = new ColorableLabel("Author", ControlsFontColor, ControlsBorderColor, false); authorText = new ColorableLabel(string.Empty, ControlsFontColor, ControlsBorderColor, false); #region Setting the controls to be center authorLabel.Position = new Vector2(Vector2.CenterX(authorLabel.Size.x + authorText.Size.x), HeaderPosY + HeaderOffset); authorText.Position = new Vector2(authorLabel.Position.x + authorLabel.Size.x - 1, authorLabel.Position.y); authorText.TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black); #endregion GetMenu.Controls.AddControl(authorLabel); GetMenu.Controls.AddControl(authorText); #endregion #region ISBN Code Setup isbnCodeLabel = new ColorableLabel("ISBN Code", ControlsFontColor, ControlsBorderColor, false); isbnCodeText = new ColorableLabel(string.Empty, ControlsFontColor, ControlsBorderColor, false) { TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black) }; #region Setting Controls to be Center isbnCodeLabel.Position = new Vector2(Vector2.CenterX(isbnCodeLabel.Size.x + isbnCodeText.Size.x), authorLabel.Position.y + 3); isbnCodeText.Position = new Vector2(isbnCodeLabel.Position.x + isbnCodeLabel.Size.x - 1, isbnCodeLabel.Position.y); #endregion GetMenu.Controls.AddControl(isbnCodeLabel); GetMenu.Controls.AddControl(isbnCodeText); #endregion #region Category Setup categoryLabel = new ColorableLabel("Category", ControlsFontColor, ControlsBorderColor, false); categoryText = new ColorableLabel(string.Empty, ControlsFontColor, ControlsBorderColor, false) { TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black) }; #region Setting Controls to be Center categoryLabel.Position = new Vector2(Vector2.CenterX(categoryLabel.Size.x + categoryText.Size.x), isbnCodeText.Position.y + 3); categoryText.Position = new Vector2(categoryLabel.Position.x + categoryLabel.Size.x - 1, categoryLabel.Position.y); Console.WriteLine(categoryLabel.Position); Console.WriteLine(categoryText.Position); #endregion GetMenu.Controls.AddControl(categoryLabel); GetMenu.Controls.AddControl(categoryText); #endregion #region Status Setup statusLabel = new ColorableLabel("Status", ControlsFontColor, ControlsBorderColor, false); statusText = new ColorableLabel(string.Empty, ControlsFontColor, ControlsBorderColor, false) { TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black) }; #region Setting Controls to be Center statusLabel.Position = new Vector2(Vector2.CenterX(statusLabel.Size.x + statusText.Size.x), categoryText.Position.y + 3); statusText.Position = new Vector2(statusLabel.Position.x + statusLabel.Size.x - 1, statusLabel.Position.y); #endregion GetMenu.Controls.AddControl(statusLabel); GetMenu.Controls.AddControl(statusText); #endregion #region Day of Lending Setup dolLabel = new ColorableLabel("DOL", ControlsFontColor, ControlsBorderColor, false); dolText = new ColorableLabel(string.Empty, ControlsFontColor, ControlsBorderColor, false) { TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black) }; #region Setting Controls to be Center dolLabel.Position = new Vector2(Vector2.CenterX(dolLabel.Size.x + dolText.Text.Length + 2), statusText.Position.y + 3); dolText.Position = new Vector2(dolLabel.Position.x + dolLabel.Size.x - 1, dolLabel.Position.y); #endregion GetMenu.Controls.AddControl(dolLabel); GetMenu.Controls.AddControl(dolText); #endregion #region Borrow Book Button ColorableOption borrowButton = new ColorableOption("Borrow Book", ControlsFontColor, ControlsBorderColor, false) { SelectedIndex = new Vector2(0, 1) }; borrowButton.Position = new Vector2(Vector2.CenterX(borrowButton.Size.x), dolText.Position.y + 3); borrowButton.OnSelect += BorrowButtonAction; loaneeEmail = new ColorableTextField("Type Loanee Email Here...", ControlsFontColor, ControlsBorderColor, false) { EraseTextOnSelect = true, ResetAfterFirstWrite = true, SelectedIndex = Vector2.Zero, TextColor = new RenderColor(ConsoleColor.Green, ConsoleColor.Black) }; loaneeEmail.Position = new Vector2(borrowButton.Position.x + borrowButton.Size.x + 1, borrowButton.Position.y + 2); GetMenu.Controls.AddControl(borrowButton); GetMenu.Controls.AddControl(loaneeEmail); #endregion #region Return Book Button ColorableOption returnButton = new ColorableOption("Return Book", ControlsFontColor, ControlsBorderColor, false) { SelectedIndex = new Vector2(0, 2) }; returnButton.Position = new Vector2(Vector2.CenterX(returnButton.Size.x), borrowButton.Position.y + 3); returnButton.OnSelect += ReturnBookButtonAction; GetMenu.Controls.AddControl(returnButton); #endregion #region Remove Button Setup ColorableOption removeButton = new ColorableOption("Remove Book", ControlsFontColor, ControlsBorderColor, false) { SelectedIndex = new Vector2(0, 3) }; removeButton.Position = new Vector2(Vector2.CenterX(removeButton.Size.x), returnButton.Position.y + 3); removeButton.OnSelect += RemoveBookButtonAction; GetMenu.Controls.AddControl(removeButton); #endregion #region Nav Button Setup NavButtonAction = (s) => { BooksMenu.Instance.GetMenu.Show(); ResetSelection(); GetMenu.Show(false); instance.loaneeEmail.Text = "Type Loanee Email Here..."; instance.loaneeEmail.EraseTextOnSelect = true; }; SetupNavButton(); #endregion ResetSelection(); }