Skip to content

Commit 45f00ca

Browse files
committed
Automatic merge of T1.5.1-1083-g7ca36e39f1 and 20 pull requests
- Pull request #891 at 9a1d6b2: Auto save - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #969 at 9d53199: Bugfix refocus to the main window when opening the map window - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #922 at a3bc9e7: Autopilot for timetable mode - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 9dabe97: Downloading route content (Github, zip) - Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #885 at 9c6c13f: feat: Add notifications to Menu - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #946 at 91a03af: Advanced track sounds - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #954 at f837ffd: Multiple Track Profiles & Superelevation Improvements - Pull request #968 at a88cb26: Initial build of adding track section identifier for rack railway
22 parents 4fce9f7 + 7ca36e3 + 9a1d6b2 + 2452cb0 + 9d53199 + d00beb9 + 8f695a4 + 1f5ba4c + a3bc9e7 + a519452 + 46d0472 + 6fa5eed + c27f32d + 9dabe97 + dfc715e + f92de76 + 9c6c13f + 5866028 + 91a03af + 8347095 + f837ffd + a88cb26 commit 45f00ca

File tree

2 files changed

+24
-51
lines changed

2 files changed

+24
-51
lines changed

Source/Menu/MainForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void CheckForUpdate()
324324
}
325325

326326
// Event raised by Retry button in NotificationPages so user can retry updates following an error notification.
327-
public event EventHandler CheckUpdatesAgain;
327+
//public event EventHandler CheckUpdatesAgain;
328328

329329
public virtual void OnCheckUpdatesAgain(EventArgs e)
330330
{

Source/Menu/Notifications/NotificationPage.cs

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -21,81 +21,36 @@
2121
using System.Drawing;
2222
using System.Windows.Forms;
2323
using ORTS.Updater;
24-
using static System.Net.Mime.MediaTypeNames;
25-
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
2624
using Button = System.Windows.Forms.Button;
2725
using Image = System.Drawing.Image;
2826

2927
namespace ORTS
3028
{
3129
public class NotificationPage
3230
{
33-
34-
3531
public List<NDetail> NDetailList = new List<NDetail>();
3632
public Dictionary<int, NButtonControl> ButtonDictionary = new Dictionary<int, NButtonControl>();
3733
public Panel Panel;
3834
private MainForm MainForm; // Needed so the Retry button can raise an event which the form can catch.
3935
public List<Control> ControlList = new List<Control>();
4036

4137
public NotificationPage(MainForm mainForm, Panel panel, Image nextImage, Image previousImage, Image firstImage, Image lastImage, string pageCount,
42-
bool previousVisible, bool firstVisible, bool nextVisible, bool lastVisisble)
38+
bool previousVisible, bool firstVisible, bool nextVisible, bool lastVisible)
4339
{
4440
MainForm = mainForm;
4541
Panel = panel;
4642
NButtonControl.ButtonCount = 0;
4743

48-
var nextPageControl = new Button { Margin = new Padding(0), Text = "", FlatStyle = FlatStyle.Flat };
49-
nextPageControl.Left = panel.ClientSize.Width - 25;
50-
nextPageControl.Top = 0;
51-
nextPageControl.Width = 20;
52-
nextPageControl.Anchor = AnchorStyles.Top | AnchorStyles.Left;
53-
nextPageControl.FlatAppearance.BorderSize = 0;
54-
nextPageControl.BackgroundImageLayout = ImageLayout.Center;
55-
nextPageControl.BackgroundImage = nextImage;
56-
nextPageControl.Visible = nextVisible;
44+
var nextPageControl = new Arrow(panel, nextImage, nextVisible, true, 25);
5745
nextPageControl.Click += new EventHandler(MainForm.Next_Click);
58-
//ControlList.Add(nextPageControl);
5946
Panel.Controls.Add(nextPageControl);
6047

61-
var previousPageControl = new Button { Margin = new Padding(0), Text = "", FlatStyle = FlatStyle.Flat };
62-
previousPageControl.Left = panel.ClientSize.Width - 90;
63-
previousPageControl.Top = 0;
64-
previousPageControl.Width = 20;
65-
previousPageControl.Anchor = AnchorStyles.Top | AnchorStyles.Left;
66-
previousPageControl.FlatAppearance.BorderSize = 0;
67-
previousPageControl.BackgroundImageLayout = ImageLayout.Center;
68-
previousPageControl.BackgroundImage = previousImage;
69-
previousPageControl.Visible = previousVisible;
48+
var previousPageControl = new Arrow(panel, previousImage, previousVisible, true, 90);
7049
previousPageControl.Click += new EventHandler(MainForm.Previous_Click);
71-
//ControlList.Add(previousPageControl);
7250
Panel.Controls.Add(previousPageControl);
7351

74-
var lastPageControl = new Button { Margin = new Padding(0), Text = "", FlatStyle = FlatStyle.Flat };
75-
lastPageControl.Left = panel.ClientSize.Width - 25;
76-
lastPageControl.Top = 0;
77-
lastPageControl.Width = 20;
78-
lastPageControl.Anchor = AnchorStyles.Top | AnchorStyles.Left;
79-
lastPageControl.FlatAppearance.BorderSize = 0;
80-
lastPageControl.BackgroundImageLayout = ImageLayout.Center;
81-
lastPageControl.BackgroundImage = lastImage;
82-
lastPageControl.Visible = lastVisisble;
83-
lastPageControl.Enabled = false;
84-
//ControlList.Add(lastPageControl);
85-
Panel.Controls.Add(lastPageControl);
86-
87-
var firstPageControl = new Button { Margin = new Padding(0), Text = "", FlatStyle = FlatStyle.Flat };
88-
firstPageControl.Left = panel.ClientSize.Width - 90;
89-
firstPageControl.Top = 0;
90-
firstPageControl.Width = 20;
91-
firstPageControl.Anchor = AnchorStyles.Top | AnchorStyles.Left;
92-
firstPageControl.FlatAppearance.BorderSize = 0;
93-
firstPageControl.BackgroundImageLayout = ImageLayout.Center;
94-
firstPageControl.BackgroundImage = firstImage;
95-
firstPageControl.Visible = firstVisible;
96-
firstPageControl.Enabled = false;
97-
//ControlList.Add(firstPageControl);
98-
Panel.Controls.Add(firstPageControl);
52+
Panel.Controls.Add( new Arrow(panel, lastImage, lastVisible, false, 25));
53+
Panel.Controls.Add( new Arrow(panel, firstImage, firstVisible, false, 90));
9954

10055
var pageCountControl = new Label
10156
{
@@ -110,6 +65,24 @@ public NotificationPage(MainForm mainForm, Panel panel, Image nextImage, Image p
11065
Panel.Controls.Add(pageCountControl);
11166
}
11267

68+
public class Arrow : Button {
69+
public Arrow(Panel panel, Image image, bool visible, bool enabled, int indentRight)
70+
{
71+
Margin = new Padding(0);
72+
Text = "";
73+
FlatStyle = FlatStyle.Flat;
74+
Left = panel.ClientSize.Width - indentRight;
75+
Top = 0;
76+
Width = 20;
77+
Anchor = AnchorStyles.Top | AnchorStyles.Left;
78+
FlatAppearance.BorderSize = 0;
79+
BackgroundImageLayout = ImageLayout.Center;
80+
BackgroundImage = image;
81+
Visible = visible;
82+
Enabled = enabled;
83+
}
84+
}
85+
11386
public class NDetail
11487
{
11588
public static readonly int TopPadding = 20;

0 commit comments

Comments
 (0)