main: restructure nav menu into alphabetical per-DB options

This commit is contained in:
mappu 2024-06-23 16:20:06 +12:00
parent bc33d26cfd
commit 43002a9fde

74
main.go
View File

@ -46,36 +46,64 @@ func (f *TMainForm) OnFormCreate(sender vcl.IObject) {
mnuFile := vcl.NewMenuItem(f)
mnuFile.SetCaption("File")
mnuFileOpen := vcl.NewMenuItem(mnuFile)
mnuFileOpen.SetCaption("Open Bolt database...")
mnuFileOpen.SetImageIndex(imgDatabaseAdd)
mnuFileOpen.SetShortCutFromString("Ctrl+O")
mnuFileOpen.SetOnClick(f.OnMnuFileOpenClick)
mnuFile.Add(mnuFileOpen)
mnuFileBadger := vcl.NewMenuItem(mnuFile)
mnuFileBadger.SetCaption("Badger")
mnuFileBadger.SetImageIndex(imgVendorGithub)
mnuFile.Add(mnuFileBadger)
mnuFileSqliteOpen := vcl.NewMenuItem(mnuFile)
mnuFileSqliteOpen.SetCaption("Open SQLite database...")
mnuFileSqliteOpen.SetImageIndex(imgDatabaseAdd)
mnuFileSqliteOpen.SetOnClick(f.OnMnuFileSqliteOpenClick)
mnuFile.Add(mnuFileSqliteOpen)
mnuFileBadgerOpen := vcl.NewMenuItem(mnuFile)
mnuFileBadgerOpen.SetCaption("Open Badger v4 database...")
mnuFileBadgerOpen := vcl.NewMenuItem(mnuFileBadger)
mnuFileBadgerOpen.SetCaption("Open database...")
mnuFileBadgerOpen.SetImageIndex(imgDatabaseAdd)
mnuFileBadgerOpen.SetOnClick(f.OnMnuFileBadgerOpenClick)
mnuFile.Add(mnuFileBadgerOpen)
mnuFileBadger.Add(mnuFileBadgerOpen)
mnuFileSqliteMemory := vcl.NewMenuItem(mnuFile)
mnuFileSqliteMemory.SetCaption("New SQLite in-memory database")
mnuFileSqliteMemory.SetImageIndex(imgDatabaseAdd)
mnuFileSqliteMemory.SetOnClick(f.OnMnuFileSqliteMemoryClick)
mnuFile.Add(mnuFileSqliteMemory)
//
mnuFileRedisConnect := vcl.NewMenuItem(mnuFile)
mnuFileRedisConnect.SetCaption("Connect to Redis...")
mnuFileBolt := vcl.NewMenuItem(mnuFile)
mnuFileBolt.SetCaption("Bolt")
mnuFileBolt.SetImageIndex(imgVendorGithub)
mnuFile.Add(mnuFileBolt)
mnuFileBoltOpen := vcl.NewMenuItem(mnuFileBolt)
mnuFileBoltOpen.SetCaption("Open database...")
mnuFileBoltOpen.SetImageIndex(imgDatabaseAdd)
mnuFileBoltOpen.SetShortCutFromString("Ctrl+O")
mnuFileBoltOpen.SetOnClick(f.OnMnuFileOpenClick)
mnuFileBolt.Add(mnuFileBoltOpen)
//
mnuFileRedis := vcl.NewMenuItem(mnuFile)
mnuFileRedis.SetCaption("Redis")
mnuFileRedis.SetImageIndex(imgVendorRedis)
mnuFile.Add(mnuFileRedis)
mnuFileRedisConnect := vcl.NewMenuItem(mnuFileRedis)
mnuFileRedisConnect.SetCaption("Connect...")
mnuFileRedisConnect.SetImageIndex(imgDatabaseAdd)
mnuFileRedisConnect.SetOnClick(f.OnMnuFileRedisConnectClick)
mnuFile.Add(mnuFileRedisConnect)
mnuFileRedis.Add(mnuFileRedisConnect)
//
mnuFileSqlite := vcl.NewMenuItem(mnuFile)
mnuFileSqlite.SetCaption("SQLite")
mnuFileSqlite.SetImageIndex(imgVendorSqlite)
mnuFile.Add(mnuFileSqlite)
mnuFileSqliteOpen := vcl.NewMenuItem(mnuFileSqlite)
mnuFileSqliteOpen.SetCaption("Open database...")
mnuFileSqliteOpen.SetImageIndex(imgDatabaseAdd)
mnuFileSqliteOpen.SetOnClick(f.OnMnuFileSqliteOpenClick)
mnuFileSqlite.Add(mnuFileSqliteOpen)
mnuFileSqliteMemory := vcl.NewMenuItem(mnuFileSqlite)
mnuFileSqliteMemory.SetCaption("New in-memory database")
mnuFileSqliteMemory.SetImageIndex(imgDatabaseAdd)
mnuFileSqliteMemory.SetOnClick(f.OnMnuFileSqliteMemoryClick)
mnuFileSqlite.Add(mnuFileSqliteMemory)
//
mnuSep := vcl.NewMenuItem(mnuFile)
mnuSep.SetCaption("-") // Creates separator