MCPcopy Create free account
hub / github.com/Eve-PySpy/PySpy / __init__

Method __init__

gui.py:35–268  ·  view source on GitHub ↗
(self, *args, **kwds)

Source from the content-addressed store, hash-verified

33
34class Frame(wx.Frame):
35 def __init__(self, *args, **kwds):
36
37 # Persistent Options
38 self.options = config.OPTIONS_OBJECT
39
40 kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE # wx.RESIZE_BORDER
41 wx.Frame.__init__(self, *args, **kwds)
42 self.SetName("Main Window")
43
44 self.Font = self.Font.Scaled(self.options.Get("FontScale", 1))
45
46 # Set stay on-top unless user deactivated it
47 if self.options.Get("StayOnTop", True):
48 self.ToggleWindowStyle(wx.STAY_ON_TOP)
49
50 # Set parameters for columns
51 self.columns = (
52 # Index, Heading, Format, Default Width, Can Toggle, Default Show, Menu Name, Outlist Column
53 [0, "ID", wx.ALIGN_LEFT, 0, False, False, "", 0],
54 [1, "Warning", wx.ALIGN_LEFT, 80, True, True, "Warning\tCTRL+ALT+X"],
55 [2, "Faction ID", wx.ALIGN_LEFT, 0, False, False, "", 1],
56 [3, "Character", wx.ALIGN_LEFT, 100, False, True, "", 2],
57 [4, "Security", wx.ALIGN_RIGHT, 50, True, False, "&Security\tCTRL+ALT+S", 15],
58 [5, "CorpID", wx.ALIGN_LEFT, 0, False, False, "", 3],
59 [6, "Corporation", wx.ALIGN_LEFT, 100, True, True, "Cor&poration\tCTRL+ALT+P", 4],
60 [7, "AllianceID", wx.ALIGN_LEFT, 0, False, False, "-", 5],
61 [8, "Alliance", wx.ALIGN_LEFT, 150, True, True, "All&iance\tCTRL+ALT+I", 6],
62 [9, "Faction", wx.ALIGN_LEFT, 50, True, False, "&Faction\tCTRL+ALT+F", 7],
63 [10, "Kills", wx.ALIGN_RIGHT, 50, True, True, "&Kills\tCTRL+ALT+K", 10],
64 [11, "Losses", wx.ALIGN_RIGHT, 50, True, True, "&Losses\tCTRL+ALT+L", 13],
65 [12, "Last Wk", wx.ALIGN_RIGHT, 50, True, True, "Last &Wk\tCTRL+ALT+W", 9],
66 [13, "Solo", wx.ALIGN_RIGHT, 50, True, False, "S&olo\tCTRL+ALT+O", 14],
67 [14, "BLOPS", wx.ALIGN_RIGHT, 50, True, False, "&BLOPS\tCTRL+ALT+B", 11],
68 [15, "HICs", wx.ALIGN_RIGHT, 50, True, False, "&HICs\tCTRL+ALT+H", 12],
69 [16, "Last Loss", wx.ALIGN_RIGHT, 60, True, True, "Days since last Loss\tCTRL+ALT+[", 16],
70 [17, "Last Kill", wx.ALIGN_RIGHT, 60, True, True, "Days since last Kill\tCTRL+ALT+]", 17],
71 [18, "Avg. Attackers", wx.ALIGN_RIGHT, 100, True, True, "&Average Attackers\tCTRL+ALT+A", 18],
72 [19, "Covert Cyno", wx.ALIGN_RIGHT, 100, True, True, "&Covert Cyno Probability\tCTRL+ALT+C", 19],
73 [20, "Regular Cyno", wx.ALIGN_RIGHT, 100, True, True, "&Regular Cyno Probability\tCTRL+ALT+R", 20],
74 [21, "Last Covert Cyno", wx.ALIGN_RIGHT, 100, True, True, "&Last Covert Cyno Ship Loss\tCTRL+ALT+<", 21],
75 [22, "Last Regular Cyno", wx.ALIGN_RIGHT, 110, True, True, "&Last Regular Cyno Ship Loss\tCTRL+ALT+>", 22],
76 [23, "Abyssal Losses", wx.ALIGN_RIGHT, 100, True, False, "&Abyssal Losses\tCTRL+ALT+Y", 23],
77 [24, "", None, 1, False, True, ""], # Need for _stretchLastCol()
78 )
79
80 # Define the menu bar and menu items
81 self.menubar = wx.MenuBar()
82 self.menubar.SetName("Menubar")
83 if os.name == "nt": # For Windows
84 self.file_menu = wx.Menu()
85 self.file_about = self.file_menu.Append(wx.ID_ANY, '&About\tCTRL+A')
86 self.file_menu.Bind(wx.EVT_MENU, self._openAboutDialog, self.file_about)
87 self.file_quit = self.file_menu.Append(wx.ID_ANY, 'Quit PySpy')
88 self.file_menu.Bind(wx.EVT_MENU, self.OnQuit, self.file_quit)
89 self.menubar.Append(self.file_menu, 'File')
90 if os.name == "posix": # For macOS
91 self.help_menu = wx.Menu()
92 self.help_about = self.help_menu.Append(wx.ID_ANY, '&About\tCTRL+A')

Callers

nothing calls this directly

Calls 6

_fontScaleMenuMethod · 0.95
__set_propertiesMethod · 0.95
_setTransparencyMethod · 0.95
__do_layoutMethod · 0.95
GetMethod · 0.80

Tested by

no test coverage detected