gui: use icons for toolbar

This commit is contained in:
mappu 2024-07-06 11:54:48 +12:00
parent 21151be8a3
commit aad92d27e9

25
main.go
View File

@ -147,7 +147,7 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
mnuQueryExecute.SetCaption("Execute")
mnuQueryExecute.SetShortCutFromString("F5")
mnuQueryExecute.SetOnClick(f.OnQueryExecute)
mnuQueryExecute.SetImageIndex(imgLightning)
mnuQueryExecute.SetImageIndex(imgResultsetNext)
mnuQuery.Add(mnuQueryExecute)
mnuHelp := vcl.NewMenuItem(f)
@ -228,27 +228,33 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
dataButtonBar.BorderSpacing().SetRight(MY_SPACING)
dataButtonBar.SetEdgeBorders(0)
dataButtonBar.SetImages(f.ImageList)
dataButtonBar.SetShowCaptions(true)
dataRefreshBtn := vcl.NewToolButton(dataButtonBar)
dataRefreshBtn.SetParent(dataButtonBar)
dataRefreshBtn.SetCaption("Refresh")
// dataRefreshBtn.SetImageIndex(imgLightning)
dataRefreshBtn.SetHint("Refresh")
dataRefreshBtn.SetShowHint(true)
dataRefreshBtn.SetImageIndex(imgArrowRefresh)
dataRefreshBtn.SetOnClick(func(sender vcl.IObject) { f.RefreshCurrentItem() })
dataInsertBtn := vcl.NewToolButton(dataButtonBar)
dataInsertBtn.SetParent(dataButtonBar)
dataInsertBtn.SetCaption("Insert")
dataInsertBtn.SetImageIndex(imgAdd)
dataInsertBtn.SetHint("Insert")
dataInsertBtn.SetShowHint(true)
dataInsertBtn.SetOnClick(f.OnDataInsertClick)
dataDelRowBtn := vcl.NewToolButton(dataButtonBar)
dataDelRowBtn.SetParent(dataButtonBar)
dataDelRowBtn.SetCaption("Delete Row")
dataDelRowBtn.SetImageIndex(imgDelete)
dataDelRowBtn.SetHint("Delete Row")
dataDelRowBtn.SetShowHint(true)
dataDelRowBtn.SetOnClick(f.OnDataDeleteRowClick)
dataCommitBtn := vcl.NewToolButton(dataButtonBar)
dataCommitBtn.SetParent(dataButtonBar)
dataCommitBtn.SetCaption("Commit")
dataCommitBtn.SetImageIndex(imgPencilGo)
dataCommitBtn.SetHint("Commit")
dataCommitBtn.SetShowHint(true)
dataCommitBtn.SetOnClick(f.OnDataCommitClick)
f.contentBox = vcl.NewStringGrid(dataTab)
@ -282,8 +288,9 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
queryExecBtn := vcl.NewToolButton(queryButtonBar)
queryExecBtn.SetParent(queryButtonBar)
queryExecBtn.SetCaption("Execute")
// queryExecBtn.SetImageIndex(imgLightning)
queryExecBtn.SetHint("Execute")
queryExecBtn.SetShowHint(true)
queryExecBtn.SetImageIndex(imgResultsetNext)
queryExecBtn.SetOnClick(f.OnQueryExecute)
f.queryInput = vcl.NewMemo(queryTab)