private void gombokPeldanyositasa() { gombJatekStart = new Gomb(); gombOnlineMod = new Gomb(); gombBeallitasok = new Gomb(); gombKilepes = new Gomb(); }
public void Gombnyomas(Gomb k) { switch (k) { case Gomb.Le: Lepes(); break; case Gomb.Fel: while (Elfer(MozgoBlock, X, Y + 1)) { Lepes(); } Lepes(); break; case Gomb.Jobbra: if (X < Jatekter.GetUpperBound(0) - MozgoBlock.GetUpperBound(0) && Elfer(MozgoBlock, X + 1, Y)) { X++; } break; case Gomb.Balra: if (X > 0 && Elfer(MozgoBlock, X - 1, Y)) { X--; } break; } }
private void button_CheckedChange(object sender, bool e) { Debug.WriteLine("nyomi"); Gomb mostNyomi = (Gomb)sender; foreach (Gomb button in listButtons) { if (button.Id == mostNyomi.Id) { button.myIschecked = true; } else { button.myIschecked = false; } } }
public FGombok() { InitializeComponent(); myLayout.Margin = new Thickness(10, 0, 10, 0); var myScroll = new ScrollView(); var myStack = new StackLayout(); myStack.VerticalOptions = LayoutOptions.FillAndExpand; myStack.HorizontalOptions = LayoutOptions.FillAndExpand; myScroll.Content = myStack; //myLayout.Children.Add(myScroll); Label kerdes = new Label(); kerdes.Text = Constans.aktQuestion.question_title; kerdes.FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)); myStack.Children.Add(kerdes); //myLayout.Children.Add(kerdes); int mostIndex = 0; foreach (var item in Constans.aktQuestion.choices) { mostIndex++; Gomb button = new Gomb { Text = item, FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)), BackgroundColor = Color.Transparent }; int padding = Convert.ToInt16(Constans.ScreenWidth / 7); button.Padding = new Thickness(padding, 0, padding, 0); listButtons.Add(button); if (mostIndex == Constans.aktQuestion.choices.Count) { button.Isuccso = true; } else { button.Isuccso = false; } //button.CheckedChange += Button_CheckedChange1; button.CheckedChange += button_CheckedChange; //button.CheckedChange += button_Clicked; /*Thickness margin = new Thickness(); * margin.Bottom = -10; * margin.Top = -0; * margin.Left= 0; * margin.Right = 0; * Frame fr = new Frame * { * OutlineColor = Color.Black, * BackgroundColor = Color.Aqua, * HorizontalOptions = LayoutOptions.Center, * VerticalOptions = LayoutOptions.Center, * CornerRadius = 10, * Margin = margin, * Content = button, * Content = new Label * { * Text = "I've been framed!", * FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), * FontAttributes = FontAttributes.Italic, * TextColor = Color.Blue * } * };*/ myStack.Children.Add(button); } myLayout.Children.Add(myScroll); }