mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-17 23:56:05 +02:00
Initial checkin
This commit is contained in:
parent
c74712dad9
commit
078564ac9e
3242 changed files with 1616395 additions and 0 deletions
72
IDE/src/ui/QuickWatchDialog.bf
Normal file
72
IDE/src/ui/QuickWatchDialog.bf
Normal file
|
@ -0,0 +1,72 @@
|
|||
using Beefy.theme.dark;
|
||||
using System;
|
||||
using Beefy.events;
|
||||
|
||||
namespace IDE.ui
|
||||
{
|
||||
class QuickWatchDialog : IDEDialog
|
||||
{
|
||||
WatchPanel mWatchPanel;
|
||||
|
||||
public void Init(StringView initStr)
|
||||
{
|
||||
mWatchPanel = new WatchPanel(false);
|
||||
AddWidget(mWatchPanel);
|
||||
|
||||
Title = "Quick Watch";
|
||||
mWindowFlags = .ClientSized | .TopMost | .Caption | .Border | .SysMenu | .Resizable;
|
||||
|
||||
mWatchPanel.[Friend]mDisabled = gApp.mWatchPanel.[Friend]mDisabled;
|
||||
mWatchPanel.Update();
|
||||
mWatchPanel.mOnKeyDown.Add(new => OnKeyDown);
|
||||
|
||||
if (!initStr.IsEmpty)
|
||||
{
|
||||
mWatchPanel.AddWatchItem(scope String(initStr));
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddedToParent()
|
||||
{
|
||||
base.AddedToParent();
|
||||
|
||||
mWatchPanel.SetFocus();
|
||||
var lvItem = (WatchListViewItem)mWatchPanel.mListView.GetRoot().GetChildAtIndex(0);
|
||||
if ((lvItem.mWatchEntry != null) && (!lvItem.mWatchEntry.mEvalStr.IsEmpty))
|
||||
{
|
||||
mWatchPanel.mListView.GetRoot().GetChildAtIndex(0).Focused = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!mWatchPanel.[Friend]mDisabled)
|
||||
mWatchPanel.EditListViewItem(lvItem);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ResizeComponents()
|
||||
{
|
||||
base.ResizeComponents();
|
||||
mWatchPanel.Resize(mX + GS!(4), mY + GS!(4), mWidth - GS!(4)*2, mHeight - GS!(4)*2);
|
||||
}
|
||||
|
||||
public override void CalcSize()
|
||||
{
|
||||
mWidth = GS!(600);
|
||||
mHeight = GS!(380);
|
||||
}
|
||||
|
||||
void OnKeyDown(KeyDownEvent evt)
|
||||
{
|
||||
if (evt.mKeyCode == .Escape)
|
||||
{
|
||||
evt.mHandled = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
base.Update();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue