mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-07 00:36:00 +02:00
Initial console support
This commit is contained in:
parent
45a5978611
commit
186c2125fa
21 changed files with 1244 additions and 29 deletions
|
@ -309,6 +309,8 @@ namespace IDE
|
|||
Add("Show File Externally", new => gApp.Cmd_ShowFileExternally);
|
||||
Add("Show Find Results", new => gApp.ShowFindResults);
|
||||
Add("Show Fixit", new => gApp.Cmd_ShowFixit);
|
||||
Add("Show Terminal", new => gApp.ShowTerminal);
|
||||
Add("Show Console", new => gApp.ShowConsole);
|
||||
Add("Show Immediate", new => gApp.ShowImmediatePanel);
|
||||
Add("Show Memory", new => gApp.ShowMemory);
|
||||
Add("Show Modules", new => gApp.ShowModules);
|
||||
|
|
|
@ -160,6 +160,7 @@ namespace IDE
|
|||
public PropertiesPanel mPropertiesPanel;
|
||||
public Font mTinyCodeFont ~ delete _;
|
||||
public Font mCodeFont ~ delete _;
|
||||
public Font mTermFont ~ delete _;
|
||||
protected bool mInitialized;
|
||||
public bool mConfig_NoIR;
|
||||
public bool mFailed;
|
||||
|
@ -196,6 +197,8 @@ namespace IDE
|
|||
public bool mWantShowOutput;
|
||||
|
||||
public OutputPanel mOutputPanel;
|
||||
public TerminalPanel mTerminalPanel;
|
||||
public ConsolePanel mConsolePanel;
|
||||
public ImmediatePanel mImmediatePanel;
|
||||
public FindResultsPanel mFindResultsPanel;
|
||||
public WatchPanel mAutoWatchPanel;
|
||||
|
@ -711,6 +714,8 @@ namespace IDE
|
|||
RemoveAndDelete!(mProjectPanel);
|
||||
RemoveAndDelete!(mClassViewPanel);
|
||||
RemoveAndDelete!(mOutputPanel);
|
||||
RemoveAndDelete!(mTerminalPanel);
|
||||
RemoveAndDelete!(mConsolePanel);
|
||||
RemoveAndDelete!(mImmediatePanel);
|
||||
RemoveAndDelete!(mFindResultsPanel);
|
||||
RemoveAndDelete!(mAutoWatchPanel);
|
||||
|
@ -815,6 +820,8 @@ namespace IDE
|
|||
dlg(mProjectPanel);
|
||||
dlg(mClassViewPanel);
|
||||
dlg(mOutputPanel);
|
||||
dlg(mTerminalPanel);
|
||||
dlg(mConsolePanel);
|
||||
dlg(mImmediatePanel);
|
||||
dlg(mFindResultsPanel);
|
||||
dlg(mAutoWatchPanel);
|
||||
|
@ -5152,6 +5159,18 @@ namespace IDE
|
|||
ShowPanel(mAutoWatchPanel, "Auto Watches");
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void ShowTerminal()
|
||||
{
|
||||
ShowPanel(mTerminalPanel, "Terminal");
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void ShowConsole()
|
||||
{
|
||||
ShowPanel(mConsolePanel, "Console");
|
||||
}
|
||||
|
||||
[IDECommand]
|
||||
public void ShowImmediatePanel()
|
||||
{
|
||||
|
@ -5924,12 +5943,14 @@ namespace IDE
|
|||
AddMenuItem(subMenu, "&Diagnostics", "Show Diagnostics");
|
||||
AddMenuItem(subMenu, "E&rrors", "Show Errors");
|
||||
AddMenuItem(subMenu, "&Find Results", "Show Find Results");
|
||||
AddMenuItem(subMenu, "&Terminal", "Show Terminal");
|
||||
AddMenuItem(subMenu, "Co&nsole", "Show Console");
|
||||
AddMenuItem(subMenu, "&Immediate Window", "Show Immediate");
|
||||
AddMenuItem(subMenu, "&Memory", "Show Memory");
|
||||
AddMenuItem(subMenu, "Mod&ules", "Show Modules");
|
||||
AddMenuItem(subMenu, "&Output", "Show Output");
|
||||
AddMenuItem(subMenu, "&Profiler", "Show Profiler");
|
||||
AddMenuItem(subMenu, "&Threads", "Show Threads");
|
||||
AddMenuItem(subMenu, "T&hreads", "Show Threads");
|
||||
AddMenuItem(subMenu, "&Watches", "Show Watches");
|
||||
AddMenuItem(subMenu, "Work&space Explorer", "Show Workspace Explorer");
|
||||
subMenu.AddMenuItem(null);
|
||||
|
@ -6076,6 +6097,7 @@ namespace IDE
|
|||
public void SetupNewWindow(WidgetWindow window, bool isMainWindow)
|
||||
{
|
||||
window.mOnWindowKeyDown.Add(new => SysKeyDown);
|
||||
window.mOnWindowKeyUp.Add(new => SysKeyUp);
|
||||
window.mOnMouseUp.Add(new => MouseUp);
|
||||
if (isMainWindow)
|
||||
window.mOnWindowCloseQuery.Add(new => SecondaryAllowClose);
|
||||
|
@ -8228,6 +8250,9 @@ namespace IDE
|
|||
NOP!();
|
||||
}
|
||||
|
||||
mConsolePanel.SysKeyDown(evt);
|
||||
//mTerminalPanel.SysKeyDown(evt);
|
||||
|
||||
if (evt.mHandled)
|
||||
return;
|
||||
|
||||
|
@ -8276,7 +8301,7 @@ namespace IDE
|
|||
{
|
||||
var keyState = scope KeyState();
|
||||
keyState.mKeyCode = evt.mKeyCode;
|
||||
keyState.mKeyFlags = evt.mKeyFlags;
|
||||
keyState.mKeyFlags = evt.mKeyFlags.HeldKeys;
|
||||
|
||||
var curKeyMap = mCommands.mKeyMap;
|
||||
|
||||
|
@ -8377,7 +8402,7 @@ namespace IDE
|
|||
//if (focusWidget is DisassemblyPanel)
|
||||
//break;
|
||||
|
||||
if (evt.mKeyFlags == 0) // No ctrl/shift/alt
|
||||
if (evt.mKeyFlags.HeldKeys == 0) // No ctrl/shift/alt
|
||||
{
|
||||
switch (evt.mKeyCode)
|
||||
{
|
||||
|
@ -8398,6 +8423,12 @@ namespace IDE
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SysKeyUp(KeyCode keyCode)
|
||||
{
|
||||
//mTerminalPanel.SysKeyUp(keyCode);
|
||||
mConsolePanel.SysKeyUp(keyCode);
|
||||
}
|
||||
|
||||
void ShowOpenFileInSolutionDialog()
|
||||
{
|
||||
|
@ -12242,6 +12273,7 @@ namespace IDE
|
|||
|
||||
mTinyCodeFont = new Font();
|
||||
mCodeFont = new Font();
|
||||
mTermFont = new Font();
|
||||
|
||||
//mCodeFont = Font.LoadFromFile(BFApp.sApp.mInstallDir + "fonts/SourceCodePro32.fnt");
|
||||
|
||||
|
@ -12268,6 +12300,10 @@ namespace IDE
|
|||
mClassViewPanel.mAutoDelete = false;
|
||||
mOutputPanel = new OutputPanel(true);
|
||||
mOutputPanel.mAutoDelete = false;
|
||||
mTerminalPanel = new TerminalPanel();
|
||||
mTerminalPanel.mAutoDelete = false;
|
||||
mConsolePanel = new ConsolePanel();
|
||||
mConsolePanel.mAutoDelete = false;
|
||||
mImmediatePanel = new ImmediatePanel();
|
||||
mImmediatePanel.mAutoDelete = false;
|
||||
mFindResultsPanel = new FindResultsPanel();
|
||||
|
@ -12395,6 +12431,7 @@ namespace IDE
|
|||
mMainWindow.mIsMainWindow = true;
|
||||
mMainWindow.mOnMouseUp.Add(new => MouseUp);
|
||||
mMainWindow.mOnWindowKeyDown.Add(new => SysKeyDown);
|
||||
mMainWindow.mOnWindowKeyUp.Add(new => SysKeyUp);
|
||||
mMainWindow.mOnWindowCloseQuery.Add(new => AllowClose);
|
||||
mMainWindow.mOnDragDropFile.Add(new => DragDropFile);
|
||||
CreateMenu();
|
||||
|
@ -12619,6 +12656,8 @@ namespace IDE
|
|||
mTinyCodeFont.AddAlternate(new String("fonts/seguihis.ttf"), tinyFontSize);*/
|
||||
}
|
||||
|
||||
mTermFont.Load("Cascadia Mono Regular", fontSize);
|
||||
|
||||
if (!err.IsEmpty)
|
||||
{
|
||||
OutputErrorLine(err);
|
||||
|
|
|
@ -242,7 +242,7 @@ namespace IDE.ui
|
|||
{
|
||||
base.KeyDown(keyCode, isRepeat);
|
||||
|
||||
if ((keyCode == (.)'C') && (mWidgetWindow.GetKeyFlags() == .Ctrl))
|
||||
if ((keyCode == (.)'C') && (mWidgetWindow.GetKeyFlags(true) == .Ctrl))
|
||||
{
|
||||
String versionInfo = scope String();
|
||||
versionInfo.AppendF("Beef IDE Version {}", gApp.mVersionInfo.FileVersion);
|
||||
|
|
1031
IDE/src/ui/ConsolePanel.bf
Normal file
1031
IDE/src/ui/ConsolePanel.bf
Normal file
File diff suppressed because it is too large
Load diff
|
@ -83,6 +83,9 @@ namespace IDE.ui
|
|||
data.GetString("Type", type);
|
||||
Panel panel = null;
|
||||
|
||||
if (type == "")
|
||||
return gApp.mTerminalPanel;
|
||||
|
||||
if (type == "CallStackPanel")
|
||||
panel = gApp.mCallStackPanel;
|
||||
else if (type == "BreakpointPanel")
|
||||
|
@ -93,6 +96,10 @@ namespace IDE.ui
|
|||
{
|
||||
panel = gApp.mOutputPanel;
|
||||
}
|
||||
else if (type == "TerminalPanel")
|
||||
{
|
||||
panel = gApp.mTerminalPanel;
|
||||
}
|
||||
else if (type == "ImmediatePanel")
|
||||
{
|
||||
panel = gApp.mImmediatePanel;
|
||||
|
@ -159,6 +166,14 @@ namespace IDE.ui
|
|||
{
|
||||
panel = gApp.mBookmarksPanel;
|
||||
}
|
||||
else if (type == "TerminalPanel")
|
||||
{
|
||||
panel = gApp.mTerminalPanel;
|
||||
}
|
||||
else if (type == "ConsolePanel")
|
||||
{
|
||||
panel = gApp.mConsolePanel;
|
||||
}
|
||||
|
||||
if (panel != null)
|
||||
{
|
||||
|
|
|
@ -2375,7 +2375,7 @@ namespace IDE.ui
|
|||
|
||||
base.KeyDown(keyCode, isRepeat);
|
||||
|
||||
if (mWidgetWindow.GetKeyFlags() == .Ctrl)
|
||||
if (mWidgetWindow.GetKeyFlags(true) == .Ctrl)
|
||||
{
|
||||
switch (keyCode)
|
||||
{
|
||||
|
@ -2388,7 +2388,7 @@ namespace IDE.ui
|
|||
default:
|
||||
}
|
||||
}
|
||||
else if (mWidgetWindow.GetKeyFlags() == .None)
|
||||
else if (mWidgetWindow.GetKeyFlags(true) == .None)
|
||||
{
|
||||
if (keyCode == KeyCode.Delete)
|
||||
RemoveSelectedItems();
|
||||
|
|
|
@ -394,7 +394,7 @@ namespace IDE.ui
|
|||
{
|
||||
var focusedListViewItem = GetRoot().FindFocusedItem();
|
||||
|
||||
bool changeFocus = (keyCode == .Tab) && (mWidgetWindow.GetKeyFlags() == .None);
|
||||
bool changeFocus = (keyCode == .Tab) && (mWidgetWindow.GetKeyFlags(true) == .None);
|
||||
if ((keyCode == .Right) && ((focusedListViewItem == null) || (focusedListViewItem.GetChildCount() == 0)))
|
||||
changeFocus = true;
|
||||
|
||||
|
@ -454,7 +454,7 @@ namespace IDE.ui
|
|||
{
|
||||
var propertiesDialog = (PropertiesDialog)mParent;
|
||||
|
||||
let keyFlags = mWidgetWindow.GetKeyFlags();
|
||||
let keyFlags = mWidgetWindow.GetKeyFlags(true);
|
||||
bool changeFocus = (keyCode == .Tab) && (keyFlags == .Shift);
|
||||
if (keyCode == .Left)
|
||||
{
|
||||
|
|
24
IDE/src/ui/TerminalPanel.bf
Normal file
24
IDE/src/ui/TerminalPanel.bf
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma warning disable 168
|
||||
|
||||
using System;
|
||||
using Beefy.geom;
|
||||
using Beefy.gfx;
|
||||
using System.Text;
|
||||
using Beefy.theme.dark;
|
||||
using System.Security.Cryptography;
|
||||
using Beefy.widgets;
|
||||
using Beefy.events;
|
||||
using System.Diagnostics;
|
||||
using Beefy.utils;
|
||||
|
||||
namespace IDE.ui;
|
||||
|
||||
class TerminalPanel : Panel
|
||||
{
|
||||
public override void Serialize(StructuredData data)
|
||||
{
|
||||
base.Serialize(data);
|
||||
|
||||
data.Add("Type", "TerminalPanel");
|
||||
}
|
||||
}
|
20
IDE/src/util/ConsoleProvider.bf
Normal file
20
IDE/src/util/ConsoleProvider.bf
Normal file
|
@ -0,0 +1,20 @@
|
|||
namespace IDE.util;
|
||||
|
||||
class ConsoleProvider
|
||||
{
|
||||
public struct Cell
|
||||
{
|
||||
public char32 mChar;
|
||||
public uint32 mFgColor;
|
||||
public uint32 mBgColor;
|
||||
}
|
||||
|
||||
public virtual void Get(int col, int row)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class WinNativeConsoleProvider
|
||||
{
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue