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

Improved ListView cursor key handling, removed debug NOPs

This commit is contained in:
Brian Fiete 2019-09-28 12:15:36 -07:00
parent 959da9884c
commit 987adaec5c
26 changed files with 87 additions and 211 deletions

View file

@ -21,11 +21,6 @@ namespace IDE
{
Debug.Assert(Thread.CurrentThread == IDEApp.sApp.mMainThread);
/*if (gApp.mMainWindow.IsKeyDown(.Control))
{
NOP!();
}*/
Debug.Assert(mOnThreadDone == null);
//mBfSystem.PerfZoneStart("BfCompiler.ThreadStart");

View file

@ -179,11 +179,6 @@ namespace IDE.Compiler
{
BfCompiler_Delete(mNativeBfCompiler);
mNativeBfCompiler = null;
if (mCommandQueue.Count > 0)
{
NOP!();
}
}
public bool Compile(BfPassInstance passInstance, String outputDirectory)
@ -556,10 +551,6 @@ namespace IDE.Compiler
{
if ([Friend]mThreadWorker.mThreadRunning)
{
/*if (gApp.mMainWindow.IsKeyDown(.Control))
{
NOP!();
}*/
if (mNativeBfCompiler != null)
BfCompiler_Cancel(mNativeBfCompiler);
}

View file

@ -89,11 +89,6 @@ namespace IDE.Compiler
mIsDisposed = true;
BfPassInstance_Delete(mNativeBfPassInstance);
mNativeBfPassInstance = null;
if (mFailed)
{
NOP!();
}
}
public bool PopOutString(String outStr)

View file

@ -52,11 +52,6 @@ namespace IDE.Compiler
public void QueueDeferredResolveAll()
{
/*if (gApp.mMainWindow.IsKeyDown(.Control))
{
NOP!();
}*/
mResolveAllWait = 2;
}
@ -134,11 +129,6 @@ namespace IDE.Compiler
public void QueueResolveCommand()
{
/*if (gApp.mMainWindow.IsKeyDown(.Control))
{
NOP!();
}*/
ResolveAllCommand command = new ResolveAllCommand();
QueueCommand(command);
}

View file

@ -480,10 +480,6 @@ namespace IDE.Debugger
{
str.Append(mSymbol);
}
else
{
NOP!();
}
}
public void ToString_HitCount(String str)

View file

@ -361,7 +361,6 @@ namespace IDE
public ~this()
{
NOP!();
}
}
@ -5380,10 +5379,6 @@ namespace IDE
if (createEditData)
{
editData = new FileEditData();
if (filePath.EndsWith("main.cs"))
{
NOP!();
}
editData.mFilePath = new String(filePath);
mFileEditData.Add(new String(fixedFilePath), editData);
}
@ -10179,11 +10174,6 @@ namespace IDE
delete pendingHandler;
}
if (expressionFlags != .None)
{
NOP!();
}
mIsImmediateDebugExprEval = false;
String evalStr = scope String();

View file

@ -75,11 +75,6 @@ namespace IDE
Windows.DisconnectNamedPipe();
}*/
if (lastError != 536)
{
NOP!();
}
if ((lastError != Windows.ERROR_PIPE_CONNECTED) && (lastError != Windows.ERROR_NO_DATA))
return;
}

View file

@ -1072,10 +1072,6 @@ namespace IDE
public ~this()
{
if ((int)(void*)this & 0xFFFF == (int)0x6180UL)
{
NOP!();
}
}
}

View file

@ -283,7 +283,6 @@ namespace IDE
public this()
{
NOP!();
}
public void Deref()
@ -294,7 +293,6 @@ namespace IDE
public ~this()
{
NOP!();
}
}

View file

@ -409,11 +409,6 @@ namespace IDE.ui
let dispWidth = g.mFont.GetWidth(selectedEntry.mEntryDisplay) + GS!(24);
float width = mWidth - GS!(16) - mAutoCompleteListWidget.mRightBoxAdjust;
if (gApp.mMainWindow.IsKeyDown(.Alt))
{
NOP!();
}
if (mAutoCompleteListWidget.mVertScrollbar != null)
width -= GS!(18);
width = Math.Max(dispWidth, width);
@ -1651,11 +1646,6 @@ namespace IDE.ui
gApp.mAutoCompletePanel.FinishBind();
SetIgnoreMove(false);
if (changedAfterInfo)
{
NOP!();
}
if ((mAutoCompleteListWidget != null) && (!mAutoCompleteListWidget.mIsInitted))
mAutoCompleteListWidget.Init();
if ((mInvokeWidget != null) && (!mInvokeWidget.mIsInitted))

