1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Added type icon to code mouseovers

This commit is contained in:
Brian Fiete 2020-09-03 09:31:22 -07:00
parent 0347f997f2
commit 70c7067bb0
5 changed files with 57 additions and 16 deletions

View file

@ -720,9 +720,19 @@ namespace IDE.ui
String val = scope String();
if (evalString.StartsWith(":", StringComparison.Ordinal))
{
useListViewItem.Label = scope String(evalString, 1);
var showString = scope String(evalString, 1);
int crPos = showString.IndexOf('\n');
if (crPos != -1)
{
val.Append("\n\n");
val.Append(showString, crPos + 1);
showString.RemoveToEnd(crPos);
}
useListViewItem.Label = showString;
isStringLiteral = true;
/*int lineCount = 0;
for (int i = 0; i < evalString.Length; i++)
if (evalString[i] == '\n')
@ -758,7 +768,8 @@ namespace IDE.ui
}
var vals = scope List<StringView>(val.Split('\n'));
String.NewOrSet!(valueSubItem.mLabel, vals[0]);
//if (!vals[0].IsEmpty)
String.NewOrSet!(valueSubItem.mLabel, vals[0]);
if (vals[0] == "!sideeffects")
{
if (useListViewItem.mWatchRefreshButton == null)
@ -787,7 +798,7 @@ namespace IDE.ui
else
valueSubItem.mFailed = false;
if (vals.Count > 1)
if ((vals.Count > 1) && (!vals[1].IsEmpty))
String.NewOrSet!(watch.mResultTypeStr, vals[1]);
else
DeleteAndNullify!(watch.mResultTypeStr);
@ -804,6 +815,7 @@ namespace IDE.ui
watch.mCanEdit = false;
watch.mLanguage = .NotSet;
watch.mMemoryBreakpointAddr = 0;
DeleteAndNullify!(watch.mEditInitialize);
DeleteAndNullify!(watch.mAction);
for (int32 memberIdx = 0; memberIdx < cmdStringCount; memberIdx++)
@ -1073,9 +1085,11 @@ namespace IDE.ui
bool hadMembers = false;
bool hasLeftIcon = false;
bool hasRightValues = false;
listView.mLabelX = GS!(40);
float childHeights = 0;
bool hadLeftIcon = false;
for (WatchListViewItem listViewItem in listView.GetRoot().mChildItems)
{
childHeights += listViewItem.mSelfHeight + listViewItem.mChildAreaHeight + listViewItem.mBottomPadding;
@ -1110,15 +1124,20 @@ namespace IDE.ui
checkValueWidth += GS!(16);
valueWidth = Math.Max(valueWidth, checkValueWidth);
if (!listViewItem.mSubItems[1].mLabel.IsEmpty)
hasRightValues = true;
if (listViewItem.mWatchEntry.mResultType != WatchResultType.None)
hadLeftIcon = true;
hasLeftIcon = true;
}
if (!hadMembers)
listView.mLabelX -= GS!(14);
if (!hadLeftIcon)
if (!hasRightValues)
{
listView.mLabelX -= GS!(4);
if (hasLeftIcon)
listView.mLabelX += GS!(4);
else
listView.mLabelX -= GS!(4);
listView.mShowColumnGrid = false;
}

View file

@ -22,11 +22,12 @@ namespace IDE.ui
Float = 4,
MM128 = 8,
Object = 0x10,
Pointer = 0x20,
TypeClass = 0x40,
TypeValueType = 0x80,
Namespace = 0x100,
Text = 0x200
Interface = 0x20,
Pointer = 0x40,
TypeClass = 0x80,
TypeValueType = 0x100,
Namespace = 0x200,
Text = 0x400
}
public class WatchEntry
@ -92,6 +93,9 @@ namespace IDE.ui
case "int":
mResultType |= WatchResultType.Int;
return true;
case "interface":
mResultType |= WatchResultType.Interface;
return true;
case "float":
mResultType |= WatchResultType.Float;
return true;
@ -1193,6 +1197,10 @@ namespace IDE.ui
{
imageIdx = .Type_Class;
}
else if (mWatchEntry.mResultType.HasFlag(WatchResultType.Interface))
{
imageIdx = .Interface;
}
else if (mWatchEntry.mResultType.HasFlag(WatchResultType.TypeValueType))
{
imageIdx = .Type_ValueType;