mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-15 14:54:09 +02:00
IDE ui issues
Fixed an autocomplete issue with path edits Made renaming symbols aware of file/project locking Fixed saving of Settings after running test Fixed async autocomplete update when not terminated with ')'
This commit is contained in:
parent
faa1dbd45e
commit
ff610742c5
7 changed files with 141 additions and 96 deletions
|
@ -243,6 +243,7 @@ namespace IDE
|
||||||
public bool mStepOverExternalFiles;
|
public bool mStepOverExternalFiles;
|
||||||
|
|
||||||
public bool mRunningTestScript;
|
public bool mRunningTestScript;
|
||||||
|
public bool mStartedWithTestScript;
|
||||||
public bool mExitWhenTestScriptDone = true;
|
public bool mExitWhenTestScriptDone = true;
|
||||||
public ScriptManager mScriptManager = new ScriptManager() ~ delete _;
|
public ScriptManager mScriptManager = new ScriptManager() ~ delete _;
|
||||||
public TestManager mTestManager;
|
public TestManager mTestManager;
|
||||||
|
@ -564,7 +565,7 @@ namespace IDE
|
||||||
public ~this()
|
public ~this()
|
||||||
{
|
{
|
||||||
#if !CLI
|
#if !CLI
|
||||||
if (!mRunningTestScript)
|
if (!mStartedWithTestScript)
|
||||||
{
|
{
|
||||||
mSettings.Save();
|
mSettings.Save();
|
||||||
SaveDefaultLayoutData();
|
SaveDefaultLayoutData();
|
||||||
|
@ -1424,6 +1425,8 @@ namespace IDE
|
||||||
{
|
{
|
||||||
if (tabWidget.mContent is SourceViewPanel)
|
if (tabWidget.mContent is SourceViewPanel)
|
||||||
continue;
|
continue;
|
||||||
|
if (tabWidget.mContent is DisassemblyPanel)
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
using (data.CreateObject())
|
using (data.CreateObject())
|
||||||
|
@ -2083,7 +2086,9 @@ namespace IDE
|
||||||
if ((loadUserData) && (!mRunningTestScript))
|
if ((loadUserData) && (!mRunningTestScript))
|
||||||
{
|
{
|
||||||
if (!LoadWorkspaceUserData())
|
if (!LoadWorkspaceUserData())
|
||||||
|
{
|
||||||
CreateDefaultLayout();
|
CreateDefaultLayout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkspaceLoaded();
|
WorkspaceLoaded();
|
||||||
|
@ -2094,6 +2099,8 @@ namespace IDE
|
||||||
|
|
||||||
ShowPanel(mOutputPanel, false);
|
ShowPanel(mOutputPanel, false);
|
||||||
mMainFrame.RehupSize();
|
mMainFrame.RehupSize();
|
||||||
|
|
||||||
|
ShowStartupFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CloseWorkspaceAndSetupNew()
|
void CloseWorkspaceAndSetupNew()
|
||||||
|
@ -6303,7 +6310,7 @@ namespace IDE
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mWorkspace.mDir = fullDir;
|
mWorkspace.mDir = fullDir;
|
||||||
case "-open":
|
case "-path":
|
||||||
String.NewOrSet!(mDeferredOpenFileName, value);
|
String.NewOrSet!(mDeferredOpenFileName, value);
|
||||||
if (mDeferredOpenFileName.EndsWith(".bfdbg", .OrdinalIgnoreCase))
|
if (mDeferredOpenFileName.EndsWith(".bfdbg", .OrdinalIgnoreCase))
|
||||||
mDeferredOpen = .DebugSession;
|
mDeferredOpen = .DebugSession;
|
||||||
|
@ -9421,6 +9428,27 @@ namespace IDE
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShowStartupFile()
|
||||||
|
{
|
||||||
|
if (mWorkspace.mStartupProject != null)
|
||||||
|
{
|
||||||
|
bool didShow = false;
|
||||||
|
|
||||||
|
mWorkspace.mStartupProject.WithProjectItems(scope [&] (item) =>
|
||||||
|
{
|
||||||
|
if (didShow)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((item.mName.Equals("main.bf", .OrdinalIgnoreCase)) ||
|
||||||
|
(item.mName.Equals("program.bf", .OrdinalIgnoreCase)))
|
||||||
|
{
|
||||||
|
ShowProjectItem(item, false);
|
||||||
|
didShow = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void CreateDefaultLayout()
|
public void CreateDefaultLayout()
|
||||||
{
|
{
|
||||||
//TODO:
|
//TODO:
|
||||||
|
@ -9526,6 +9554,8 @@ namespace IDE
|
||||||
{
|
{
|
||||||
scope AutoBeefPerf("IDEApp.Init");
|
scope AutoBeefPerf("IDEApp.Init");
|
||||||
|
|
||||||
|
mStartedWithTestScript = mRunningTestScript;
|
||||||
|
|
||||||
mCommands.Init();
|
mCommands.Init();
|
||||||
EnableGCCollect = mEnableGCCollect;
|
EnableGCCollect = mEnableGCCollect;
|
||||||
|
|
||||||
|
@ -9765,6 +9795,7 @@ namespace IDE
|
||||||
|
|
||||||
ShowPanel(mOutputPanel, false);
|
ShowPanel(mOutputPanel, false);
|
||||||
UpdateRecentFileMenuItems();
|
UpdateRecentFileMenuItems();
|
||||||
|
ShowStartupFile();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1258,11 +1258,6 @@ namespace IDE.ui
|
||||||
else if (char8Data.mChar == ')')
|
else if (char8Data.mChar == ')')
|
||||||
{
|
{
|
||||||
openDepth--;
|
openDepth--;
|
||||||
if (openDepth == 0)
|
|
||||||
{
|
|
||||||
mInvokeSrcPositions.Add(checkIdx);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if ((char8Data.mChar == ',') && (openDepth == 1))
|
else if ((char8Data.mChar == ',') && (openDepth == 1))
|
||||||
{
|
{
|
||||||
|
@ -1271,6 +1266,12 @@ namespace IDE.ui
|
||||||
}
|
}
|
||||||
else if (!((char8)char8Data.mChar).IsWhiteSpace)
|
else if (!((char8)char8Data.mChar).IsWhiteSpace)
|
||||||
HadContent();
|
HadContent();
|
||||||
|
|
||||||
|
if (openDepth == 0)
|
||||||
|
{
|
||||||
|
mInvokeSrcPositions.Add(checkIdx);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (char8Data.mDisplayPassId != (.)SourceElementType.Comment)
|
else if (char8Data.mDisplayPassId != (.)SourceElementType.Comment)
|
||||||
{
|
{
|
||||||
|
@ -1487,11 +1488,6 @@ namespace IDE.ui
|
||||||
//if (selectString == null)
|
//if (selectString == null)
|
||||||
if (changedAfterInfo)
|
if (changedAfterInfo)
|
||||||
{
|
{
|
||||||
if (curString == "Hey")
|
|
||||||
{
|
|
||||||
NOP!();
|
|
||||||
}
|
|
||||||
|
|
||||||
mAutoCompleteListWidget.mSelectIdx = -1;
|
mAutoCompleteListWidget.mSelectIdx = -1;
|
||||||
|
|
||||||
if ((curString.Length == 0) && (!mIsMember) && (mInvokeSrcPositions == null))
|
if ((curString.Length == 0) && (!mIsMember) && (mInvokeSrcPositions == null))
|
||||||
|
@ -1923,6 +1919,7 @@ namespace IDE.ui
|
||||||
infoSections[i].ToString(str);
|
infoSections[i].ToString(str);
|
||||||
mInvokeSrcPositions.Add(int32.Parse(str));
|
mInvokeSrcPositions.Add(int32.Parse(str));
|
||||||
}
|
}
|
||||||
|
Debug.WriteLine("Invoke size: {}", mInvokeSrcPositions.Count);
|
||||||
}
|
}
|
||||||
case "invokeLeftParen":
|
case "invokeLeftParen":
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,7 @@ using Beefy.theme;
|
||||||
|
|
||||||
namespace IDE.ui
|
namespace IDE.ui
|
||||||
{
|
{
|
||||||
public class NewProjectDialog : DarkDialog
|
public class NewProjectDialog : IDEDialog
|
||||||
{
|
{
|
||||||
public PathEditWidget mDirectoryEdit;
|
public PathEditWidget mDirectoryEdit;
|
||||||
public EditWidget mNameEdit;
|
public EditWidget mNameEdit;
|
||||||
|
@ -25,8 +25,9 @@ namespace IDE.ui
|
||||||
public bool mDirChanged;
|
public bool mDirChanged;
|
||||||
public String mDirBase ~ delete _;
|
public String mDirBase ~ delete _;
|
||||||
|
|
||||||
public this() : base("Create New Project", "")
|
public this()
|
||||||
{
|
{
|
||||||
|
mTitle = new String("Create New Project");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void CalcSize()
|
public override void CalcSize()
|
||||||
|
@ -68,7 +69,7 @@ namespace IDE.ui
|
||||||
if (!isNameValid)
|
if (!isNameValid)
|
||||||
{
|
{
|
||||||
mNameEdit.SetFocus();
|
mNameEdit.SetFocus();
|
||||||
app.Fail("Invalid project name. The project name can only consist of alphanumeric char8acters, spaces, dashes, and underscores.");
|
app.Fail("Invalid project name. The project name can only consist of alphanumeric characters, spaces, dashes, and underscores.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ namespace IDE.ui
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
mEditWidgetContent.mTextInsets.mRight += GS!(20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,9 +210,10 @@ namespace IDE.ui
|
||||||
public override void Resize(float x, float y, float width, float height)
|
public override void Resize(float x, float y, float width, float height)
|
||||||
{
|
{
|
||||||
base.Resize(x, y, width, height);
|
base.Resize(x, y, width, height);
|
||||||
|
let btnSize = (int)(height - GS!(4));
|
||||||
if (mBrowseButton != null)
|
if (mBrowseButton != null)
|
||||||
{
|
{
|
||||||
mBrowseButton.Resize(mWidth - DarkTheme.sUnitSize - GS!(2), GS!(2), DarkTheme.sUnitSize, DarkTheme.sUnitSize);
|
mBrowseButton.Resize(mWidth - btnSize - GS!(2), GS!(2), btnSize, btnSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
public FileEditData mFileEditData;
|
public FileEditData mFileEditData;
|
||||||
public List<ReplaceSpan> mSpans = new List<ReplaceSpan>() ~ delete _;
|
public List<ReplaceSpan> mSpans = new List<ReplaceSpan>() ~ delete _;
|
||||||
|
public bool mIsLocked;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum BackgroundKind
|
enum BackgroundKind
|
||||||
|
@ -65,6 +66,7 @@ namespace IDE.ui
|
||||||
String mReplaceStr = new String() ~ delete _;
|
String mReplaceStr = new String() ~ delete _;
|
||||||
String mOrigReplaceStr = new String() ~ delete _;
|
String mOrigReplaceStr = new String() ~ delete _;
|
||||||
String mModifiedParsers ~ delete _;
|
String mModifiedParsers ~ delete _;
|
||||||
|
bool mRenameHadChange;
|
||||||
bool mIgnoreTextChanges;
|
bool mIgnoreTextChanges;
|
||||||
bool mTextChanged;
|
bool mTextChanged;
|
||||||
int32 mStartIdx;
|
int32 mStartIdx;
|
||||||
|
@ -289,7 +291,6 @@ namespace IDE.ui
|
||||||
bool wantsLine = false;
|
bool wantsLine = false;
|
||||||
|
|
||||||
var editWidgetContent = editData.mEditWidget.mEditWidgetContent;
|
var editWidgetContent = editData.mEditWidget.mEditWidgetContent;
|
||||||
|
|
||||||
for (int32 idx < editWidgetContent.mData.mTextLength)
|
for (int32 idx < editWidgetContent.mData.mTextLength)
|
||||||
{
|
{
|
||||||
char8 c = editWidgetContent.mData.mText[idx].mChar;
|
char8 c = editWidgetContent.mData.mText[idx].mChar;
|
||||||
|
@ -437,6 +438,23 @@ namespace IDE.ui
|
||||||
replaceSymbolData.mFileEditData = editData;
|
replaceSymbolData.mFileEditData = editData;
|
||||||
//replaceSymbolData.mProjectSource = projectSource;
|
//replaceSymbolData.mProjectSource = projectSource;
|
||||||
|
|
||||||
|
if (mKind == .Rename)
|
||||||
|
{
|
||||||
|
if (let sourceEditWidgetContent = editData.mEditWidget.mEditWidgetContent as SourceEditWidgetContent)
|
||||||
|
{
|
||||||
|
if (sourceEditWidgetContent.mSourceViewPanel != null)
|
||||||
|
{
|
||||||
|
replaceSymbolData.mIsLocked = sourceEditWidgetContent.mSourceViewPanel.IsReadOnly;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var projectSource in editData.mProjectSources)
|
||||||
|
{
|
||||||
|
if (projectSource.mProject.mLocked)
|
||||||
|
replaceSymbolData.mIsLocked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var spanData = parserData.GetNext().Get().Split(' ');
|
var spanData = parserData.GetNext().Get().Split(' ');
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (true)
|
while (true)
|
||||||
|
@ -507,22 +525,31 @@ namespace IDE.ui
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mIgnoreTextChanges = true;
|
mIgnoreTextChanges = true;
|
||||||
//var bfSystem = IDEApp.sApp.mBfResolveSystem;
|
|
||||||
//var bfCompiler = IDEApp.sApp.mBfResolveCompiler;
|
|
||||||
|
|
||||||
String prevReplaceStr = scope String();
|
String prevReplaceStr = scope String();
|
||||||
prevReplaceStr.Set(mReplaceStr);
|
prevReplaceStr.Set(mReplaceStr);
|
||||||
|
|
||||||
GlobalUndoData globalUndoData = null;
|
|
||||||
if (mKind == Kind.Rename)
|
|
||||||
globalUndoData = IDEApp.sApp.mGlobalUndoManager.CreateUndoData();
|
|
||||||
|
|
||||||
int32 strLenDiff = (int32)(mNewReplaceStr.Length - mReplaceStr.Length);
|
int32 strLenDiff = (int32)(mNewReplaceStr.Length - mReplaceStr.Length);
|
||||||
mReplaceStr.Set(mNewReplaceStr);
|
mReplaceStr.Set(mNewReplaceStr);
|
||||||
|
|
||||||
|
var activeSourceEditWidgetContent = (SourceEditWidgetContent)mSourceViewPanel.mEditWidget.Content;
|
||||||
|
|
||||||
String newStr = mReplaceStr;
|
String newStr = mReplaceStr;
|
||||||
bool didUndo = false;
|
bool didUndo = false;
|
||||||
|
|
||||||
|
if (mKind == .Rename)
|
||||||
|
{
|
||||||
|
if (!mRenameHadChange)
|
||||||
|
{
|
||||||
|
if (newStr != mOrigReplaceStr)
|
||||||
|
mRenameHadChange = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobalUndoData globalUndoData = null;
|
||||||
|
if (mKind == Kind.Rename)
|
||||||
|
globalUndoData = IDEApp.sApp.mGlobalUndoManager.CreateUndoData();
|
||||||
|
|
||||||
List<int32> cursorPositions = scope List<int32>();
|
List<int32> cursorPositions = scope List<int32>();
|
||||||
for (var replaceSymbolData in mUpdatingProjectSources)
|
for (var replaceSymbolData in mUpdatingProjectSources)
|
||||||
{
|
{
|
||||||
|
@ -537,19 +564,24 @@ namespace IDE.ui
|
||||||
cursorPositions.Add((int32)sourceEditWidgetContent.CursorTextPos);
|
cursorPositions.Add((int32)sourceEditWidgetContent.CursorTextPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
var sourceEditWidgetContent = (SourceEditWidgetContent)mSourceViewPanel.mEditWidget.Content;
|
var prevSelection = activeSourceEditWidgetContent.mSelection;
|
||||||
var prevSelection = sourceEditWidgetContent.mSelection;
|
|
||||||
|
|
||||||
for (int sourceIdx = 0; sourceIdx < mUpdatingProjectSources.Count; sourceIdx++)
|
for (int sourceIdx = 0; sourceIdx < mUpdatingProjectSources.Count; sourceIdx++)
|
||||||
{
|
{
|
||||||
var replaceSymbolData = mUpdatingProjectSources[sourceIdx];
|
var replaceSymbolData = mUpdatingProjectSources[sourceIdx];
|
||||||
|
if (replaceSymbolData.mIsLocked)
|
||||||
|
continue;
|
||||||
|
|
||||||
var editData = replaceSymbolData.mFileEditData;
|
var editData = replaceSymbolData.mFileEditData;
|
||||||
if (editData.mEditWidget == null)
|
if (editData.mEditWidget == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (var projectSource in editData.mProjectSources)
|
if ((mKind == Kind.Rename) && (mRenameHadChange))
|
||||||
{
|
{
|
||||||
projectSource.HasChangedSinceLastCompile = true;
|
for (var projectSource in editData.mProjectSources)
|
||||||
|
{
|
||||||
|
projectSource.HasChangedSinceLastCompile = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 cursorPos = cursorPositions[sourceIdx];
|
int32 cursorPos = cursorPositions[sourceIdx];
|
||||||
|
@ -591,7 +623,8 @@ namespace IDE.ui
|
||||||
int32 spanStart = replaceSymbolData.mSpans[i].mSpanStart + idxOffset;
|
int32 spanStart = replaceSymbolData.mSpans[i].mSpanStart + idxOffset;
|
||||||
int32 spanLen = replaceSymbolData.mSpans[i].mSpanLength;
|
int32 spanLen = replaceSymbolData.mSpans[i].mSpanLength;
|
||||||
|
|
||||||
if (mKind == Kind.Rename)
|
if ((mKind == Kind.Rename) &&
|
||||||
|
((mRenameHadChange) || (editWidgetContent == activeSourceEditWidgetContent)))
|
||||||
{
|
{
|
||||||
editWidgetContent.CursorTextPos = spanStart;
|
editWidgetContent.CursorTextPos = spanStart;
|
||||||
var deleteCharAction = new EditWidgetContent.DeleteCharAction(editWidgetContent, 0, spanLen);
|
var deleteCharAction = new EditWidgetContent.DeleteCharAction(editWidgetContent, 0, spanLen);
|
||||||
|
@ -631,10 +664,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
if ((mUpdateTextCount == 0) && (mKind == Kind.Rename))
|
if ((mUpdateTextCount == 0) && (mKind == Kind.Rename))
|
||||||
{
|
{
|
||||||
sourceEditWidgetContent.mSelection = prevSelection;
|
activeSourceEditWidgetContent.mSelection = prevSelection;
|
||||||
//var sourceEditWidgetContent = (SourceEditWidgetContent)mSourceViewPanel.mEditWidget.Content;
|
|
||||||
//sourceEditWidgetContent.CursorTextPos = mEndIdx;
|
|
||||||
//sourceEditWidgetContent.mSelection = EditSelection(mStartIdx, mEndIdx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mUpdateTextCount++;
|
mUpdateTextCount++;
|
||||||
|
@ -680,7 +710,6 @@ namespace IDE.ui
|
||||||
|
|
||||||
for (var replaceSymbolData in mUpdatingProjectSources)
|
for (var replaceSymbolData in mUpdatingProjectSources)
|
||||||
{
|
{
|
||||||
//var editData = IDEApp.sApp.GetEditData(replaceSymbolData.mProjectSource, true);
|
|
||||||
var editData = replaceSymbolData.mFileEditData;
|
var editData = replaceSymbolData.mFileEditData;
|
||||||
if (editData.mEditWidget == null)
|
if (editData.mEditWidget == null)
|
||||||
continue;
|
continue;
|
||||||
|
@ -690,7 +719,6 @@ namespace IDE.ui
|
||||||
editWidgetContent.mData.mText[i].mDisplayFlags &= 0xFF ^ (uint8)(SourceElementFlags.SymbolReference);
|
editWidgetContent.mData.mText[i].mDisplayFlags &= 0xFF ^ (uint8)(SourceElementFlags.SymbolReference);
|
||||||
}
|
}
|
||||||
|
|
||||||
//var projectSource = replaceSymbolData.mProjectSource;
|
|
||||||
using (gApp.mMonitor.Enter())
|
using (gApp.mMonitor.Enter())
|
||||||
editData.SetSavedData(null, IdSpan());
|
editData.SetSavedData(null, IdSpan());
|
||||||
var app = IDEApp.sApp;
|
var app = IDEApp.sApp;
|
||||||
|
@ -718,7 +746,9 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
for (var replaceSymbolData in mUpdatingProjectSources)
|
for (var replaceSymbolData in mUpdatingProjectSources)
|
||||||
{
|
{
|
||||||
//var editData = IDEApp.sApp.GetEditData(replaceSymbolData.mProjectSource, true);
|
if (replaceSymbolData.mIsLocked)
|
||||||
|
continue;
|
||||||
|
|
||||||
var editData = replaceSymbolData.mFileEditData;
|
var editData = replaceSymbolData.mFileEditData;
|
||||||
var editWidgetContent = editData.mEditWidget.Content;
|
var editWidgetContent = editData.mEditWidget.Content;
|
||||||
|
|
||||||
|
@ -833,9 +863,32 @@ namespace IDE.ui
|
||||||
if (mKind == Kind.ShowFileReferences)
|
if (mKind == Kind.ShowFileReferences)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
int symCount = 0;
|
||||||
|
int readOnlyRefCount = 0;
|
||||||
|
int lockedFileCount = 0;
|
||||||
|
if (mUpdatingProjectSources != null)
|
||||||
|
{
|
||||||
|
for (var replaceSymbolData in mUpdatingProjectSources)
|
||||||
|
{
|
||||||
|
symCount += replaceSymbolData.mSpans.Count;
|
||||||
|
if (replaceSymbolData.mIsLocked)
|
||||||
|
{
|
||||||
|
lockedFileCount++;
|
||||||
|
readOnlyRefCount += replaceSymbolData.mSpans.Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float boxHeight = mHeight - GS!(8);
|
||||||
|
|
||||||
|
if (lockedFileCount > 0)
|
||||||
|
{
|
||||||
|
boxHeight += GS!(14);
|
||||||
|
}
|
||||||
|
|
||||||
base.Draw(g);
|
base.Draw(g);
|
||||||
using (g.PushColor(0xFFFFFFFF))
|
using (g.PushColor((lockedFileCount == 0) ? 0xFFFFFFFF : 0xFFF0B0B0))
|
||||||
g.DrawBox(DarkTheme.sDarkTheme.GetImage(DarkTheme.ImageIdx.Menu), 0, 0, mWidth - GS!(8), mHeight - GS!(8));
|
g.DrawBox(DarkTheme.sDarkTheme.GetImage(DarkTheme.ImageIdx.Menu), 0, 0, mWidth - GS!(8), boxHeight);
|
||||||
|
|
||||||
using (g.PushColor(0xFFE0E0E0))
|
using (g.PushColor(0xFFE0E0E0))
|
||||||
{
|
{
|
||||||
|
@ -865,18 +918,20 @@ namespace IDE.ui
|
||||||
|
|
||||||
if (mUpdatingProjectSources != null)
|
if (mUpdatingProjectSources != null)
|
||||||
{
|
{
|
||||||
int symCount = 0;
|
|
||||||
for (var replaceSymbolData in mUpdatingProjectSources)
|
|
||||||
{
|
|
||||||
symCount += replaceSymbolData.mSpans.Count;
|
|
||||||
}
|
|
||||||
|
|
||||||
g.SetFont(DarkTheme.sDarkTheme.mSmallFont);
|
g.SetFont(DarkTheme.sDarkTheme.mSmallFont);
|
||||||
var drawString = scope String();
|
var drawString = scope String();
|
||||||
drawString.AppendF("{0} {1} in {2} {3}",
|
drawString.AppendF("{0} {1} in {2} {3}",
|
||||||
symCount, (symCount == 1) ? "reference" : "references",
|
symCount, (symCount == 1) ? "reference" : "references",
|
||||||
mUpdatingProjectSources.Count, (mUpdatingProjectSources.Count == 1) ? "file" : "files");
|
mUpdatingProjectSources.Count, (mUpdatingProjectSources.Count == 1) ? "file" : "files");
|
||||||
g.DrawString(drawString, GS!(8), GS!(22), FontAlign.Centered, mWidth - GS!(8) - GS!(16));
|
g.DrawString(drawString, GS!(8), GS!(22), FontAlign.Centered, mWidth - GS!(8) - GS!(16));
|
||||||
|
|
||||||
|
if (lockedFileCount > 0)
|
||||||
|
{
|
||||||
|
g.SetFont(DarkTheme.sDarkTheme.mSmallBoldFont);
|
||||||
|
using (g.PushColor(((mUpdateCnt > 200) || (mUpdateCnt / 10 % 2 == 0)) ? 0xFFFF7070 : 0xFFFFB0B0))
|
||||||
|
g.DrawString(scope String()..AppendF("{} {} LOCKED!", lockedFileCount, (lockedFileCount == 1) ? "FILE" : "FILES"),
|
||||||
|
GS!(8), GS!(38), FontAlign.Centered, mWidth - GS!(8) - GS!(16));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,31 +968,6 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mReplaceStr == "") && (mUpdatingProjectSources != null))
|
|
||||||
{
|
|
||||||
for (int32 sourceIdx = 0; sourceIdx < mUpdatingProjectSources.Count; sourceIdx++)
|
|
||||||
{
|
|
||||||
var replaceSymbolData = mUpdatingProjectSources[sourceIdx];
|
|
||||||
|
|
||||||
int32 idxOffset = 0;
|
|
||||||
for (int32 i = 0; i < replaceSymbolData.mSpans.Count; i++)
|
|
||||||
{
|
|
||||||
int32 spanStart = replaceSymbolData.mSpans[i].mSpanStart + idxOffset;
|
|
||||||
int32 spanLen = replaceSymbolData.mSpans[i].mSpanLength;
|
|
||||||
|
|
||||||
if ((index == spanStart) && (spanLen == 0))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*if (hadSel)
|
|
||||||
{
|
|
||||||
Update();
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SourcePreRemoveText(SourceEditWidgetContent sourceEditWidgetContent, int index, int length)
|
public void SourcePreRemoveText(SourceEditWidgetContent sourceEditWidgetContent, int index, int length)
|
||||||
|
@ -971,29 +1001,6 @@ namespace IDE.ui
|
||||||
|
|
||||||
if (mSkipNextUpdate)
|
if (mSkipNextUpdate)
|
||||||
{
|
{
|
||||||
/*string newStr = mReplaceStr;
|
|
||||||
for (int sourceIdx = 0; sourceIdx < mUpdatingProjectSources.Count; sourceIdx++)
|
|
||||||
{
|
|
||||||
var replaceSymbolData = mUpdatingProjectSources[sourceIdx];
|
|
||||||
var projectSource = replaceSymbolData.mProjectSource;
|
|
||||||
var editData = IDEApp.sApp.GetEditData(replaceSymbolData.mProjectSource);
|
|
||||||
var editWidgetContent = editData.mEditWidget.Content;
|
|
||||||
|
|
||||||
int idxOffset = 0;
|
|
||||||
for (int i = 0; i < replaceSymbolData.mSpans.Count; i++)
|
|
||||||
{
|
|
||||||
int spanStart = replaceSymbolData.mSpans[i].mSpanStart + idxOffset;
|
|
||||||
int spanLen = replaceSymbolData.mSpans[i].mSpanLength;
|
|
||||||
|
|
||||||
for (int attrIdx = spanStart; attrIdx < spanStart + newStr.Length; attrIdx++)
|
|
||||||
{
|
|
||||||
editWidgetContent.mText[attrIdx].mDisplayFlags |= (byte)(SourceElementFlags.SymbolReference);
|
|
||||||
}
|
|
||||||
|
|
||||||
idxOffset += newStr.Length - spanLen;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
mSkipNextUpdate = false;
|
mSkipNextUpdate = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4373,7 +4373,9 @@ namespace IDE.ui
|
||||||
|
|
||||||
public void RenameSymbol()
|
public void RenameSymbol()
|
||||||
{
|
{
|
||||||
ShowSymbolReferenceHelper(SymbolReferenceHelper.Kind.Rename);
|
var sourceEditWidgetContent = (SourceEditWidgetContent)mEditWidget.Content;
|
||||||
|
if (!sourceEditWidgetContent.CheckReadOnly())
|
||||||
|
ShowSymbolReferenceHelper(SymbolReferenceHelper.Kind.Rename);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FindAllReferences()
|
public void FindAllReferences()
|
||||||
|
|
|
@ -189,7 +189,12 @@ namespace IDE.ui
|
||||||
: base(new ExpressionEditWidgetContent())
|
: base(new ExpressionEditWidgetContent())
|
||||||
{
|
{
|
||||||
var editWidgetContent = (ExpressionEditWidgetContent)mEditWidgetContent;
|
var editWidgetContent = (ExpressionEditWidgetContent)mEditWidgetContent;
|
||||||
editWidgetContent.mOnGenerateAutocomplete = new (keyChar, options) => UpdateText(keyChar, true);
|
editWidgetContent.mOnGenerateAutocomplete = new (keyChar, options) =>
|
||||||
|
{
|
||||||
|
if ((editWidgetContent.mAutoComplete?.mIsDocumentationPass).GetValueOrDefault())
|
||||||
|
return;
|
||||||
|
UpdateText(keyChar, true);
|
||||||
|
};
|
||||||
editWidgetContent.mScrollToStartOnLostFocus = true;
|
editWidgetContent.mScrollToStartOnLostFocus = true;
|
||||||
mScrollContentInsets.Set(GS!(4), GS!(3), GS!(1), GS!(3));
|
mScrollContentInsets.Set(GS!(4), GS!(3), GS!(1), GS!(3));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue