1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-06 16:25:59 +02:00

Allow clicking on reg in mem window, other minor fixes

This commit is contained in:
Brian Fiete 2019-12-25 12:43:45 -08:00
parent 4dcd7f9c6a
commit 2618b29daa
13 changed files with 96 additions and 32 deletions

View file

@ -25,7 +25,7 @@ OtherLinkFlags = ""
TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE_d"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib"
DebugCommandArguments = "-workspace=C:\\Proj\\CycloBuddy"
DebugCommandArguments = "-proddir=C:\\proj\\CycloBuddy"
DebugWorkingDirectory = "c:\\Beef\\IDE\\Tests\\EmptyTest"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]
@ -49,7 +49,7 @@ OtherLinkFlags = ""
TargetDirectory = "$(WorkspaceDir)/dist"
TargetName = "BeefIDE_d2"
OtherLinkFlags = "$(LinkFlags) Comdlg32.lib kernel32.lib user32.lib advapi32.lib shell32.lib IDEHelper64_d.lib BeefySysLib64_d.lib wsock32.lib"
DebugCommandArguments = "-proddir=C:\\Beef\\IDEHelper\\Tests"
DebugCommandArguments = "-proddir=C:\\Beef\\ide\\mintest"
DebugWorkingDirectory = "$(ProjectDir)\\dist"
EnvironmentVars = ["_NO_DEBUG_HEAP=1"]

View file

@ -216,36 +216,23 @@ namespace Hey.Dude.Bro
}
}
public static void Florgs()
{
}
public static int Main(String[] args)
{
Int i = (.)123;
i = i + i;
function void() func = => Florgs;
int32 val = (int32)(int)(void*)func;
Zangles zang = scope .();
//void* ptr = "Hey";
//val = (int32)ptr;
Zangles.GetMe(zang, "hey");
TypeCode tc = .Boolean;
PrintF("Hey\n");
//Test2(1, 2, 3, 4);
/*IHashable ih = (int32)TypeCode.Boolean;
let hashCode = ih.GetHashCode();*/
Object obj = new Object();
int* iPtr = scope .();
int hash = GetHash(iPtr);
//Test2(1, 2, 3, 4);
//Test2(1, 2, val, 4);
Blurg.Hey();
return 1;
}
@ -334,3 +321,10 @@ static
static int gApsings = 123;
}
/*namespace zSquarf
{
class Zorf
{
}
}*/

View file

@ -1,3 +1,5 @@
//using Squarf;
//GORB
#pragma warning disable 168
@ -6,10 +8,19 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
enum EnumA
{
Abo = 1,
Boop = _*2,
Croop = _*2,
}
struct Blurg
{
public static int32 Hey()
{
int a = 123;
int* aPtr = &a;
return (int32)123;
}

View file

@ -4282,7 +4282,7 @@ namespace IDE
return result;
}
public void RecordHistoryLocation(bool includeLastActive = false, bool b = true)
public void RecordHistoryLocation(bool includeLastActive = false)
{
var sourceViewPanel = GetActiveSourceViewPanel(includeLastActive);
if (sourceViewPanel != null)

View file

@ -495,6 +495,7 @@ namespace IDE.ui
public uint32 mDisplayColor;
public bool mIsReg;
public bool mIsVisible;
public Rect? mDrawRect;
public this(BinaryDataWidget binaryDataWidget, StringView expr, int memStart, int size, StringView displayName, uint32 displayColor, bool isReg)
{
@ -861,6 +862,9 @@ namespace IDE.ui
{
base.Draw(g);
for (var te in mTrackedExprs)
te.mDrawRect = null;
int barThickness = (int)GS!(1.5f);
/*
@ -1429,6 +1433,8 @@ namespace IDE.ui
}
}
for (var kvp in trackedRegYDict)
{
var te = kvp.key;
@ -1441,6 +1447,9 @@ namespace IDE.ui
var useFont = IDEApp.sApp.mTinyCodeFont;
float strWidth = useFont.GetWidth(te.mExpr);
bool shortLine = trackedRegYShortLines[lineIdx];
var useLineSpacing = useFont.GetLineSpacing();
te.mDrawRect = Rect(barX, barY, strWidth + GS!(2), useLineSpacing + GS!(2));
if (te.mDisplayName.StartsWith("$"))
continue;
@ -1448,7 +1457,6 @@ namespace IDE.ui
using (g.PushColor(te.mDisplayColor))
{
var regsOnThisLine = trackedRegsByLine[lineIdx].Count;
var useLineSpacing = useFont.GetLineSpacing();
float barYAdj = barY + useLineSpacing*0.5f + GS!(1);
float barGoalYAdj = barGoalY + useLineSpacing*0.5f + GS!(1);
if (regsOnThisLine == 2)
@ -1699,6 +1707,18 @@ namespace IDE.ui
var selection = GetSelectionForDisplayPosition(x, y, 1, 1);
if (selection == null)
{
for (var te in mTrackedExprs)
{
if ((var rect = te.mDrawRect) && (rect.Contains(x, y)))
{
SelectRange(te.mCurValue, 0);
break;
}
}
}
if (selection != null)
{
delete mCurKeyCursor;

View file

@ -687,7 +687,9 @@ namespace IDE.ui
if (folder.mIncludeKind != .Auto)
folder.mProject.SetChanged();
gApp.RecordHistoryLocation(true);
gApp.ShowProjectItem(projectSource);
gApp.RecordHistoryLocation(true);
}
int CompareListViewItem(ListViewItem left, ListViewItem right)