mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-04 15:26:00 +02:00
Fixed issue with outer extension state change
This commit is contained in:
parent
04a93f0618
commit
c7e41a30e4
5 changed files with 116 additions and 5 deletions
87
IDE/mintest/src/base.cs
Normal file
87
IDE/mintest/src/base.cs
Normal file
|
@ -0,0 +1,87 @@
|
|||
/*using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Allegro
|
||||
{
|
||||
public partial class AllegroAPI
|
||||
{
|
||||
//internal const string AllegroDllName = "allegro_monolith-5.2.dll";
|
||||
|
||||
public static string AllegroDllVersionName(string name)
|
||||
{
|
||||
var p = (int)Environment.OSVersion.Platform;
|
||||
if ((p == 4) || (p == 6) || (p == 128))
|
||||
return name; // Linux
|
||||
|
||||
// Windows
|
||||
return name + '-' + ALLEGRO_VERSION + '.' + ALLEGRO_SUB_VERSION + ".dll";
|
||||
}
|
||||
|
||||
//private const string AllegroDllName = "allegro";
|
||||
internal const string AllegroDllName = "allegro_monolith-5.2.dll";
|
||||
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate int AppMainDelegate(int argc, string[] argv);
|
||||
|
||||
|
||||
|
||||
|
||||
public const int ALLEGRO_VERSION = 5;
|
||||
public const int ALLEGRO_SUB_VERSION = 2;
|
||||
public const int ALLEGRO_WIP_VERSION = 2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Not sure we need it, but since ALLEGRO_VERSION_STR contains it:
|
||||
/// 0 = GIT
|
||||
/// 1 = first release
|
||||
/// 2... = hotfixes?
|
||||
///
|
||||
/// Note x.y.z (= x.y.z.0) has release number 1, and x.y.z.1 has release
|
||||
/// number 2, just to confuse you.
|
||||
/// </summary>
|
||||
public const int ALLEGRO_RELEASE_NUMBER = 0;
|
||||
|
||||
public const string ALLEGRO_VERSION_STR = "5.2.2 (GIT)";
|
||||
public const string ALLEGRO_DATE_STR = "2016";
|
||||
public const int ALLEGRO_DATE = 20160731; /* yyyymmdd */
|
||||
public const int ALLEGRO_VERSION_INT =
|
||||
((ALLEGRO_VERSION << 24) | (ALLEGRO_SUB_VERSION << 16) |
|
||||
(ALLEGRO_WIP_VERSION << 8) | ALLEGRO_RELEASE_NUMBER);
|
||||
|
||||
//[DllImport(AllegroDllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
//[Import(AllegroDllName)]Cdecl)]
|
||||
public static extern UInt32 al_get_allegro_version();
|
||||
|
||||
[DllImport(AllegroDllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern int al_run_main(int argc,
|
||||
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0, ArraySubType = UnmanagedType.LPStr)]
|
||||
string[] argv, AppMainDelegate main);
|
||||
|
||||
/*******************************************/
|
||||
/************ Some global stuff ************/
|
||||
/*******************************************/
|
||||
|
||||
/// <summary>
|
||||
/// ALLEGRO_PI
|
||||
/// </summary>
|
||||
public const double ALLEGRO_PI = 3.14159265358979323846;
|
||||
|
||||
public static int AL_ID(byte a, byte b, byte c, byte d)
|
||||
{
|
||||
return (a << 24) | (b << 16) | (c << 8) | d;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static bool IsLinux
|
||||
{
|
||||
get
|
||||
{
|
||||
int p = (int) Environment.OSVersion.Platform;
|
||||
return (p == 4) || (p == 6) || (p == 128);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
|
@ -1064,6 +1064,16 @@ namespace IDE.ui
|
|||
return projectItem;
|
||||
}
|
||||
|
||||
ProjectFolder GetSelectedProjectFolder()
|
||||
{
|
||||
let projectItem = GetSelectedProjectItem();
|
||||
if (projectItem == null)
|
||||
return null;
|
||||
if (let projectFolder = projectItem as ProjectFolder)
|
||||
return projectFolder;
|
||||
return projectItem.mParentFolder;
|
||||
}
|
||||
|
||||
public void SelectItem(ListViewItem item, bool checkKeyStates = false)
|
||||
{
|
||||
if (item.Focused)
|
||||
|
@ -2145,7 +2155,7 @@ namespace IDE.ui
|
|||
item = menu.AddItem("New Folder");
|
||||
item.mOnMenuItemSelected.Add(new (item) =>
|
||||
{
|
||||
var projectFolder = GetSelectedProjectItem() as ProjectFolder;
|
||||
var projectFolder = GetSelectedProjectFolder();
|
||||
if (projectFolder != null)
|
||||
{
|
||||
if (CheckProjectModify(projectFolder.mProject))
|
||||
|
@ -2156,7 +2166,7 @@ namespace IDE.ui
|
|||
item = menu.AddItem("New Class...");
|
||||
item.mOnMenuItemSelected.Add(new (item) =>
|
||||
{
|
||||
var projectFolder = GetSelectedProjectItem() as ProjectFolder;
|
||||
var projectFolder = GetSelectedProjectFolder();
|
||||
if (projectFolder != null)
|
||||
{
|
||||
if (CheckProjectModify(projectFolder.mProject))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue