Fix for maximized case of stats window
This commit is contained in:
@@ -44,7 +44,13 @@ class ItemStats(ContextMenu):
|
||||
elif reuse:
|
||||
lastWnd = self.mainFrame.GetActiveStatsWindow()
|
||||
pos = lastWnd.GetPosition()
|
||||
dlg=ItemStatsDialog(stuff, context.capitalize() if context not in self.REPLACES else self.REPLACES[context], pos)
|
||||
maximized = lastWnd.IsMaximized()
|
||||
if not maximized:
|
||||
size = lastWnd.GetSize()
|
||||
else:
|
||||
size = wx.DefaultSize
|
||||
pos = wx.DefaultPosition
|
||||
dlg=ItemStatsDialog(stuff, context.capitalize() if context not in self.REPLACES else self.REPLACES[context], pos, size, maximized)
|
||||
lastWnd.closeEvent(None)
|
||||
|
||||
else:
|
||||
|
||||
@@ -30,10 +30,10 @@ import service
|
||||
|
||||
class ItemStatsDialog(wx.Dialog):
|
||||
counter = 0
|
||||
def __init__(self, victim, context = None, pos = wx.DefaultPosition):
|
||||
def __init__(self, victim, context = None, pos = wx.DefaultPosition, size = wx.DefaultSize, maximized = False):
|
||||
wx.Dialog.__init__(self,
|
||||
gui.mainFrame.MainFrame.getInstance(),
|
||||
wx.ID_ANY, title="Item stats", pos = pos,
|
||||
wx.ID_ANY, title="Item stats", pos = pos, size = size,
|
||||
style = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX |
|
||||
wx.MAXIMIZE_BOX | wx.RESIZE_BORDER| wx.SYSTEM_MENU)
|
||||
|
||||
@@ -86,6 +86,11 @@ class ItemStatsDialog(wx.Dialog):
|
||||
self.SetPosition((dlgx,dlgy))
|
||||
else:
|
||||
self.SetPosition(pos)
|
||||
if maximized:
|
||||
self.Maximize(True)
|
||||
else:
|
||||
if size != wx.DefaultSize:
|
||||
self.SetSize(size)
|
||||
self.parentWnd.RegisterStatsWindow(self)
|
||||
|
||||
self.Show()
|
||||
|
||||
Reference in New Issue
Block a user