gui: attach some icons to menu and nav tree
This commit is contained in:
parent
8b1e7064e7
commit
6234f02ea6
1
bolt.go
1
bolt.go
@ -98,6 +98,7 @@ func (f *TMainForm) boltAddDatabaseFromFile(path string) {
|
||||
|
||||
ld.nav = f.Buckets.Items().Add(nil, ld.displayName)
|
||||
ld.nav.SetHasChildren(true) // dynamically populate in OnNavExpanding
|
||||
ld.nav.SetImageIndex(imgDatabase)
|
||||
navData := &navData{
|
||||
ld: ld,
|
||||
childrenLoaded: false, // will be loaded dynamically
|
||||
|
5
main.go
5
main.go
@ -46,17 +46,20 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
|
||||
|
||||
mnuFileOpen := vcl.NewMenuItem(mnuFile)
|
||||
mnuFileOpen.SetCaption("Open Bolt database...")
|
||||
mnuFileOpen.SetImageIndex(imgDatabaseAdd)
|
||||
mnuFileOpen.SetShortCutFromString("Ctrl+O")
|
||||
mnuFileOpen.SetOnClick(f.OnMnuFileOpenClick)
|
||||
mnuFile.Add(mnuFileOpen)
|
||||
|
||||
mnuFileSqliteOpen := vcl.NewMenuItem(mnuFile)
|
||||
mnuFileSqliteOpen.SetCaption("Open SQLite database...")
|
||||
mnuFileSqliteOpen.SetImageIndex(imgDatabaseAdd)
|
||||
mnuFileSqliteOpen.SetOnClick(f.OnMnuFileSqliteOpenClick)
|
||||
mnuFile.Add(mnuFileSqliteOpen)
|
||||
|
||||
mnuFileSqliteMemory := vcl.NewMenuItem(mnuFile)
|
||||
mnuFileSqliteMemory.SetCaption("New SQLite in-memory database")
|
||||
mnuFileSqliteMemory.SetImageIndex(imgDatabaseAdd)
|
||||
mnuFileSqliteMemory.SetOnClick(f.OnMnuFileSqliteMemoryClick)
|
||||
mnuFile.Add(mnuFileSqliteMemory)
|
||||
|
||||
@ -70,10 +73,12 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
|
||||
mnuFile.Add(mnuFileExit)
|
||||
|
||||
f.Menu = vcl.NewMainMenu(f)
|
||||
f.Menu.SetImages(f.ImageList)
|
||||
f.Menu.Items().Add(mnuFile)
|
||||
|
||||
f.Buckets = vcl.NewTreeView(f)
|
||||
f.Buckets.SetParent(f)
|
||||
f.Buckets.SetImages(f.ImageList)
|
||||
f.Buckets.SetAlign(types.AlLeft)
|
||||
f.Buckets.SetWidth(MY_WIDTH)
|
||||
f.Buckets.SetReadOnly(true) // prevent click to rename on nodes
|
||||
|
Loading…
Reference in New Issue
Block a user