Exemplo n.º 1
0
    def __init__(self, mainWindow):
        tk.Toplevel.__init__(self)
        self.minsize(5, 5)
        self.overrideredirect(True)
        self.wm_attributes("-topmost", True)
        self.wm_attributes("-alpha", settings.getCompactTransparency() / 100)
        self.columnconfigure(10, weight=1)
        self.rowconfigure(10, weight=1)
        self.configure(background="black")

        self.collapseButton = tk.Canvas(self,
                                        width=15,
                                        height=15,
                                        background="black",
                                        highlightbackground="white",
                                        highlightthickness="1")
        #Boxception
        self.collapseButton.create_line(5, 5, 12, 5, fill="white")
        self.collapseButton.create_line(5, 5, 5, 12, fill="white")
        self.collapseButton.create_line(11, 11, 11, 5, fill="white")
        self.collapseButton.create_line(11, 11, 5, 11, fill="white")

        self.collapseButton.grid(row=10, column=10, sticky="n")
        self.collapseButton.bind("<ButtonPress-1>", mainWindow.buttonDimGray)
        self.collapseButton.bind("<ButtonRelease-1>", mainWindow.collapseEvent)
        self.collapseButton.bind("<Enter>", mainWindow.buttonGray25)
        self.collapseButton.bind("<Leave>", mainWindow.buttonBlack)

        self.geometry("+%s+%s" % (mainWindow.collapseButton.winfo_rootx(),
                                  mainWindow.collapseButton.winfo_rooty()))
        self.update_idletasks()
Exemplo n.º 2
0
 def collapseHandler(self, collapsed):
     """ this is called when the main window receives a collapseEvent """
     if collapsed:
         self.wm_attributes("-alpha", 1.0)
         self.topResizeFrame.grid()
         self.bottomResizeFrame.grid()
         self.leftResizeFrame.grid()
         self.rightResizeFrame.grid()
         self.topLeftResizeFrame.grid()
         self.topRightResizeFrame.grid()
         self.bottomLeftResizeFrame.grid()
         self.bottomRightResizeFrame.grid()
         self.makeDraggable(self.mainFrame)
         self.makeDraggable(self.detailsHandler)
         self.makeDraggable(self.topLabel)
     else:
         self.wm_attributes("-alpha",
                            settings.getCompactTransparency() / 100)
         self.topResizeFrame.grid_remove()
         self.bottomResizeFrame.grid_remove()
         self.leftResizeFrame.grid_remove()
         self.rightResizeFrame.grid_remove()
         self.topLeftResizeFrame.grid_remove()
         self.topRightResizeFrame.grid_remove()
         self.bottomLeftResizeFrame.grid_remove()
         self.bottomRightResizeFrame.grid_remove()
         self.unmakeDraggable(self.mainFrame)
         self.unmakeDraggable(self.detailsHandler)
         self.unmakeDraggable(self.topLabel)
Exemplo n.º 3
0
 def collapseEvent(self, event):
     """ This is called when the collapse icon is clicked
     it also calls the same event on the details window """
     logging.debug('window collapse event occured')
     self.detailsWindow.collapseHandler(self.collapsed)
     if self.collapsed:
         self.wm_attributes("-alpha", 1.0)
         self.rightSpacerFrame.grid_remove()
         self.topResizeFrame.grid()
         self.bottomResizeFrame.grid()
         self.leftResizeFrame.grid()
         self.rightResizeFrame.grid()
         self.topLeftResizeFrame.grid()
         self.topRightResizeFrame.grid()
         self.bottomLeftResizeFrame.grid()
         self.bottomRightResizeFrame.grid()
         self.makeDraggable(self.topLabel)
         self.makeDraggable(self.mainFrame)
         self.makeDraggable(self.middleFrame)
         self.makeDraggable(self.labelHandler)
         self.makeAllChildrenDraggable(self.labelHandler)
         self.makeDraggable(self.graphFrame.canvas.get_tk_widget())
         self.mainMenu.grid()
         self.characterMenu.grid()
         self.quitButton.grid()
         self.minimizeButton.grid()
         self.collapseButton.destroy()
         self.addCollapseButton(self, row="5", column="17")
         self.collapsed = False
     else:
         self.wm_attributes("-alpha",
                            settings.getCompactTransparency() / 100)
         self.topResizeFrame.grid_remove()
         self.bottomResizeFrame.grid_remove()
         self.leftResizeFrame.grid_remove()
         self.rightResizeFrame.grid_remove()
         self.topLeftResizeFrame.grid_remove()
         self.topRightResizeFrame.grid_remove()
         self.bottomLeftResizeFrame.grid_remove()
         self.bottomRightResizeFrame.grid_remove()
         self.rightSpacerFrame.grid()
         self.unmakeDraggable(self.topLabel)
         self.unmakeDraggable(self.mainFrame)
         self.unmakeDraggable(self.middleFrame)
         self.unmakeDraggable(self.labelHandler)
         self.unmakeAllChildrenDraggable(self.labelHandler)
         self.unmakeDraggable(self.graphFrame.canvas.get_tk_widget())
         self.mainMenu.grid_remove()
         self.characterMenu.grid_remove()
         self.quitButton.grid_remove()
         self.minimizeButton.grid_remove()
         self.collapseButton.destroy()
         self.addCollapseButton(self.middleFrame, row="0", column="1")
         self.collapsed = True