View file

@ -28,7 +28,6 @@ namespace IDE.ui
public ~this()
{
NOP!();
}
}

View file

@ -534,11 +534,6 @@ namespace IDE.ui
{
checkIdx++;
if (checkIdx == 0x82)
{
NOP!();
}
line.Reference(lineStrView);
if (line.Length == 0)
break;

View file

@ -25,12 +25,7 @@ namespace IDE.ui
public ~this()
{
//Debug.Assert((mWatchSeriesInfo == null) || (mWatchSeriesInfo.mMoreButton == null));
if (mWatchSeriesInfo != null)
{
NOP!();
}
}
}
@ -47,18 +42,10 @@ namespace IDE.ui
public this(IWatchOwner watchOwner, HoverListView listView) : base(watchOwner, listView)
{
if (mHLVItemId == 8)
{
NOP!();
}
}
public ~this()
{
if (mHLVItemId == 8)
{
NOP!();
}
}
public override WatchListViewItem GetWatchListViewItemParent()
@ -204,11 +191,6 @@ namespace IDE.ui
public override void Resize(float x, float y, float width, float height)
{
if (width < mWidth)
{
NOP!();
}
base.Resize(x, y, width, height);
}
}
@ -293,17 +275,6 @@ namespace IDE.ui
public ~this()
{
//Debug.WriteLine("HoverWatch.~this {0}", this);
if (!String.IsNullOrEmpty(mOrigEvalString))
{
NOP!();
}
if (mListView != null)
{
NOP!();
}
Clear();
}
@ -948,11 +919,6 @@ namespace IDE.ui
//var font = DarkTheme.sDarkTheme.mSmallFont;
var listView = new HoverListView(this);
if (mListView != null)
{
NOP!();
}
//Debug.WriteLine("HoverWatch.CreateListView {0}", listView);
listView.mHoverWatch = this;

View file

@ -1407,6 +1407,12 @@ namespace IDE.ui
clickedItem = (DarkListViewItem)clickedItem.GetSubItem(0);
}
if (theEvent.mBtn != 0)
{
if (clickedItem.Selected)
return;
}
SelectItem(clickedItem, true);
if ((!clickedItem.IsParent) && (theEvent.mBtnCount > 1))

View file

