gui: improvements for execute toolbar

This commit is contained in:
mappu 2024-06-15 12:57:35 +12:00
parent 5cd3f6c765
commit f4d2d2ec39

19
main.go
View File

@ -90,6 +90,7 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
mnuQueryExecute.SetCaption("Execute") mnuQueryExecute.SetCaption("Execute")
mnuQueryExecute.SetShortCutFromString("F5") mnuQueryExecute.SetShortCutFromString("F5")
mnuQueryExecute.SetOnClick(f.OnQueryExecute) mnuQueryExecute.SetOnClick(f.OnQueryExecute)
mnuQueryExecute.SetImageIndex(imgLightning)
mnuQuery.Add(mnuQueryExecute) mnuQuery.Add(mnuQueryExecute)
f.Menu = vcl.NewMainMenu(f) f.Menu = vcl.NewMainMenu(f)
@ -157,10 +158,20 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
queryTab.SetCaption("Query") queryTab.SetCaption("Query")
queryTab.SetImageIndex(imgLightning) queryTab.SetImageIndex(imgLightning)
queryExecBtn := vcl.NewButton(queryTab) queryButtonBar := vcl.NewToolBar(queryTab)
queryExecBtn.SetParent(queryTab) queryButtonBar.SetParent(queryTab)
queryButtonBar.SetAlign(types.AlTop)
queryButtonBar.BorderSpacing().SetLeft(MY_SPACING)
queryButtonBar.BorderSpacing().SetTop(MY_SPACING)
queryButtonBar.BorderSpacing().SetBottom(0)
queryButtonBar.BorderSpacing().SetRight(MY_SPACING)
queryButtonBar.SetImages(f.ImageList)
queryButtonBar.SetShowCaptions(true)
queryExecBtn := vcl.NewToolButton(queryButtonBar)
queryExecBtn.SetParent(queryButtonBar)
queryExecBtn.SetCaption("Execute") queryExecBtn.SetCaption("Execute")
queryExecBtn.SetAlign(types.AlTop) // queryExecBtn.SetImageIndex(imgLightning)
queryExecBtn.SetOnClick(f.OnQueryExecute) queryExecBtn.SetOnClick(f.OnQueryExecute)
f.queryInput = vcl.NewMemo(queryTab) f.queryInput = vcl.NewMemo(queryTab)
@ -170,7 +181,7 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
f.queryInput.SetTop(1) f.queryInput.SetTop(1)
f.queryInput.Font().SetName("monospace") f.queryInput.Font().SetName("monospace")
f.queryInput.BorderSpacing().SetLeft(MY_SPACING) f.queryInput.BorderSpacing().SetLeft(MY_SPACING)
f.queryInput.BorderSpacing().SetTop(MY_SPACING) f.queryInput.BorderSpacing().SetTop(0)
f.queryInput.BorderSpacing().SetRight(MY_SPACING) f.queryInput.BorderSpacing().SetRight(MY_SPACING)
vsplit := vcl.NewSplitter(queryTab) vsplit := vcl.NewSplitter(queryTab)