Exemplo n.º 4
0
 def collapseEvent(self, event):
     """ This is called when the collapse icon is clicked
     it also calls the same event on the details window """
     logging.debug('window collapse event occured')
     self.detailsWindow.collapseHandler(self.collapsed)
     self.fleetWindow.collapseHandler(self.collapsed)
     if self.collapsed:
         if (self.platform == "Windows"):
             self.uncollapseWindow.destroy()
             windowsCollapseEvent(self, False)
             windowsCollapseEvent(self.detailsWindow, False)
             windowsCollapseEvent(self.fleetWindow, False)
         self.wm_attributes("-alpha", 1.0)
         self.rightSpacerFrame.grid_remove()
         self.showResizeFrames()
         self.makeDraggable(self.topLabel)
         self.makeDraggable(self.mainFrame)
         self.makeDraggable(self.middleFrame)
         self.makeDraggable(self.labelHandler)
         self.makeAllChildrenDraggable(self.labelHandler)
         self.makeDraggable(self.graphFrame.canvas.get_tk_widget())
         self.mainMenu.grid()
         self.characterMenu.grid()
         self.quitButton.grid()
         self.minimizeButton.grid()
         self.collapseButton.destroy()
         self.addCollapseButton(self, row="5", column="17")
         self.collapsed = False
     else:
         self.wm_attributes("-alpha",
                            settings.getCompactTransparency() / 100)
         self.hideResizeFrames()
         self.rightSpacerFrame.grid()
         self.unmakeDraggable(self.topLabel)
         self.unmakeDraggable(self.mainFrame)
         self.unmakeDraggable(self.middleFrame)
         self.unmakeDraggable(self.labelHandler)
         self.unmakeAllChildrenDraggable(self.labelHandler)
         self.unmakeDraggable(self.graphFrame.canvas.get_tk_widget())
         self.mainMenu.grid_remove()
         self.characterMenu.grid_remove()
         self.quitButton.grid_remove()
         self.minimizeButton.grid_remove()
         self.collapseButton.destroy()
         self.addCollapseButton(self.middleFrame, row="0", column="1")
         if (self.platform == "Windows"):
             self.update_idletasks()
             self.uncollapseWindow = UncollapseWindow(self)
             windowsCollapseEvent(self, True)
             windowsCollapseEvent(self.detailsWindow, True)
             windowsCollapseEvent(self.fleetWindow, True)
         self.collapsed = True
Exemplo n.º 5
0
 def collapseHandler(self, collapsed):
     """ this is called when the main window receives a collapseEvent """
     if collapsed:
         self.wm_attributes("-alpha", 1.0)
         self.rightSpacerFrame.grid_remove()
         self.leftSpacerFrame.grid_remove()
         self.showResizeFrames()
         self.makeDraggable(self.mainFrame)
         self.makeAllChildrenDraggable(self.mainFrame)
     else:
         self.wm_attributes("-alpha",
                            settings.getCompactTransparency() / 100)
         self.hideResizeFrames()
         self.rightSpacerFrame.grid()
         self.leftSpacerFrame.grid()
         self.unmakeDraggable(self.mainFrame)
         self.unmakeAllChildrenDraggable(self.mainFrame)
Exemplo n.º 6
0
    def __init__(self, parent, mainWindow, **kwargs):
        tk.Frame.__init__(self, parent, **kwargs)
        self.mainWindow = mainWindow

        self.columnconfigure(0, weight=1)
        self.columnconfigure(4, weight=1)
        self.configure(pady=10)
        tk.Frame(self, height="0", width="1").grid(row="0", column="0")
        tk.Frame(self, height="0", width="1").grid(row="0", column="4")
        self.counter = 0

        checkboxValue = tk.BooleanVar()
        checkboxValue.set(settings.getGraphDisabled())
        self.graphDisabled = tk.Checkbutton(self,
                                            text="完全禁用图象",
                                            variable=checkboxValue)
        self.graphDisabled.var = checkboxValue
        self.graphDisabled.grid(row=self.counter, column="1", columnspan="2")
        descriptor = tk.Label(self, text="数据标签将仍被显示")
        font = tkFont.Font(font=descriptor['font'])
        font.config(slant='italic')
        descriptor['font'] = font
        descriptor.grid(row=self.counter + 1, column="1", columnspan="2")
        tk.Frame(self, height="20", width="10").grid(row=self.counter + 2,
                                                     column="1",
                                                     columnspan="5")
        self.counter += 3

        self.secondsVar = tk.StringVar()
        self.secondsVar.set(settings.getSeconds())
        self.addSetting(self.secondsVar, "每求一次数据平均值的时间间隔(秒):",
                        "建议将此值设定为高于你武器射速的数值。")

        self.intervalVar = tk.StringVar()
        self.intervalVar.set(settings.getInterval())
        self.addSetting(self.intervalVar, "更新图象与数据标签的时间间隔(毫秒):",
                        "该值越低,电脑CPU的占用越高。")

        self.transparencyVar = tk.StringVar()
        self.transparencyVar.set(settings.getCompactTransparency())
        self.addSetting(self.transparencyVar, "紧凑模式下的窗口透明度:",
                        "100为完全可见,0为完全不可见。")
