1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00
Beef/BeefTools/BeefPerf/src/Board.bf
2019-09-04 11:39:56 -07:00

82 lines
1.3 KiB
Beef

using System;
using Beefy;
using Beefy.gfx;
using Beefy.widgets;
using Beefy.geom;
using System.Collections.Generic;
using Beefy.utils;
using System.Diagnostics;
using Beefy.theme.dark;
namespace BeefPerf
{
struct BPEntry
{
public int32 mZoneNameId;
public int32 mParamsReadPos;
public int64 mStartTick;
}
struct BPSelection
{
public int32 mThreadIdx;
public int64 mTickStart;
public int64 mTickEnd;
public int32 mDepth;
}
class Board : Widget
{
public PerfView mPerfView;
public this()
{
}
public override void Resize(float x, float y, float width, float height)
{
base.Resize(x, y, width, height);
ResizeComponents();
}
public override void Draw(Graphics g)
{
base.Draw(g);
g.DrawBox(DarkTheme.sDarkTheme.GetImage(DarkTheme.ImageIdx.Bkg), 0, 0, mWidth, mHeight);
}
void GetData()
{
}
public void ShowSession(BpSession session)
{
if (mPerfView != null)
{
mPerfView.RemoveSelf();
DeleteAndNullify!(mPerfView);
}
if (session != null)
{
mPerfView = new PerfView(this, session);
mPerfView.mSession = session;
AddWidget(mPerfView);
ResizeComponents();
if (mWidgetWindow != null)
mPerfView.SetFocus();
}
}
void ResizeComponents()
{
if (mPerfView != null)
mPerfView.Resize(0, 0, mWidth, mHeight);
}
}
}