@ -340,11 +340,6 @@ namespace IDE.ui
}
else
{
if (type.IsEnum)
{
NOP!();
}
if (mApplyAction != null)
{
mApplyAction();

View file

@ -933,11 +933,6 @@ namespace IDE.ui
public bool Classify(ResolveType resolveType, ResolveParams resolveParams = null)
{
if (resolveType == .GetFixits)
{
NOP!();
}
// Don't allow other classify calls interrupt a symbol rename
if ((IDEApp.sApp.mSymbolReferenceHelper != null) && (IDEApp.sApp.mSymbolReferenceHelper.HasStarted) && (IDEApp.sApp.mSymbolReferenceHelper.mKind == SymbolReferenceHelper.Kind.Rename))
return false;
@ -1812,10 +1807,6 @@ namespace IDE.ui
var sw = scope Stopwatch(true);
sw.Start();
bfSystem.Lock(1);
if (sw.ElapsedMicroseconds > 100)
{
NOP!();
}
bfSystem.PerfZoneEnd();
}
else
@ -1865,11 +1856,6 @@ namespace IDE.ui
parser.ClassifySource(char8Data, !mIsBeefSource);
}
if (resolveType == .Autocomplete)
{
NOP!();
}
if (!isBackground)
{
String autocompleteInfo = scope String();
@ -5225,10 +5211,7 @@ namespace IDE.ui
{
for (int i < mProcessResolveCharData.Count)
{
if (mProcessResolveCharData[i].mDisplayFlags == 1)
{
NOP!();
}
}
MarkDirty();

View file

@ -87,11 +87,6 @@ namespace IDE.ui
{
if (mHoverWatch != null)
{
if (mHoverWatch.mCloseCountdown == 1)
{
NOP!();
}
bool hasActiveHoverWatch = false;
if (mHoverWatch.mEditWidget != null)

View file

@ -24,11 +24,6 @@ namespace IDE.ui
{
if (mIsSelected != value)
{
if (!value)
{
NOP!();
}
var threadListView = (ThreadListView)mListView;
if (threadListView.mThreadPanel.mCallstackPopup != null)
threadListView.mThreadPanel.mCallstackPopup.Close();

View file

@ -50,11 +50,6 @@ namespace IDE.ui
else
isValid = gApp.mBfResolveCompiler.VerifyTypeName(editText, cursorPos);
if (isValid)
{
NOP!();
}
for (int ofs < editText.Length)
{
mEditWidgetContent.mData.mText[editOffset + ofs].mDisplayTypeId = isValid ? 0 : 1;

View file

@ -445,11 +445,6 @@ namespace IDE.ui
public DarkButton mLessButton;
public static int32 sIdx;
public int32 mSeriesId = ++sIdx;
public ~this()
{
NOP!();
}
}
public class WatchRefreshButton : ButtonWidget
@ -815,8 +810,8 @@ namespace IDE.ui
set
{
if (value)
mParent.UpdateAll();
/*if (value)
mParent.UpdateAll();*/
base.Selected = value;
}
}
@ -831,11 +826,6 @@ namespace IDE.ui
public this(IWatchOwner watchOwner, IDEListView listView)
{
if (mIdx == 670)
{
NOP!();
}
mWatchOwner = watchOwner;
}
@ -1357,7 +1347,7 @@ namespace IDE.ui
}
if ((forceDelete) ||
((wantsDelete) && (idx != 0) && (curWatchListViewItem != null) && (curWatchListViewItem.mChildAreaHeight == 0)))
((wantsDelete) && (idx != 0) && (curWatchListViewItem != null) && (curWatchListViewItem.mChildAreaHeight == 0) && (!curWatchListViewItem.mIsSelected)))
{
curMemberIdx--;
mParentItem.RemoveChildItem(curWatchListViewItem);
@ -1822,6 +1812,23 @@ namespace IDE.ui
SetupListViewItem(listViewItem, name, evalStr);
if ((parentItem != null) && (parentItem.Selected))
{
// If the parentItem is selected and the next item after the parentItem is selected then we may have a selection span
// so we want to expand that selection to the newly-created item
int parentIdx = parentItem.mParentItem.GetIndexOfChild(parentItem);
if (parentIdx + 1 < parentItem.mParentItem.mChildItems.Count)
{
let nextItem = parentItem.mParentItem.mChildItems[parentIdx + 1];
if (nextItem.Selected)
{
if ((parentItem.mChildItems.Count == 1) || (parentItem.mChildItems[parentItem.mChildItems.Count - 2].Selected))
listViewItem.Selected = true;
}
}
}
return listViewItem;
}
@ -2126,7 +2133,10 @@ namespace IDE.ui
if (btnNum == 0)
ListViewItemMouseDown(clickedItem, btnCount);
else
ListViewItemMouseDown(clickedItem, 1);
{
if (!clickedItem.GetSubItem(0).Selected)
ListViewItemMouseDown(clickedItem, 1);
}
}
void ClearWatchValues(ListViewItem parentListViewItem)
@ -2436,7 +2446,7 @@ namespace IDE.ui
}
if (memberVals.Count >= 2)
{
{
WatchListViewItem memberItem;
if (memberCount >= listViewItem.GetChildCount())
{
@ -2563,11 +2573,6 @@ namespace IDE.ui
while (curIdx < mListView.GetRoot().GetChildCount())
parentItem.RemoveChildItemAt(curIdx);
if (parentItem.GetChildCount() == 0)
{
NOP!();
}
}
}
}
@ -2755,7 +2760,7 @@ namespace IDE.ui
void WithSelected(Action<ListViewItem> func)
{
var root = listView.GetRoot();
root.WithSelectedItems(func);
root.WithSelectedItems(func, false, true);
if (clickedHoverItem != null)
func(clickedHoverItem);