private void DrawStations(grid g) { Track t; int y = Configuration.HEADER_HEIGHT; Globals.nstations = 0; for (t = Globals.layout; t != null && Globals.nstations < 100; t = t.next) { if (!t.isstation || string.IsNullOrEmpty(t.station)) { continue; } Globals.stations[Globals.nstations++] = t; Globals.DrawTimeGrid(g, y); g.DrawText1(0, y - 10, t.station, false); g.DrawLine(Configuration.STATION_WIDTH + Configuration.KM_WIDTH, y, Configuration.STATION_WIDTH + Configuration.KM_WIDTH + 24 * 120, y, 0); y += Configuration.Y_DIST; } if (Globals.nstations == 0) { g.DrawText1(10, 10, wxPorting.L("Sorry, this feature is not available on this scenario."), false); g.DrawText1(10, 25, wxPorting.L("No station was found on the layout."), false); } }
public static void DrawTimeGrid1(grid g, int y) { int h, m; int x; string buff; x = Configuration.STATION_WIDTH1 + Configuration.KM_WIDTH1; for (h = 0; h < 24; ++h) { for (m = 0; m < 60; ++m) { if ((m % 10) != 0) { g.DrawLine( x + h * 240 + m * 4, y - 2, x + h * 240 + m * 4, y + 2, 0); } else { g.DrawLine( x + h * 240 + m * 4, 20, x + h * 240 + m * 4, 1000, m != 0 ? 1 : 0); } } } for (h = 0; h < 24; ++h) { buff = String.Format(wxPorting.T("%2d:00"), h); g.DrawText1(x + h * 240, 10, buff, false); } }
public static void DrawTimeGrid(grid g, int y) { int h, m; int x; string buff; x = Configuration.STATION_WIDTH + Configuration.KM_WIDTH; g.DrawLine(x, Configuration.HEIGHT, x + 23 * 120 + 59 * 2, Configuration.HEIGHT, 0); for (h = 0; h < 24; ++h) { for (m = 0; m < 60; ++m) { if ((m % 10) != 0) { } else { g.DrawLine( x + h * 120 + m * 2, 20, x + h * 120 + m * 2, Configuration.HEIGHT, m != 0 ? 6 : 0); } } } for (h = 0; h < 24; ++h) { buff = String.Format(wxPorting.T("%2d:00"), h); g.DrawText1(x + h * 120, 10, buff, false); } }