Skip to content

Commit 2680638

Browse files
committed
Add web-search icons to most fields in LockedOption edit dialog
1 parent 3e10eba commit 2680638

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

Page/PopmenuEditor.py

+36-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
from datetime import datetime
1111
import re
1212
import platform
13+
import webbrowser
14+
from functools import partial
1315

1416
import FM.flatmenu as FM
1517

@@ -917,12 +919,42 @@ def EditorDialog(self):
917919

918920
staticbox = sbsizer.GetStaticBox()
919921

920-
gridsizer = wx.FlexGridSizer(2, 2, 5)
921-
for ctrl in ['DisplayName', 'Command', 'Icon', 'Authbit', 'Badge', 'RewardToken', 'StoreProduct', 'PowerReady', 'PowerOwned']:
922-
gridsizer.Add(wx.StaticText(staticbox, label = ctrl, style=wx.ALIGN_RIGHT), 0, wx.ALIGN_CENTER)
922+
gridsizer = wx.GridBagSizer(5, 5)
923+
row = 0
924+
for ctrl in ['DisplayName', 'Command', 'Icon']:
925+
gridsizer.Add(wx.StaticText(staticbox, label = ctrl, style=wx.ALIGN_RIGHT), pos = (row, 0), flag = wx.ALIGN_CENTER)
926+
self.Ctrls[ctrl] = cgTextCtrl(staticbox, size = (400, -1), value = self.Data.get(ctrl, ''))
927+
self.Ctrls[ctrl].Bind(wx.EVT_TEXT, self.CheckEditorFieldsForError)
928+
span = (1,1) if ctrl == 'Icon' else (1,2)
929+
gridsizer.Add(self.Ctrls[ctrl], pos = (row, 1), span = span, flag = wx.EXPAND)
930+
row = row + 1
931+
932+
IconButton = wx.BitmapButton(staticbox, -1, bitmap = GetIcon('UI/search'))
933+
gridsizer.Add(IconButton, pos = (2,2))
934+
IconButton.Bind(wx.EVT_BUTTON, partial(webbrowser.open, 'https://homecoming.wiki/wiki/Macro_image_(Slash_Command)'))
935+
936+
gridsizer.Add(wx.StaticLine(staticbox, wx.ID_ANY, style = wx.LI_HORIZONTAL), pos = (row, 1), flag = wx.EXPAND|wx.ALL|wx.ALIGN_CENTER_VERTICAL, border = 10)
937+
row = row + 1
938+
939+
URLs = {
940+
'Authbit' : 'https://homecoming.wiki/wiki/Popmenu_(Slash_Command)/List_of_Authbit_Identifiers',
941+
'Badge' : 'https://homecoming.wiki/wiki/Settitle_(Slash_Command)/listing',
942+
'RewardToken' : 'https://homecoming.wiki/wiki/Popmenu_(Slash_Command)/List_of_RewardToken_Identifiers',
943+
'StoreProduct' : 'https://homecoming.wiki/wiki/Popmenu_(Slash_Command)/List_of_StoreProduct_Identifiers',
944+
'PowerReady' : 'https://cod.uberguy.net/html/index.html',
945+
'PowerOwned' : 'https://cod.uberguy.net/html/index.html',
946+
}
947+
948+
for ctrl in ['Authbit', 'Badge', 'RewardToken', 'StoreProduct', 'PowerReady', 'PowerOwned']:
949+
gridsizer.Add(wx.StaticText(staticbox, label = ctrl, style=wx.ALIGN_RIGHT), pos = (row, 0), flag = wx.ALIGN_CENTER)
923950
self.Ctrls[ctrl] = cgTextCtrl(staticbox, size = (400, -1), value = self.Data.get(ctrl, ''))
924951
self.Ctrls[ctrl].Bind(wx.EVT_TEXT, self.CheckEditorFieldsForError)
925-
gridsizer.Add(self.Ctrls[ctrl], 1, wx.EXPAND)
952+
gridsizer.Add(self.Ctrls[ctrl], pos = (row, 1), flag = wx.EXPAND)
953+
srchbutton = wx.BitmapButton(staticbox, -1, bitmap = GetIcon('UI/search'))
954+
gridsizer.Add(srchbutton, pos = (row,2))
955+
srchbutton.Bind(wx.EVT_BUTTON, partial(webbrowser.open, URLs[ctrl]))
956+
row = row + 1
957+
926958

927959
buttons = dialog.CreateButtonSizer(wx.OK|wx.CANCEL)
928960

icons/UI/search.png

1.06 KB
Loading

0 commit comments

Comments
 (0)