Exemplo n.º 7
0
 def __init__(self, parent, mainWindow, **kwargs):
     tk.Frame.__init__(self, parent, **kwargs)
     self.mainWindow = mainWindow
     
     self.columnconfigure(0, weight=1)
     self.columnconfigure(4, weight=1)
     self.configure(pady=10)
     tk.Frame(self, height="0", width="1").grid(row="0", column="0")
     tk.Frame(self, height="0", width="1").grid(row="0", column="4")
     self.counter = 0
     
     checkboxValue = tk.BooleanVar()
     checkboxValue.set(settings.getGraphDisabled())
     self.graphDisabled = tk.Checkbutton(self, text="禁用统计图", variable=checkboxValue)
     self.graphDisabled.var = checkboxValue
     self.graphDisabled.grid(row=self.counter, column="1", columnspan="2")
     descriptor = tk.Label(self, text="标签仍然会显示")
     font = tkFont.Font(font=descriptor['font'])
     font.config(slant='italic')
     descriptor['font'] = font
     descriptor.grid(row=self.counter+1, column="1", columnspan="2")
     tk.Frame(self, height="20", width="10").grid(row=self.counter+2, column="1", columnspan="5")
     self.counter += 3
     
     self.secondsVar = tk.StringVar()
     self.secondsVar.set(settings.getSeconds())
     self.addSetting(self.secondsVar, "DPS计算周期(秒):", 
                     "建议将此条设置为比你武器循环时间高一点的整数")
     
     self.intervalVar = tk.StringVar()
     self.intervalVar.set(settings.getInterval())
     self.addSetting(self.intervalVar, "图形绘制周期(毫秒):", 
                     "数值越低CPU负担越大")
     
     self.transparencyVar = tk.StringVar()
     self.transparencyVar.set(settings.getCompactTransparency())
     self.addSetting(self.transparencyVar, "Compat模式的透明度:", 
                     "100为不透明,0为全透明")
Exemplo n.º 8
0
 def __init__(self, parent, mainWindow, **kwargs):
     tk.Frame.__init__(self, parent, **kwargs)
     self.mainWindow = mainWindow
     
     self.columnconfigure(0, weight=1)
     self.columnconfigure(4, weight=1)
     self.configure(pady=10)
     tk.Frame(self, height="0", width="1").grid(row="0", column="0")
     tk.Frame(self, height="0", width="1").grid(row="0", column="4")
     self.counter = 0
     
     checkboxValue = tk.BooleanVar()
     checkboxValue.set(settings.getGraphDisabled())
     self.graphDisabled = tk.Checkbutton(self, text="Disable graph entirely", variable=checkboxValue)
     self.graphDisabled.var = checkboxValue
     self.graphDisabled.grid(row=self.counter, column="1", columnspan="2")
     descriptor = tk.Label(self, text="Labels will still be shown")
     font = tkFont.Font(font=descriptor['font'])
     font.config(slant='italic')
     descriptor['font'] = font
     descriptor.grid(row=self.counter+1, column="1", columnspan="2")
     tk.Frame(self, height="20", width="10").grid(row=self.counter+2, column="1", columnspan="5")
     self.counter += 3
     
     self.secondsVar = tk.StringVar()
     self.secondsVar.set(settings.getSeconds())
     self.addSetting(self.secondsVar, "Number of seconds to average values:", 
                     "Recommended to set this value higher than your weapon cycle time")
     
     self.intervalVar = tk.StringVar()
     self.intervalVar.set(settings.getInterval())
     self.addSetting(self.intervalVar, "How often to update graph/labels in milliseconds:", 
                     "The lower you set this value, the higher your CPU usage will be")
     
     self.transparencyVar = tk.StringVar()
     self.transparencyVar.set(settings.getCompactTransparency())
     self.addSetting(self.transparencyVar, "Window transparency percentage in compact mode:", 
                     "100 is fully visible, 0 is invisible")