public Tutorial(int x) { self = this; textList[0] = tut13Text; textList[1] = tut14Text; textList[2] = tut15Text; textList[3] = tut16Text; textList[4] = tut17Text; textList[5] = tut18Text; textList[6] = ""; if (x == 0) { readFile(); } }
/// <summary> /// Main page for Sentence Building /// </summary> public MainPage() { InitializeComponent(); for (int i = 0; i < GlobalData.subjects[(int)time].Count; i++) { Button temp = new Button { Text = GlobalData.subjects[(int)time][i].GetName(), FontSize = 34 }; AbsoluteLayout.SetLayoutBounds(temp, new Rectangle(0.2 * ((3 * i) + 1), 0.5, 0.35, 0.9)); AbsoluteLayout.SetLayoutFlags(temp, AbsoluteLayoutFlags.All); temp.Clicked += (s, e) => Handle_Subject(s, e); topFlex.Children.Add(temp); } text.FontSize = 28; text.Text = ""; self = this; tut = new Tutorial(0); }
/// <summary> /// When user presses a custom conclusion button /// Only call from XAML /// </summary> /// <param name="se"></param> /// <param name="ee"></param> void Handle_CustomConclusion(object se, EventArgs ee) { string str = (se as Button).Text; string tut = ""; customConclusionHolder = Customization.GetItem(str); string sentence = subjectHolder.GetName() + " " + emotionHolder.GetName() + " " + customConclusionHolder.GetConjunction() + " " + customConclusionHolder.GetConclusion() + (subjectHolder.GetName().ToLower().StartsWith("i") ? "." : "?"); text.FontSize = CalculateFontSize(sentence); text.Text = sentence; if (keepTut) { tut = "Your full sentence is displayed here:\r\n"; Tutorial.self.tutSetPageTwo(se, ee, tutFiveText, 0.1, 0.05); topFlex.IsEnabled = false; BackButton.IsEnabled = true; } DisplayAlert("Sentence", tut + subjectHolder.GetName() + " " + emotionHolder.GetName() + " " + customConclusionHolder.GetConjunction() + " " + customConclusionHolder.GetConclusion() + (subjectHolder.GetName().ToLower().StartsWith("i") ? "." : "?"), "OK"); canGoBack = true; }
/// <summary> /// Main page for Help Me /// </summary> public HelpMe(bool tutStart) { InitializeComponent(); string tempS; Color tempColor = Color.Gray; for (int i = 0; i < emotions.Count(); i++) { tempS = emotions[i]; //tempS is a String that is an emotion, but it is in uppercase tempColor = GlobalData.GetColor(tempS); StackLayout col = new StackLayout { Padding = 4, BackgroundColor = tempColor }; Button temp = new Button { Text = tempS, BackgroundColor = Color.FromRgb(200, 150, 200), Padding = 4, FontSize = 22 }; AbsoluteLayout.SetLayoutBounds(temp, new Rectangle(0.5 * (i % 3), (0.7 * (i / 3)) + 0.15, 0.25, 0.35)); AbsoluteLayout.SetLayoutFlags(temp, AbsoluteLayoutFlags.All); AbsoluteLayout.SetLayoutBounds(col, new Rectangle(0.5 * (i % 3), (0.7 * (i / 3)) + 0.15, 0.3, 0.35)); AbsoluteLayout.SetLayoutFlags(col, AbsoluteLayoutFlags.All); temp.Clicked += (s, e) => Handle_Emotion(s, e); col.Children.Add(temp); topFlex.Children.Add(col); } text.FontSize = 28; text.Text = ""; tut = new Tutorial(1); if (tutStart) { setTutorialVisible(tutStart); } self = this; }