diff --git a/libhyperdbg_test.go b/libhyperdbg_test.go index 64361bcf..a701d031 100644 --- a/libhyperdbg_test.go +++ b/libhyperdbg_test.go @@ -7,8 +7,9 @@ import ( "github.com/stretchr/testify/assert" ) +// go test -run ^\QTestSdk\E$ func TestSdk(t *testing.T) { - t.Skip("github ci windows not support vt-x nested virtualization") + // t.Skip("github ci windows not support vt-x nested virtualization") mylog.Call(func() { assert.True(t, VmxSupportDetection()) mylog.Trace("InstallVmmDriver", InstallVmmDriver()) diff --git a/main.go b/main.go index d8bd6152..d89803f8 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,15 @@ package main import ( + "time" + + "github.com/ddkwork/golibrary/mylog" + "github.com/ddkwork/app" "github.com/ddkwork/app/widget" "github.com/richardwilkes/unison" "github.com/richardwilkes/unison/enums/align" + "github.com/richardwilkes/unison/enums/side" ) func main() { @@ -34,23 +39,47 @@ func testLayoutCpu() { toolBar := widget.NewToolBar(t.Elems()...) content.AddChild(toolBar) - //dock := unison.NewDock() - //dock.AsPanel().SetLayoutData(&unison.FlexLayoutData{ - // HSpan: 1, - // VSpan: 1, - // HAlign: align.Fill, - // VAlign: align.Fill, - // HGrab: true, - // VGrab: true, - //}) - fileName := "hyperdbg-cli.exe" asm := LayoutDisassemblyTable(fileName) - leftTab := widget.NewTab("cpu with fast call", "todo fast call layout", true, asm) - //content.AddChild(leftTab) - //return + + mylog.Todo("NewTab has some bug") + + left := widget.NewTab("cpu with fast call", "todo fast call layout", true, asm) + right := widget.NewTab("reg", "todo reg", true, widget.NewButton("todo reg")) + + dock := unison.NewDock() + dock.AsPanel().SetLayoutData(&unison.FlexLayoutData{ + HSpan: 1, + VSpan: 1, + HAlign: align.Fill, + VAlign: align.Fill, + HGrab: true, + VGrab: true, + }) + display := unison.PrimaryDisplay() + r := display.Usable.Size + pos := float32(0) + + dock.DockTo(left, nil, side.Left) + // LeftContainer := widget.NewDockContainer(left) + LeftContainer := unison.Ancestor[*unison.DockContainer](left) + dock.DockTo(right, LeftContainer, side.Right) + RightContainer := widget.NewDockContainer(right) + scale := float32(0.3) + pos = (r.Width/(display.ScaleX*1000)/2 + scale) * 1000 + RightContainer.Stack(right, -1) + dock.RootDockLayout().SetDividerPosition(pos) + unison.InvokeTaskAfter(func() { dock.RootDockLayout().SetDividerPosition(pos) }, time.Millisecond) + + LeftContainer.SetCurrentDockable(left) // left not work + RightContainer.SetCurrentDockable(right) // right not work + content.AddChild(dock) + + return + // content.AddChild(left) + // return TopHSplit := widget.NewHSplit( - leftTab, + left, widget.NewTab("reg", "todo reg", true, widget.NewButton("todo reg")), 0.3) // content.AddChild(asm) diff --git a/ux.go b/ux.go index 62a4e3d8..e2b06d42 100644 --- a/ux.go +++ b/ux.go @@ -36,8 +36,8 @@ func Run() { switch filepath.Ext(files[0]) { case ".exe", ".dll", ".sys": mylog.Trace("dropped file", files[0]) - pages.pe.SetContent(LayoutPeView(files[0])) // right action is remove all children - pages.cpu.SetContent(LayoutCpu(files[0])) // todo test parent panel is dock or cpu tab page + // pages.pe.SetContent(LayoutPeView(files[0])) // right action is remove all children + // pages.cpu.SetContent(LayoutCpu(files[0])) // todo test parent panel is dock or cpu tab page default: mylog.Check("not support file type") }