Rozklad.ButtonLinia addLabel(gtf.Routes Rout) { Rozklad.ButtonLinia L = new Rozklad.ButtonLinia(); L.Name = Rout.route_id; L.Text = Rout.route_short_name; if (Rout.route_text_color != null && Rout.route_text_color != string.Empty && Rout.route_text_color != "route_text_color") { L.ForeColor = ColorTranslator.FromHtml("#" + Rout.route_text_color); } if (Rout.route_color != null && Rout.route_color != string.Empty && Rout.route_color != "route_color") { L.BackColor = ColorTranslator.FromHtml("#" + Rout.route_color); } else { L.BackColor = Color.ForestGreen; } L.Font = new Font("Serif", 15, FontStyle.Bold); L.Width = 65; L.Height = 40; L.TextAlign = ContentAlignment.MiddleCenter; L.Margin = new Padding(5); L.linia = Rout; return(L); }
private void labelClick(object sender, EventArgs e) { Rozklad.ButtonLinia obecna = (Rozklad.ButtonLinia)sender; //MessageBox.Show(obecna.Text); kier = new Kierunki(obecna.linia, this); listaPrzystankow = new ListaPrzystankow(this); godzinyOdjazdu = new GodzinyOdjazdu(this); }
public FlowLayoutPanel F_DodajLinie(FlowLayoutPanel flow) { int i = 0; foreach (Routes R in routes) { if (R.route_id != null) { Rozklad.ButtonLinia L = addLabel(R); flow.Controls.Add(L); L.Click += new EventHandler(this.labelClick); } } return(flow); }
ButtonLinia addZona(Stops S) { ButtonLinia L = new Rozklad.ButtonLinia(); if (S.zone_id != null && S.zone_id != string.Empty && S.zone_id != "zone_id") { L.Name = S.zone_id; } else { L.Name = S.stop_id; } if (S.zone_id != null && S.zone_id != string.Empty && S.zone_id != "zone_id") { L.Text = S.zone_id; } else { L.Text = "?"; } L.ForeColor = Color.WhiteSmoke; if (S.zone_id == "A") { L.BackColor = Color.DarkGreen; } else if (S.zone_id == "B") { L.BackColor = Color.Red; } else if (S.zone_id == "C") { L.BackColor = Color.Gold; } else if (S.zone_id == null || S.zone_id == string.Empty || S.zone_id == "zone_id") { L.BackColor = Color.Black; } L.Font = new Font("Serif", 8, FontStyle.Bold); L.Width = 30; L.Height = 30; L.TextAlign = ContentAlignment.MiddleCenter; L.Margin = new Padding(5); L.przystanek = S; return(L); }
ButtonLinia addLabel(gtf.Stops S, gtf.Routes routes) { Rozklad.ButtonLinia L = new Rozklad.ButtonLinia(); L.Name = S.stop_name; L.Text = S.stop_name; L.ForeColor = Color.Black; L.BackColor = Color.Gray; L.Font = new Font("Serif", 8, FontStyle.Bold); L.Width = 270; L.Height = 30; L.TextAlign = ContentAlignment.MiddleCenter; L.Margin = new Padding(5); L.przystanek = S; return(L); }
ButtonLinia addLabel(string s, int i) { Rozklad.ButtonLinia L = new Rozklad.ButtonLinia(); L.Name = s; L.Text = s; L.ForeColor = Color.Cornsilk; L.BackColor = Color.DimGray; L.Font = new Font("Serif", 8, FontStyle.Bold); L.Width = 300; L.Height = 30; L.TextAlign = ContentAlignment.MiddleCenter; L.Margin = new Padding(5); L.i = (i + 1).ToString(); return(L); }
private void labelClick(object sender, EventArgs e) { Rozklad.ButtonLinia obecna = (Rozklad.ButtonLinia)sender; odpo = obecna.przystanek; Close(); }