Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get rid of obsolete warning when compiling GUI, partially fix scale 1…
…/2 not working
- Loading branch information
1 parent
dad908c
commit 8ee32ba
Showing
12 changed files
with
87 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
Copyright 2015 MCGalaxy | ||
Dual-licensed under the Educational Community License, Version 2.0 and | ||
the GNU General Public License, Version 3 (the "Licenses"); you may | ||
not use this file except in compliance with the Licenses. You may | ||
obtain a copy of the Licenses at | ||
http://www.opensource.org/licenses/ecl2.php | ||
http://www.gnu.org/licenses/gpl-3.0.html | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the Licenses are distributed on an "AS IS" | ||
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
or implied. See the Licenses for the specific language governing | ||
permissions and limitations under the Licenses. | ||
*/ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Windows.Forms; | ||
|
||
namespace MCGalaxy.Gui | ||
{ | ||
/// <summary> Shortcuts for MessageBox.Show </summary> | ||
public static class Popup | ||
{ | ||
public static void Message(string message, string title = "") { | ||
MessageBox.Show(message, title); | ||
} | ||
|
||
public static void Error(string message) { | ||
MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
|
||
public static void Warning(string message) { | ||
MessageBox.Show(message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); | ||
} | ||
|
||
public static bool OKCancel(string message, string title) { | ||
return MessageBox.Show(message, title, MessageBoxButtons.OKCancel, | ||
MessageBoxIcon.Warning) == DialogResult.OK; | ||
} | ||
|
||
public static bool YesNo(string message, string title) { | ||
return MessageBox.Show(message, title, MessageBoxButtons.YesNo, | ||
MessageBoxIcon.Question) == DialogResult.Yes; | ||
} | ||
} | ||
|
||
public static class GuiUtils | ||
{ | ||
/// <summary> Opens the given url in the system's default web browser </summary> | ||
/// <remarks> Catches and logs any unhandled errors </remarks> | ||
public static void OpenBrowser(string url) { | ||
try { | ||
Process.Start(url); | ||
} catch (Exception ex) { | ||
Logger.LogError("Opening url in browser", ex); | ||
Popup.Error("Failed to open " + url); | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters