|
10 | 10 | from datetime import datetime
|
11 | 11 | import re
|
12 | 12 | import platform
|
| 13 | +import webbrowser |
| 14 | +from functools import partial |
13 | 15 |
|
14 | 16 | import FM.flatmenu as FM
|
15 | 17 |
|
@@ -917,12 +919,42 @@ def EditorDialog(self):
|
917 | 919 |
|
918 | 920 | staticbox = sbsizer.GetStaticBox()
|
919 | 921 |
|
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) |
923 | 950 | self.Ctrls[ctrl] = cgTextCtrl(staticbox, size = (400, -1), value = self.Data.get(ctrl, ''))
|
924 | 951 | 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 | + |
926 | 958 |
|
927 | 959 | buttons = dialog.CreateButtonSizer(wx.OK|wx.CANCEL)
|
928 | 960 |
|
|
0 commit comments