mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-06 00:05:59 +02:00
Merge remote-tracking branch 'upstream/master' into Yuvan/CustomBuildProperties
This commit is contained in:
commit
4b879670ca
294 changed files with 15180 additions and 4106 deletions
|
@ -695,23 +695,32 @@ namespace IDE
|
|||
return false;
|
||||
}
|
||||
|
||||
String compilerExePath = scope String();
|
||||
// Set for auto-install without prompting
|
||||
gApp.mSettings.mEmscriptenPendingInstall = false;
|
||||
|
||||
String wasmPath = Path.GetAbsolutePath("../wasm", gApp.mInstallDir, .. scope .());
|
||||
if (!Directory.Exists(wasmPath))
|
||||
Path.GetAbsolutePath("../../wasm", gApp.mInstallDir, wasmPath..Clear());
|
||||
IDEUtils.FixFilePath(wasmPath);
|
||||
|
||||
if (gApp.mSettings.mEmscriptenPath.IsEmpty)
|
||||
{
|
||||
// Set for auto-install without prompting
|
||||
gApp.mSettings.mEmscriptenPendingInstall = true;
|
||||
}
|
||||
else if (!File.Exists(scope $"{wasmPath}/EmsdkDep1_Done.txt"))
|
||||
{
|
||||
gApp.mSettings.mEmscriptenPendingInstall = true;
|
||||
}
|
||||
|
||||
String compilerExePath = scope String();
|
||||
if (gApp.mSettings.mEmscriptenPendingInstall)
|
||||
{
|
||||
#if CLI
|
||||
gApp.Fail("Emscripten path not configured. Check Wasm configuration in File\\Preferences\\Settings.");
|
||||
return false;
|
||||
#else
|
||||
if (gApp.mSettings.mEmscriptenPendingInstall)
|
||||
{
|
||||
String wasmPath = Path.GetAbsolutePath("../wasm", gApp.mInstallDir, .. scope .());
|
||||
if (!Directory.Exists(wasmPath))
|
||||
Path.GetAbsolutePath("../../wasm", gApp.mInstallDir, wasmPath..Clear());
|
||||
IDEUtils.FixFilePath(wasmPath);
|
||||
|
||||
var runCmd = gApp.QueueRun(scope $"{wasmPath}/fetch_wasm.bat", "", wasmPath, .UTF8);
|
||||
runCmd.mOnlyIfNotFailed = true;
|
||||
|
||||
|
@ -849,8 +858,7 @@ namespace IDE
|
|||
|
||||
if ((workspaceOptions.mEnableObjectDebugFlags)
|
||||
|| (workspaceOptions.mAllocType == .Debug)
|
||||
|| (workspaceOptions.mAllocType == .Stomp)
|
||||
|| (workspaceOptions.mAllocStackTraceDepth > 0))
|
||||
|| (workspaceOptions.mAllocType == .Stomp))
|
||||
{
|
||||
outDbg.Append("Beef", IDEApp.sRTVersionStr, "Dbg");
|
||||
outDbg.Append((Workspace.PlatformType.GetPtrSizeByName(gApp.mPlatformName) == 4) ? "32" : "64");
|
||||
|
|
|
@ -987,7 +987,11 @@ namespace IDE.Compiler
|
|||
{
|
||||
if (!curWatches.Contains(kv.key))
|
||||
{
|
||||
gApp.mFileWatcher.RemoveWatch(kv.key, kv.value);
|
||||
var watchFile = scope String(kv.key);
|
||||
if ((watchFile.EndsWith(Path.DirectorySeparatorChar)) || (watchFile.EndsWith(Path.AltDirectorySeparatorChar)))
|
||||
watchFile.Append("*");
|
||||
gApp.mFileWatcher.RemoveWatch(watchFile, kv.value);
|
||||
//Debug.Assert(!gApp.mFileWatcher.HasDependentObject(kv.value));
|
||||
oldKeys.Add(kv.key);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -432,7 +432,8 @@ namespace IDE.Debugger
|
|||
public int32 mActiveCallStackIdx;
|
||||
public Event<Action> mBreakpointsChangedDelegate ~ _.Dispose();
|
||||
public Breakpoint mRunToCursorBreakpoint;
|
||||
public int32 mDebugIdx;
|
||||
public int32 mSessionIdx;
|
||||
public int32 mStateIdx;
|
||||
|
||||
public bool IsRunning
|
||||
{
|
||||
|
@ -466,6 +467,17 @@ namespace IDE.Debugger
|
|||
Debugger_Delete();
|
||||
}
|
||||
|
||||
public void IncrementSessionIdx()
|
||||
{
|
||||
mSessionIdx++;
|
||||
mStateIdx++;
|
||||
}
|
||||
|
||||
public void IncrementStateIdx()
|
||||
{
|
||||
mStateIdx++;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
for (var breakpoint in mBreakpointList)
|
||||
|
@ -532,10 +544,8 @@ namespace IDE.Debugger
|
|||
|
||||
public void HotLoad(String[] objectFileNames, int hotIdx)
|
||||
{
|
||||
|
||||
|
||||
String filenamesStr = scope String();
|
||||
filenamesStr.Join("\n", params objectFileNames);
|
||||
filenamesStr.Join("\n", objectFileNames);
|
||||
Debugger_HotLoad(filenamesStr, (int32)hotIdx);
|
||||
|
||||
// The hot load will bind breakpoints to any new methods, but the old versions
|
||||
|
|
|
@ -581,6 +581,18 @@ namespace IDE
|
|||
#endif
|
||||
}
|
||||
|
||||
public bool HasDependentObject(Object dependentObject)
|
||||
{
|
||||
for (var watchedFileKV in mWatchedFiles)
|
||||
{
|
||||
if (watchedFileKV.value.mDependentObjects.Contains(dependentObject))
|
||||
return true;
|
||||
}
|
||||
if (mDependencyChangeSet.Contains(Internal.UnsafeCastToPtr(dependentObject)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Update(delegate void(String, String, WatcherChangeTypes) fileChangeHandler = null)
|
||||
{
|
||||
while (true)
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace IDE
|
|||
public class IDEApp : BFApp
|
||||
{
|
||||
public static String sRTVersionStr = "042";
|
||||
public const String cVersion = "0.43.5";
|
||||
public const String cVersion = "0.43.6";
|
||||
|
||||
#if BF_PLATFORM_WINDOWS
|
||||
public static readonly String sPlatform64Name = "Win64";
|
||||
|
@ -135,9 +135,6 @@ namespace IDE
|
|||
public static readonly String sPlatform32Name = "Unknown32";
|
||||
#endif
|
||||
|
||||
public const uint32 cDialogOutlineLightColor = 0xFF404040;
|
||||
public const uint32 cDialogOutlineDarkColor = 0xFF202020;
|
||||
|
||||
public static bool sExitTest;
|
||||
|
||||
public Verbosity mVerbosity = .Default;
|
||||
|
@ -262,7 +259,7 @@ namespace IDE
|
|||
#if IDE_C_SUPPORT
|
||||
public ClangCompiler mDepClang ~ delete _;
|
||||
#endif
|
||||
// The Beef resolve system is up-to-date with the projects' files,
|
||||
// The Beef resolve system is up-to-date with the projects' files,
|
||||
// but the Clang resolver only has open files in it
|
||||
public bool mNoResolve = false;
|
||||
public bool mDeterministic = false;
|
||||
|
@ -323,7 +320,7 @@ namespace IDE
|
|||
};
|
||||
public int32 mFileDataDataRevision;
|
||||
|
||||
/*public Point mLastAbsMousePos;
|
||||
/*public Point mLastAbsMousePos;
|
||||
public Point mLastRelMousePos;
|
||||
public int32 mMouseStillTicks;
|
||||
public Widget mLastMouseWidget;*/
|
||||
|
@ -794,11 +791,11 @@ namespace IDE
|
|||
mMainBreakpoint = null;
|
||||
}*/
|
||||
|
||||
/*delete mBfBuildCompiler;
|
||||
/*delete mBfBuildCompiler;
|
||||
delete mBfBuildSystem;
|
||||
delete mDepClang;
|
||||
|
||||
|
||||
|
||||
|
||||
delete mBfResolveCompiler;
|
||||
delete mBfResolveSystem;
|
||||
delete mResolveClang;
|
||||
|
@ -1096,7 +1093,7 @@ namespace IDE
|
|||
}
|
||||
else
|
||||
{
|
||||
Fail(StackStringFormat!("Failed to load minidump '{0}'", mCrashDumpPath));
|
||||
Fail(scope String()..AppendF("Failed to load minidump '{0}'", mCrashDumpPath));
|
||||
DeleteAndNullify!(mCrashDumpPath);
|
||||
}
|
||||
}
|
||||
|
@ -1230,7 +1227,7 @@ namespace IDE
|
|||
Dialog aDialog;
|
||||
if (changedList.Count == 1)
|
||||
{
|
||||
aDialog = ThemeFactory.mDefault.CreateDialog("Save file?", StackStringFormat!("Save changes to '{0}' before closing?", changedList[0]), DarkTheme.sDarkTheme.mIconWarning);
|
||||
aDialog = ThemeFactory.mDefault.CreateDialog("Save file?", scope String()..AppendF("Save changes to '{0}' before closing?", changedList[0]), DarkTheme.sDarkTheme.mIconWarning);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1532,7 +1529,7 @@ namespace IDE
|
|||
if (Utils.WriteTextFile(path, useText) case .Err)
|
||||
{
|
||||
if (showErrors)
|
||||
Fail(StackStringFormat!("Failed to write file '{0}'", path));
|
||||
Fail(scope String()..AppendF("Failed to write file '{0}'", path));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1665,7 +1662,7 @@ namespace IDE
|
|||
lineEndingKind = editData.mLineEndingKind;
|
||||
}
|
||||
|
||||
// Lock file watcher to synchronize the 'file changed' notification so we don't
|
||||
// Lock file watcher to synchronize the 'file changed' notification so we don't
|
||||
// think a file was externally saved
|
||||
using (mFileWatcher.mMonitor.Enter())
|
||||
{
|
||||
|
@ -2313,7 +2310,7 @@ namespace IDE
|
|||
|
||||
if (Directory.CreateDirectory(mWorkspace.mDir) case .Err)
|
||||
{
|
||||
Fail(StackStringFormat!("Failed to create workspace directory '{0}'", mWorkspace.mDir));
|
||||
Fail(scope String()..AppendF("Failed to create workspace directory '{0}'", mWorkspace.mDir));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -2331,7 +2328,7 @@ namespace IDE
|
|||
|
||||
if (!SafeWriteTextFile(workspaceFileName, tomlString))
|
||||
{
|
||||
Fail(StackStringFormat!("Failed to write workspace file '{0}'", workspaceFileName));
|
||||
Fail(scope String()..AppendF("Failed to write workspace file '{0}'", workspaceFileName));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -2520,9 +2517,16 @@ namespace IDE
|
|||
{
|
||||
if (mDebugger.mIsRunning)
|
||||
{
|
||||
if (mDebugger.mIsComptimeDebug)
|
||||
CancelBuild();
|
||||
mDebugger.StopDebugging();
|
||||
while (mDebugger.GetRunState() != .Terminated)
|
||||
{
|
||||
if (mDebugger.mIsComptimeDebug)
|
||||
{
|
||||
if (!mBfBuildCompiler.IsPerformingBackgroundOperation())
|
||||
break;
|
||||
}
|
||||
mDebugger.Update();
|
||||
}
|
||||
mDebugger.mIsRunning = false;
|
||||
|
@ -2530,6 +2534,9 @@ namespace IDE
|
|||
}
|
||||
mDebugger.DisposeNativeBreakpoints();
|
||||
mWantsRehupCallstack = false;
|
||||
|
||||
if (mDebugger.mIsComptimeDebug)
|
||||
mDebugger.Detach();
|
||||
}
|
||||
|
||||
void CloseWorkspace()
|
||||
|
@ -2574,9 +2581,9 @@ namespace IDE
|
|||
{
|
||||
var sourceViewPanel = tab.mContent as SourceViewPanel;
|
||||
if (sourceViewPanel != null)
|
||||
{
|
||||
{
|
||||
docPanels.Add(sourceViewPanel);
|
||||
}
|
||||
}
|
||||
});
|
||||
for (var docPanel in docPanels)
|
||||
CloseDocument(docPanel);*/
|
||||
|
@ -2806,7 +2813,7 @@ namespace IDE
|
|||
else
|
||||
{
|
||||
int32 spanSize = -cmd;
|
||||
|
||||
|
||||
charId += spanSize;
|
||||
charIdx += spanSize;
|
||||
|
||||
|
@ -2913,7 +2920,7 @@ namespace IDE
|
|||
hadLoad = true;
|
||||
|
||||
var projectPath = project.mProjectPath;
|
||||
|
||||
|
||||
if (project.mDeferState == .Pending)
|
||||
{
|
||||
hasDeferredProjects = true;
|
||||
|
@ -2928,7 +2935,7 @@ namespace IDE
|
|||
|
||||
AddProjectToWorkspace(project, false);
|
||||
if (addToUI)
|
||||
mProjectPanel.InitProject(project, null);
|
||||
mProjectPanel?.InitProject(project, null);
|
||||
}
|
||||
}
|
||||
if (!hadLoad)
|
||||
|
@ -2948,7 +2955,7 @@ namespace IDE
|
|||
|
||||
if (loadFailed)
|
||||
{
|
||||
mProjectPanel.RebuildUI();
|
||||
mProjectPanel?.RebuildUI();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3130,9 +3137,9 @@ namespace IDE
|
|||
|
||||
if (projSpec.mVerSpec.Parse(data) case .Err)
|
||||
{
|
||||
var err = scope String();
|
||||
err.AppendF("Unable to parse version specifier for {0} in {1}", projectName, workspaceFileName);
|
||||
Fail(err);
|
||||
var errStr = scope String();
|
||||
errStr.AppendF("Unable to parse version specifier for {0} in {1}", projectName, workspaceFileName);
|
||||
Fail(errStr);
|
||||
LoadFailed();
|
||||
continue;
|
||||
}
|
||||
|
@ -3348,7 +3355,7 @@ namespace IDE
|
|||
case .SemVer(let semVer):
|
||||
//
|
||||
case .Git(let url, let ver):
|
||||
|
||||
|
||||
var checkPath = scope String();
|
||||
if (mPackMan.CheckLock(projectName, checkPath, var projectFailed))
|
||||
{
|
||||
|
@ -3379,7 +3386,7 @@ namespace IDE
|
|||
|
||||
/*if (!project.Load(projectFilePath))
|
||||
{
|
||||
Fail(StackStringFormat!("Failed to load project {0}", projectFilePath));
|
||||
Fail(scope String()..AppendF("Failed to load project {0}", projectFilePath));
|
||||
delete project;
|
||||
return .Err(.LoadFailed);
|
||||
}
|
||||
|
@ -3883,7 +3890,7 @@ namespace IDE
|
|||
{
|
||||
#if !CLI
|
||||
/*SaveFileDialog dialog = scope .();
|
||||
|
||||
|
||||
let activeWindow = GetActiveWindow();
|
||||
dialog.OverwritePrompt = true;
|
||||
dialog.SetFilter("Debug Session (*.bfdbg)|*.bfdbg");
|
||||
|
@ -4073,7 +4080,7 @@ namespace IDE
|
|||
|
||||
if (mMainWindow == null)
|
||||
{
|
||||
Internal.FatalError(StackStringFormat!("FAILED: {0}", text));
|
||||
Internal.FatalError(scope String()..AppendF("FAILED: {0}", text));
|
||||
}
|
||||
|
||||
Beep(MessageBeepType.Error);
|
||||
|
@ -4680,7 +4687,7 @@ namespace IDE
|
|||
int defLine;
|
||||
int defColumn;
|
||||
mResolveClang.CancelBackground();
|
||||
|
||||
|
||||
int defIdx = sourceViewPanel.mEditWidget.Content.GetTextIdx(line, lineChar);
|
||||
if (mResolveClang.FindDefinition(sourceViewPanel.mFilePath, defIdx,
|
||||
defFile, out defLine, out defColumn))
|
||||
|
@ -4694,7 +4701,7 @@ namespace IDE
|
|||
}
|
||||
else
|
||||
#endif
|
||||
/*{
|
||||
/*{
|
||||
ResolveParams resolveParams = scope ResolveParams();
|
||||
sourceViewPanel.Classify(ResolveType.GoToDefinition, resolveParams);
|
||||
if (resolveParams.mOutFileName != null)
|
||||
|
@ -4887,7 +4894,7 @@ namespace IDE
|
|||
{
|
||||
if (mDebugger.mIsRunning)
|
||||
{
|
||||
if (mExecutionPaused)
|
||||
if ((mExecutionPaused) && (mDebugger.IsPaused()))
|
||||
{
|
||||
DebuggerUnpaused();
|
||||
mDebugger.StepInto(IsInDisassemblyMode());
|
||||
|
@ -4905,7 +4912,7 @@ namespace IDE
|
|||
mStepCount++;
|
||||
if (mDebugger.mIsRunning)
|
||||
{
|
||||
if (mExecutionPaused)
|
||||
if ((mExecutionPaused) && (mDebugger.IsPaused()))
|
||||
{
|
||||
DebuggerUnpaused();
|
||||
mDebugger.StepOver(IsInDisassemblyMode());
|
||||
|
@ -4925,7 +4932,7 @@ namespace IDE
|
|||
[IDECommand]
|
||||
void StepOut()
|
||||
{
|
||||
if (mExecutionPaused)
|
||||
if ((mExecutionPaused) && (mDebugger.IsPaused()))
|
||||
{
|
||||
DebuggerUnpaused();
|
||||
mDebugger.StepOut(IsInDisassemblyMode());
|
||||
|
@ -6635,20 +6642,33 @@ namespace IDE
|
|||
return tabButton;
|
||||
}
|
||||
|
||||
public DisassemblyPanel ShowDisassemblyPanel(bool clearData = false)
|
||||
public DisassemblyPanel ShowDisassemblyPanel(bool clearData = false, bool setFocus = false)
|
||||
{
|
||||
DisassemblyPanel disassemblyPanel = null;
|
||||
TabbedView.TabButton disassemblyTab = null;
|
||||
|
||||
WithTabs(scope [&] (tab) =>
|
||||
{
|
||||
if ((disassemblyPanel == null) && (tab.mContent is DisassemblyPanel))
|
||||
{
|
||||
disassemblyTab = tab;
|
||||
disassemblyPanel = (DisassemblyPanel)tab.mContent;
|
||||
disassemblyPanel.ClearQueuedData();
|
||||
tab.Activate();
|
||||
}
|
||||
});
|
||||
|
||||
if (disassemblyTab != null)
|
||||
{
|
||||
var window = disassemblyTab.mWidgetWindow;
|
||||
if ((setFocus) && (window != null) && (!HasModalDialogs()) && (!mRunningTestScript))
|
||||
window.SetForeground();
|
||||
}
|
||||
|
||||
if (disassemblyPanel != null)
|
||||
{
|
||||
disassemblyPanel.ClearQueuedData();
|
||||
disassemblyTab.Activate();
|
||||
return disassemblyPanel;
|
||||
}
|
||||
|
||||
TabbedView tabbedView = GetDefaultDocumentTabbedView();
|
||||
disassemblyPanel = new DisassemblyPanel();
|
||||
|
@ -6916,8 +6936,8 @@ namespace IDE
|
|||
|
||||
var editWidgetContent = (SourceEditWidgetContent)editWidget.Content;
|
||||
//mEditWidget.mVertScrollbar.mScrollIncrement = editWidgetContent.mFont.GetLineSpacing();
|
||||
editWidgetContent.mHiliteColor = 0xFF384858;
|
||||
editWidgetContent.mUnfocusedHiliteColor = 0x80384858;
|
||||
editWidgetContent.mHiliteColor = mSettings.mUISettings.mColors.mCodeHilite;
|
||||
editWidgetContent.mUnfocusedHiliteColor = mSettings.mUISettings.mColors.mCodeHiliteUnfocused;
|
||||
editWidgetContent.mHiliteCurrentLine = mSettings.mEditorSettings.mHiliteCurrentLine;
|
||||
|
||||
return editWidget;
|
||||
|
@ -7112,7 +7132,7 @@ namespace IDE
|
|||
mFileEditData.Add(editData);
|
||||
projectSource.mEditData = editData;
|
||||
projectSource.mEditData.mLastFileTextVersion = projectSource.mEditData.mEditWidget.Content.mData.mCurTextVersionId;
|
||||
}
|
||||
}
|
||||
}
|
||||
return projectSource.mEditData;*/
|
||||
}
|
||||
|
@ -7172,6 +7192,12 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
|
||||
void ActivateWindow(WidgetWindow window)
|
||||
{
|
||||
if ((setFocus) && (window != null) && (!HasModalDialogs()) && (!mRunningTestScript))
|
||||
window.SetForeground();
|
||||
}
|
||||
|
||||
if (showType != SourceShowType.New)
|
||||
{
|
||||
delegate void(TabbedView.TabButton) tabFunc = scope [&] (tabButton) =>
|
||||
|
@ -7220,8 +7246,7 @@ namespace IDE
|
|||
//sourceViewPanel.QueueFullRefresh(true);
|
||||
}
|
||||
|
||||
if ((sourceViewPanel.mWidgetWindow != null) && (!HasModalDialogs()) && (!mRunningTestScript))
|
||||
sourceViewPanel.mWidgetWindow.SetForeground();
|
||||
ActivateWindow(sourceViewPanelTab.mWidgetWindow);
|
||||
sourceViewPanelTab.Activate(setFocus);
|
||||
sourceViewPanelTab.mTabbedView.FinishTabAnim();
|
||||
if (setFocus)
|
||||
|
@ -7237,6 +7262,7 @@ namespace IDE
|
|||
//ShowSourceFile(filePath, projectSource, showTemp, setFocus);
|
||||
|
||||
DarkTabbedView tabbedView = GetDefaultDocumentTabbedView();
|
||||
ActivateWindow(tabbedView.mWidgetWindow);
|
||||
sourceViewPanel = new SourceViewPanel();
|
||||
bool success;
|
||||
if (useProjectSource != null)
|
||||
|
@ -7436,7 +7462,7 @@ namespace IDE
|
|||
Path.GetFileName(sourceViewPanel.mFilePath, fileName);
|
||||
else
|
||||
fileName.Append("untitled");
|
||||
Dialog aDialog = ThemeFactory.mDefault.CreateDialog("Save file?", StackStringFormat!("Save changes to '{0}' before closing?", fileName), DarkTheme.sDarkTheme.mIconWarning);
|
||||
Dialog aDialog = ThemeFactory.mDefault.CreateDialog("Save file?", scope String()..AppendF("Save changes to '{0}' before closing?", fileName), DarkTheme.sDarkTheme.mIconWarning);
|
||||
aDialog.mDefaultButton = aDialog.AddButton("Save", new (evt) => { SaveFile(sourceViewPanel); CloseDocument(sourceViewPanel); });
|
||||
aDialog.AddButton("Don't Save", new (evt) => CloseDocument(sourceViewPanel));
|
||||
aDialog.mEscButton = aDialog.AddButton("Cancel");
|
||||
|
@ -7509,7 +7535,7 @@ namespace IDE
|
|||
hasFocus = true;
|
||||
}
|
||||
|
||||
/*if (sourceViewPanel != null)
|
||||
/*if (sourceViewPanel != null)
|
||||
hasFocus = sourceViewPanel.mEditWidget.mHasFocus;*/
|
||||
|
||||
if ((sourceViewPanel != null) && (sourceViewPanel.HasUnsavedChanges()))
|
||||
|
@ -8000,7 +8026,7 @@ namespace IDE
|
|||
}
|
||||
else
|
||||
{
|
||||
var disassemblyPanel = ShowDisassemblyPanel(true);
|
||||
var disassemblyPanel = ShowDisassemblyPanel(true, setFocus);
|
||||
if (aliasFilePath != null)
|
||||
String.NewOrSet!(disassemblyPanel.mAliasFilePath, aliasFilePath);
|
||||
disassemblyPanel.Show(addr, filePath, line, column, hotIdx, defLineStart, defLineEnd);
|
||||
|
@ -8097,7 +8123,7 @@ namespace IDE
|
|||
DragDropFile(key);
|
||||
return;
|
||||
}
|
||||
Fail(StackStringFormat!("Unhandled command line param: {0}", key));
|
||||
Fail(scope String()..AppendF("Unhandled command line param: {0}", key));
|
||||
}
|
||||
|
||||
public override bool HandleCommandLineParam(String key, String value)
|
||||
|
@ -8241,12 +8267,14 @@ namespace IDE
|
|||
if (fullDir.EndsWith("BeefSpace.toml", .OrdinalIgnoreCase))
|
||||
fullDir.RemoveFromEnd("BeefSpace.toml".Length);
|
||||
|
||||
if ((File.Exists(fullDir)) || (IsBeefFile(fullDir)))
|
||||
//TODO: Properly implement 'composite files'
|
||||
/*if ((File.Exists(fullDir)) ||
|
||||
((IsBeefFile(fullDir)) && (!Directory.Exists(fullDir))))
|
||||
{
|
||||
mWorkspace.mCompositeFile = new CompositeFile(fullDir);
|
||||
delete fullDir;
|
||||
}
|
||||
else
|
||||
else*/
|
||||
mWorkspace.mDir = fullDir;
|
||||
case "-file":
|
||||
DragDropFile(value);
|
||||
|
@ -8265,6 +8293,8 @@ namespace IDE
|
|||
mDeferredOpen = .DebugSession;
|
||||
else if (filePath.EndsWith(".dmp", .OrdinalIgnoreCase))
|
||||
mDeferredOpen = .CrashDump;
|
||||
else if (filePath.EndsWith("BeefSpace.toml", .OrdinalIgnoreCase))
|
||||
mDeferredOpen = .Workspace;
|
||||
else
|
||||
mDeferredOpen = .File;
|
||||
|
||||
|
@ -9146,8 +9176,8 @@ namespace IDE
|
|||
|
||||
/*var buffer = scope String();
|
||||
if (streamReader.Read(buffer) case .Err)
|
||||
break;
|
||||
using (mDebugOutputMonitor.Enter())
|
||||
break;
|
||||
using (mDebugOutputMonitor.Enter())
|
||||
mDebugOutput.Add(new String(buffer));*/
|
||||
|
||||
count++;
|
||||
|
@ -9169,10 +9199,10 @@ namespace IDE
|
|||
{
|
||||
var buffer = scope String();
|
||||
if (streamReader.ReadLine(buffer) case .Err)
|
||||
break;
|
||||
break;
|
||||
|
||||
using (IDEApp.sApp.mMonitor.Enter())
|
||||
executionInstance.mDeferredOutput.Add(new String(buffer));
|
||||
using (IDEApp.sApp.mMonitor.Enter())
|
||||
executionInstance.mDeferredOutput.Add(new String(buffer));
|
||||
}
|
||||
}*/
|
||||
|
||||
|
@ -9333,13 +9363,19 @@ namespace IDE
|
|||
executionInstance.mStopwatch.Start();
|
||||
executionInstance.mProcess = process;
|
||||
|
||||
executionInstance.mOutputThread = new Thread(new => ReadOutputThread);
|
||||
executionInstance.mOutputThread.Start(executionInstance, false);
|
||||
if (startInfo.RedirectStandardOutput)
|
||||
{
|
||||
executionInstance.mOutputThread = new Thread(new => ReadOutputThread);
|
||||
executionInstance.mOutputThread.Start(executionInstance, false);
|
||||
}
|
||||
|
||||
executionInstance.mErrorThread = new Thread(new => ReadErrorThread);
|
||||
executionInstance.mErrorThread.Start(executionInstance, false);
|
||||
if (startInfo.RedirectStandardError)
|
||||
{
|
||||
executionInstance.mErrorThread = new Thread(new => ReadErrorThread);
|
||||
executionInstance.mErrorThread.Start(executionInstance, false);
|
||||
}
|
||||
|
||||
if (stdInData != null)
|
||||
if ((startInfo.RedirectStandardInput) && (stdInData != null))
|
||||
{
|
||||
executionInstance.mStdInData = new String(stdInData);
|
||||
executionInstance.mInputThread = new Thread(new => WriteInputThread);
|
||||
|
@ -9474,7 +9510,7 @@ namespace IDE
|
|||
}
|
||||
|
||||
if ((executionInstance == null) && (mExecutionQueue.Count == 0))
|
||||
{
|
||||
{
|
||||
OutputLine("Compilation finished.");
|
||||
}*/
|
||||
}
|
||||
|
@ -9649,29 +9685,32 @@ namespace IDE
|
|||
if ((processCompileCmd.mHadBeef) && (mVerbosity >= .Normal))
|
||||
OutputLine("Beef compilation time: {0:0.00}s", processCompileCmd.mStopwatch.ElapsedMilliseconds / 1000.0f);
|
||||
|
||||
var compileInstance = mWorkspace.mCompileInstanceList.Back;
|
||||
compileInstance.mCompileResult = .Failure;
|
||||
if (processCompileCmd.mBfPassInstance.mCompileSucceeded)
|
||||
{
|
||||
//foreach (var sourceViewPanel in GetSourceViewPanels())
|
||||
WithSourceViewPanels(scope (sourceViewPanel) =>
|
||||
{
|
||||
sourceViewPanel.mHasChangedSinceLastCompile = false;
|
||||
});
|
||||
compileInstance.mCompileResult = .Success;
|
||||
}
|
||||
else
|
||||
if (!mWorkspace.mCompileInstanceList.IsEmpty)
|
||||
{
|
||||
var compileInstance = mWorkspace.mCompileInstanceList.Back;
|
||||
compileInstance.mCompileResult = .Failure;
|
||||
}
|
||||
if (processCompileCmd.mBfPassInstance.mCompileSucceeded)
|
||||
{
|
||||
//foreach (var sourceViewPanel in GetSourceViewPanels())
|
||||
WithSourceViewPanels(scope (sourceViewPanel) =>
|
||||
{
|
||||
sourceViewPanel.mHasChangedSinceLastCompile = false;
|
||||
});
|
||||
compileInstance.mCompileResult = .Success;
|
||||
}
|
||||
else
|
||||
{
|
||||
compileInstance.mCompileResult = .Failure;
|
||||
}
|
||||
|
||||
ProcessBeefCompileResults(processCompileCmd.mBfPassInstance, processCompileCmd.mCompileKind, processCompileCmd.mHotProject, processCompileCmd.mStopwatch);
|
||||
processCompileCmd.mBfPassInstance = null;
|
||||
ProcessBeefCompileResults(processCompileCmd.mBfPassInstance, processCompileCmd.mCompileKind, processCompileCmd.mHotProject, processCompileCmd.mStopwatch);
|
||||
processCompileCmd.mBfPassInstance = null;
|
||||
|
||||
if (mHotResolveState != .None)
|
||||
{
|
||||
if (compileInstance.mCompileResult == .Success)
|
||||
compileInstance.mCompileResult = .PendingHotLoad;
|
||||
if (mHotResolveState != .None)
|
||||
{
|
||||
if (compileInstance.mCompileResult == .Success)
|
||||
compileInstance.mCompileResult = .PendingHotLoad;
|
||||
}
|
||||
}
|
||||
|
||||
if (processCompileCmd.mProfileCmd != null)
|
||||
|
@ -9754,7 +9793,7 @@ namespace IDE
|
|||
{
|
||||
mDepClang.QueueCheckDependencies(projectSource, ClangCompiler.DepCheckerType.Clang);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (!completedCompileCmd.mFailed)
|
||||
mDepClang.mDoDependencyCheck = false;
|
||||
|
@ -9765,9 +9804,9 @@ namespace IDE
|
|||
CompileResult(buildCompletedCmd.mHotProjectName, !buildCompletedCmd.mFailed);
|
||||
|
||||
if (buildCompletedCmd.mFailed)
|
||||
OutputLineSmart("ERROR: BUILD FAILED");
|
||||
if ((mVerbosity >= .Detailed) && (buildCompletedCmd.mStopwatch != null))
|
||||
OutputLine("Total build time: {0:0.00}s", buildCompletedCmd.mStopwatch.ElapsedMilliseconds / 1000.0f);
|
||||
OutputLineSmart("ERROR: BUILD FAILED. Total build time: {0:0.00}s", buildCompletedCmd.mStopwatch.ElapsedMilliseconds / 1000.0f);
|
||||
else if ((mVerbosity >= .Detailed) && (buildCompletedCmd.mStopwatch != null))
|
||||
OutputLineSmart("SUCCESS: Build completed with no errors. Total build time: {0:0.00}s", buildCompletedCmd.mStopwatch.ElapsedMilliseconds / 1000.0f);
|
||||
|
||||
if (mDebugger?.mIsComptimeDebug == true)
|
||||
DebuggerComptimeStop();
|
||||
|
@ -10154,8 +10193,8 @@ namespace IDE
|
|||
}
|
||||
|
||||
// Project options are inherently thread safe. Resolve-system project settings
|
||||
// Can only be changed from the Resolve BfCompiler thread, and Build settings
|
||||
// are only changed before background compilation begins. We also call this
|
||||
// Can only be changed from the Resolve BfCompiler thread, and Build settings
|
||||
// are only changed before background compilation begins. We also call this
|
||||
// during WorkspaceLoad, but the resolve threads aren't processing then.
|
||||
public bool SetupBeefProjectSettings(BfSystem bfSystem, BfCompiler bfCompiler, Project project)
|
||||
{
|
||||
|
@ -10165,7 +10204,7 @@ namespace IDE
|
|||
Workspace.Options workspaceOptions = GetCurWorkspaceOptions();
|
||||
if (options == null)
|
||||
{
|
||||
//Fail(StackStringFormat!("Failed to retrieve options for {0}", project.mProjectName));
|
||||
//Fail(scope String()..AppendF("Failed to retrieve options for {0}", project.mProjectName));
|
||||
bfProject.SetDisabled(true);
|
||||
return false;
|
||||
}
|
||||
|
@ -10327,7 +10366,7 @@ namespace IDE
|
|||
string clangArgsStr = String.Join("\n", clangArgs);
|
||||
|
||||
long hash = 0;
|
||||
for (int i = 0; i < clangArgsStr.Length; i++)
|
||||
for (int i = 0; i < clangArgsStr.Length; i++)
|
||||
hash = (hash << 5) - hash + clangArgsStr[i];
|
||||
return String.Format("{0:X16}", hash);
|
||||
}*/
|
||||
|
@ -11433,7 +11472,7 @@ namespace IDE
|
|||
Project depProject = FindProject(dep.mProjectName);
|
||||
if (depProject == null)
|
||||
{
|
||||
OutputLine(StackStringFormat!("Unable to find project '{0}', a dependency of project '{1}'", dep.mProjectName, project.mProjectName));
|
||||
OutputLine(scope String()..AppendF("Unable to find project '{0}', a dependency of project '{1}'", dep.mProjectName, project.mProjectName));
|
||||
return false;
|
||||
}
|
||||
if (!GetDependentProjectList(depProject, orderedProjectList, useProjectStack))
|
||||
|
@ -11466,12 +11505,12 @@ namespace IDE
|
|||
mLastTestFailed = true;
|
||||
}
|
||||
|
||||
protected virtual void CompileFailed()
|
||||
protected virtual void CompileFailed(Stopwatch stopwatch)
|
||||
{
|
||||
if (mTestManager != null)
|
||||
mTestManager.BuildFailed();
|
||||
if (mVerbosity > .Quiet)
|
||||
OutputLine("Compile failed.");
|
||||
OutputLineSmart("ERROR-SOFT: Compile failed. Total build time: {0:0.00}s", stopwatch.ElapsedMilliseconds / 1000.0f);
|
||||
mLastCompileFailed = true;
|
||||
|
||||
if (mRunningTestScript)
|
||||
|
@ -11635,7 +11674,7 @@ namespace IDE
|
|||
if ((passInstance.mFailed) && (passInstance.mCompileSucceeded))
|
||||
{
|
||||
// This can happen if we can't load a Beef file
|
||||
CompileFailed();
|
||||
CompileFailed(startStopWatch);
|
||||
passInstance.mCompileSucceeded = false;
|
||||
}
|
||||
|
||||
|
@ -11667,7 +11706,7 @@ namespace IDE
|
|||
if (!mDebugger.mIsRunning)
|
||||
{
|
||||
OutputErrorLine("Hot compile failed - target no longer running");
|
||||
CompileFailed();
|
||||
CompileFailed(startStopWatch);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -11699,7 +11738,7 @@ namespace IDE
|
|||
SkipProjectCompile(project, hotProject);
|
||||
}
|
||||
CompileResult((hotProject != null) ? hotProject.mProjectName : null, false);
|
||||
CompileFailed();
|
||||
CompileFailed(startStopWatch);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -11751,7 +11790,7 @@ namespace IDE
|
|||
}
|
||||
|
||||
if (!success)
|
||||
CompileFailed();
|
||||
CompileFailed(startStopWatch);
|
||||
|
||||
if (success)
|
||||
{
|
||||
|
@ -11912,9 +11951,9 @@ namespace IDE
|
|||
startupCode.AppendF(
|
||||
"""
|
||||
using System;
|
||||
|
||||
|
||||
namespace {};
|
||||
|
||||
|
||||
class {}
|
||||
{{
|
||||
public static int Main(String[] args)
|
||||
|
@ -12162,7 +12201,7 @@ namespace IDE
|
|||
String err =
|
||||
"""
|
||||
Beef requires the Microsoft C++ build tools for Visual Studio 2013 or later, but they don't seem to be installed.
|
||||
|
||||
|
||||
Install just Microsoft Visual C++ Build Tools or the entire Visual Studio suite from:
|
||||
https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
|
||||
""";
|
||||
|
@ -12279,7 +12318,7 @@ namespace IDE
|
|||
passInstance = CompileBeef(hotProject, hotIdx, lastCompileHadMessages, let hadBeef);
|
||||
if (passInstance == null)
|
||||
{
|
||||
CompileFailed();
|
||||
CompileFailed(scope .());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -12447,7 +12486,7 @@ namespace IDE
|
|||
CheckDebugVisualizers();
|
||||
|
||||
mDebugger.mIsRunning = true;
|
||||
mDebugger.mDebugIdx++;
|
||||
mDebugger.IncrementSessionIdx();
|
||||
WithSourceViewPanels(scope (sourceView) =>
|
||||
{
|
||||
sourceView.RehupAlias();
|
||||
|
@ -12465,8 +12504,8 @@ namespace IDE
|
|||
|
||||
if ((mTargetStartWithStep) && (mMainBreakpoint == null))
|
||||
{
|
||||
// The idea is that we don't want to step into static initializers, so we
|
||||
// temporarily break on _main and then we single step
|
||||
// The idea is that we don't want to step into static initializers, so we
|
||||
// temporarily break on _main and then we single step
|
||||
//mMainBreakpoint = mDebugger.CreateSymbolBreakpoint("_ZN3Hey4Dude3Bro9TestClass4MainEv");
|
||||
if ((project.mGeneralOptions.mTargetType == Project.TargetType.BeefConsoleApplication) ||
|
||||
(project.mGeneralOptions.mTargetType == Project.TargetType.BeefGUIApplication))
|
||||
|
@ -12506,7 +12545,7 @@ namespace IDE
|
|||
|
||||
CheckDebugVisualizers();
|
||||
mDebugger.mIsRunning = true;
|
||||
mDebugger.mDebugIdx++;
|
||||
mDebugger.IncrementSessionIdx();
|
||||
mDebugger.RehupBreakpoints(true);
|
||||
mDebugger.Run();
|
||||
mIsAttachPendingSourceShow = true;
|
||||
|
@ -12951,7 +12990,7 @@ namespace IDE
|
|||
{
|
||||
case .Ok:
|
||||
case .Err:
|
||||
Fail(StackStringFormat!("Unable to locate process id {0}", mProcessAttachId));
|
||||
Fail(scope String()..AppendF("Unable to locate process id {0}", mProcessAttachId));
|
||||
}
|
||||
if (debugProcess.IsAttached)
|
||||
{
|
||||
|
@ -12981,13 +13020,13 @@ namespace IDE
|
|||
if (mDebugger.OpenMiniDump(mCrashDumpPath))
|
||||
{
|
||||
mDebugger.mIsRunning = true;
|
||||
mDebugger.mDebugIdx++;
|
||||
mDebugger.IncrementSessionIdx();
|
||||
mExecutionPaused = false; // Make this false so we can detect a Pause immediately
|
||||
mIsAttachPendingSourceShow = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Fail(StackStringFormat!("Failed to load minidump '{0}'", mCrashDumpPath));
|
||||
Fail(scope String()..AppendF("Failed to load minidump '{0}'", mCrashDumpPath));
|
||||
}
|
||||
}
|
||||
else if (mLaunchData != null)
|
||||
|
@ -13179,7 +13218,7 @@ namespace IDE
|
|||
|
||||
/*for (var window in gApp.mWindows)
|
||||
{
|
||||
|
||||
|
||||
window.SetMinimumSize(GS!());
|
||||
}*/
|
||||
}
|
||||
|
@ -13293,6 +13332,7 @@ namespace IDE
|
|||
|
||||
void DebuggerPaused()
|
||||
{
|
||||
mDebugger.IncrementStateIdx();
|
||||
mDebugger.mActiveCallStackIdx = 0;
|
||||
mExecutionPaused = true;
|
||||
mDebugger.GetRunState();
|
||||
|
@ -13306,6 +13346,8 @@ namespace IDE
|
|||
|
||||
void WithWatchPanels(delegate void(WatchPanel watchPanel) dlg)
|
||||
{
|
||||
if (mWatchPanel == null)
|
||||
return;
|
||||
dlg(mWatchPanel);
|
||||
dlg(mAutoWatchPanel);
|
||||
for (let window in mWindows)
|
||||
|
@ -13607,14 +13649,14 @@ namespace IDE
|
|||
if (mBfResolveSystem != null)
|
||||
mBfResolveSystem.AddProject(project);
|
||||
}
|
||||
|
||||
|
||||
foreach (var project in mWorkspace.mProjects)
|
||||
{
|
||||
project.WithProjectItems(scope (projectItem) =>
|
||||
{
|
||||
var projectSource = projectItem as ProjectSource;
|
||||
if (projectSource != null)
|
||||
{
|
||||
{
|
||||
var resolveCompiler = GetProjectCompilerForFile(projectSource.mPath);
|
||||
if (resolveCompiler == mBfResolveCompiler)
|
||||
resolveCompiler.QueueProjectSource(projectSource);
|
||||
|
@ -13980,9 +14022,11 @@ namespace IDE
|
|||
if (checkBreakpoint.mMemoryAddress == memoryAddress)
|
||||
breakpoint = checkBreakpoint;
|
||||
}
|
||||
String infoString = StackStringFormat!("Memory breakpoint hit: '0x{0:X08}'", (int64)memoryAddress);
|
||||
String infoString = scope .();
|
||||
if (breakpoint != null)
|
||||
infoString = StackStringFormat!("Memory breakpoint hit: '0x{0:X08}' ({1})", (int64)memoryAddress, breakpoint.mMemoryWatchExpression);
|
||||
infoString.AppendF("Memory breakpoint hit: '0x{0:X08}' ({1})", (int64)memoryAddress, breakpoint.mMemoryWatchExpression);
|
||||
else
|
||||
infoString.AppendF("Memory breakpoint hit: '0x{0:X08}'", (int64)memoryAddress);
|
||||
OutputLine(infoString);
|
||||
if (!mRunningTestScript)
|
||||
{
|
||||
|
@ -14045,8 +14089,8 @@ namespace IDE
|
|||
OutputFormatted(deferredOutput, deferredMsgType == "dbgEvalMsg");
|
||||
}
|
||||
|
||||
/*if (hadMessages)
|
||||
mNoDebugMessagesTick = 0;
|
||||
/*if (hadMessages)
|
||||
mNoDebugMessagesTick = 0;
|
||||
else if (IDEApp.sApp.mIsUpdateBatchStart)
|
||||
mNoDebugMessagesTick++;
|
||||
if (mNoDebugMessagesTick < 10)
|
||||
|
@ -14178,11 +14222,11 @@ namespace IDE
|
|||
mDebugger.GetCurrentException(exceptionLine);
|
||||
var exceptionData = String.StackSplit!(exceptionLine, '\n');
|
||||
|
||||
String exHeader = StackStringFormat!("Exception {0}", exceptionData[1]);
|
||||
String exHeader = scope String()..AppendF("Exception {0}", exceptionData[1]);
|
||||
if (exceptionData.Count >= 3)
|
||||
exHeader = exceptionData[2];
|
||||
|
||||
String exString = StackStringFormat!("{0} at {1}", exHeader, exceptionData[0]);
|
||||
String exString = scope String()..AppendF("{0} at {1}", exHeader, exceptionData[0]);
|
||||
|
||||
OutputLine(exString);
|
||||
if (!IsCrashDump)
|
||||
|
@ -14331,7 +14375,7 @@ namespace IDE
|
|||
/*public bool CheckMouseover(Widget checkWidget, int32 wantTicks, out Point mousePoint)
|
||||
{
|
||||
mousePoint = Point(Int32.MinValue, Int32.MinValue);
|
||||
if (checkWidget != mLastMouseWidget)
|
||||
if (checkWidget != mLastMouseWidget)
|
||||
return false;
|
||||
checkWidget.RootToSelfTranslate(mLastRelMousePos.x, mLastRelMousePos.y, out mousePoint.x, out mousePoint.y);
|
||||
return mMouseStillTicks == wantTicks;
|
||||
|
@ -14362,7 +14406,7 @@ namespace IDE
|
|||
foreach (var window in mWindows)
|
||||
{
|
||||
var widgetWindow = window as WidgetWindow;
|
||||
|
||||
|
||||
widgetWindow.RehupMouse(false);
|
||||
var windowOverWidget = widgetWindow.mCaptureWidget ?? widgetWindow.mOverWidget;
|
||||
if ((windowOverWidget != null) && (widgetWindow.mAlpha == 1.0f) && (widgetWindow.mCaptureWidget == null))
|
||||
|
@ -14371,7 +14415,7 @@ namespace IDE
|
|||
numOverWidgets++;
|
||||
if (overWidget != mLastMouseWidget)
|
||||
{
|
||||
SetLastMouseWidget(overWidget);
|
||||
SetLastMouseWidget(overWidget);
|
||||
mMouseStillTicks = -1;
|
||||
}
|
||||
|
||||
|
@ -14389,7 +14433,7 @@ namespace IDE
|
|||
}
|
||||
|
||||
if (overWidget == null)
|
||||
{
|
||||
{
|
||||
SetLastMouseWidget(null);
|
||||
mMouseStillTicks = -1;
|
||||
}
|
||||
|
@ -14399,7 +14443,7 @@ namespace IDE
|
|||
//int a = 0;
|
||||
}
|
||||
|
||||
Debug.Assert(numOverWidgets <= 1);
|
||||
Debug.Assert(numOverWidgets <= 1);
|
||||
}*/
|
||||
|
||||
public void FileRenamed(ProjectFileItem projectFileItem, String oldPath, String newPath)
|
||||
|
|
|
@ -307,8 +307,8 @@ namespace IDE
|
|||
|
||||
public static void DrawOutline(Graphics g, Widget widget, int inflateX = 0, int32 inflateY = 0)
|
||||
{
|
||||
DrawOutline(g, widget, inflateX, inflateY, IDEApp.cDialogOutlineLightColor);
|
||||
DrawOutline(g, widget, inflateX - 1, inflateY - 1, IDEApp.cDialogOutlineDarkColor);
|
||||
DrawOutline(g, widget, inflateX, inflateY, DarkTheme.COLOR_DIALOG_OUTLINE_OUT);
|
||||
DrawOutline(g, widget, inflateX - 1, inflateY - 1, DarkTheme.COLOR_DIALOG_OUTLINE_IN);
|
||||
}
|
||||
|
||||
public static void ClampMenuCoords(ref float x, ref float y, ScrollableWidget scrollableWidget, Insets insets = null)
|
||||
|
|
|
@ -153,7 +153,8 @@ namespace IDE
|
|||
public List<String> mSymbolSearchPath = new .() ~ DeleteContainerAndItems!(_);
|
||||
public List<String> mAutoFindPaths = new .() ~ DeleteContainerAndItems!(_);
|
||||
public int32 mProfileSampleRate = 1000;
|
||||
public bool mAutoEvaluateProperties = false;
|
||||
public bool mAutoEvaluatePropertiesOnHover = false;
|
||||
public bool mAutoRefreshWatches = false;
|
||||
|
||||
public void Serialize(StructuredData sd)
|
||||
{
|
||||
|
@ -194,7 +195,8 @@ namespace IDE
|
|||
sd.RemoveIfEmpty();
|
||||
}
|
||||
sd.Add("ProfileSampleRate", mProfileSampleRate);
|
||||
sd.Add("AutoEvaluateProperties", mAutoEvaluateProperties);
|
||||
sd.Add("AutoEvaluateProperties", mAutoEvaluatePropertiesOnHover);
|
||||
sd.Add("AutoRefreshWatches", mAutoRefreshWatches);
|
||||
}
|
||||
|
||||
public void Deserialize(StructuredData sd)
|
||||
|
@ -233,7 +235,8 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
sd.Get("ProfileSampleRate", ref mProfileSampleRate);
|
||||
sd.Get("AutoEvaluateProperties", ref mAutoEvaluateProperties);
|
||||
sd.Get("AutoEvaluateProperties", ref mAutoEvaluatePropertiesOnHover);
|
||||
sd.Get("AutoRefreshWatches", ref mAutoRefreshWatches);
|
||||
}
|
||||
|
||||
public void Apply()
|
||||
|
@ -264,6 +267,9 @@ namespace IDE
|
|||
gApp.mDebugger.SetSourcePathRemap(remapStr);
|
||||
|
||||
mProfileSampleRate = Math.Clamp(mProfileSampleRate, 10, 10000);
|
||||
|
||||
gApp.mDebugger.IncrementStateIdx();
|
||||
gApp.RefreshWatches();
|
||||
}
|
||||
|
||||
public void SetDefaults()
|
||||
|
@ -305,7 +311,12 @@ namespace IDE
|
|||
public class Colors
|
||||
{
|
||||
public Color mText = 0xFFFFFFFF;
|
||||
public Color mTextDisabled = 0xFFA8A8A8;
|
||||
public Color mTextSelected = 0xFF2f5c88;
|
||||
public Color mWindow = 0xFF44444D;
|
||||
public Color mDialogOutlineIn = 0xFF404040;
|
||||
public Color mDialogOutlineOut = 0xFF202020;
|
||||
public Color mGrid = 0x0CFFFFFF;
|
||||
public Color mBackground = 0xFF1C1C24;
|
||||
public Color mSelectedOutline = 0xFFCFAE11;
|
||||
public Color mMenuFocused = 0xFFE5A910;
|
||||
|
@ -340,10 +351,13 @@ namespace IDE
|
|||
public Color mError = 0xFFFF0000;
|
||||
public Color mBuildError = 0xFFFF8080;
|
||||
public Color mBuildWarning = 0xFFFFFF80;
|
||||
public Color mBuildSuccess = 0xFF80FF80;
|
||||
public Color mVisibleWhiteSpace = 0xFF9090C0;
|
||||
public Color mCurrentLineHilite = 0xFF4C4C54;
|
||||
public Color mCurrentLineNumberHilite = 0x18FFFFFF;
|
||||
public Color mCharPairHilite = 0x1DFFFFFF;
|
||||
public Color mCodeHilite = 0xFF384858;
|
||||
public Color mCodeHiliteUnfocused = 0x80384858;
|
||||
|
||||
public void Deserialize(StructuredData sd)
|
||||
{
|
||||
|
@ -356,7 +370,12 @@ namespace IDE
|
|||
}
|
||||
|
||||
GetColor("Text", ref mText);
|
||||
GetColor("TextDisabled", ref mTextDisabled);
|
||||
GetColor("TextSelected", ref mTextSelected);
|
||||
GetColor("Window", ref mWindow);
|
||||
GetColor("DialogOutlineIn", ref mDialogOutlineIn);
|
||||
GetColor("DialogOutlineOut", ref mDialogOutlineOut);
|
||||
GetColor("Grid", ref mGrid);
|
||||
GetColor("Background", ref mBackground);
|
||||
GetColor("SelectedOutline", ref mSelectedOutline);
|
||||
GetColor("MenuFocused", ref mMenuFocused);
|
||||
|
@ -408,10 +427,13 @@ namespace IDE
|
|||
GetColor("Error", ref mError);
|
||||
GetColor("BuildError", ref mBuildError);
|
||||
GetColor("BuildWarning", ref mBuildWarning);
|
||||
GetColor("BuildSuccess", ref mBuildSuccess);
|
||||
GetColor("VisibleWhiteSpace", ref mVisibleWhiteSpace);
|
||||
GetColor("CurrentLineHilite", ref mCurrentLineHilite);
|
||||
GetColor("CurrentLineNumberHilite", ref mCurrentLineNumberHilite);
|
||||
GetColor("CharPairHilite", ref mCharPairHilite);
|
||||
GetColor("CodeHilite", ref mCodeHilite);
|
||||
GetColor("CodeHiliteUnfocused", ref mCodeHiliteUnfocused);
|
||||
}
|
||||
|
||||
public void Apply()
|
||||
|
@ -437,10 +459,16 @@ namespace IDE
|
|||
SourceEditWidgetContent.sTextColors[(.)SourceElementType.Error] = mError;
|
||||
SourceEditWidgetContent.sTextColors[(.)SourceElementType.BuildError] = mBuildError;
|
||||
SourceEditWidgetContent.sTextColors[(.)SourceElementType.BuildWarning] = mBuildWarning;
|
||||
SourceEditWidgetContent.sTextColors[(.)SourceElementType.BuildSuccess] = mBuildSuccess;
|
||||
SourceEditWidgetContent.sTextColors[(.)SourceElementType.VisibleWhiteSpace] = mVisibleWhiteSpace;
|
||||
|
||||
DarkTheme.COLOR_TEXT = mText;
|
||||
DarkTheme.COLOR_TEXT_DISABLED = mTextDisabled;
|
||||
DarkTheme.COLOR_TEXT_SELECTED = mTextSelected;
|
||||
DarkTheme.COLOR_WINDOW = mWindow;
|
||||
DarkTheme.COLOR_DIALOG_OUTLINE_IN = mDialogOutlineIn;
|
||||
DarkTheme.COLOR_DIALOG_OUTLINE_OUT = mDialogOutlineOut;
|
||||
DarkTheme.COLOR_GRID = mGrid;
|
||||
DarkTheme.COLOR_BKG = mBackground;
|
||||
DarkTheme.COLOR_SELECTED_OUTLINE = mSelectedOutline;
|
||||
DarkTheme.COLOR_MENU_FOCUSED = mMenuFocused;
|
||||
|
@ -670,6 +698,7 @@ namespace IDE
|
|||
|
||||
public List<String> mFonts = new .() ~ DeleteContainerAndItems!(_);
|
||||
public float mFontSize = 12;
|
||||
public float mLineHeightScale = 1.0f;
|
||||
public AutoCompleteShowKind mAutoCompleteShowKind = .PanelIfVisible;
|
||||
public bool mAutoCompleteRequireControl = true;
|
||||
public bool mAutoCompleteRequireTab = false;
|
||||
|
@ -704,6 +733,7 @@ namespace IDE
|
|||
sd.Add(str);
|
||||
}
|
||||
sd.Add("FontSize", mFontSize);
|
||||
sd.Add("LineHeightScale", mLineHeightScale);
|
||||
sd.Add("AutoCompleteShowKind", mAutoCompleteShowKind);
|
||||
sd.Add("AutoCompleteRequireControl", mAutoCompleteRequireControl);
|
||||
sd.Add("AutoCompleteRequireTab", mAutoCompleteRequireTab);
|
||||
|
@ -741,6 +771,7 @@ namespace IDE
|
|||
}
|
||||
sd.Get("UIScale", ref gApp.mSettings.mUISettings.mScale); // Legacy
|
||||
sd.Get("FontSize", ref mFontSize);
|
||||
sd.Get("LineHeightScale", ref mLineHeightScale);
|
||||
sd.Get("AutoCompleteShowKind", ref mAutoCompleteShowKind);
|
||||
sd.Get("AutoCompleteRequireControl", ref mAutoCompleteRequireControl);
|
||||
sd.Get("AutoCompleteRequireTab", ref mAutoCompleteRequireTab);
|
||||
|
@ -1337,6 +1368,7 @@ namespace IDE
|
|||
{
|
||||
gApp.mSettings.mUISettings.mScale = Math.Clamp(gApp.mSettings.mUISettings.mScale, 50, 400);
|
||||
gApp.mSettings.mEditorSettings.mFontSize = Math.Clamp(gApp.mSettings.mEditorSettings.mFontSize, 6.0f, 72.0f);
|
||||
gApp.mSettings.mEditorSettings.mLineHeightScale = Math.Clamp(gApp.mSettings.mEditorSettings.mLineHeightScale, 0.125f, 10.0f);
|
||||
|
||||
mUISettings.Apply();
|
||||
mEditorSettings.Apply();
|
||||
|
@ -1349,7 +1381,6 @@ namespace IDE
|
|||
mKeySettings.Apply();
|
||||
mDebuggerSettings.Apply();
|
||||
|
||||
|
||||
for (var window in gApp.mWindows)
|
||||
{
|
||||
if (var widgetWindow = window as WidgetWindow)
|
||||
|
@ -1360,7 +1391,12 @@ namespace IDE
|
|||
|
||||
for (let value in gApp.mFileEditData.Values)
|
||||
if (value.mEditWidget != null)
|
||||
((SourceEditWidgetContent)value.mEditWidget.Content).mHiliteCurrentLine = gApp.mSettings.mEditorSettings.mHiliteCurrentLine;
|
||||
{
|
||||
var ewc = (SourceEditWidgetContent)value.mEditWidget.Content;
|
||||
ewc.mHiliteCurrentLine = gApp.mSettings.mEditorSettings.mHiliteCurrentLine;
|
||||
ewc.mLineHeightScale = gApp.mSettings.mEditorSettings.mLineHeightScale;
|
||||
ewc.RehupLineCoords();
|
||||
}
|
||||
|
||||
if (!mWakaTimeKey.IsEmpty)
|
||||
{
|
||||
|
|
|
@ -639,7 +639,7 @@ namespace IDE
|
|||
gApp.mDebugger.RehupBreakpoints(true);
|
||||
gApp.mDebugger.Run();
|
||||
gApp.mDebugger.mIsRunning = true;
|
||||
gApp.mDebugger.mDebugIdx++;
|
||||
gApp.mDebugger.IncrementSessionIdx();
|
||||
}
|
||||
|
||||
mTestInstance.mThread.Start(false);
|
||||
|
|
|
@ -238,17 +238,11 @@ namespace IDE.ui
|
|||
MarkDirty();
|
||||
}
|
||||
|
||||
public override void KeyDown(KeyCode keyCode, bool isRepeat)
|
||||
{
|
||||
base.KeyDown(keyCode, isRepeat);
|
||||
|
||||
if ((keyCode == (.)'C') && (mWidgetWindow.GetKeyFlags(true) == .Ctrl))
|
||||
{
|
||||
String versionInfo = scope String();
|
||||
versionInfo.AppendF("Beef IDE Version {}", gApp.mVersionInfo.FileVersion);
|
||||
versionInfo.AppendF(" Build {}", gApp.mVersionInfo.ProductVersion);
|
||||
gApp.SetClipboardText(versionInfo);
|
||||
}
|
||||
public override void GenerateClipboardText(String outText)
|
||||
{
|
||||
outText.AppendF("Beef IDE Version {}", gApp.mVersionInfo.FileVersion);
|
||||
outText.AppendF(" Build {}", gApp.mVersionInfo.ProductVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -308,8 +308,8 @@ namespace IDE.ui
|
|||
//Outline(g, mCategorySelector, 0, 0, 0xFF404040);
|
||||
//Outline(g, mCategorySelector, -1, -1, 0xFF202020);
|
||||
|
||||
Outline(g, mFileList, 0, 0, IDEApp.cDialogOutlineLightColor);
|
||||
Outline(g, mFileList, -1, -1, IDEApp.cDialogOutlineDarkColor);
|
||||
Outline(g, mFileList, 0, 0, DarkTheme.COLOR_DIALOG_OUTLINE_OUT);
|
||||
Outline(g, mFileList, -1, -1, DarkTheme.COLOR_DIALOG_OUTLINE_IN);
|
||||
}
|
||||
|
||||
void CheckFileDates()
|
||||
|
|
|
@ -413,6 +413,11 @@ namespace IDE.ui
|
|||
g.PushColor(DarkTheme.COLOR_MENU_FOCUSED);
|
||||
defer:loop g.PopColor();
|
||||
}
|
||||
else
|
||||
{
|
||||
g.PushColor(DarkTheme.COLOR_TEXT);
|
||||
defer:loop g.PopColor();
|
||||
}
|
||||
|
||||
let str = StringView(mEntryDisplay, index, @c.NextIndex - index);
|
||||
|
||||
|
@ -512,9 +517,6 @@ namespace IDE.ui
|
|||
|
||||
public void UpdateWidth()
|
||||
{
|
||||
if (mWidgetWindow == null)
|
||||
return;
|
||||
|
||||
int firstEntry = (int)(-(int)mScrollContent.mY / mItemSpacing);
|
||||
int lastEntry = (int)((-(int)mScrollContent.mY + mScrollContentContainer.mHeight) / mItemSpacing);
|
||||
|
||||
|
@ -536,6 +538,8 @@ namespace IDE.ui
|
|||
mMaxWidth = Math.Max(mMaxWidth, entryWidth);
|
||||
}
|
||||
|
||||
if (mWidgetWindow == null)
|
||||
return;
|
||||
|
||||
float docWidth = 0.0f;
|
||||
float docHeight = 0;
|
||||
|
@ -557,8 +561,8 @@ namespace IDE.ui
|
|||
|
||||
int drawScreenX = (.)(mWidgetWindow.mX + mWidth - mDocWidth);
|
||||
gApp.GetWorkspaceRectFrom(drawScreenX, mWidgetWindow.mY, 0, 0, var workspaceX, var workspaceY, var workspaceWidth, var workspaceHeight);
|
||||
float maxWidth = workspaceWidth - drawScreenX - GS!(8);
|
||||
float newDocWidth = Math.Min(docWidth, workspaceWidth - drawScreenX - GS!(8));
|
||||
float maxWidth = workspaceWidth - (drawScreenX - workspaceX) - GS!(8);
|
||||
float newDocWidth = Math.Min(docWidth, workspaceWidth - (drawScreenX - workspaceX) - GS!(8));
|
||||
newDocWidth = Math.Max(newDocWidth, GS!(80));
|
||||
if ((docWidth > maxWidth) || (lineCount > 1))
|
||||
{
|
||||
|
@ -703,6 +707,8 @@ namespace IDE.ui
|
|||
|
||||
public void SelectDirection(int32 dir)
|
||||
{
|
||||
mAutoComplete.HasInteracted = true;
|
||||
|
||||
if (mEntryList.IsEmpty)
|
||||
return;
|
||||
int32 newSelection = mSelectIdx + dir;
|
||||
|
@ -932,6 +938,9 @@ namespace IDE.ui
|
|||
mWidth = extWidth;
|
||||
mHeight = extHeight;
|
||||
|
||||
if ((mWidth <= 0) || (mHeight <= 0))
|
||||
return;
|
||||
|
||||
if (resizeWindow)
|
||||
{
|
||||
if (mOwnsWindow)
|
||||
|
@ -1069,8 +1078,12 @@ namespace IDE.ui
|
|||
{
|
||||
var font = IDEApp.sApp.mCodeFont;
|
||||
|
||||
extHeight = 0;
|
||||
extWidth = 0;
|
||||
|
||||
if (mSelectIdx < 0)
|
||||
return;
|
||||
|
||||
float curX = GS!(8);
|
||||
float curY = GS!(5);
|
||||
|
||||
|
@ -1274,6 +1287,8 @@ namespace IDE.ui
|
|||
float mWantX;
|
||||
float mWantY;
|
||||
|
||||
public bool HasInteracted;
|
||||
|
||||
public this(EditWidget targetEditWidget)
|
||||
{
|
||||
mTargetEditWidget = targetEditWidget;
|
||||
|
@ -1295,7 +1310,7 @@ namespace IDE.ui
|
|||
var textIdx;
|
||||
|
||||
// This makes typing '..' NOT move the window after pressing the second '.'
|
||||
if (mTargetEditWidget.Content.SafeGetChar(textIdx - 2) == '.')
|
||||
if (mTargetEditWidget.Content.SafeGetChar(textIdx - 2) == '.')
|
||||
{
|
||||
textIdx--;
|
||||
}
|
||||
|
@ -1572,7 +1587,7 @@ namespace IDE.ui
|
|||
mInsertStartIdx--;
|
||||
}*/
|
||||
|
||||
if ((mInvokeWidget != null) && (mInvokeWidget.mEntryList.Count > 0))
|
||||
if ((mInvokeWidget != null) && (mInvokeSrcPositions != null) && (mInvokeWidget.mEntryList.Count > 0))
|
||||
{
|
||||
var data = mTargetEditWidget.Content.mData;
|
||||
|
||||
|
@ -1807,7 +1822,7 @@ namespace IDE.ui
|
|||
|
||||
if (!fts_fuzzy_match(filter.CStr(), entry.mEntryDisplay.CStr(), ref score, &matches, matches.Count))
|
||||
{
|
||||
entry.SetMatches(Span<uint8>(null, 0));
|
||||
entry.SetMatches(Span<uint8>((uint8*)null, 0));
|
||||
entry.mScore = score;
|
||||
return false;
|
||||
}
|
||||
|
@ -2032,7 +2047,7 @@ namespace IDE.ui
|
|||
if (mInvokeWidget != null)
|
||||
{
|
||||
prevInvokeSelect = mInvokeWidget.mSelectIdx;
|
||||
if ((mInvokeWidget.mEntryList.Count > 0) && (!mInvokeSrcPositions.IsEmpty))
|
||||
if ((mInvokeWidget.mEntryList.Count > 0) && (mInvokeSrcPositions != null) && (!mInvokeSrcPositions.IsEmpty) && (mInvokeWidget.mSelectIdx >= 0))
|
||||
{
|
||||
if (IsInPanel())
|
||||
{
|
||||
|
@ -2042,8 +2057,11 @@ namespace IDE.ui
|
|||
{
|
||||
mInvokeWidget.mOwnsWindow = true;
|
||||
mInvokeWidget.ResizeContent(false);
|
||||
UpdateWindow(ref mInvokeWindow, mInvokeWidget, mInvokeSrcPositions[0], (int32)mInvokeWidget.mWidth, (int32)mInvokeWidget.mHeight);
|
||||
mInvokeWidget.ResizeContent(true);
|
||||
if ((mInvokeWidget.mWidth > 0) && (mInvokeWidget.mHeight > 0))
|
||||
{
|
||||
UpdateWindow(ref mInvokeWindow, mInvokeWidget, mInvokeSrcPositions[0], (int32)mInvokeWidget.mWidth, (int32)mInvokeWidget.mHeight);
|
||||
mInvokeWidget.ResizeContent(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2209,6 +2227,7 @@ namespace IDE.ui
|
|||
}
|
||||
contentHeight += GS!(8);
|
||||
mAutoCompleteListWidget.ResizeContent(windowWidth, contentHeight, wantScrollbar);
|
||||
//mAutoCompleteListWidget.UpdateWidth();
|
||||
if ((mInsertStartIdx != -1) && (!IsInPanel()))
|
||||
{
|
||||
UpdateWindow(ref mListWindow, mAutoCompleteListWidget, mInsertStartIdx, windowWidth, windowHeight);
|
||||
|
@ -2963,7 +2982,7 @@ namespace IDE.ui
|
|||
return;
|
||||
}
|
||||
|
||||
bool isExplicitInsert = (keyChar == '\0') || (keyChar == '\t') || (keyChar == '\n');
|
||||
bool isExplicitInsert = (keyChar == '\0') || (keyChar == '\t') || (keyChar == '\n') || (keyChar == '\r');
|
||||
|
||||
String insertText = entry.mEntryInsert ?? entry.mEntryDisplay;
|
||||
if ((!isExplicitInsert) && (insertText.Contains('\t')))
|
||||
|
@ -2977,11 +2996,15 @@ namespace IDE.ui
|
|||
//insertText = insertText.Substring(0, insertText.Length - 1);
|
||||
String implText = null;
|
||||
int tabIdx = insertText.IndexOf('\t');
|
||||
if (tabIdx != -1)
|
||||
int splitIdx = tabIdx;
|
||||
int crIdx = insertText.IndexOf('\r');
|
||||
if ((crIdx != -1) && (tabIdx != -1) && (crIdx < tabIdx))
|
||||
splitIdx = crIdx;
|
||||
if (splitIdx != -1)
|
||||
{
|
||||
implText = scope:: String();
|
||||
implText.Append(insertText, tabIdx);
|
||||
insertText.RemoveToEnd(tabIdx);
|
||||
implText.Append(insertText, splitIdx);
|
||||
insertText.RemoveToEnd(splitIdx);
|
||||
}
|
||||
String prevText = scope String();
|
||||
mTargetEditWidget.Content.ExtractString(editSelection.mStartPos, editSelection.mEndPos - editSelection.mStartPos, prevText);
|
||||
|
|
|
@ -693,7 +693,7 @@ namespace IDE.ui
|
|||
|
||||
for (int32 c in scope int32[] ( 4, 8, 16, 32, 64 ))
|
||||
{
|
||||
columnChoice = menuItem.AddItem(StackStringFormat!("{0} bytes", c));
|
||||
columnChoice = menuItem.AddItem(scope String()..AppendF("{0} bytes", c));
|
||||
if ((mAutoResizeType == .Manual) && (c == (int32)mBytesPerDisplayLine))
|
||||
columnChoice.mIconImage = DarkTheme.sDarkTheme.GetImage(DarkTheme.ImageIdx.Check);
|
||||
columnChoice.mOnMenuItemSelected.Add(new (evt) =>
|
||||
|
@ -877,15 +877,15 @@ namespace IDE.ui
|
|||
// column header
|
||||
using (g.PushClip(0, 0, mWidth, GS!(mColumnHeaderHeight)))
|
||||
{
|
||||
using (g.PushColor(0xFFFFFFFF))
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
{
|
||||
g.SetFont(mFont);
|
||||
float strViewColumnStart = GS!(mColumnDisplayStart) + mBytesPerDisplayLine*GS!(mColumnDisplayStride) + GS!(mStrViewDisplayStartOffset);
|
||||
|
||||
for (int i=0; i<mBytesPerDisplayLine; ++i)
|
||||
{
|
||||
g.DrawString(StackStringFormat!("{0:X1}", i), GS!(mColumnDisplayStart) + i*GS!(mColumnDisplayStride) + GS!(mColumnDisplayStride)*0.125f - ((i > 0xF) ? GS!(4) : 0), GS!(3), FontAlign.Left);
|
||||
g.DrawString(StackStringFormat!("{0:X1}", i & 0xF), strViewColumnStart + i*GS!(mStrViewDisplayStride), GS!(3), FontAlign.Left);
|
||||
g.DrawString(scope String()..AppendF("{0:X1}", i), GS!(mColumnDisplayStart) + i*GS!(mColumnDisplayStride) + GS!(mColumnDisplayStride)*0.125f - ((i > 0xF) ? GS!(4) : 0), GS!(3), FontAlign.Left);
|
||||
g.DrawString(scope String()..AppendF("{0:X1}", i & 0xF), strViewColumnStart + i*GS!(mStrViewDisplayStride), GS!(3), FontAlign.Left);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -908,7 +908,7 @@ namespace IDE.ui
|
|||
float displayAdj = (float)(-mShowPositionDisplayOffset * lineSpacing);
|
||||
using (g.PushTranslate(0, displayAdj))
|
||||
{
|
||||
using (g.PushColor(0xFFFFFFFF))
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
{
|
||||
//ulong lineStart = mCurPosition / mBytesPerDisplayLine;
|
||||
int lockSize = lineCount * mBytesPerDisplayLine;
|
||||
|
|
|
@ -652,17 +652,15 @@ namespace IDE.ui
|
|||
subItem.mOnMouseClick.Add(new => ListViewItemClicked);
|
||||
}
|
||||
var listViewItem = (BreakpointListViewItem)root.GetChildAtIndex(breakIdx);
|
||||
listViewItem.mTextColor = Color.White;
|
||||
listViewItem.mTextColor = DarkTheme.COLOR_TEXT;
|
||||
|
||||
listViewItem.mIsBold = breakpoint.IsActiveBreakpoint();
|
||||
|
||||
var locString = scope String();
|
||||
breakpoint.ToString_Location(locString);
|
||||
listViewItem.Label = locString;
|
||||
if (breakpoint.IsBound())
|
||||
listViewItem.mTextColor = 0xFFFFFFFF;
|
||||
else
|
||||
listViewItem.mTextColor = 0x80FFFFFF;
|
||||
if (!breakpoint.IsBound())
|
||||
listViewItem.mTextColor = (0x00FFFFFF & DarkTheme.COLOR_TEXT) | 0x80000000;
|
||||
|
||||
// Condition
|
||||
var subItem = listViewItem.GetSubItem(2);
|
||||
|
|
|
@ -369,14 +369,17 @@ namespace IDE.ui
|
|||
{
|
||||
base.Draw(g);
|
||||
|
||||
g.DrawString("Breakpoint Condition", mConditionEdit.mX, mConditionEdit.mY - GS!(20));
|
||||
g.DrawString("Thread Id", mThreadEdit.mX, mThreadEdit.mY - GS!(20));
|
||||
g.DrawString("Log String", mLogEdit.mX, mLogEdit.mY - GS!(20));
|
||||
g.DrawString("Break on Hit Count", mHitCountCombo.mX, mHitCountEdit.mY - GS!(19));
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
{
|
||||
g.DrawString("Breakpoint Condition", mConditionEdit.mX, mConditionEdit.mY - GS!(20));
|
||||
g.DrawString("Thread Id", mThreadEdit.mX, mThreadEdit.mY - GS!(20));
|
||||
g.DrawString("Log String", mLogEdit.mX, mLogEdit.mY - GS!(20));
|
||||
g.DrawString("Break on Hit Count", mHitCountCombo.mX, mHitCountEdit.mY - GS!(19));
|
||||
|
||||
var str = scope String();
|
||||
str.AppendF("Current: {0}", mStartingHitCount);
|
||||
g.DrawString(str, mWidth - GS!(16) - GS!(8), mHitCountEdit.mY - GS!(19), .Right);
|
||||
var str = scope String();
|
||||
str.AppendF("Current: {0}", mStartingHitCount);
|
||||
g.DrawString(str, mWidth - GS!(16) - GS!(8), mHitCountEdit.mY - GS!(19), .Right);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -255,7 +255,8 @@ namespace IDE.ui
|
|||
{
|
||||
using (g.PushClip(0, 0, width, height))
|
||||
{
|
||||
using (g.PushColor(0xFF00FF00))
|
||||
// Using override to prevent the color turning black when using a dark text color.
|
||||
using (g.PushColorOverride(0xFF00FF00))
|
||||
{
|
||||
float prevY = 0;
|
||||
|
||||
|
@ -439,10 +440,13 @@ namespace IDE.ui
|
|||
using (g.PushColor(0x20FFFFFF))
|
||||
g.FillRect(0, 0, mWidth, mHeight);
|
||||
|
||||
DrawData(g, mData, mTimes, dataRect.mX, dataRect.mY, dataRect.mWidth, dataRect.mHeight);
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
{
|
||||
DrawData(g, mData, mTimes, dataRect.mX, dataRect.mY, dataRect.mWidth, dataRect.mHeight);
|
||||
|
||||
g.SetFont(DarkTheme.sDarkTheme.mSmallBoldFont);
|
||||
g.DrawString(mLabel, -GS!(0), -GS!(0), .Centered, dataRect.mX);
|
||||
g.SetFont(DarkTheme.sDarkTheme.mSmallBoldFont);
|
||||
g.DrawString(mLabel, -GS!(0), -GS!(0), .Centered, dataRect.mX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -890,7 +890,7 @@ namespace IDE.ui
|
|||
{
|
||||
var lineData = mLineDatas[lineIdx];
|
||||
if (lineData.mSourceFile != null)
|
||||
g.DrawString(StackStringFormat!("{0}", lineData.mSourceLineNum + 1), GS!(8), GS!(2) + lineIdx * lineSpacing, FontAlign.Right, mEditWidget.mX - GS!(14));
|
||||
g.DrawString(scope String()..AppendF("{0}", lineData.mSourceLineNum + 1), GS!(8), GS!(2) + lineIdx * lineSpacing, FontAlign.Right, mEditWidget.mX - GS!(14));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1338,7 +1338,7 @@ namespace IDE.ui
|
|||
{
|
||||
if (mLineDatas[line].mAddrEnd != (int)0)
|
||||
{
|
||||
String nextAddr = StackStringFormat!("0x{0:x}L", (int64)mLineDatas[line].mAddrEnd);
|
||||
String nextAddr = scope String()..AppendF("0x{0:x}L", (int64)mLineDatas[line].mAddrEnd);
|
||||
nextAddr.Append(" +");
|
||||
debugExpr.Replace("rip +", nextAddr);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,43 @@ namespace IDE.ui
|
|||
public int mLine;
|
||||
public int mColumn;
|
||||
|
||||
public override void MouseClicked(float x, float y, float origX, float origY, int32 btn)
|
||||
{
|
||||
base.MouseClicked(x, y, origX, origY, btn);
|
||||
|
||||
if (btn == 1)
|
||||
{
|
||||
Menu menu = new Menu();
|
||||
var menuItemCopySingle = menu.AddItem("Copy");
|
||||
menuItemCopySingle.mOnMenuItemSelected.Add(new (evt) =>
|
||||
{
|
||||
String buffer = scope .();
|
||||
mListView.GetRoot().WithSelectedItems(scope (item) =>
|
||||
{
|
||||
var errorItem = (ErrorsListViewItem)item;
|
||||
if (!buffer.IsEmpty)
|
||||
buffer.Append("\n");
|
||||
errorItem.CopyError(buffer);
|
||||
});
|
||||
if (!buffer.IsEmpty)
|
||||
gApp.SetClipboardText(buffer);
|
||||
});
|
||||
|
||||
MenuWidget menuWidget = DarkTheme.sDarkTheme.CreateMenuWidget(menu);
|
||||
menuWidget.Init(this, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyError (String buffer)
|
||||
{
|
||||
var preffix = scope String();
|
||||
Font.StrRemoveColors(this.mSubItems[0].mLabel, preffix);
|
||||
preffix.ToUpper();
|
||||
var description = this.mSubItems[1].mLabel;
|
||||
|
||||
buffer.AppendF("{}: {} at line {}:{} in {}", preffix, description, this.mLine, this.mColumn, this.mFilePath);
|
||||
}
|
||||
|
||||
public override void DrawSelect(Graphics g)
|
||||
{
|
||||
bool hasFocus = mListView.mHasFocus;
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace IDE.ui
|
|||
AddDialogComponent(mMatchCaseCheckbox);
|
||||
|
||||
mMatchWholeWordCheckbox = new DarkCheckBox();
|
||||
mMatchWholeWordCheckbox.Label = "Match &whole case";
|
||||
mMatchWholeWordCheckbox.Label = "Match &whole word";
|
||||
AddDialogComponent(mMatchWholeWordCheckbox);
|
||||
|
||||
mAbortButton = new DarkButton();
|
||||
|
@ -322,11 +322,14 @@ namespace IDE.ui
|
|||
{
|
||||
base.Draw(g);
|
||||
|
||||
g.DrawString("Find what:", 6, mEditWidget.mY - GS!(18));
|
||||
if (mReplaceWidget != null)
|
||||
g.DrawString("Replace with:", GS!(6), mReplaceWidget.mY - GS!(18));
|
||||
g.DrawString("Look in:", GS!(6), mLocationCombo.mY - GS!(18));
|
||||
g.DrawString("Look at these file types:", GS!(6), mFileTypesCombo.mY - GS!(18));
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
{
|
||||
g.DrawString("Find what:", 6, mEditWidget.mY - GS!(18));
|
||||
if (mReplaceWidget != null)
|
||||
g.DrawString("Replace with:", GS!(6), mReplaceWidget.mY - GS!(18));
|
||||
g.DrawString("Look in:", GS!(6), mLocationCombo.mY - GS!(18));
|
||||
g.DrawString("Look at these file types:", GS!(6), mFileTypesCombo.mY - GS!(18));
|
||||
}
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
|
|
|
@ -185,9 +185,10 @@ namespace IDE.ui
|
|||
|
||||
char8* linePtr = line.Ptr;
|
||||
|
||||
bool lineMatched;
|
||||
bool lineMatched = false;
|
||||
if (mSearchOptions.mMatchWholeWord)
|
||||
{
|
||||
line.EnsureNullTerminator();
|
||||
bool isNewStart = true;
|
||||
int lineIdx = 0;
|
||||
for (let c32 in line.DecodedChars)
|
||||
|
|
|
@ -581,12 +581,15 @@ namespace IDE.ui
|
|||
uiEntry.mName = partItr.GetNext().Value.UnQuoteString(.. new .());
|
||||
uiEntry.mLabel = partItr.GetNext().Value.UnQuoteString(.. new .());
|
||||
var defaultValue = partItr.GetNext().Value.UnQuoteString(.. scope .());
|
||||
var focus = partItr.GetNext().Value;
|
||||
DarkEditWidget editWidget = new DarkEditWidget();
|
||||
uiEntry.mWidget = editWidget;
|
||||
editWidget.SetText(defaultValue);
|
||||
editWidget.mEditWidgetContent.SelectAll();
|
||||
editWidget.mOnSubmit.Add(new => EditSubmitHandler);
|
||||
AddWidget(editWidget);
|
||||
if (focus == "True")
|
||||
editWidget.SetFocus();
|
||||
mUIEntries.Add(uiEntry);
|
||||
mTabWidgets.Add(editWidget);
|
||||
case "addFilePath", "addFolderPath":
|
||||
|
@ -834,9 +837,12 @@ namespace IDE.ui
|
|||
g.DrawString(label, widget.mX + GS!(6), widget.mY - GS!(20));
|
||||
}
|
||||
|
||||
DrawLabel(mKindBar, mRegenerating ? "Regenerating ..." : "Generator");
|
||||
for (var uiEntry in mUIEntries)
|
||||
DrawLabel(uiEntry.mWidget, uiEntry.mLabel);
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
{
|
||||
DrawLabel(mKindBar, mRegenerating ? "Regenerating ..." : "Generator");
|
||||
for (var uiEntry in mUIEntries)
|
||||
DrawLabel(uiEntry.mWidget, uiEntry.mLabel);
|
||||
}
|
||||
}
|
||||
|
||||
public override void DrawAll(Graphics g)
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace IDE.ui
|
|||
|
||||
mDefaultButton = AddButton("OK", new (evt) => GotoLineSubmit(true));
|
||||
mEscButton = AddButton("Cancel", new (evt) => Cancel());
|
||||
mEditWidget = AddEdit(StackStringFormat!("{0}", line + 1));
|
||||
mEditWidget = AddEdit(scope String()..AppendF("{0}", line + 1));
|
||||
mEditWidget.mOnContentChanged.Add(new (evt) => GotoLineSubmit(false));
|
||||
}
|
||||
|
||||
|
|
|
@ -775,7 +775,7 @@ namespace IDE.ui
|
|||
flags |= DebugManager.EvalExpressionFlags.DeselectCallStackIdx;
|
||||
if (mAllowSideEffects)
|
||||
flags |= .AllowSideEffects | .AllowCalls;
|
||||
if (gApp.mSettings.mDebuggerSettings.mAutoEvaluateProperties)
|
||||
if (gApp.mSettings.mDebuggerSettings.mAutoEvaluatePropertiesOnHover)
|
||||
flags |= .AllowProperties;
|
||||
if (watch.mResultType == .RawText)
|
||||
flags |= .RawStr;
|
||||
|
@ -1311,6 +1311,7 @@ namespace IDE.ui
|
|||
|
||||
float addHeight = nameHeight - listViewItem.mSelfHeight;
|
||||
listViewItem.mSelfHeight = nameHeight;
|
||||
listViewItem.mFreezeHeight = true;
|
||||
height += addHeight;
|
||||
}
|
||||
|
||||
|
@ -1322,6 +1323,8 @@ namespace IDE.ui
|
|||
height += GS!(2);
|
||||
|
||||
listView.Resize(popupX, popupY, useWidth, height);
|
||||
listView.mListSizeDirty = true;
|
||||
listView.UpdateListSize();
|
||||
ResizeWindow();
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,8 @@ namespace IDE.ui
|
|||
{
|
||||
base.Draw(g);
|
||||
|
||||
g.DrawString((mBreakpointKind == .Memory) ? "Breakpoint Address" : "Symbol Name", mAddressEdit.mX, mAddressEdit.mY - GS!(20));
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
g.DrawString((mBreakpointKind == .Memory) ? "Breakpoint Address" : "Symbol Name", mAddressEdit.mX, mAddressEdit.mY - GS!(20));
|
||||
//g.DrawString("Project Directory", mDialogEditWidget.mX, mDialogEditWidget.mY - 20);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace IDE.ui
|
|||
String projectFilePath = scope String()..Append(projDirectory, "/BeefProj.toml");
|
||||
if (File.Exists(projectFilePath))
|
||||
{
|
||||
gApp.Fail(scope String()..AppendF("A Beef projects already exists at '{0}'", projDirectory));
|
||||
gApp.Fail(scope String()..AppendF("A Beef project already exists at '{0}'", projDirectory));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -365,8 +365,8 @@ namespace IDE.ui
|
|||
//Outline(g, mCategorySelector, 0, 0, 0xFF404040);
|
||||
//Outline(g, mCategorySelector, -1, -1, 0xFF202020);
|
||||
|
||||
Outline(g, mFileList, 0, 0, IDEApp.cDialogOutlineLightColor);
|
||||
Outline(g, mFileList, -1, -1, IDEApp.cDialogOutlineDarkColor);
|
||||
Outline(g, mFileList, 0, 0, DarkTheme.COLOR_DIALOG_OUTLINE_OUT);
|
||||
Outline(g, mFileList, -1, -1, DarkTheme.COLOR_DIALOG_OUTLINE_IN);
|
||||
}
|
||||
|
||||
void CheckFileDates()
|
||||
|
|
|
@ -287,7 +287,7 @@ namespace IDE.ui
|
|||
|
||||
public void WriteSmart(StringView text)
|
||||
{
|
||||
for (var line in text.Split('\n'))
|
||||
LineLoop: for (var line in text.Split('\n'))
|
||||
{
|
||||
if (@line.Pos != 0)
|
||||
Write("\n");
|
||||
|
@ -302,10 +302,21 @@ namespace IDE.ui
|
|||
|
||||
mQueuedDisplayChanges.Add(QueuedDisplayChange(mQueuedText.Length, "ERROR".Length, (.)SourceElementType.BuildError));
|
||||
}
|
||||
if (line.StartsWith("ERROR-SOFT:"))
|
||||
{
|
||||
var str = scope:LineLoop String(line);
|
||||
str.Replace("ERROR-SOFT", "ERROR");
|
||||
line = str;
|
||||
mQueuedDisplayChanges.Add(QueuedDisplayChange(mQueuedText.Length, "ERROR".Length, (.)SourceElementType.BuildError));
|
||||
}
|
||||
if ((line.StartsWith("WARNING:")) || (line.StartsWith("WARNING(")))
|
||||
{
|
||||
mQueuedDisplayChanges.Add(QueuedDisplayChange(mQueuedText.Length, "WARNING".Length, (.)SourceElementType.BuildWarning));
|
||||
}
|
||||
if (line.StartsWith("SUCCESS:"))
|
||||
{
|
||||
mQueuedDisplayChanges.Add(QueuedDisplayChange(mQueuedText.Length, "SUCCESS".Length, (.)SourceElementType.BuildSuccess));
|
||||
}
|
||||
Write(line);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace IDE.ui
|
|||
var editWidget = new WatchStringEdit(mTooltipText, null);
|
||||
|
||||
tooltip.mRelWidgetMouseInsets = new Insets(0, 0, GS!(-8), 0);
|
||||
tooltip.mAllowMouseInsideSelf = true;
|
||||
tooltip.mAllowMouseInsideInsets = new .();
|
||||
tooltip.AddWidget(editWidget);
|
||||
tooltip.mOnResized.Add(new (widget) => editWidget.Resize(GS!(6), GS!(6), widget.mWidth - GS!(6) * 2, widget.mHeight - GS!(6) * 2));
|
||||
tooltip.mOnResized(tooltip);
|
||||
|
|
|
@ -95,9 +95,12 @@ namespace IDE.ui
|
|||
{
|
||||
base.Draw(g);
|
||||
|
||||
DrawLabel(g, mDescEdit, "Profile Description (Optional)");
|
||||
DrawLabel(g, mThreadCombo, "Thread");
|
||||
DrawLabel(g, mSampleRateEdit, "Sample Rate");
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
{
|
||||
DrawLabel(g, mDescEdit, "Profile Description (Optional)");
|
||||
DrawLabel(g, mThreadCombo, "Thread");
|
||||
DrawLabel(g, mSampleRateEdit, "Sample Rate");
|
||||
}
|
||||
}
|
||||
|
||||
public override void CalcSize()
|
||||
|
|
|
@ -684,24 +684,27 @@ namespace IDE.ui
|
|||
{
|
||||
base.Draw(g);
|
||||
|
||||
g.PushColor(DarkTheme.COLOR_TEXT);
|
||||
defer g.PopColor();
|
||||
|
||||
g.SetFont(DarkTheme.sDarkTheme.mSmallFont);
|
||||
g.DrawString("Session", mSessionComboBox.mX - GS!(2), mSessionComboBox.mY, .Right);
|
||||
g.DrawString("Thread", mThreadComboBox.mX - GS!(2), mThreadComboBox.mY, .Right);
|
||||
|
||||
if ((mProfiler != null) && (mShowOverview != null))
|
||||
{
|
||||
g.DrawString(StackStringFormat!("Rate: {0} Hz", mShowOverview.mSamplesPerSecond), GS!(320), GS!(2));
|
||||
g.DrawString(scope String()..AppendF("Rate: {0} Hz", mShowOverview.mSamplesPerSecond), GS!(320), GS!(2));
|
||||
int32 seconds = (mShowOverview.mRecordedTicks / 1000);
|
||||
g.DrawString(StackStringFormat!("Length: {0}:{1:00}.{2}", seconds / 60, seconds % 60, (mShowOverview.mRecordedTicks % 1000)/100), GS!(320), GS!(22));
|
||||
g.DrawString(scope String()..AppendF("Length: {0}:{1:00}.{2}", seconds / 60, seconds % 60, (mShowOverview.mRecordedTicks % 1000)/100), GS!(320), GS!(22));
|
||||
|
||||
seconds = (mShowOverview.mEndedTicks / 1000);
|
||||
if (seconds > 60*60)
|
||||
g.DrawString(StackStringFormat!("Age: {0}:{1:00}:{2:00}", seconds / 60 / 60, (seconds / 60) % 60, seconds % 60), GS!(420), GS!(22));
|
||||
g.DrawString(scope String()..AppendF("Age: {0}:{1:00}:{2:00}", seconds / 60 / 60, (seconds / 60) % 60, seconds % 60), GS!(420), GS!(22));
|
||||
else
|
||||
g.DrawString(StackStringFormat!("Age: {0}:{1:00}", seconds / 60, seconds % 60), GS!(420), GS!(22));
|
||||
g.DrawString(scope String()..AppendF("Age: {0}:{1:00}", seconds / 60, seconds % 60), GS!(420), GS!(22));
|
||||
|
||||
g.DrawString(StackStringFormat!("Samples: {0}", mShowOverview.mTotalActualSamples), GS!(420), GS!(2));
|
||||
g.DrawString(StackStringFormat!("Missed Samples: {0}", mShowOverview.mTotalVirtualSamples - mShowOverview.mTotalActualSamples), GS!(550), GS!(2));
|
||||
g.DrawString(scope String()..AppendF("Samples: {0}", mShowOverview.mTotalActualSamples), GS!(420), GS!(2));
|
||||
g.DrawString(scope String()..AppendF("Missed Samples: {0}", mShowOverview.mTotalVirtualSamples - mShowOverview.mTotalActualSamples), GS!(550), GS!(2));
|
||||
}
|
||||
|
||||
if (mTickCreated != 0)
|
||||
|
|
|
@ -1257,9 +1257,9 @@ namespace IDE.ui
|
|||
{
|
||||
String errorStr;
|
||||
if (alreadyHadFileList.Count == 1)
|
||||
errorStr = StackStringFormat!("Project already contained file: {0}", alreadyHadFileList[0]);
|
||||
errorStr = scope:: String()..AppendF("Project already contained file: {0}", alreadyHadFileList[0]);
|
||||
else
|
||||
errorStr = StackStringFormat!("Project already contained {0} of the {1} files specified", alreadyHadFileList.Count, totalFileCount);
|
||||
errorStr = scope:: String()..AppendF("Project already contained {0} of the {1} files specified", alreadyHadFileList.Count, totalFileCount);
|
||||
IDEApp.sApp.Fail(errorStr);
|
||||
}
|
||||
}
|
||||
|
@ -1991,7 +1991,7 @@ namespace IDE.ui
|
|||
|
||||
if (projectCount == 1)
|
||||
{
|
||||
aDialog = ThemeFactory.mDefault.CreateDialog("Remove Project", StackStringFormat!("Remove project '{0}' from the workspace?", selectedProjectItem.mProject.mProjectName));
|
||||
aDialog = ThemeFactory.mDefault.CreateDialog("Remove Project", scope String()..AppendF("Remove project '{0}' from the workspace?", selectedProjectItem.mProject.mProjectName));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2009,7 +2009,7 @@ namespace IDE.ui
|
|||
if (fileCount + folderCount == 1)
|
||||
{
|
||||
aDialog = ThemeFactory.mDefault.CreateDialog((fileCount > 0) ? "Delete File" : "Delete Folder",
|
||||
StackStringFormat!("Choose Remove to remove '{0}' from '{1}'.\n\nChoose Delete to permanently delete '{0}'.", selectedProjectItem.mName, selectedProjectItem.mProject.mProjectName));
|
||||
scope String()..AppendF("Choose Remove to remove '{0}' from '{1}'.\n\nChoose Delete to permanently delete '{0}'.", selectedProjectItem.mName, selectedProjectItem.mProject.mProjectName));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2034,12 +2034,12 @@ namespace IDE.ui
|
|||
if (projectsReferenced.Count == 1)
|
||||
{
|
||||
aDialog = ThemeFactory.mDefault.CreateDialog(title,
|
||||
StackStringFormat!("Choose Remove to remove the selected {0} from '{1}'.\n\nChoose Delete to permanently delete the selected items.", typeDeleting, selectedProjectItem.mProject.mProjectName));
|
||||
scope String()..AppendF("Choose Remove to remove the selected {0} from '{1}'.\n\nChoose Delete to permanently delete the selected items.", typeDeleting, selectedProjectItem.mProject.mProjectName));
|
||||
}
|
||||
else
|
||||
{
|
||||
aDialog = ThemeFactory.mDefault.CreateDialog(title,
|
||||
StackStringFormat!("Choose Remove to removed the selected {0}.\n\nChoose Delete to permanently delete the selected items.", typeDeleting));
|
||||
scope String()..AppendF("Choose Remove to removed the selected {0}.\n\nChoose Delete to permanently delete the selected items.", typeDeleting));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2580,7 +2580,7 @@ namespace IDE.ui
|
|||
/*if ((IDEApp.IsBeefFile(prevPath) != IDEApp.IsBeefFile(newPath)) ||
|
||||
(IDEApp.IsClangSourceFile(prevPath) != IDEApp.IsClangSourceFile(newPath)))
|
||||
{
|
||||
IDEApp.sApp.Fail(StackStringFormat!("Invalid file extension change, cannot rename '{0}' to '{1}'", prevPath, newPath));
|
||||
IDEApp.sApp.Fail(scope String()..AppendF("Invalid file extension change, cannot rename '{0}' to '{1}'", prevPath, newPath));
|
||||
return;
|
||||
}*/
|
||||
|
||||
|
@ -2798,7 +2798,7 @@ namespace IDE.ui
|
|||
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
gApp.Fail(StackStringFormat!("Project file not found: {0}", filePath));
|
||||
gApp.Fail(scope String()..AppendF("Project file not found: {0}", filePath));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -2823,7 +2823,7 @@ namespace IDE.ui
|
|||
Path.GetFileNameWithoutExtension(filePath, projName);
|
||||
if (gApp.mWorkspace.FindProject(projName) != null)
|
||||
{
|
||||
gApp.Fail(StackStringFormat!("A project named '{0}' name already exists in the workspace.", projName));
|
||||
gApp.Fail(scope String()..AppendF("A project named '{0}' name already exists in the workspace.", projName));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -2841,7 +2841,7 @@ namespace IDE.ui
|
|||
InitProject(proj, workspaceFolder);
|
||||
if (failed)
|
||||
{
|
||||
gApp.Fail(StackStringFormat!("Failed to load project: {0}", filePath));
|
||||
gApp.Fail(scope String()..AppendF("Failed to load project: {0}", filePath));
|
||||
return proj;
|
||||
}
|
||||
|
||||
|
|
|
@ -884,7 +884,7 @@ namespace IDE.ui
|
|||
if (projectSpec.mVerSpec case .Git(let url, let ver))
|
||||
{
|
||||
dependencyEntry.SetValue(1, url);
|
||||
dependencyEntry.SetValue(2, ver.mVersion);
|
||||
dependencyEntry.SetValue(2, ver?.mVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,6 +195,7 @@ namespace IDE.ui
|
|||
None,
|
||||
BrowseForFile,
|
||||
BrowseForFolder,
|
||||
Percent
|
||||
}
|
||||
|
||||
public enum MultiEncodeKind
|
||||
|
@ -1036,8 +1037,10 @@ namespace IDE.ui
|
|||
}
|
||||
else if (curVariantType.[Friend]mTypeCode == .Float)
|
||||
{
|
||||
if (float.Parse(newValue) case .Ok(let floatVal))
|
||||
if (float.Parse(newValue) case .Ok(var floatVal))
|
||||
{
|
||||
if (editingProp.mFlags.HasFlag(.Percent))
|
||||
floatVal /= 100;
|
||||
editingProp.mCurValue = Variant.Create(floatVal);
|
||||
}
|
||||
else
|
||||
|
@ -1536,7 +1539,7 @@ namespace IDE.ui
|
|||
}
|
||||
if (i < strVals.Count)
|
||||
{
|
||||
childItem.Label = StackStringFormat!("#{0}", i + 1);
|
||||
childItem.Label = scope String()..AppendF("#{0}", i + 1);
|
||||
childSubItem.mTextColor = DarkTheme.COLOR_TEXT;
|
||||
}
|
||||
else
|
||||
|
@ -1600,6 +1603,8 @@ namespace IDE.ui
|
|||
{
|
||||
let valStr = scope String();
|
||||
float floatVal = propEntry.mCurValue.Get<float>();
|
||||
if (propEntry.mFlags.HasFlag(.Percent))
|
||||
floatVal *= 100;
|
||||
floatVal.ToString(valStr);
|
||||
valueItem.Label = valStr;
|
||||
}
|
||||
|
@ -2042,7 +2047,7 @@ namespace IDE.ui
|
|||
let width = GetValueEditWidth(subItem);
|
||||
propEntry.mEditInsets.mRight = GS!(22);
|
||||
browseButton.mLabelYOfs = GS!(-2);
|
||||
browseButton.Resize(width - GS!(21), GS!(1), GS!(20), subItem.mHeight - 2);
|
||||
browseButton.Resize(width - GS!(21), GS!(1), GS!(20), Math.Max(subItem.mHeight - 2, 0));
|
||||
|
||||
});
|
||||
subItem.AddWidget(browseButton);
|
||||
|
|
|
@ -182,7 +182,7 @@ namespace IDE.ui
|
|||
mEditWidget.SetFocus();
|
||||
replaceCount = Replace(true);
|
||||
if (replaceCount > 0)
|
||||
IDEApp.sApp.MessageDialog("Replace Results", StackStringFormat!("{0} instance(s) replaced.", replaceCount));
|
||||
IDEApp.sApp.MessageDialog("Replace Results", scope String()..AppendF("{0} instance(s) replaced.", replaceCount));
|
||||
|
||||
if (replaceCount != -1)
|
||||
{
|
||||
|
|
|
@ -367,11 +367,7 @@ namespace IDE.ui
|
|||
{
|
||||
String lineStr = scope String();
|
||||
editWidgetContent.ExtractString(lineStart, idx - lineStart, lineStr);
|
||||
|
||||
//String fileName = editData.mFilePath;
|
||||
//String fileName = scope String();
|
||||
//projectSource.GetFullImportPath(fileName);
|
||||
|
||||
lineStr.Trim();
|
||||
gApp.mFindResultsPanel.QueueLine(editData, lineNum, 0, lineStr);
|
||||
|
||||
wantsLine = false;
|
||||
|
@ -719,7 +715,7 @@ namespace IDE.ui
|
|||
editWidgetContent.mData.mUndoManager.Add(insertTextAction);
|
||||
editWidgetContent.PhysInsertAtCursor(newStr, false);
|
||||
|
||||
if (spanStart <= cursorPos)
|
||||
if (spanStart + strLenDiff <= cursorPos)
|
||||
cursorPos += strLenDiff;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,6 +98,7 @@ namespace IDE.ui
|
|||
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||
AddPropertiesItem(category, "Font", "mFonts");
|
||||
AddPropertiesItem(category, "Font Size", "mFontSize");
|
||||
AddPropertiesItem(category, "Line Height Scale", "mLineHeightScale", null, .Percent);
|
||||
AddPropertiesItem(category, "Autocomplete", "mAutoCompleteShowKind");
|
||||
AddPropertiesItem(category, "Autocomplete Require Control", "mAutoCompleteRequireControl");
|
||||
AddPropertiesItem(category, "Autocomplete Require Tab", "mAutoCompleteRequireTab");
|
||||
|
@ -347,7 +348,8 @@ namespace IDE.ui
|
|||
AddPropertiesItem(root, "Symbol File Locations", "mSymbolSearchPath");
|
||||
AddPropertiesItem(root, "Auto Find Paths", "mAutoFindPaths");
|
||||
AddPropertiesItem(root, "Profile Sample Rate", "mProfileSampleRate");
|
||||
AddPropertiesItem(root, "Auto Evaluate Properties", "mAutoEvaluateProperties");
|
||||
AddPropertiesItem(root, "Auto Eval Properties on Hover", "mAutoEvaluatePropertiesOnHover");
|
||||
AddPropertiesItem(root, "Auto Refresh Side Effects", "mAutoRefreshWatches");
|
||||
}
|
||||
|
||||
protected override void ResetSettings()
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#pragma warning disable 168
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
|
@ -806,6 +807,7 @@ namespace IDE.ui
|
|||
|
||||
0xFFFF8080, // BuildError
|
||||
0xFFFFFF80, // BuildWarning
|
||||
0xFF80FF80, // BuildSuccess
|
||||
|
||||
0xFF9090C0, // VisibleWhiteSpace
|
||||
) ~ delete _;
|
||||
|
@ -856,6 +858,7 @@ namespace IDE.ui
|
|||
SetFont(IDEApp.sApp.mCodeFont, true, true);
|
||||
//SetFont(DarkTheme.sDarkTheme.mSmallFont, false, false);
|
||||
|
||||
mLineHeightScale = Math.Clamp(gApp.mSettings.mEditorSettings.mLineHeightScale, 0.125f, 10.0f);
|
||||
mWantsTabsAsSpaces = gApp.mSettings.mEditorSettings.mTabsOrSpaces == .Spaces;
|
||||
mTabLength = gApp.mSettings.mEditorSettings.mTabSize;
|
||||
mTabSize = mFont.GetWidth(scope String(' ', gApp.mSettings.mEditorSettings.mTabSize));
|
||||
|
@ -1209,11 +1212,12 @@ namespace IDE.ui
|
|||
if ((flags & ~(uint8)SourceElementFlags.Skipped) == 0)
|
||||
return;
|
||||
|
||||
let lineSpacing = LineHeight;
|
||||
if ((flags & (uint8)SourceElementFlags.SymbolReference) != 0)
|
||||
{
|
||||
bool isRenameSymbol = (IDEApp.sApp.mSymbolReferenceHelper != null) && (IDEApp.sApp.mSymbolReferenceHelper.mKind == SymbolReferenceHelper.Kind.Rename);
|
||||
using (g.PushColor(isRenameSymbol ? (uint32)0x28FFFFFF : (uint32)0x18FFFFFF))
|
||||
g.FillRect(x, y, width, mFont.GetLineSpacing());
|
||||
g.FillRect(x, y, width, lineSpacing);
|
||||
|
||||
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)SourceElementFlags.SymbolReference));
|
||||
return;
|
||||
|
@ -1222,7 +1226,7 @@ namespace IDE.ui
|
|||
if ((flags & (uint8)SourceElementFlags.Find_CurrentSelection) != 0)
|
||||
{
|
||||
using (g.PushColor(0x504C575C))
|
||||
g.FillRect(x, y, width, mFont.GetLineSpacing());
|
||||
g.FillRect(x, y, width, lineSpacing);
|
||||
|
||||
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)(SourceElementFlags.Find_CurrentSelection | .Find_Matches)));
|
||||
return;
|
||||
|
@ -1231,7 +1235,7 @@ namespace IDE.ui
|
|||
if ((flags & (uint8)SourceElementFlags.Find_Matches) != 0)
|
||||
{
|
||||
using (g.PushColor(0x50D0C090))
|
||||
g.FillRect(x, y, width, mFont.GetLineSpacing());
|
||||
g.FillRect(x, y, width, lineSpacing);
|
||||
|
||||
DrawSectionFlagsOver(g, x, y, width, (uint8)(flags & ~(uint8)SourceElementFlags.Find_Matches));
|
||||
return;
|
||||
|
@ -1275,7 +1279,7 @@ namespace IDE.ui
|
|||
if (underlineColor != 0)
|
||||
{
|
||||
using (g.PushColor(underlineColor))
|
||||
gApp.DrawSquiggle(g, x, y, width);
|
||||
gApp.DrawSquiggle(g, x, y + GetTextOffset(), width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3015,6 +3019,7 @@ namespace IDE.ui
|
|||
|
||||
didLineComment = false;
|
||||
lineStartCol = 0;
|
||||
int appendedCount = 0;
|
||||
for (int i = minPos; i < maxPos; i++)
|
||||
{
|
||||
var c = mData.mText[i].mChar;
|
||||
|
@ -3052,6 +3057,8 @@ namespace IDE.ui
|
|||
InsertAtCursor(str);
|
||||
didLineComment = true;
|
||||
maxPos += str.Length;
|
||||
if (i <= startTextPos + appendedCount)
|
||||
appendedCount += str.Length;
|
||||
}
|
||||
}
|
||||
mSelection = EditSelection(minPos, maxPos);
|
||||
|
@ -3059,7 +3066,10 @@ namespace IDE.ui
|
|||
if (undoBatchStart != null)
|
||||
mData.mUndoManager.Add(undoBatchStart.mBatchEnd);
|
||||
|
||||
CursorLineAndColumn = startLineAndCol;
|
||||
if (appendedCount > 0)
|
||||
CursorTextPos = startTextPos + appendedCount;
|
||||
else
|
||||
CursorLineAndColumn = startLineAndCol;
|
||||
|
||||
if (!hadSelection)
|
||||
mSelection = null;
|
||||
|
@ -3889,7 +3899,10 @@ namespace IDE.ui
|
|||
}
|
||||
else if (c == '.')
|
||||
{
|
||||
doAutocomplete = true;
|
||||
if (mAutoComplete?.HasInteracted == true)
|
||||
{
|
||||
doAutocomplete = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4188,8 +4201,10 @@ namespace IDE.ui
|
|||
//int cursorTextPos = CursorTextPos;
|
||||
if (cursorTextPos < mData.mTextLength)
|
||||
{
|
||||
charUnderCursor = (char8)mData.mText[cursorTextPos].mChar;
|
||||
cursorInOpenSpace = ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace));
|
||||
let charData = mData.mText[cursorTextPos];
|
||||
let cursorInLiteral = (SourceElementType)charData.mDisplayTypeId == .Literal;
|
||||
charUnderCursor = (char8)charData.mChar;
|
||||
cursorInOpenSpace = ((!cursorInLiteral) && ((charUnderCursor == ')') || (charUnderCursor == ']') || (charUnderCursor == ';') || (charUnderCursor == (char8)0) || (charUnderCursor.IsWhiteSpace)));
|
||||
|
||||
if (((keyChar == '(') && (charUnderCursor == ')')) ||
|
||||
((keyChar == '[') && (charUnderCursor == ']')))
|
||||
|
@ -4224,7 +4239,7 @@ namespace IDE.ui
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((keyChar == '"') || (keyChar == '\''))
|
||||
if ((!cursorInLiteral) && ((keyChar == '"') || (keyChar == '\'')))
|
||||
cursorInOpenSpace = true;
|
||||
}
|
||||
}
|
||||
|
@ -5077,7 +5092,7 @@ namespace IDE.ui
|
|||
int callInstLoc = (int)int64.Parse(callInstLocStr, System.Globalization.NumberStyles.HexNumber);
|
||||
if (callData.Count == 1)
|
||||
{
|
||||
callMenuItem = stepIntoSpecificMenu.AddItem(StackStringFormat!("Indirect call at 0x{0:X}", callInstLoc));
|
||||
callMenuItem = stepIntoSpecificMenu.AddItem(scope String()..AppendF("Indirect call at 0x{0:X}", callInstLoc));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5175,6 +5190,33 @@ namespace IDE.ui
|
|||
}
|
||||
}
|
||||
|
||||
void SetCollapseLineOpen(int line, bool wantOpen, bool includeChildren)
|
||||
{
|
||||
List<int32> collapseOpenList = scope .();
|
||||
CollapseEntry* parentCollapse = null;
|
||||
|
||||
for (var collapse in mOrderedCollapseEntries)
|
||||
{
|
||||
if (parentCollapse == null)
|
||||
{
|
||||
if (collapse.mAnchorLine == line)
|
||||
{
|
||||
parentCollapse = collapse;
|
||||
collapseOpenList.Add((.)@collapse.Index);
|
||||
if (!includeChildren)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ((collapse.mAnchorLine >= parentCollapse.mStartLine) && (collapse.mAnchorLine < parentCollapse.mEndLine))
|
||||
{
|
||||
collapseOpenList.Add((.)@collapse.Index);
|
||||
}
|
||||
}
|
||||
|
||||
for (int32 collapseIdx in collapseOpenList)
|
||||
SetCollapseOpen(collapseIdx, wantOpen);
|
||||
}
|
||||
|
||||
public override void MouseDown(float x, float y, int32 btn, int32 btnCount)
|
||||
{
|
||||
int line = GetLineAt(y);
|
||||
|
@ -5187,10 +5229,13 @@ namespace IDE.ui
|
|||
embed.MouseDown(GetEmbedRect(line, embed), x, y, btn, btnCount);
|
||||
if (btn == 0)
|
||||
{
|
||||
if (btnCount % 2 == 0)
|
||||
bool hasCtrl = mWidgetWindow.IsKeyDown(.Control);
|
||||
if ((btnCount % 2 == 0) || (hasCtrl))
|
||||
{
|
||||
if (var collapseSummary = embed as SourceEditWidgetContent.CollapseSummary)
|
||||
SetCollapseOpen(collapseSummary.mCollapseIndex, true);
|
||||
{
|
||||
SetCollapseLineOpen(line, true, hasCtrl);
|
||||
}
|
||||
else if (var emitEmbed = embed as EmitEmbed)
|
||||
{
|
||||
emitEmbed.mIsOpen = !emitEmbed.mIsOpen;
|
||||
|
@ -5198,6 +5243,28 @@ namespace IDE.ui
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (btn == 1)
|
||||
{
|
||||
float useX = x;
|
||||
float useY = y;
|
||||
|
||||
Menu menu = new Menu();
|
||||
|
||||
var menuItem = menu.AddItem("Expand");
|
||||
menuItem.mOnMenuItemSelected.Add(new (evt) =>
|
||||
{
|
||||
SetCollapseLineOpen(line, true, false);
|
||||
});
|
||||
|
||||
menuItem = menu.AddItem("Expand All|Ctrl+Click");
|
||||
menuItem.mOnMenuItemSelected.Add(new (evt) =>
|
||||
{
|
||||
SetCollapseLineOpen(line, true, true);
|
||||
});
|
||||
|
||||
MenuWidget menuWidget = DarkTheme.sDarkTheme.CreateMenuWidget(menu);
|
||||
menuWidget.Init(this, useX, useY);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -5794,7 +5861,7 @@ namespace IDE.ui
|
|||
}
|
||||
orderedEmitEmbeds.Sort(scope (lhs, rhs) => lhs.line <=> rhs.line);
|
||||
|
||||
float fontHeight = mFont.GetLineSpacing();
|
||||
float fontHeight = LineHeight;
|
||||
int prevJumpIdx = -1;
|
||||
float jumpCoordSpacing = GetJumpCoordSpacing();
|
||||
|
||||
|
@ -6373,8 +6440,10 @@ namespace IDE.ui
|
|||
let height = mFont.GetHeight() + GS!(2);
|
||||
using (g.PushColor(DarkTheme.COLOR_CHAR_PAIR_HILITE))
|
||||
{
|
||||
g.FillRect(x1, y1, charWidth, height);
|
||||
g.FillRect(x2, y2, charWidth, height);
|
||||
float offset = GetTextOffset();
|
||||
|
||||
g.FillRect(x1, y1 + offset, charWidth, height);
|
||||
g.FillRect(x2, y2 + offset, charWidth, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6543,7 +6612,6 @@ namespace IDE.ui
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetCollapseOpen(int collapseIdx, bool wantOpen, bool immediate = false, bool keepCursorVisible = false)
|
||||
{
|
||||
var entry = mOrderedCollapseEntries[collapseIdx];
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace IDE.ui
|
|||
|
||||
BuildError,
|
||||
BuildWarning,
|
||||
BuildSuccess,
|
||||
|
||||
VisibleWhiteSpace
|
||||
}
|
||||
|
@ -95,7 +96,7 @@ namespace IDE.ui
|
|||
base.MouseDown(x, y, btn, btnCount);
|
||||
}
|
||||
|
||||
public override void MouseWheel(float x, float y, float deltaX, float deltaY)
|
||||
public override void MouseWheel(MouseEvent evt)
|
||||
{
|
||||
var sewc = mEditWidgetContent as SourceEditWidgetContent;
|
||||
if ((sewc.mSourceViewPanel != null) && (sewc.mSourceViewPanel.mEmbedParent != null))
|
||||
|
@ -104,19 +105,26 @@ namespace IDE.ui
|
|||
{
|
||||
if ((mVertScrollbar != null) && (mVertScrollbar.mAllowMouseWheel))
|
||||
{
|
||||
mVertScrollbar.MouseWheel(x, y, 0, deltaY);
|
||||
mVertScrollbar.MouseWheel(evt.mX, evt.mY, evt.mWheelDeltaX, evt.mWheelDeltaY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var target = sewc.mSourceViewPanel.mEmbedParent.mEditWidget.mEditWidgetContent;
|
||||
SelfToOtherTranslate(target, x, y, var transX, var transY);
|
||||
target.MouseWheel(transX, transY, deltaX, deltaY);
|
||||
|
||||
MouseEvent parentEvt = scope .();
|
||||
parentEvt.mWheelDeltaX = evt.mWheelDeltaX;
|
||||
parentEvt.mWheelDeltaY = evt.mWheelDeltaY;
|
||||
parentEvt.mSender = evt.mSender;
|
||||
|
||||
// Keep passing it up until some is interested in using it...
|
||||
SelfToOtherTranslate(target, evt.mX, evt.mY, out parentEvt.mX, out parentEvt.mY);
|
||||
|
||||
target.MouseWheel(evt);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
base.MouseWheel(x, y, deltaX, deltaY);
|
||||
base.MouseWheel(evt);
|
||||
}
|
||||
|
||||
public override void GotFocus()
|
||||
|
@ -3809,7 +3817,7 @@ namespace IDE.ui
|
|||
var text = scope String();
|
||||
if (gApp.LoadTextFile(mFilePath, text) case .Err)
|
||||
{
|
||||
gApp.Fail(StackStringFormat!("Failed to open file '{0}'", mFilePath));
|
||||
gApp.Fail(scope String()..AppendF("Failed to open file '{0}'", mFilePath));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4542,7 +4550,7 @@ namespace IDE.ui
|
|||
{
|
||||
float editX = GetEditX();
|
||||
|
||||
float lineSpacing = ewc.mFont.GetLineSpacing();
|
||||
float lineSpacing = ewc.LineHeight;
|
||||
int cursorLineNumber = mEditWidget.mEditWidgetContent.CursorLineAndColumn.mLine;
|
||||
bool hiliteCurrentLine = mEditWidget.mHasFocus;
|
||||
|
||||
|
@ -4711,6 +4719,8 @@ namespace IDE.ui
|
|||
}*/
|
||||
}
|
||||
|
||||
float offset = ewc.GetTextOffset();
|
||||
|
||||
if ((gApp.mSettings.mEditorSettings.mShowLineNumbers) && (mEmbedKind == .None))
|
||||
{
|
||||
String lineStr = scope String(16);
|
||||
|
@ -4739,7 +4749,8 @@ namespace IDE.ui
|
|||
case 2: lineStr.AppendF("{0}", (lineIdx + 1) % 100);
|
||||
default: lineStr.AppendF("{0}", lineIdx + 1);
|
||||
}
|
||||
g.DrawString(lineStr, 0, GS!(2) + ewc.mLineCoords[lineIdx], FontAlign.Right, editX - GS!(14));
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
g.DrawString(lineStr, 0, GS!(2) + ewc.mLineCoords[lineIdx] + offset, FontAlign.Right, editX - GS!(14));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4778,7 +4789,7 @@ namespace IDE.ui
|
|||
{
|
||||
using (g.PushColor(0xFFA5A5A5))
|
||||
{
|
||||
g.FillRect(editX - (int)GS!(7.5f), ewc.mLineCoords[lineIdx] - (int)GS!(0.5f), (int)GS!(1.5f), lineSpacing);
|
||||
g.FillRect(editX - (int)GS!(7.5f), ewc.mLineCoords[lineIdx] - offset - (int)GS!(0.5f), (int)GS!(1.5f), lineSpacing + offset);
|
||||
g.FillRect(editX - (int)GS!(7.5f), ewc.mLineCoords[lineIdx] + lineSpacing - (int)GS!(1.5f), GS!(5), (int)GS!(1.5f));
|
||||
}
|
||||
}
|
||||
|
@ -4850,7 +4861,7 @@ namespace IDE.ui
|
|||
mLinePointerDrawData.mUpdateCnt = gApp.mUpdateCnt;
|
||||
mLinePointerDrawData.mDebuggerContinueIdx = gApp.mDebuggerContinueIdx;
|
||||
g.Draw(img, mEditWidget.mX - GS!(20) - sDrawLeftAdjust,
|
||||
0 + ewc.GetLineY(lineNum, 0));
|
||||
0 + ewc.GetLineY(lineNum, 0) + ewc.GetTextOffset());
|
||||
}
|
||||
|
||||
if (mMousePos != null && mIsDraggingLinePointer)
|
||||
|
@ -4860,7 +4871,7 @@ namespace IDE.ui
|
|||
{
|
||||
using (g.PushColor(0x7FFFFFFF))
|
||||
g.Draw(img, mEditWidget.mX - GS!(20) - sDrawLeftAdjust,
|
||||
0 + ewc.GetLineY(dragLineNum, 0));
|
||||
0 + ewc.GetLineY(dragLineNum, 0) + ewc.GetTextOffset());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5121,10 +5132,16 @@ namespace IDE.ui
|
|||
if (!mIsBeefSource)
|
||||
return;
|
||||
|
||||
var bfSystem = IDEApp.sApp.mBfResolveSystem;
|
||||
var bfSystem = IDEApp.sApp.mBfResolveSystem;
|
||||
if (bfSystem == null)
|
||||
return;
|
||||
var parser = bfSystem.CreateEmptyParser(null);
|
||||
let projectSource = FilteredProjectSource;
|
||||
BfProject bfProject = null;
|
||||
if ((projectSource != null) && (mIsBeefSource))
|
||||
{
|
||||
bfProject = bfSystem.GetBfProject(projectSource.mProject);
|
||||
}
|
||||
var parser = bfSystem.CreateEmptyParser(bfProject);
|
||||
defer delete parser;
|
||||
var text = scope String();
|
||||
mEditWidget.GetText(text);
|
||||
|
@ -5179,7 +5196,7 @@ namespace IDE.ui
|
|||
|
||||
public void GotoLine()
|
||||
{
|
||||
GoToLineDialog aDialog = new GoToLineDialog("Go To Line", StackStringFormat!("Line Number ({0}-{1})", 1, mEditWidget.Content.GetLineCount()));
|
||||
GoToLineDialog aDialog = new GoToLineDialog("Go To Line", scope String()..AppendF("Line Number ({0}-{1})", 1, mEditWidget.Content.GetLineCount()));
|
||||
aDialog.Init(this);
|
||||
aDialog.PopupWindow(mWidgetWindow);
|
||||
}
|
||||
|
@ -5645,8 +5662,22 @@ namespace IDE.ui
|
|||
if ((mHoverResolveTask == null) &&
|
||||
((debugExpr == null) || (!debugExpr.StartsWith(':'))))
|
||||
{
|
||||
bool wantDebugEval = false;
|
||||
if ((gApp.mDebugger.mIsRunning) && (!String.IsNullOrEmpty(debugExpr)))
|
||||
{
|
||||
wantDebugEval = true;
|
||||
if (FilteredProjectSource != null)
|
||||
{
|
||||
// This is active Beef source
|
||||
if ((debugExpr[0].IsNumber) || (debugExpr.StartsWith('\'')) || (debugExpr.StartsWith('"')))
|
||||
{
|
||||
// Literal, don't debug eval
|
||||
wantDebugEval = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (((!gApp.mDebugger.mIsRunning) || (!mHoverWatch.HasDisplay)) && // Don't show extended information for debug watches
|
||||
if (((!wantDebugEval) || (!mHoverWatch.HasDisplay)) && // Don't show extended information for debug watches
|
||||
(!handlingHoverResolveTask) && (ResolveCompiler != null) && (!ResolveCompiler.mThreadWorkerHi.mThreadRunning) && (gApp.mSettings.mEditorSettings.mHiliteCursorReferences) && (!gApp.mDeterministic))
|
||||
{
|
||||
ResolveParams resolveParams = new .();
|
||||
|
@ -7335,7 +7366,13 @@ namespace IDE.ui
|
|||
int collapseIndex = collapseVal & CollapseRegionView.cIdMask;
|
||||
|
||||
var entry = ewc.mOrderedCollapseEntries[collapseIndex];
|
||||
ewc.SetCollapseOpen(collapseIndex, !entry.mIsOpen);
|
||||
|
||||
if ((mWidgetWindow.IsKeyDown(.Control)))
|
||||
{
|
||||
ewc.[Friend]SetCollapseLineOpen(lineClick, !entry.mIsOpen, true);
|
||||
}
|
||||
else
|
||||
ewc.SetCollapseOpen(collapseIndex, !entry.mIsOpen);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -7521,7 +7558,7 @@ namespace IDE.ui
|
|||
SourceEditWidgetContent ewc = (.)mEditWidget.Content;
|
||||
Rect linePointerRect = .(
|
||||
mEditWidget.mX - GS!(20) - sDrawLeftAdjust,
|
||||
0 + ewc.GetLineY(mLinePointerDrawData.mLine, 0),
|
||||
0 + ewc.GetLineY(mLinePointerDrawData.mLine, 0) + ewc.GetTextOffset(),
|
||||
GS!(15),
|
||||
GS!(15)
|
||||
);
|
||||
|
@ -7538,7 +7575,7 @@ namespace IDE.ui
|
|||
else if (mIsDraggingLinePointer)
|
||||
{
|
||||
SourceEditWidgetContent ewc = (.)mEditWidget.Content;
|
||||
float linePos = ewc.GetLineY(GetLineAt(0, mMousePos.Value.y), 0);
|
||||
float linePos = ewc.GetLineY(GetLineAt(0, mMousePos.Value.y), 0) + ewc.GetTextOffset();
|
||||
Rect visibleRange = mEditWidget.GetVisibleContentRange();
|
||||
|
||||
if (visibleRange.Top > linePos)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#pragma warning disable 168
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
|
@ -9,6 +11,7 @@ using IDE.util;
|
|||
using Beefy.events;
|
||||
using Beefy.theme;
|
||||
using System.Diagnostics;
|
||||
using Beefy.utils;
|
||||
|
||||
namespace IDE.ui
|
||||
{
|
||||
|
@ -17,6 +20,7 @@ namespace IDE.ui
|
|||
class RecentWorkspacesScrollWidget : ScrollableWidget
|
||||
{
|
||||
public Font mTitleFont;
|
||||
public bool mHasIcons;
|
||||
|
||||
public this()
|
||||
{
|
||||
|
@ -31,7 +35,7 @@ namespace IDE.ui
|
|||
|
||||
public override void Resize(float x, float y, float width, float height)
|
||||
{
|
||||
const float MARGIN = 3;
|
||||
const float MARGIN = 0;
|
||||
float currentY = 0;
|
||||
|
||||
float fillWidth = width - (mVertScrollbar?.Width).GetValueOrDefault();
|
||||
|
@ -40,7 +44,7 @@ namespace IDE.ui
|
|||
{
|
||||
for (let widget in mScrollContent.mChildWidgets)
|
||||
{
|
||||
widget.Resize(0, currentY, fillWidth, GS!(30));
|
||||
widget.Resize(0, currentY, fillWidth, GS!(33));
|
||||
currentY += widget.Height + MARGIN;
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +64,7 @@ namespace IDE.ui
|
|||
g.SetFont(mTitleFont);
|
||||
|
||||
using (g.PushColor(gApp.mSettings.mUISettings.mColors.mText))
|
||||
g.DrawString("Recent Workspaces", 0, GS!(-30), .Centered, mWidth, .Ellipsis);
|
||||
g.DrawString("Recent Workspaces", GS!(2), GS!(-30), .Centered, mWidth - GS!(4), .Ellipsis);
|
||||
|
||||
base.Draw(g);
|
||||
}
|
||||
|
@ -70,6 +74,8 @@ namespace IDE.ui
|
|||
{
|
||||
public static Font s_Font;
|
||||
append String mPath;
|
||||
public bool mTriedLoadIcon;
|
||||
public Image mIcon ~ delete _;
|
||||
|
||||
public bool mPinned;
|
||||
public RecentWorkspacesScrollWidget mRecentsParent;
|
||||
|
@ -91,8 +97,67 @@ namespace IDE.ui
|
|||
|
||||
}
|
||||
|
||||
if (!mTriedLoadIcon)
|
||||
{
|
||||
mTriedLoadIcon = true;
|
||||
|
||||
StructuredData sd = scope .();
|
||||
if (sd.Load(scope $"{mPath}/BeefProj.toml") case .Ok)
|
||||
{
|
||||
using (sd.Open("Platform"))
|
||||
{
|
||||
using (sd.Open("Windows"))
|
||||
{
|
||||
var iconFileName = sd.GetString("IconFile", .. scope .());
|
||||
iconFileName.Replace("$(ProjectDir)", mPath);
|
||||
iconFileName.Replace("$(WorkspaceDir)", mPath);
|
||||
var iconFilePath = IO.Path.GetAbsolutePath(iconFileName, mPath, .. scope .());
|
||||
|
||||
if (File.Exists(iconFilePath))
|
||||
{
|
||||
int wantSize = 32;
|
||||
if (var image = ResourceGen.LoadIcon(iconFilePath, wantSize))
|
||||
{
|
||||
if ((image.mWidth != wantSize) || (image.mHeight != wantSize))
|
||||
{
|
||||
image.Scale(wantSize / Math.Max(image.mWidth, image.mHeight));
|
||||
}
|
||||
mIcon = image;
|
||||
mRecentsParent.mHasIcons = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g.SetFont(s_Font);
|
||||
g.DrawString(mPath, 10, 0, .Left, mWidth - 10);
|
||||
using (g.PushColor(gApp.mSettings.mUISettings.mColors.mText))
|
||||
{
|
||||
String drawStr = scope String();
|
||||
int lastSlash = Math.Max(mPath.LastIndexOf('\\'), mPath.LastIndexOf('/'));
|
||||
if (lastSlash != -1)
|
||||
{
|
||||
drawStr.Append(Font.EncodeColor(0x80FFFFFF));
|
||||
drawStr.Append(mPath.Substring(0, lastSlash + 1));
|
||||
drawStr.Append(Font.EncodePopColor());
|
||||
drawStr.Append(mPath.Substring(lastSlash + 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
drawStr.Append(mPath);
|
||||
}
|
||||
|
||||
float drawX = GS!(50);
|
||||
g.DrawString(drawStr, drawX, GS!(3), .Left, mWidth - drawX - GS!(2), .Ellipsis);
|
||||
}
|
||||
if (mIcon != null)
|
||||
g.DrawCentered(mIcon, GS!(24), mHeight / 2);
|
||||
else
|
||||
{
|
||||
using (g.PushColor(0x80FFFFFF))
|
||||
g.DrawCentered(DarkTheme.sDarkTheme.GetImage(.Workspace), GS!(24), mHeight / 2);
|
||||
}
|
||||
}
|
||||
|
||||
public override void MouseEnter()
|
||||
|
|
|
@ -355,22 +355,22 @@ namespace IDE.ui
|
|||
lineCount++;
|
||||
}
|
||||
|
||||
String str = StackStringFormat!("Sel {0} | {1}", sel.MaxPos - sel.MinPos, lineCount);
|
||||
String str = scope String()..AppendF("Sel {0} | {1}", sel.MaxPos - sel.MinPos, lineCount);
|
||||
float curX = mWidth - GS!(240);
|
||||
g.DrawString(str, curX, 0);
|
||||
leftX = curX + g.mFont.GetWidth(str);
|
||||
}
|
||||
else if (showIndex)
|
||||
g.DrawString(StackStringFormat!("Idx {0}", activeEditWidget.Content.CursorTextPos), mWidth - GS!(240), 0);
|
||||
g.DrawString(scope String()..AppendF("Idx {0}", activeEditWidget.Content.CursorTextPos), mWidth - GS!(240), 0);
|
||||
|
||||
if (leftX >= mWidth - GS!(142))
|
||||
{
|
||||
g.DrawString(StackStringFormat!("Ln {0}:{1}", lineAndColumn.mLine + 1, lineAndColumn.mColumn + 1), mWidth - GS!(32), 0, .Right);
|
||||
g.DrawString(scope String()..AppendF("Ln {0}:{1}", lineAndColumn.mLine + 1, lineAndColumn.mColumn + 1), mWidth - GS!(32), 0, .Right);
|
||||
}
|
||||
else
|
||||
{
|
||||
g.DrawString(StackStringFormat!("Ln {0}", lineAndColumn.mLine + 1), Math.Max(leftX + GS!(8), mWidth - GS!(150)), 0);
|
||||
g.DrawString(StackStringFormat!("Col {0}", lineAndColumn.mColumn + 1), mWidth - GS!(78), 0);
|
||||
g.DrawString(scope String()..AppendF("Ln {0}", lineAndColumn.mLine + 1), Math.Max(leftX + GS!(8), mWidth - GS!(150)), 0);
|
||||
g.DrawString(scope String()..AppendF("Col {0}", lineAndColumn.mColumn + 1), mWidth - GS!(78), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ namespace IDE.ui
|
|||
if (gApp.mSettings.mEnableDevMode)
|
||||
{
|
||||
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||
g.DrawString(StackStringFormat!("FPS: {0}", gApp.mLastFPS), GS!(32), 0);
|
||||
g.DrawString(scope String()..AppendF("FPS: {0}", gApp.mLastFPS), GS!(32), 0);
|
||||
|
||||
String resolveStr = scope String();
|
||||
let bfResolveCompiler = gApp.mBfResolveCompiler;
|
||||
|
@ -590,7 +590,35 @@ namespace IDE.ui
|
|||
|
||||
if (Rect(GS!(6), 0, GS!(20), mHeight).Contains(x, y))
|
||||
{
|
||||
gApp.mErrorsPanel.ShowErrorNext();
|
||||
bool hasError = (gApp.mErrorsPanel.mErrorCount > 0);
|
||||
bool hasWarning = (gApp.mErrorsPanel.mWarningCount > 0);
|
||||
|
||||
if (btn == 0)
|
||||
{
|
||||
gApp.mErrorsPanel.ShowErrorNext();
|
||||
}
|
||||
else if ((btn == 1) && ((hasError || hasWarning)))
|
||||
{
|
||||
float useX = x;
|
||||
float useY = y;
|
||||
|
||||
Menu menu = new Menu();
|
||||
|
||||
var menuItem = menu.AddItem("Goto Next Error");
|
||||
menuItem.mOnMenuItemSelected.Add(new (evt) =>
|
||||
{
|
||||
gApp.mErrorsPanel.ShowErrorNext();
|
||||
});
|
||||
|
||||
menuItem = menu.AddItem("Clean Beef");
|
||||
menuItem.mOnMenuItemSelected.Add(new (evt) =>
|
||||
{
|
||||
gApp.Cmd_CleanBeef();
|
||||
});
|
||||
|
||||
MenuWidget menuWidget = DarkTheme.sDarkTheme.CreateMenuWidget(menu);
|
||||
menuWidget.Init(this, useX, useY);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace IDE.ui
|
|||
|
||||
if (!mTargetedProperties.mActiveConfigName.IsEmpty)
|
||||
{
|
||||
String dispStr = StackStringFormat!("Active({0})", mTargetedProperties.mActiveConfigName);
|
||||
String dispStr = scope String()..AppendF("Active({0})", mTargetedProperties.mActiveConfigName);
|
||||
item = menu.AddItem(dispStr);
|
||||
item.mOnMenuItemSelected.Add(new (evt) => { SelectConfig(mTargetedProperties.mActiveConfigName); });
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ namespace IDE.ui
|
|||
|
||||
if (!mActiveConfigName.IsEmpty)
|
||||
{
|
||||
String dispStr = StackStringFormat!("Active({0})", mActiveConfigName);
|
||||
String dispStr = scope String()..AppendF("Active({0})", mActiveConfigName);
|
||||
item = menu.AddItem(dispStr);
|
||||
item.mOnMenuItemSelected.Add(new (evt) => { SelectConfig(mActiveConfigName); });
|
||||
}
|
||||
|
@ -613,7 +613,7 @@ namespace IDE.ui
|
|||
{
|
||||
if (!platformName.IsEmpty)
|
||||
{
|
||||
String dispStr = (IDEApp.sApp.mPlatformName == platformName) ? StackStringFormat!("Active({0})", platformName) : platformName;
|
||||
String dispStr = (IDEApp.sApp.mPlatformName == platformName) ? scope String()..AppendF("Active({0})", platformName) : platformName;
|
||||
item = menu.AddItem(dispStr);
|
||||
item.mOnMenuItemSelected.Add(new (evt) => { SelectPlatform(platformName); });
|
||||
}
|
||||
|
@ -692,7 +692,7 @@ namespace IDE.ui
|
|||
{
|
||||
if (mConfigNames.Count == 1)
|
||||
{
|
||||
String dispStr = ((mConfigNames.Count == 1) && (mActiveConfigName == mConfigNames[0])) ? StackStringFormat!("Active({0})", mConfigNames[0]) : mConfigNames[0];
|
||||
String dispStr = ((mConfigNames.Count == 1) && (mActiveConfigName == mConfigNames[0])) ? scope String()..AppendF("Active({0})", mConfigNames[0]) : mConfigNames[0];
|
||||
mConfigComboBox.Label = dispStr;
|
||||
}
|
||||
else
|
||||
|
@ -716,7 +716,7 @@ namespace IDE.ui
|
|||
{
|
||||
if (mPlatformNames.Count == 1)
|
||||
{
|
||||
String dispStr = ((mPlatformNames.Count == 1) && (mActivePlatformName == mPlatformNames[0])) ? StackStringFormat!("Active({0})", mPlatformNames[0]) : mPlatformNames[0];
|
||||
String dispStr = ((mPlatformNames.Count == 1) && (mActivePlatformName == mPlatformNames[0])) ? scope String()..AppendF("Active({0})", mPlatformNames[0]) : mPlatformNames[0];
|
||||
mPlatformComboBox.Label = dispStr;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -54,6 +54,8 @@ namespace IDE.ui
|
|||
public bool mIsNewExpression;
|
||||
public bool mIsPending;
|
||||
public bool mUsedLock;
|
||||
public bool? mAutoRefresh;
|
||||
public int32 mDebuggerStateIdx;
|
||||
public int32 mCurStackIdx;
|
||||
public int mMemoryBreakpointAddr;
|
||||
public int32 mHadStepCount;
|
||||
|
@ -66,6 +68,24 @@ namespace IDE.ui
|
|||
public int32 mSeriesFirstVersion = -1;
|
||||
public int32 mSeriesVersion = -1;
|
||||
|
||||
public bool AutoRefresh
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mAutoRefresh != null)
|
||||
return mAutoRefresh.Value;
|
||||
return gApp.mSettings.mDebuggerSettings.mAutoRefreshWatches;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value == gApp.mSettings.mDebuggerSettings.mAutoRefreshWatches)
|
||||
mAutoRefresh = null;
|
||||
else
|
||||
mAutoRefresh = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsConstant
|
||||
{
|
||||
get
|
||||
|
@ -1644,8 +1664,8 @@ namespace IDE.ui
|
|||
if (mShowStatusBar)
|
||||
{
|
||||
g.DrawString(textPosString, 16, textY, .Left, mWidth - GS!(140), .Ellipsis);
|
||||
g.DrawString(StackStringFormat!("Ln {0}", line + 1), mWidth - GS!(130), textY);
|
||||
g.DrawString(StackStringFormat!("Col {0}", col + 1), mWidth - GS!(70), textY);
|
||||
g.DrawString(scope String()..AppendF("Ln {0}", line + 1), mWidth - GS!(130), textY);
|
||||
g.DrawString(scope String()..AppendF("Col {0}", col + 1), mWidth - GS!(70), textY);
|
||||
}
|
||||
|
||||
//using (g.PushColor(0xD0FFFFFF))
|
||||
|
@ -1793,7 +1813,8 @@ namespace IDE.ui
|
|||
public bool mFindMismatch;
|
||||
public bool mChildHasMatch;
|
||||
public String mColoredLabel ~ delete _;
|
||||
bool mWantRemoveSelf;
|
||||
public bool mWantRemoveSelf;
|
||||
public bool mFreezeHeight;
|
||||
|
||||
public WatchRefreshButton mWatchRefreshButton;
|
||||
public ActionButton mActionButton;
|
||||
|
@ -1941,7 +1962,7 @@ namespace IDE.ui
|
|||
if (tooltip != null)
|
||||
{
|
||||
tooltip.mRelWidgetMouseInsets = new Insets(0, 0, GS!(-8), 0);
|
||||
tooltip.mAllowMouseInsideSelf = true;
|
||||
tooltip.mAllowMouseInsideInsets = new .(GS!(-12), GS!(-12), GS!(-4), GS!(-4));
|
||||
tooltip.AddWidget(watchStringEdit);
|
||||
tooltip.mOnResized.Add(new (widget) => watchStringEdit.Resize(GS!(6), GS!(6), widget.mWidth - GS!(6) * 2, widget.mHeight - GS!(6) * 2));
|
||||
tooltip.mOnResized(tooltip);
|
||||
|
@ -1968,7 +1989,32 @@ namespace IDE.ui
|
|||
{
|
||||
mWatchRefreshButton = new WatchRefreshButton();
|
||||
mWatchRefreshButton.Resize(GS!(-16), 0, GS!(20), GS!(20));
|
||||
mWatchRefreshButton.mOnMouseDown.Add(new (evt) => RefreshWatch());
|
||||
mWatchRefreshButton.mOnMouseDown.Add(new (evt) =>
|
||||
{
|
||||
if (evt.mBtn == 0)
|
||||
RefreshWatch();
|
||||
if (evt.mBtn == 1)
|
||||
{
|
||||
Menu menu = new Menu();
|
||||
Menu anItem;
|
||||
anItem = menu.AddItem("Refresh");
|
||||
anItem.mOnMenuItemSelected.Add(new (item) => { RefreshWatch(); });
|
||||
|
||||
anItem = menu.AddItem("Auto Refresh");
|
||||
if (mWatchEntry.AutoRefresh)
|
||||
anItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Check);
|
||||
anItem.mOnMenuItemSelected.Add(new (item) =>
|
||||
{
|
||||
mWatchEntry.AutoRefresh = !mWatchEntry.AutoRefresh;
|
||||
if (mWatchEntry.AutoRefresh)
|
||||
RefreshWatch();
|
||||
});
|
||||
|
||||
MenuWidget menuWidget = ThemeFactory.mDefault.CreateMenuWidget(menu);
|
||||
menuWidget.Init(mWatchRefreshButton, evt.mX, mHeight + GS!(2));
|
||||
}
|
||||
|
||||
});
|
||||
var typeSubItem = GetSubItem(columnIdx);
|
||||
typeSubItem.AddWidget(mWatchRefreshButton);
|
||||
mListView.mListSizeDirty = true;
|
||||
|
@ -2024,7 +2070,7 @@ namespace IDE.ui
|
|||
|
||||
if ((mDisabled) && (allowRefresh))
|
||||
{
|
||||
AddRefreshButton();
|
||||
AddRefreshButton();
|
||||
}
|
||||
else if (mWatchRefreshButton != null)
|
||||
{
|
||||
|
@ -2061,7 +2107,7 @@ namespace IDE.ui
|
|||
return retVal;
|
||||
}
|
||||
|
||||
void RefreshWatch()
|
||||
public void RefreshWatch()
|
||||
{
|
||||
var parentWatchListViewItem = mParentItem as WatchListViewItem;
|
||||
if (parentWatchListViewItem != null)
|
||||
|
@ -2635,9 +2681,9 @@ namespace IDE.ui
|
|||
}
|
||||
|
||||
var dispStr = scope String();
|
||||
dispStr.AppendF(mWatchSeriesInfo.mDisplayTemplate, params formatParams);
|
||||
dispStr.AppendF(mWatchSeriesInfo.mDisplayTemplate, params formatParams).IgnoreError();
|
||||
var evalStr = scope String();
|
||||
evalStr.AppendF(mWatchSeriesInfo.mEvalTemplate, params formatParams);
|
||||
evalStr.AppendF(mWatchSeriesInfo.mEvalTemplate, params formatParams).IgnoreError();
|
||||
|
||||
watchListView.mWatchOwner.SetupListViewItem(curWatchListViewItem, dispStr, evalStr);
|
||||
curWatchListViewItem.mWatchEntry.mSeriesFirstVersion = mWatchSeriesInfo.mSeriesFirstVersion;
|
||||
|
@ -2860,7 +2906,10 @@ namespace IDE.ui
|
|||
|
||||
base.UpdateAll();
|
||||
if (mWantRemoveSelf)
|
||||
{
|
||||
mParentItem?.RemoveChildItem(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mColumnIdx == 0)
|
||||
{
|
||||
|
@ -2890,7 +2939,9 @@ namespace IDE.ui
|
|||
wantHeight = 0;
|
||||
else
|
||||
wantHeight = watchListView.mFont.GetLineSpacing();
|
||||
if (mSelfHeight != wantHeight)
|
||||
|
||||
var dataItem = GetSubItem(1) as WatchListViewItem;
|
||||
if ((mSelfHeight != wantHeight) && (!mFreezeHeight) && (dataItem.mCustomContentWidget == null))
|
||||
{
|
||||
mSelfHeight = wantHeight;
|
||||
watchListView.mListSizeDirty = true;
|
||||
|
@ -2997,7 +3048,12 @@ namespace IDE.ui
|
|||
for (WatchListViewItem watchListViewItem in childItems)
|
||||
{
|
||||
var watchEntry = watchListViewItem.mWatchEntry;
|
||||
data.Add(watchEntry.mEvalStr);
|
||||
using (data.CreateObject())
|
||||
{
|
||||
data.Add("EvalStr", watchEntry.mEvalStr);
|
||||
if (watchEntry.mAutoRefresh != null)
|
||||
data.Add("AutoRefresh", watchEntry.mAutoRefresh.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3017,14 +3073,23 @@ namespace IDE.ui
|
|||
IDEUtils.DeserializeListViewState(data, mListView);
|
||||
for (let itemKey in data.Enumerate("Items"))
|
||||
{
|
||||
//for (int32 watchIdx = 0; watchIdx < data.Count; watchIdx++)
|
||||
//for (var watchKV in data)
|
||||
{
|
||||
String watchEntry = scope String();
|
||||
//data.GetString(watchIdx, watchEntry);
|
||||
data.GetCurString(watchEntry);
|
||||
AddWatch(watchEntry);
|
||||
}
|
||||
String watchEntry = scope String();
|
||||
data.GetCurString(watchEntry);
|
||||
WatchListViewItem watchItem;
|
||||
|
||||
if (!watchEntry.IsEmpty)
|
||||
{
|
||||
watchItem = AddWatch(watchEntry);
|
||||
}
|
||||
else
|
||||
{
|
||||
data.GetString("EvalStr", watchEntry);
|
||||
watchItem = AddWatch(watchEntry);
|
||||
if (data.Contains("AutoRefresh"))
|
||||
{
|
||||
watchItem.mWatchEntry.mAutoRefresh = data.GetBool("AutoRefresh");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -3622,6 +3687,12 @@ namespace IDE.ui
|
|||
}
|
||||
else if (watch.mEvalStr.Length > 0)
|
||||
{
|
||||
if (!gApp.mDebugger.IsPaused())
|
||||
{
|
||||
// Keep waiting
|
||||
return;
|
||||
}
|
||||
|
||||
String evalStr = scope String(1024);
|
||||
if (watch.mStackFrameId != null)
|
||||
{
|
||||
|
@ -3637,6 +3708,7 @@ namespace IDE.ui
|
|||
DebugManager.EvalExpressionFlags flags = .AllowStringView;
|
||||
if (watch.mIsNewExpression)
|
||||
flags |= .AllowSideEffects | .AllowCalls;
|
||||
|
||||
gApp.DebugEvaluate(null, evalStr, val, -1, watch.mLanguage, flags);
|
||||
watch.mIsNewExpression = false;
|
||||
}
|
||||
|
@ -3666,6 +3738,14 @@ namespace IDE.ui
|
|||
if (((!valueSubItem.mFailed) && (watch.mHadValue)) || (hadSideEffects) || (hadPropertyEval))
|
||||
{
|
||||
watch.mHasValue = true;
|
||||
|
||||
if ((hadSideEffects) && (watch.AutoRefresh))
|
||||
{
|
||||
if (watch.mDebuggerStateIdx != gApp.mDebugger.mStateIdx)
|
||||
listViewItem.RefreshWatch();
|
||||
return;
|
||||
}
|
||||
|
||||
listViewItem.SetDisabled(true, hadSideEffects);
|
||||
return;
|
||||
}
|
||||
|
@ -3730,6 +3810,7 @@ namespace IDE.ui
|
|||
watch.mIsStackAlloc = false;
|
||||
watch.mUsedLock = false;
|
||||
watch.mCurStackIdx = -1;
|
||||
watch.mDebuggerStateIdx = gApp.mDebugger.mStateIdx;
|
||||
watch.mLanguage = .NotSet;
|
||||
DeleteAndNullify!(watch.mEditInitialize);
|
||||
DeleteAndNullify!(watch.mAction);
|
||||
|
|
|
@ -596,7 +596,7 @@ namespace IDE.ui
|
|||
curWorkspaceOptions.mConfigSelections.TryGetValue(project, out setConfigSelection);
|
||||
if (setConfigSelection == null)
|
||||
{
|
||||
IDEApp.sApp.Fail(StackStringFormat!("Project '{0}' not in workspace", project.mProjectName));
|
||||
IDEApp.sApp.Fail(scope String()..AppendF("Project '{0}' not in workspace", project.mProjectName));
|
||||
return;
|
||||
}
|
||||
setConfigSelection.mEnabled = newConfigSelection.mEnabled;
|
||||
|
|
|
@ -903,6 +903,7 @@ class BeefConConsoleProvider : ConsoleProvider
|
|||
public bool mConnected;
|
||||
public Thread mThread ~ delete _;
|
||||
public Monitor mDataMonitor = new .() ~ delete _;
|
||||
public WaitEvent mDataEvent = new .() ~ delete _;
|
||||
public int mPendingReadClear;
|
||||
public bool mExiting;
|
||||
|
||||
|
@ -949,6 +950,7 @@ class BeefConConsoleProvider : ConsoleProvider
|
|||
using (mDataMonitor.Enter())
|
||||
{
|
||||
mRecvStream.TryWrite(.(&data, len));
|
||||
mDataEvent.Set(true);
|
||||
}
|
||||
case .Err(let err):
|
||||
if ((err == .PipeListening) && (!mConnected))
|
||||
|
@ -1022,7 +1024,7 @@ class BeefConConsoleProvider : ConsoleProvider
|
|||
}
|
||||
}
|
||||
|
||||
public Result<Span<uint8>> ReadMessage(int timeoutMS)
|
||||
Result<Span<uint8>> DoReadMessage()
|
||||
{
|
||||
using (mDataMonitor.Enter())
|
||||
{
|
||||
|
@ -1044,6 +1046,19 @@ class BeefConConsoleProvider : ConsoleProvider
|
|||
return .Ok(.(mRecvStream.Memory.Ptr + 4, wantTotalLen - 4));
|
||||
}
|
||||
}
|
||||
|
||||
public Result<Span<uint8>> ReadMessage(int timeoutMS)
|
||||
{
|
||||
if (timeoutMS != 0)
|
||||
mDataEvent.WaitFor(timeoutMS);
|
||||
using (mDataMonitor.Enter())
|
||||
{
|
||||
var result = DoReadMessage();
|
||||
if (result case .Err)
|
||||
mDataEvent.Reset();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int sConId = 0;
|
||||
|
|
|
@ -257,7 +257,11 @@ class GitManager
|
|||
if (mProcess.WaitFor(0))
|
||||
{
|
||||
if (mProcess.ExitCode != 0)
|
||||
{
|
||||
if (gApp.mVerbosity >= .Diagnostic)
|
||||
gApp.OutputLine($"Git failed with Exit Code:{mProcess.ExitCode} Args:{mArgs} Path:{mPath}");
|
||||
mFailed = true;
|
||||
}
|
||||
mDone = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
#pragma warning disable 168
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using Beefy.gfx;
|
||||
|
||||
namespace IDE.util
|
||||
{
|
||||
class ResourceGen
|
||||
|
@ -62,6 +66,60 @@ namespace IDE.util
|
|||
|
||||
FileStream mOutStream = new FileStream() ~ delete _;
|
||||
|
||||
public static Result<Image> LoadIcon(String iconFile, int wantSize = -1)
|
||||
{
|
||||
FileStream stream = scope FileStream();
|
||||
if (stream.Open(iconFile, .Read) case .Err)
|
||||
{
|
||||
return .Err;
|
||||
}
|
||||
|
||||
let iconDir = Try!(stream.Read<IconDir>());
|
||||
if ((iconDir.mReserved != 0) || (iconDir.mType != 1) || (iconDir.mCount > 0x100))
|
||||
{
|
||||
return .Err;
|
||||
}
|
||||
|
||||
var entries = scope List<IconDirectoryEntry>();
|
||||
|
||||
for (int idx < iconDir.mCount)
|
||||
{
|
||||
entries.Add(Try!(stream.Read<IconDirectoryEntry>()));
|
||||
}
|
||||
|
||||
int bestIdx = iconDir.mCount - 1;
|
||||
for (int idx < iconDir.mCount)
|
||||
{
|
||||
let iconEntry = ref entries[idx];
|
||||
if (iconEntry.mWidth >= wantSize)
|
||||
{
|
||||
bestIdx = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
let iconEntry = ref entries[bestIdx];
|
||||
|
||||
Try!(stream.Seek(iconEntry.mImageOffset));
|
||||
|
||||
if (iconEntry.mBytesInRes > 1024*1024)
|
||||
{
|
||||
return .Err;
|
||||
}
|
||||
|
||||
uint8* data = new:ScopedAlloc! uint8[iconEntry.mBytesInRes]*;
|
||||
|
||||
Try!(stream.TryRead(.(data, iconEntry.mBytesInRes)));
|
||||
|
||||
String bmpPath = scope $"@{(int)(void*)data:X}:{iconEntry.mBytesInRes}.bmp";
|
||||
|
||||
var image = Image.LoadFromFile(bmpPath);
|
||||
if (image != null)
|
||||
return image;
|
||||
|
||||
return .Err;
|
||||
}
|
||||
|
||||
public Result<void> AddIcon(String iconFile)
|
||||
{
|
||||
if (!iconFile.EndsWith(".ico", .OrdinalIgnoreCase))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue