示例#1
0
文件: Gomoku.py 项目: z88a/Gobang
 def on_move(self, event):
     pos = event.GetPosition()
     if pos.x <= self.PANEL_ORIG_POINT.x + self.d_sum and pos.y <= self.PANEL_ORIG_POINT.y + self.d_sum and pos.x >= self.PANEL_ORIG_POINT.x and pos.y >= self.PANEL_ORIG_POINT.y:
         self.SetCursor(wx.Cursor(wx.CURSOR_HAND))
     else:
         self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
示例#2
0
def StockCursor(cursorId):
    if wxPythonPhoenix:
        return wx.Cursor(cursorId=cursorId)
    else:
        return wx.StockCursor(cursorId)
    def on_motion(self, evt):
        '''Mouse motion handler. Handle cursor changes and gate-boundary 
        dragging.
        '''        
        if self.dragging:
            #
            # A gate is being resized:
            #   Recompute the current gate min/max from the mouse position.
            #
            if self.hover == self.BOUNDARY_LEFT and evt.xdata:
                for subgate in self.gate.get_subgates():
                    if subgate.get_column() == self.x_column:
                        subgate.set_min(min(evt.xdata, subgate.get_max()))
                
            elif self.hover == self.BOUNDARY_RIGHT and evt.xdata:
                for subgate in self.gate.get_subgates():
                    if subgate.get_column() == self.x_column:
                        subgate.set_max(max(evt.xdata, subgate.get_min()))

            elif self.hover == self.BOUNDARY_BOTTOM and evt.ydata:
                for subgate in self.gate.get_subgates():
                    if subgate.get_column() == self.y_column:
                        subgate.set_min(min(evt.ydata, subgate.get_max()))

            elif self.hover == self.BOUNDARY_TOP and evt.ydata:
                for subgate in self.gate.get_subgates():
                    if subgate.get_column() == self.y_column:
                        subgate.set_max(max(evt.ydata, subgate.get_min()))

            elif self.hover == self.BOUNDARY_INSIDE and evt.xdata and evt.ydata:
                for subgate in self.gate.get_subgates():
                    if subgate.get_column() == self.x_column:
                        new_range = self._init_range[subgate.get_column()] - self._mouse_click_xy_data[0] + evt.xdata
                    elif subgate.get_column() == self.y_column:
                        new_range = self._init_range[subgate.get_column()] - self._mouse_click_xy_data[1] + evt.ydata
                    subgate.set_range(*new_range)

            if evt.xdata and evt.ydata:
                self._mouse_xy_data = (evt.xdata, evt.ydata)
            return

        self.hover = None
        if self.patch:
            #
            # If there is a patch, change the mouse according to which part of
            # the patch the mouse is hovering over.
            #
            xmin, ymin = self.subplot.transData.transform(
                             np.array([self.patch.get_xy()]))[0]
            xmax, ymax = self.subplot.transData.transform(
                             np.array([(self.patch.get_x() + self.patch.get_width(),
                                        self.patch.get_y() + self.patch.get_height())]))[0]
            
            if abs(evt.x - xmin) < 2 and (ymin < evt.y < ymax):
                self.hover = self.BOUNDARY_LEFT
                wx.SetCursor(wx.Cursor(wx.CURSOR_SIZEWE))
                
            elif abs(evt.x - xmax) < 2 and (ymin < evt.y < ymax):
                self.hover = self.BOUNDARY_RIGHT
                wx.SetCursor(wx.Cursor(wx.CURSOR_SIZEWE))
                
            elif abs(evt.y - ymin) < 2 and (xmin < evt.x < xmax):
                self.hover = self.BOUNDARY_BOTTOM
                wx.SetCursor(wx.Cursor(wx.CURSOR_SIZENS))
                
            elif abs(evt.y - ymax) < 2 and (xmin < evt.x < xmax):
                self.hover = self.BOUNDARY_TOP
                wx.SetCursor(wx.Cursor(wx.CURSOR_SIZENS))
                
            elif (xmin < evt.x < xmax) and (ymin < evt.y < ymax):
                self.hover = self.BOUNDARY_INSIDE
                wx.SetCursor(wx.Cursor(wx.CURSOR_SIZING))
                
            else:
                wx.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
        else:
            wx.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
    def __init__(self, parent, composer=False):
        wx.Panel.__init__(self, parent)
        self.parent = parent

        self.user_settings = self.parent.user_settings
        self.user_profile = self.parent.user_profile

        self.SetBackgroundColour(self.user_settings.get_background_color())
        self.emoji_categories = emoji_categs_from_file()
        if self.user_profile.username != "guest":
            self.emoji_categories["most_used"] = list(
                self.user_profile.used_emojis.keys())
        self.emoji_categ_buttons = dict()

        self.dbtab_sizer = wx.FlexGridSizer(3, 1, 0, 0)
        self.dbtab_sizer.AddGrowableRow(2)
        self.dbtab_sizer.AddGrowableCol(0)

        self.button_sizer = wx.GridSizer(1, len(self.emoji_categories), 0, 0)
        self.emoji_bmps_panel = wx.Panel()

        self.composer = composer

        self.dbtab_sizer.Add(self.button_sizer, 1, wx.EXPAND)
        self.dbtab_sizer.AddSpacer(10)
        if self.user_profile.username != "guest":
            mostused_bmp_file = os.path.join(
                os.path.abspath(os.path.dirname(__file__)), 'gui_utils_files',
                'most_used.png')
            most_used_bmp = wx.Bitmap(mostused_bmp_file).ConvertToImage()
            most_used_bmp = most_used_bmp.Scale(
                self.user_settings.get_composer_emoji_size()
                if self.composer else self.user_settings.get_db_emoji_size(),
                self.user_settings.get_composer_emoji_size()
                if self.composer else self.user_settings.get_db_emoji_size(),
                wx.IMAGE_QUALITY_HIGH)
            self.emoji_categ_buttons["most_used"] = wx.BitmapToggleButton(
                self,
                label=wx.Bitmap(most_used_bmp),
                name="most_used",
                style=wx.BORDER_NONE)
            self.emoji_categ_buttons["most_used"].Bind(wx.EVT_TOGGLEBUTTON,
                                                       self.OnEmojiCategory)
            self.emoji_categ_buttons["most_used"].SetCursor(
                wx.Cursor(wx.CURSOR_HAND))
            self.emoji_categ_buttons["most_used"].SetBackgroundColour(
                (255, 255, 255))
            self.button_sizer.Add(self.emoji_categ_buttons["most_used"], 1,
                                  wx.EXPAND)

        for cat in self.emoji_categories:
            if cat != "most_used":
                bmp_path = unicode_to_filename(
                    STRING_UNICODE[self.emoji_categories[cat][0]],
                    self.user_settings.get_composer_emoji_size() if
                    self.composer else self.user_settings.get_db_emoji_size())
                self.emoji_categ_buttons[cat] = wx.BitmapToggleButton(
                    self,
                    label=wx.Bitmap(bmp_path),
                    name=cat,
                    style=wx.BORDER_NONE)
                self.emoji_categ_buttons[cat].Bind(wx.EVT_TOGGLEBUTTON,
                                                   self.OnEmojiCategory)
                self.emoji_categ_buttons[cat].SetCursor(
                    wx.Cursor(wx.CURSOR_HAND))
                self.emoji_categ_buttons[cat].SetBackgroundColour(
                    (255, 255, 255))
                self.button_sizer.Add(self.emoji_categ_buttons[cat], 1,
                                      wx.EXPAND)

        self.SetSizer(self.dbtab_sizer)
示例#5
0
文件: LMS_Admin.py 项目: mp5lii/LMS
    def _on_btn_export_users(self, event):
        default_dir = os.path.join(os.path.expanduser("~"), 'Desktop')
        default_file = u"导出用户" + time.strftime(
            '%Y-%m-%d', time.localtime(time.time())) + r".xlsx"
        file_dialog = wx.FileDialog(self,
                                    u"导出用户数据",
                                    defaultDir=default_dir,
                                    defaultFile=default_file,
                                    wildcard=u"Excel 文件(*.xlsx)|",
                                    style=wx.FD_SAVE)
        if file_dialog.ShowModal() == wx.ID_OK:
            # 导处操作进行时设置鼠标形状为箭头等待状态
            self.SetCursor(wx.Cursor(wx.CURSOR_ARROWWAIT))
            # 创建Excel文件
            work_book = Workbook()
            work_sheet = work_book.active
            work_sheet.title = u"导出用户"
            # 写表头
            row = ("", "ID", "姓名", "照片", "班级")
            work_sheet.append(row)
            for i in range(1, 6):
                cell = get_column_letter(i) + '1'
                work_sheet[cell].style = 'Headline 1'
                work_sheet[cell].fill = PatternFill("solid", fgColor="DDDDDD")
                work_sheet[cell].alignment = Alignment(horizontal="center",
                                                       vertical="center")
            # 初始化
            class_name = u""
            start_row = 1
            end_row = 1
            # 连接数据库
            conn = pyodbc.connect(
                'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=%s\\LMSdb.accdb'
                % os.getcwd())
            cursor = conn.cursor()
            # 检索数据库中users表
            cursor.execute(
                "SELECT user_id, user_name, user_photo, user_class FROM users ORDER BY user_class DESC"
            )
            rows = cursor.fetchall()
            for row in rows:
                # 获取一行数据
                user = [row[3], row[0], row[1], row[2], row[3]]
                if row[2] is None:  # 用户照片为空时,该位置设置为空字符串
                    user[3] = ""
                # 输出一行
                work_sheet.append(user)
                # 如果是新班级
                if class_name != row[3]:
                    # 合并上一班级单元格
                    work_sheet.merge_cells(start_row=start_row,
                                           start_column=1,
                                           end_row=end_row,
                                           end_column=1)
                    class_cell = work_sheet["A" + str(start_row)]
                    class_cell.value = class_name
                    class_cell.alignment = Alignment(horizontal="center",
                                                     vertical="center")
                    # 记录新班级开始行
                    start_row = end_row + 1
                    # 记录新班级名称
                    class_name = row[3]
                # 下一行
                end_row += 1
            # 合并最后一个班级
            work_sheet.merge_cells(start_row=start_row,
                                   start_column=1,
                                   end_row=end_row,
                                   end_column=1)
            class_cell = work_sheet["A" + str(start_row)]
            class_cell.value = class_name
            class_cell.alignment = Alignment(horizontal="center",
                                             vertical="center")

            # 关闭数据库
            cursor.close()
            conn.close()
            # 保存Excel文件
            work_book.save(filename=file_dialog.GetPath())
            # 恢复鼠标形状
            self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
            # 弹出提示框
            wx.MessageBox("导出完成!")
        event.Skip()
示例#6
0
    def on_mouseevent(self, me):
        tool = self.ips.tool
        if tool == None: tool = ToolsManager.curtool
        x, y = self.to_data_coor(me.GetX(), me.GetY())
        if me.Moving() and not me.LeftIsDown() and not me.RightIsDown(
        ) and not me.MiddleIsDown():
            xx, yy = int(round(x)), int(round(y))
            k, unit = self.ips.unit
            if xx >= 0 and xx < self.ips.img.shape[
                    1] and yy >= 0 and yy < self.ips.img.shape[0]:
                IPy.set_info('Location:%.1f %.1f  Value:%s' %
                             (x * k, y * k, self.ips.img[yy, xx]))
        if tool == None: return

        sta = [me.AltDown(), me.ControlDown(), me.ShiftDown()]
        if me.ButtonDown():
            tool.mouse_down(self.ips,
                            x,
                            y,
                            me.GetButton(),
                            alt=sta[0],
                            ctrl=sta[1],
                            shift=sta[2],
                            canvas=self)
        if me.ButtonUp():
            tool.mouse_up(self.ips,
                          x,
                          y,
                          me.GetButton(),
                          alt=sta[0],
                          ctrl=sta[1],
                          shift=sta[2],
                          canvas=self)
        if me.Moving():
            tool.mouse_move(self.ips,
                            x,
                            y,
                            None,
                            alt=sta[0],
                            ctrl=sta[1],
                            shift=sta[2],
                            canvas=self)
        btn = [me.LeftIsDown(),
               me.MiddleIsDown(),
               me.RightIsDown(), True].index(True)
        if me.Dragging():
            tool.mouse_move(self.ips,
                            x,
                            y,
                            0 if btn == 3 else btn + 1,
                            alt=sta[0],
                            ctrl=sta[1],
                            shift=sta[2],
                            canvas=self)
        wheel = np.sign(me.GetWheelRotation())
        if wheel != 0:
            tool.mouse_wheel(self.ips,
                             x,
                             y,
                             wheel,
                             alt=sta[0],
                             ctrl=sta[1],
                             shift=sta[2],
                             canvas=self)
        if hasattr(tool, 'cursor'):
            self.SetCursor(wx.Cursor(tool.cursor))
        else:
            self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
示例#7
0
 def enableControls(self, flag):
     self.enabled = flag
     if not flag:
         self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
示例#8
0
 def on_mouse_middle_down(self, event):
     self.SetCursor(wx.Cursor(wx.CURSOR_HAND))
     self.previous_window_position = event.GetPosition()
     self.previous_scene_position = self.convert_window_to_scene(
         self.previous_window_position)
示例#9
0
 def on_mouse_middle_up(self, event):
     self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
     self.previous_window_position = None
     self.previous_scene_position = None
示例#10
0
文件: images.py 项目: aith-q/mMass
def loadImages():
    """Load images from lib."""

    # load image library
    if wx.Platform == "__WXMAC__":
        from . import images_lib_mac as images_lib
    elif wx.Platform == "__WXMSW__":
        from . import images_lib_msw as images_lib
    else:
        from . import images_lib_gtk as images_lib

    # common
    lib["icon16"] = images_lib.getIcon16Icon()
    lib["icon32"] = images_lib.getIcon32Icon()
    lib["icon48"] = images_lib.getIcon48Icon()
    lib["icon128"] = images_lib.getIcon128Icon()
    lib["icon256"] = images_lib.getIcon256Icon()
    lib["icon512"] = images_lib.getIcon512Icon()

    lib["iconAbout"] = images_lib.getIconAboutBitmap()
    lib["iconError"] = images_lib.getIconErrorBitmap()
    lib["iconDlg"] = images_lib.getIconDlgBitmap()

    # singles
    lib["stopper"] = images_lib.getStopperBitmap()

    # cursors
    cursors = images_lib.getCursorsBitmap()
    image = cursors.GetSubBitmap(wx.Rect(0, 0, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 0)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 0)
    lib["cursorsArrow"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(16, 0, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 0)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 0)
    lib["cursorsArrowMeasure"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(32, 0, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 0)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 0)
    lib["cursorsArrowPeak"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(48, 0, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 0)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 0)
    lib["cursorsArrowPoint"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(64, 0, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 0)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 0)
    lib["cursorsArrowDelete"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(80, 0, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 0)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 0)
    lib["cursorsArrowOffset"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(0, 16, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 7)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 7)
    lib["cursorsCross"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(16, 16, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 7)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 7)
    lib["cursorsCrossMeasure"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(32, 16, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 7)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 7)
    lib["cursorsCrossPeak"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(48, 16, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 7)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 7)
    lib["cursorsCrossPoint"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(64, 16, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 7)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 7)
    lib["cursorsCrossDelete"] = wx.Cursor(image)
    image = cursors.GetSubBitmap(wx.Rect(80, 16, 16, 16)).ConvertToImage()
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_X, 7)
    image.SetOption(wx.IMAGE_OPTION_CUR_HOTSPOT_Y, 7)
    lib["cursorsCrossOffset"] = wx.Cursor(image)

    # arrows
    arrows = images_lib.getArrowsBitmap()
    lib["arrowsUp"] = arrows.GetSubBitmap(wx.Rect(0, 0, 11, 11))
    lib["arrowsRight"] = arrows.GetSubBitmap(wx.Rect(11, 0, 11, 11))
    lib["arrowsDown"] = arrows.GetSubBitmap(wx.Rect(22, 0, 11, 11))
    lib["arrowsLeft"] = arrows.GetSubBitmap(wx.Rect(33, 0, 11, 11))

    # backgrounds
    lib["bgrToolbar"] = images_lib.getBgrToolbarBitmap()
    lib["bgrToolbarNoBorder"] = images_lib.getBgrToolbarNoBorderBitmap()
    lib["bgrControlbar"] = images_lib.getBgrControlbarBitmap()
    lib["bgrControlbarBorder"] = images_lib.getBgrControlbarBorderBitmap()
    lib["bgrControlbarDouble"] = images_lib.getBgrControlbarDoubleBitmap()
    lib["bgrBottombar"] = images_lib.getBgrBottombarBitmap()
    lib["bgrPeakEditor"] = images_lib.getBgrPeakEditorBitmap()

    # bullets
    bulletsOn = images_lib.getBulletsOnBitmap()
    bulletsOff = images_lib.getBulletsOffBitmap()
    lib["bulletsDocument"] = bulletsOn.GetSubBitmap(wx.Rect(0, 0, 13, 12))
    lib["bulletsAnnotationsOn"] = bulletsOn.GetSubBitmap(wx.Rect(
        13, 0, 13, 12))
    lib["bulletsAnnotationsOff"] = bulletsOff.GetSubBitmap(
        wx.Rect(13, 0, 13, 12))
    lib["bulletsSequenceOn"] = bulletsOn.GetSubBitmap(wx.Rect(26, 0, 13, 12))
    lib["bulletsSequenceOff"] = bulletsOff.GetSubBitmap(wx.Rect(26, 0, 13, 12))
    lib["bulletsNotationOn"] = bulletsOn.GetSubBitmap(wx.Rect(39, 0, 13, 12))
    lib["bulletsNotationOff"] = bulletsOff.GetSubBitmap(wx.Rect(39, 0, 13, 12))

    # tools
    if wx.Platform == "__WXMAC__":
        tools = images_lib.getToolsBitmap()
        lib["toolsProcessing"] = tools.GetSubBitmap(wx.Rect(0, 5, 32, 23))
        lib["toolsCalibration"] = tools.GetSubBitmap(wx.Rect(32, 5, 32, 23))
        lib["toolsSequence"] = tools.GetSubBitmap(wx.Rect(64, 5, 32, 23))
        lib["toolsMassCalculator"] = tools.GetSubBitmap(wx.Rect(96, 5, 32, 23))
        lib["toolsCompoundsSearch"] = tools.GetSubBitmap(
            wx.Rect(128, 5, 32, 23))
        lib["toolsPeakDifferences"] = tools.GetSubBitmap(
            wx.Rect(160, 5, 32, 23))
        lib["toolsComparePeaklists"] = tools.GetSubBitmap(
            wx.Rect(192, 5, 32, 23))
        lib["toolsMascot"] = tools.GetSubBitmap(wx.Rect(224, 5, 32, 23))
        lib["toolsProfound"] = tools.GetSubBitmap(wx.Rect(256, 5, 32, 23))
        lib["toolsDocumentInfo"] = tools.GetSubBitmap(wx.Rect(288, 5, 32, 23))
        lib["toolsDocumentReport"] = tools.GetSubBitmap(wx.Rect(
            320, 5, 32, 23))
        lib["toolsDocumentExport"] = tools.GetSubBitmap(wx.Rect(
            352, 5, 32, 23))
        lib["toolsMassFilter"] = tools.GetSubBitmap(wx.Rect(384, 5, 32, 23))
        lib["toolsSpectrumGenerator"] = tools.GetSubBitmap(
            wx.Rect(416, 5, 32, 23))
        lib["toolsEnvelopeFit"] = tools.GetSubBitmap(wx.Rect(448, 5, 32, 23))
        lib["toolsMassToFormula"] = tools.GetSubBitmap(wx.Rect(480, 5, 32, 23))
        lib["toolsPeriodicTable"] = tools.GetSubBitmap(wx.Rect(512, 5, 32, 23))
        lib["toolsMassDefectPlot"] = tools.GetSubBitmap(wx.Rect(
            544, 5, 32, 23))

        lib["toolsPresets"] = tools.GetSubBitmap(wx.Rect(0, 37, 32, 22))
        lib["toolsLibrary"] = tools.GetSubBitmap(wx.Rect(32, 37, 32, 22))
    else:
        tools = images_lib.getToolsBitmap()
        lib["toolsOpen"] = tools.GetSubBitmap(wx.Rect(0, 0, 22, 22))
        lib["toolsSave"] = tools.GetSubBitmap(wx.Rect(22, 0, 22, 22))
        lib["toolsPrint"] = tools.GetSubBitmap(wx.Rect(44, 0, 22, 22))
        lib["toolsProcessing"] = tools.GetSubBitmap(wx.Rect(66, 0, 22, 22))
        lib["toolsCalibration"] = tools.GetSubBitmap(wx.Rect(88, 0, 22, 22))
        lib["toolsSequence"] = tools.GetSubBitmap(wx.Rect(110, 0, 22, 22))
        lib["toolsMassCalculator"] = tools.GetSubBitmap(wx.Rect(
            132, 0, 22, 22))
        lib["toolsCompoundsSearch"] = tools.GetSubBitmap(
            wx.Rect(154, 0, 22, 22))
        lib["toolsPeakDifferences"] = tools.GetSubBitmap(
            wx.Rect(176, 0, 22, 22))
        lib["toolsComparePeaklists"] = tools.GetSubBitmap(
            wx.Rect(198, 0, 22, 22))
        lib["toolsMascot"] = tools.GetSubBitmap(wx.Rect(220, 0, 22, 22))
        lib["toolsProfound"] = tools.GetSubBitmap(wx.Rect(242, 0, 22, 22))
        lib["toolsDocumentInfo"] = tools.GetSubBitmap(wx.Rect(264, 0, 22, 22))
        lib["toolsDocumentReport"] = tools.GetSubBitmap(wx.Rect(
            286, 0, 22, 22))
        lib["toolsDocumentExport"] = tools.GetSubBitmap(wx.Rect(
            308, 0, 22, 22))
        lib["toolsPresets"] = tools.GetSubBitmap(wx.Rect(330, 0, 22, 22))
        lib["toolsMassFilter"] = tools.GetSubBitmap(wx.Rect(352, 0, 22, 22))
        lib["toolsSpectrumGenerator"] = tools.GetSubBitmap(
            wx.Rect(374, 0, 22, 22))
        lib["toolsEnvelopeFit"] = tools.GetSubBitmap(wx.Rect(396, 0, 22, 22))
        lib["toolsLibrary"] = tools.GetSubBitmap(wx.Rect(418, 0, 22, 22))
        lib["toolsMassToFormula"] = tools.GetSubBitmap(wx.Rect(440, 0, 22, 22))
        lib["toolsPeriodicTable"] = tools.GetSubBitmap(wx.Rect(462, 0, 22, 22))
        lib["toolsMassDefectPlot"] = tools.GetSubBitmap(wx.Rect(
            484, 0, 22, 22))

    # bottombars
    bottombarsOn = images_lib.getBottombarsOnBitmap()
    bottombarsOff = images_lib.getBottombarsOffBitmap()

    lib["documentsAdd"] = bottombarsOff.GetSubBitmap(wx.Rect(0, 0, 29, 22))
    lib["documentsDelete"] = bottombarsOff.GetSubBitmap(wx.Rect(29, 0, 29, 22))

    lib["peaklistAdd"] = bottombarsOff.GetSubBitmap(wx.Rect(0, 22, 29, 22))
    lib["peaklistDelete"] = bottombarsOff.GetSubBitmap(wx.Rect(29, 22, 29, 22))
    lib["peaklistAnnotate"] = bottombarsOff.GetSubBitmap(
        wx.Rect(58, 22, 29, 22))
    lib["peaklistEditorOn"] = bottombarsOn.GetSubBitmap(wx.Rect(
        87, 22, 29, 22))
    lib["peaklistEditorOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(87, 22, 29, 22))

    lib["spectrumLabelsOn"] = bottombarsOn.GetSubBitmap(wx.Rect(0, 44, 29, 22))
    lib["spectrumLabelsOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(0, 44, 29, 22))
    lib["spectrumTicksOn"] = bottombarsOn.GetSubBitmap(wx.Rect(29, 44, 29, 22))
    lib["spectrumTicksOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(29, 44, 29, 22))
    lib["spectrumNotationsOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(58, 44, 29, 22))
    lib["spectrumNotationsOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(58, 44, 29, 22))
    lib["spectrumLabelAngleOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(87, 44, 29, 22))
    lib["spectrumLabelAngleOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(87, 44, 29, 22))
    lib["spectrumPosBarsOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(116, 44, 29, 22))
    lib["spectrumPosBarsOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(116, 44, 29, 22))
    lib["spectrumGelOn"] = bottombarsOn.GetSubBitmap(wx.Rect(145, 44, 29, 22))
    lib["spectrumGelOff"] = bottombarsOff.GetSubBitmap(wx.Rect(
        145, 44, 29, 22))
    lib["spectrumTrackerOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(174, 44, 29, 22))
    lib["spectrumTrackerOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(174, 44, 29, 22))
    lib["spectrumAutoscaleOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(203, 44, 29, 22))
    lib["spectrumAutoscaleOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(203, 44, 29, 22))
    lib["spectrumNormalizeOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(232, 44, 29, 22))
    lib["spectrumNormalizeOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(232, 44, 29, 22))

    lib["spectrumRulerOn"] = bottombarsOn.GetSubBitmap(wx.Rect(0, 66, 29, 22))
    lib["spectrumRulerOff"] = bottombarsOff.GetSubBitmap(wx.Rect(
        0, 66, 29, 22))
    lib["spectrumLabelPeakOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(29, 66, 29, 22))
    lib["spectrumLabelPeakOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(29, 66, 29, 22))
    lib["spectrumLabelPointOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(58, 66, 29, 22))
    lib["spectrumLabelPointOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(58, 66, 29, 22))
    lib["spectrumLabelEnvelopeOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(87, 66, 29, 22))
    lib["spectrumLabelEnvelopeOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(87, 66, 29, 22))
    lib["spectrumDeleteLabelOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(116, 66, 29, 22))
    lib["spectrumDeleteLabelOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(116, 66, 29, 22))
    lib["spectrumOffsetOn"] = bottombarsOn.GetSubBitmap(
        wx.Rect(145, 66, 29, 22))
    lib["spectrumOffsetOff"] = bottombarsOff.GetSubBitmap(
        wx.Rect(145, 66, 29, 22))

    # toolbars
    toolbarsOn = images_lib.getToolbarsOnBitmap()
    toolbarsOff = images_lib.getToolbarsOffBitmap()

    lib["compoundsSearchCompoundsOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(0, 0, 29, 22))
    lib["compoundsSearchCompoundsOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(0, 0, 29, 22))
    lib["compoundsSearchFormulaOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(29, 0, 29, 22))
    lib["compoundsSearchFormulaOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(29, 0, 29, 22))

    lib["calibrationReferencesOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(0, 22, 29, 22))
    lib["calibrationReferencesOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(0, 22, 29, 22))
    lib["calibrationErrorsOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(29, 22, 29, 22))
    lib["calibrationErrorsOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(29, 22, 29, 22))

    lib["documentExportImageOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(0, 44, 29, 22))
    lib["documentExportImageOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(0, 44, 29, 22))
    lib["documentExportPeaklistOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(29, 44, 29, 22))
    lib["documentExportPeaklistOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(29, 44, 29, 22))
    lib["documentExportSpectrumOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(58, 44, 29, 22))
    lib["documentExportSpectrumOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(58, 44, 29, 22))

    lib["documentInfoSummaryOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(0, 66, 29, 22))
    lib["documentInfoSummaryOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(0, 66, 29, 22))
    lib["documentInfoSpectrumOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(29, 66, 29, 22))
    lib["documentInfoSpectrumOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(29, 66, 29, 22))
    lib["documentInfoNotesOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(58, 66, 29, 22))
    lib["documentInfoNotesOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(58, 66, 29, 22))

    lib["mascotPMFOn"] = toolbarsOn.GetSubBitmap(wx.Rect(0, 88, 29, 22))
    lib["mascotPMFOff"] = toolbarsOff.GetSubBitmap(wx.Rect(0, 88, 29, 22))
    lib["mascotMISOn"] = toolbarsOn.GetSubBitmap(wx.Rect(29, 88, 29, 22))
    lib["mascotMISOff"] = toolbarsOff.GetSubBitmap(wx.Rect(29, 88, 29, 22))
    lib["mascotSQOn"] = toolbarsOn.GetSubBitmap(wx.Rect(58, 88, 29, 22))
    lib["mascotSQOff"] = toolbarsOff.GetSubBitmap(wx.Rect(58, 88, 29, 22))
    lib["mascotQueryOn"] = toolbarsOn.GetSubBitmap(wx.Rect(87, 88, 29, 22))
    lib["mascotQueryOff"] = toolbarsOff.GetSubBitmap(wx.Rect(87, 88, 29, 22))

    lib["massCalculatorSummaryOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(0, 110, 29, 22))
    lib["massCalculatorSummaryOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(0, 110, 29, 22))
    lib["massCalculatorIonSeriesOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(29, 110, 29, 22))
    lib["massCalculatorIonSeriesOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(29, 110, 29, 22))
    lib["massCalculatorPatternOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(58, 110, 29, 22))
    lib["massCalculatorPatternOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(58, 110, 29, 22))

    lib["processingMathOn"] = toolbarsOn.GetSubBitmap(wx.Rect(0, 132, 29, 22))
    lib["processingMathOff"] = toolbarsOff.GetSubBitmap(wx.Rect(
        0, 132, 29, 22))
    lib["processingCropOn"] = toolbarsOn.GetSubBitmap(wx.Rect(29, 132, 29, 22))
    lib["processingCropOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(29, 132, 29, 22))
    lib["processingBaselineOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(58, 132, 29, 22))
    lib["processingBaselineOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(58, 132, 29, 22))
    lib["processingSmoothingOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(87, 132, 29, 22))
    lib["processingSmoothingOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(87, 132, 29, 22))
    lib["processingPeakpickingOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(116, 132, 29, 22))
    lib["processingPeakpickingOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(116, 132, 29, 22))
    lib["processingDeisotopingOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(145, 132, 29, 22))
    lib["processingDeisotopingOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(145, 132, 29, 22))
    lib["processingDeconvolutionOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(174, 132, 29, 22))
    lib["processingDeconvolutionOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(174, 132, 29, 22))
    lib["processingBatchOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(203, 132, 29, 22))
    lib["processingBatchOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(203, 132, 29, 22))

    lib["sequenceEditorOn"] = toolbarsOn.GetSubBitmap(wx.Rect(0, 154, 29, 22))
    lib["sequenceEditorOff"] = toolbarsOff.GetSubBitmap(wx.Rect(
        0, 154, 29, 22))
    lib["sequenceModificationsOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(29, 154, 29, 22))
    lib["sequenceModificationsOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(29, 154, 29, 22))
    lib["sequenceDigestOn"] = toolbarsOn.GetSubBitmap(wx.Rect(58, 154, 29, 22))
    lib["sequenceDigestOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(58, 154, 29, 22))
    lib["sequenceFragmentOn"] = toolbarsOn.GetSubBitmap(
        wx.Rect(87, 154, 29, 22))
    lib["sequenceFragmentOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(87, 154, 29, 22))
    lib["sequenceSearchOn"] = toolbarsOn.GetSubBitmap(wx.Rect(
        116, 154, 29, 22))
    lib["sequenceSearchOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(116, 154, 29, 22))

    lib["profoundPMFOn"] = toolbarsOn.GetSubBitmap(wx.Rect(0, 176, 29, 22))
    lib["profoundPMFOff"] = toolbarsOff.GetSubBitmap(wx.Rect(0, 176, 29, 22))
    lib["profoundQueryOn"] = toolbarsOn.GetSubBitmap(wx.Rect(58, 176, 29, 22))
    lib["profoundQueryOff"] = toolbarsOff.GetSubBitmap(wx.Rect(
        58, 176, 29, 22))

    lib["prospectorMSFitOn"] = toolbarsOn.GetSubBitmap(wx.Rect(0, 176, 29, 22))
    lib["prospectorMSFitOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(0, 176, 29, 22))
    lib["prospectorMSTagOn"] = toolbarsOn.GetSubBitmap(wx.Rect(29, 88, 29, 22))
    lib["prospectorMSTagOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(29, 88, 29, 22))
    lib["prospectorQueryOn"] = toolbarsOn.GetSubBitmap(wx.Rect(
        58, 176, 29, 22))
    lib["prospectorQueryOff"] = toolbarsOff.GetSubBitmap(
        wx.Rect(58, 176, 29, 22))

    lib["matchErrorsOn"] = toolbarsOn.GetSubBitmap(wx.Rect(0, 198, 29, 22))
    lib["matchErrorsOff"] = toolbarsOff.GetSubBitmap(wx.Rect(0, 198, 29, 22))
    lib["matchSummaryOn"] = toolbarsOn.GetSubBitmap(wx.Rect(29, 198, 29, 22))
    lib["matchSummaryOff"] = toolbarsOff.GetSubBitmap(wx.Rect(29, 198, 29, 22))

    # periodic table
    ptableOn = images_lib.getPtableOnBitmap()
    ptableOff = images_lib.getPtableOffBitmap()
    ptableSel = images_lib.getPtableSelBitmap()

    lib["periodicTableConnection"] = ptableOn.GetSubBitmap(
        wx.Rect(48, 183, 24, 72))

    lib["periodicTableHOn"] = ptableOn.GetSubBitmap(wx.Rect(0, 0, 25, 27))
    lib["periodicTableHeOn"] = ptableOn.GetSubBitmap(wx.Rect(408, 0, 25, 27))
    lib["periodicTableLiOn"] = ptableOn.GetSubBitmap(wx.Rect(0, 26, 25, 27))
    lib["periodicTableBeOn"] = ptableOn.GetSubBitmap(wx.Rect(24, 26, 25, 27))
    lib["periodicTableBOn"] = ptableOn.GetSubBitmap(wx.Rect(288, 26, 25, 27))
    lib["periodicTableCOn"] = ptableOn.GetSubBitmap(wx.Rect(312, 26, 25, 27))
    lib["periodicTableNOn"] = ptableOn.GetSubBitmap(wx.Rect(336, 26, 25, 27))
    lib["periodicTableOOn"] = ptableOn.GetSubBitmap(wx.Rect(360, 26, 25, 27))
    lib["periodicTableFOn"] = ptableOn.GetSubBitmap(wx.Rect(384, 26, 25, 27))
    lib["periodicTableNeOn"] = ptableOn.GetSubBitmap(wx.Rect(408, 26, 25, 27))
    lib["periodicTableNaOn"] = ptableOn.GetSubBitmap(wx.Rect(0, 52, 25, 27))
    lib["periodicTableMgOn"] = ptableOn.GetSubBitmap(wx.Rect(24, 52, 25, 27))
    lib["periodicTableAlOn"] = ptableOn.GetSubBitmap(wx.Rect(288, 52, 25, 27))
    lib["periodicTableSiOn"] = ptableOn.GetSubBitmap(wx.Rect(312, 52, 25, 27))
    lib["periodicTablePOn"] = ptableOn.GetSubBitmap(wx.Rect(336, 52, 25, 27))
    lib["periodicTableSOn"] = ptableOn.GetSubBitmap(wx.Rect(360, 52, 25, 27))
    lib["periodicTableClOn"] = ptableOn.GetSubBitmap(wx.Rect(384, 52, 25, 27))
    lib["periodicTableArOn"] = ptableOn.GetSubBitmap(wx.Rect(408, 52, 25, 27))
    lib["periodicTableKOn"] = ptableOn.GetSubBitmap(wx.Rect(0, 78, 25, 27))
    lib["periodicTableCaOn"] = ptableOn.GetSubBitmap(wx.Rect(24, 78, 25, 27))
    lib["periodicTableScOn"] = ptableOn.GetSubBitmap(wx.Rect(48, 78, 25, 27))
    lib["periodicTableTiOn"] = ptableOn.GetSubBitmap(wx.Rect(72, 78, 25, 27))
    lib["periodicTableVOn"] = ptableOn.GetSubBitmap(wx.Rect(96, 78, 25, 27))
    lib["periodicTableCrOn"] = ptableOn.GetSubBitmap(wx.Rect(120, 78, 25, 27))
    lib["periodicTableMnOn"] = ptableOn.GetSubBitmap(wx.Rect(144, 78, 25, 27))
    lib["periodicTableFeOn"] = ptableOn.GetSubBitmap(wx.Rect(168, 78, 25, 27))
    lib["periodicTableCoOn"] = ptableOn.GetSubBitmap(wx.Rect(192, 78, 25, 27))
    lib["periodicTableNiOn"] = ptableOn.GetSubBitmap(wx.Rect(216, 78, 25, 27))
    lib["periodicTableCuOn"] = ptableOn.GetSubBitmap(wx.Rect(240, 78, 25, 27))
    lib["periodicTableZnOn"] = ptableOn.GetSubBitmap(wx.Rect(264, 78, 25, 27))
    lib["periodicTableGaOn"] = ptableOn.GetSubBitmap(wx.Rect(288, 78, 25, 27))
    lib["periodicTableGeOn"] = ptableOn.GetSubBitmap(wx.Rect(312, 78, 25, 27))
    lib["periodicTableAsOn"] = ptableOn.GetSubBitmap(wx.Rect(336, 78, 25, 27))
    lib["periodicTableSeOn"] = ptableOn.GetSubBitmap(wx.Rect(360, 78, 25, 27))
    lib["periodicTableBrOn"] = ptableOn.GetSubBitmap(wx.Rect(384, 78, 25, 27))
    lib["periodicTableKrOn"] = ptableOn.GetSubBitmap(wx.Rect(408, 78, 25, 27))
    lib["periodicTableRbOn"] = ptableOn.GetSubBitmap(wx.Rect(0, 104, 25, 27))
    lib["periodicTableSrOn"] = ptableOn.GetSubBitmap(wx.Rect(24, 104, 25, 27))
    lib["periodicTableYOn"] = ptableOn.GetSubBitmap(wx.Rect(48, 104, 25, 27))
    lib["periodicTableZrOn"] = ptableOn.GetSubBitmap(wx.Rect(72, 104, 25, 27))
    lib["periodicTableNbOn"] = ptableOn.GetSubBitmap(wx.Rect(96, 104, 25, 27))
    lib["periodicTableMoOn"] = ptableOn.GetSubBitmap(wx.Rect(120, 104, 25, 27))
    lib["periodicTableTcOn"] = ptableOn.GetSubBitmap(wx.Rect(144, 104, 25, 27))
    lib["periodicTableRuOn"] = ptableOn.GetSubBitmap(wx.Rect(168, 104, 25, 27))
    lib["periodicTableRhOn"] = ptableOn.GetSubBitmap(wx.Rect(192, 104, 25, 27))
    lib["periodicTablePdOn"] = ptableOn.GetSubBitmap(wx.Rect(216, 104, 25, 27))
    lib["periodicTableAgOn"] = ptableOn.GetSubBitmap(wx.Rect(240, 104, 25, 27))
    lib["periodicTableCdOn"] = ptableOn.GetSubBitmap(wx.Rect(264, 104, 25, 27))
    lib["periodicTableInOn"] = ptableOn.GetSubBitmap(wx.Rect(288, 104, 25, 27))
    lib["periodicTableSnOn"] = ptableOn.GetSubBitmap(wx.Rect(312, 104, 25, 27))
    lib["periodicTableSbOn"] = ptableOn.GetSubBitmap(wx.Rect(336, 104, 25, 27))
    lib["periodicTableTeOn"] = ptableOn.GetSubBitmap(wx.Rect(360, 104, 25, 27))
    lib["periodicTableIOn"] = ptableOn.GetSubBitmap(wx.Rect(384, 104, 25, 27))
    lib["periodicTableXeOn"] = ptableOn.GetSubBitmap(wx.Rect(408, 104, 25, 27))
    lib["periodicTableCsOn"] = ptableOn.GetSubBitmap(wx.Rect(0, 130, 25, 27))
    lib["periodicTableBaOn"] = ptableOn.GetSubBitmap(wx.Rect(24, 130, 25, 27))
    lib["periodicTableLaOn"] = ptableOn.GetSubBitmap(wx.Rect(48, 130, 25, 27))
    lib["periodicTableHfOn"] = ptableOn.GetSubBitmap(wx.Rect(72, 130, 25, 27))
    lib["periodicTableTaOn"] = ptableOn.GetSubBitmap(wx.Rect(96, 130, 25, 27))
    lib["periodicTableWOn"] = ptableOn.GetSubBitmap(wx.Rect(120, 130, 25, 27))
    lib["periodicTableReOn"] = ptableOn.GetSubBitmap(wx.Rect(144, 130, 25, 27))
    lib["periodicTableOsOn"] = ptableOn.GetSubBitmap(wx.Rect(168, 130, 25, 27))
    lib["periodicTableIrOn"] = ptableOn.GetSubBitmap(wx.Rect(192, 130, 25, 27))
    lib["periodicTablePtOn"] = ptableOn.GetSubBitmap(wx.Rect(216, 130, 25, 27))
    lib["periodicTableAuOn"] = ptableOn.GetSubBitmap(wx.Rect(240, 130, 25, 27))
    lib["periodicTableHgOn"] = ptableOn.GetSubBitmap(wx.Rect(264, 130, 25, 27))
    lib["periodicTableTlOn"] = ptableOn.GetSubBitmap(wx.Rect(288, 130, 25, 27))
    lib["periodicTablePbOn"] = ptableOn.GetSubBitmap(wx.Rect(312, 130, 25, 27))
    lib["periodicTableBiOn"] = ptableOn.GetSubBitmap(wx.Rect(336, 130, 25, 27))
    lib["periodicTablePoOn"] = ptableOn.GetSubBitmap(wx.Rect(360, 130, 25, 27))
    lib["periodicTableAtOn"] = ptableOn.GetSubBitmap(wx.Rect(384, 130, 25, 27))
    lib["periodicTableRnOn"] = ptableOn.GetSubBitmap(wx.Rect(408, 130, 25, 27))
    lib["periodicTableFrOn"] = ptableOn.GetSubBitmap(wx.Rect(0, 156, 25, 27))
    lib["periodicTableRaOn"] = ptableOn.GetSubBitmap(wx.Rect(24, 156, 25, 27))
    lib["periodicTableAcOn"] = ptableOn.GetSubBitmap(wx.Rect(48, 156, 25, 27))
    lib["periodicTableCeOn"] = ptableOn.GetSubBitmap(wx.Rect(72, 202, 25, 27))
    lib["periodicTablePrOn"] = ptableOn.GetSubBitmap(wx.Rect(96, 202, 25, 27))
    lib["periodicTableNdOn"] = ptableOn.GetSubBitmap(wx.Rect(120, 202, 25, 27))
    lib["periodicTablePmOn"] = ptableOn.GetSubBitmap(wx.Rect(144, 202, 25, 27))
    lib["periodicTableSmOn"] = ptableOn.GetSubBitmap(wx.Rect(168, 202, 25, 27))
    lib["periodicTableEuOn"] = ptableOn.GetSubBitmap(wx.Rect(192, 202, 25, 27))
    lib["periodicTableGdOn"] = ptableOn.GetSubBitmap(wx.Rect(216, 202, 25, 27))
    lib["periodicTableTbOn"] = ptableOn.GetSubBitmap(wx.Rect(240, 202, 25, 27))
    lib["periodicTableDyOn"] = ptableOn.GetSubBitmap(wx.Rect(264, 202, 25, 27))
    lib["periodicTableHoOn"] = ptableOn.GetSubBitmap(wx.Rect(288, 202, 25, 27))
    lib["periodicTableErOn"] = ptableOn.GetSubBitmap(wx.Rect(312, 202, 25, 27))
    lib["periodicTableTmOn"] = ptableOn.GetSubBitmap(wx.Rect(336, 202, 25, 27))
    lib["periodicTableYbOn"] = ptableOn.GetSubBitmap(wx.Rect(360, 202, 25, 27))
    lib["periodicTableLuOn"] = ptableOn.GetSubBitmap(wx.Rect(384, 202, 25, 27))
    lib["periodicTableThOn"] = ptableOn.GetSubBitmap(wx.Rect(72, 228, 25, 27))
    lib["periodicTablePaOn"] = ptableOn.GetSubBitmap(wx.Rect(96, 228, 25, 27))
    lib["periodicTableUOn"] = ptableOn.GetSubBitmap(wx.Rect(120, 228, 25, 27))
    lib["periodicTableNpOn"] = ptableOn.GetSubBitmap(wx.Rect(144, 228, 25, 27))
    lib["periodicTablePuOn"] = ptableOn.GetSubBitmap(wx.Rect(168, 228, 25, 27))
    lib["periodicTableAmOn"] = ptableOn.GetSubBitmap(wx.Rect(192, 228, 25, 27))
    lib["periodicTableCmOn"] = ptableOn.GetSubBitmap(wx.Rect(216, 228, 25, 27))
    lib["periodicTableBkOn"] = ptableOn.GetSubBitmap(wx.Rect(240, 228, 25, 27))
    lib["periodicTableCfOn"] = ptableOn.GetSubBitmap(wx.Rect(264, 228, 25, 27))
    lib["periodicTableEsOn"] = ptableOn.GetSubBitmap(wx.Rect(288, 228, 25, 27))
    lib["periodicTableFmOn"] = ptableOn.GetSubBitmap(wx.Rect(312, 228, 25, 27))
    lib["periodicTableMdOn"] = ptableOn.GetSubBitmap(wx.Rect(336, 228, 25, 27))
    lib["periodicTableNoOn"] = ptableOn.GetSubBitmap(wx.Rect(360, 228, 25, 27))
    lib["periodicTableLrOn"] = ptableOn.GetSubBitmap(wx.Rect(384, 228, 25, 27))

    lib["periodicTableHOff"] = ptableOff.GetSubBitmap(wx.Rect(0, 0, 25, 27))
    lib["periodicTableHeOff"] = ptableOff.GetSubBitmap(wx.Rect(408, 0, 25, 27))
    lib["periodicTableLiOff"] = ptableOff.GetSubBitmap(wx.Rect(0, 26, 25, 27))
    lib["periodicTableBeOff"] = ptableOff.GetSubBitmap(wx.Rect(24, 26, 25, 27))
    lib["periodicTableBOff"] = ptableOff.GetSubBitmap(wx.Rect(288, 26, 25, 27))
    lib["periodicTableCOff"] = ptableOff.GetSubBitmap(wx.Rect(312, 26, 25, 27))
    lib["periodicTableNOff"] = ptableOff.GetSubBitmap(wx.Rect(336, 26, 25, 27))
    lib["periodicTableOOff"] = ptableOff.GetSubBitmap(wx.Rect(360, 26, 25, 27))
    lib["periodicTableFOff"] = ptableOff.GetSubBitmap(wx.Rect(384, 26, 25, 27))
    lib["periodicTableNeOff"] = ptableOff.GetSubBitmap(wx.Rect(
        408, 26, 25, 27))
    lib["periodicTableNaOff"] = ptableOff.GetSubBitmap(wx.Rect(0, 52, 25, 27))
    lib["periodicTableMgOff"] = ptableOff.GetSubBitmap(wx.Rect(24, 52, 25, 27))
    lib["periodicTableAlOff"] = ptableOff.GetSubBitmap(wx.Rect(
        288, 52, 25, 27))
    lib["periodicTableSiOff"] = ptableOff.GetSubBitmap(wx.Rect(
        312, 52, 25, 27))
    lib["periodicTablePOff"] = ptableOff.GetSubBitmap(wx.Rect(336, 52, 25, 27))
    lib["periodicTableSOff"] = ptableOff.GetSubBitmap(wx.Rect(360, 52, 25, 27))
    lib["periodicTableClOff"] = ptableOff.GetSubBitmap(wx.Rect(
        384, 52, 25, 27))
    lib["periodicTableArOff"] = ptableOff.GetSubBitmap(wx.Rect(
        408, 52, 25, 27))
    lib["periodicTableKOff"] = ptableOff.GetSubBitmap(wx.Rect(0, 78, 25, 27))
    lib["periodicTableCaOff"] = ptableOff.GetSubBitmap(wx.Rect(24, 78, 25, 27))
    lib["periodicTableScOff"] = ptableOff.GetSubBitmap(wx.Rect(48, 78, 25, 27))
    lib["periodicTableTiOff"] = ptableOff.GetSubBitmap(wx.Rect(72, 78, 25, 27))
    lib["periodicTableVOff"] = ptableOff.GetSubBitmap(wx.Rect(96, 78, 25, 27))
    lib["periodicTableCrOff"] = ptableOff.GetSubBitmap(wx.Rect(
        120, 78, 25, 27))
    lib["periodicTableMnOff"] = ptableOff.GetSubBitmap(wx.Rect(
        144, 78, 25, 27))
    lib["periodicTableFeOff"] = ptableOff.GetSubBitmap(wx.Rect(
        168, 78, 25, 27))
    lib["periodicTableCoOff"] = ptableOff.GetSubBitmap(wx.Rect(
        192, 78, 25, 27))
    lib["periodicTableNiOff"] = ptableOff.GetSubBitmap(wx.Rect(
        216, 78, 25, 27))
    lib["periodicTableCuOff"] = ptableOff.GetSubBitmap(wx.Rect(
        240, 78, 25, 27))
    lib["periodicTableZnOff"] = ptableOff.GetSubBitmap(wx.Rect(
        264, 78, 25, 27))
    lib["periodicTableGaOff"] = ptableOff.GetSubBitmap(wx.Rect(
        288, 78, 25, 27))
    lib["periodicTableGeOff"] = ptableOff.GetSubBitmap(wx.Rect(
        312, 78, 25, 27))
    lib["periodicTableAsOff"] = ptableOff.GetSubBitmap(wx.Rect(
        336, 78, 25, 27))
    lib["periodicTableSeOff"] = ptableOff.GetSubBitmap(wx.Rect(
        360, 78, 25, 27))
    lib["periodicTableBrOff"] = ptableOff.GetSubBitmap(wx.Rect(
        384, 78, 25, 27))
    lib["periodicTableKrOff"] = ptableOff.GetSubBitmap(wx.Rect(
        408, 78, 25, 27))
    lib["periodicTableRbOff"] = ptableOff.GetSubBitmap(wx.Rect(0, 104, 25, 27))
    lib["periodicTableSrOff"] = ptableOff.GetSubBitmap(wx.Rect(
        24, 104, 25, 27))
    lib["periodicTableYOff"] = ptableOff.GetSubBitmap(wx.Rect(48, 104, 25, 27))
    lib["periodicTableZrOff"] = ptableOff.GetSubBitmap(wx.Rect(
        72, 104, 25, 27))
    lib["periodicTableNbOff"] = ptableOff.GetSubBitmap(wx.Rect(
        96, 104, 25, 27))
    lib["periodicTableMoOff"] = ptableOff.GetSubBitmap(
        wx.Rect(120, 104, 25, 27))
    lib["periodicTableTcOff"] = ptableOff.GetSubBitmap(
        wx.Rect(144, 104, 25, 27))
    lib["periodicTableRuOff"] = ptableOff.GetSubBitmap(
        wx.Rect(168, 104, 25, 27))
    lib["periodicTableRhOff"] = ptableOff.GetSubBitmap(
        wx.Rect(192, 104, 25, 27))
    lib["periodicTablePdOff"] = ptableOff.GetSubBitmap(
        wx.Rect(216, 104, 25, 27))
    lib["periodicTableAgOff"] = ptableOff.GetSubBitmap(
        wx.Rect(240, 104, 25, 27))
    lib["periodicTableCdOff"] = ptableOff.GetSubBitmap(
        wx.Rect(264, 104, 25, 27))
    lib["periodicTableInOff"] = ptableOff.GetSubBitmap(
        wx.Rect(288, 104, 25, 27))
    lib["periodicTableSnOff"] = ptableOff.GetSubBitmap(
        wx.Rect(312, 104, 25, 27))
    lib["periodicTableSbOff"] = ptableOff.GetSubBitmap(
        wx.Rect(336, 104, 25, 27))
    lib["periodicTableTeOff"] = ptableOff.GetSubBitmap(
        wx.Rect(360, 104, 25, 27))
    lib["periodicTableIOff"] = ptableOff.GetSubBitmap(wx.Rect(
        384, 104, 25, 27))
    lib["periodicTableXeOff"] = ptableOff.GetSubBitmap(
        wx.Rect(408, 104, 25, 27))
    lib["periodicTableCsOff"] = ptableOff.GetSubBitmap(wx.Rect(0, 130, 25, 27))
    lib["periodicTableBaOff"] = ptableOff.GetSubBitmap(wx.Rect(
        24, 130, 25, 27))
    lib["periodicTableLaOff"] = ptableOff.GetSubBitmap(wx.Rect(
        48, 130, 25, 27))
    lib["periodicTableHfOff"] = ptableOff.GetSubBitmap(wx.Rect(
        72, 130, 25, 27))
    lib["periodicTableTaOff"] = ptableOff.GetSubBitmap(wx.Rect(
        96, 130, 25, 27))
    lib["periodicTableWOff"] = ptableOff.GetSubBitmap(wx.Rect(
        120, 130, 25, 27))
    lib["periodicTableReOff"] = ptableOff.GetSubBitmap(
        wx.Rect(144, 130, 25, 27))
    lib["periodicTableOsOff"] = ptableOff.GetSubBitmap(
        wx.Rect(168, 130, 25, 27))
    lib["periodicTableIrOff"] = ptableOff.GetSubBitmap(
        wx.Rect(192, 130, 25, 27))
    lib["periodicTablePtOff"] = ptableOff.GetSubBitmap(
        wx.Rect(216, 130, 25, 27))
    lib["periodicTableAuOff"] = ptableOff.GetSubBitmap(
        wx.Rect(240, 130, 25, 27))
    lib["periodicTableHgOff"] = ptableOff.GetSubBitmap(
        wx.Rect(264, 130, 25, 27))
    lib["periodicTableTlOff"] = ptableOff.GetSubBitmap(
        wx.Rect(288, 130, 25, 27))
    lib["periodicTablePbOff"] = ptableOff.GetSubBitmap(
        wx.Rect(312, 130, 25, 27))
    lib["periodicTableBiOff"] = ptableOff.GetSubBitmap(
        wx.Rect(336, 130, 25, 27))
    lib["periodicTablePoOff"] = ptableOff.GetSubBitmap(
        wx.Rect(360, 130, 25, 27))
    lib["periodicTableAtOff"] = ptableOff.GetSubBitmap(
        wx.Rect(384, 130, 25, 27))
    lib["periodicTableRnOff"] = ptableOff.GetSubBitmap(
        wx.Rect(408, 130, 25, 27))
    lib["periodicTableFrOff"] = ptableOff.GetSubBitmap(wx.Rect(0, 156, 25, 27))
    lib["periodicTableRaOff"] = ptableOff.GetSubBitmap(wx.Rect(
        24, 156, 25, 27))
    lib["periodicTableAcOff"] = ptableOff.GetSubBitmap(wx.Rect(
        48, 156, 25, 27))
    lib["periodicTableCeOff"] = ptableOff.GetSubBitmap(wx.Rect(
        72, 202, 25, 27))
    lib["periodicTablePrOff"] = ptableOff.GetSubBitmap(wx.Rect(
        96, 202, 25, 27))
    lib["periodicTableNdOff"] = ptableOff.GetSubBitmap(
        wx.Rect(120, 202, 25, 27))
    lib["periodicTablePmOff"] = ptableOff.GetSubBitmap(
        wx.Rect(144, 202, 25, 27))
    lib["periodicTableSmOff"] = ptableOff.GetSubBitmap(
        wx.Rect(168, 202, 25, 27))
    lib["periodicTableEuOff"] = ptableOff.GetSubBitmap(
        wx.Rect(192, 202, 25, 27))
    lib["periodicTableGdOff"] = ptableOff.GetSubBitmap(
        wx.Rect(216, 202, 25, 27))
    lib["periodicTableTbOff"] = ptableOff.GetSubBitmap(
        wx.Rect(240, 202, 25, 27))
    lib["periodicTableDyOff"] = ptableOff.GetSubBitmap(
        wx.Rect(264, 202, 25, 27))
    lib["periodicTableHoOff"] = ptableOff.GetSubBitmap(
        wx.Rect(288, 202, 25, 27))
    lib["periodicTableErOff"] = ptableOff.GetSubBitmap(
        wx.Rect(312, 202, 25, 27))
    lib["periodicTableTmOff"] = ptableOff.GetSubBitmap(
        wx.Rect(336, 202, 25, 27))
    lib["periodicTableYbOff"] = ptableOff.GetSubBitmap(
        wx.Rect(360, 202, 25, 27))
    lib["periodicTableLuOff"] = ptableOff.GetSubBitmap(
        wx.Rect(384, 202, 25, 27))
    lib["periodicTableThOff"] = ptableOff.GetSubBitmap(wx.Rect(
        72, 228, 25, 27))
    lib["periodicTablePaOff"] = ptableOff.GetSubBitmap(wx.Rect(
        96, 228, 25, 27))
    lib["periodicTableUOff"] = ptableOff.GetSubBitmap(wx.Rect(
        120, 228, 25, 27))
    lib["periodicTableNpOff"] = ptableOff.GetSubBitmap(
        wx.Rect(144, 228, 25, 27))
    lib["periodicTablePuOff"] = ptableOff.GetSubBitmap(
        wx.Rect(168, 228, 25, 27))
    lib["periodicTableAmOff"] = ptableOff.GetSubBitmap(
        wx.Rect(192, 228, 25, 27))
    lib["periodicTableCmOff"] = ptableOff.GetSubBitmap(
        wx.Rect(216, 228, 25, 27))
    lib["periodicTableBkOff"] = ptableOff.GetSubBitmap(
        wx.Rect(240, 228, 25, 27))
    lib["periodicTableCfOff"] = ptableOff.GetSubBitmap(
        wx.Rect(264, 228, 25, 27))
    lib["periodicTableEsOff"] = ptableOff.GetSubBitmap(
        wx.Rect(288, 228, 25, 27))
    lib["periodicTableFmOff"] = ptableOff.GetSubBitmap(
        wx.Rect(312, 228, 25, 27))
    lib["periodicTableMdOff"] = ptableOff.GetSubBitmap(
        wx.Rect(336, 228, 25, 27))
    lib["periodicTableNoOff"] = ptableOff.GetSubBitmap(
        wx.Rect(360, 228, 25, 27))
    lib["periodicTableLrOff"] = ptableOff.GetSubBitmap(
        wx.Rect(384, 228, 25, 27))

    lib["periodicTableHSel"] = ptableSel.GetSubBitmap(wx.Rect(0, 0, 25, 27))
    lib["periodicTableHeSel"] = ptableSel.GetSubBitmap(wx.Rect(408, 0, 25, 27))
    lib["periodicTableLiSel"] = ptableSel.GetSubBitmap(wx.Rect(0, 26, 25, 27))
    lib["periodicTableBeSel"] = ptableSel.GetSubBitmap(wx.Rect(24, 26, 25, 27))
    lib["periodicTableBSel"] = ptableSel.GetSubBitmap(wx.Rect(288, 26, 25, 27))
    lib["periodicTableCSel"] = ptableSel.GetSubBitmap(wx.Rect(312, 26, 25, 27))
    lib["periodicTableNSel"] = ptableSel.GetSubBitmap(wx.Rect(336, 26, 25, 27))
    lib["periodicTableOSel"] = ptableSel.GetSubBitmap(wx.Rect(360, 26, 25, 27))
    lib["periodicTableFSel"] = ptableSel.GetSubBitmap(wx.Rect(384, 26, 25, 27))
    lib["periodicTableNeSel"] = ptableSel.GetSubBitmap(wx.Rect(
        408, 26, 25, 27))
    lib["periodicTableNaSel"] = ptableSel.GetSubBitmap(wx.Rect(0, 52, 25, 27))
    lib["periodicTableMgSel"] = ptableSel.GetSubBitmap(wx.Rect(24, 52, 25, 27))
    lib["periodicTableAlSel"] = ptableSel.GetSubBitmap(wx.Rect(
        288, 52, 25, 27))
    lib["periodicTableSiSel"] = ptableSel.GetSubBitmap(wx.Rect(
        312, 52, 25, 27))
    lib["periodicTablePSel"] = ptableSel.GetSubBitmap(wx.Rect(336, 52, 25, 27))
    lib["periodicTableSSel"] = ptableSel.GetSubBitmap(wx.Rect(360, 52, 25, 27))
    lib["periodicTableClSel"] = ptableSel.GetSubBitmap(wx.Rect(
        384, 52, 25, 27))
    lib["periodicTableArSel"] = ptableSel.GetSubBitmap(wx.Rect(
        408, 52, 25, 27))
    lib["periodicTableKSel"] = ptableSel.GetSubBitmap(wx.Rect(0, 78, 25, 27))
    lib["periodicTableCaSel"] = ptableSel.GetSubBitmap(wx.Rect(24, 78, 25, 27))
    lib["periodicTableScSel"] = ptableSel.GetSubBitmap(wx.Rect(48, 78, 25, 27))
    lib["periodicTableTiSel"] = ptableSel.GetSubBitmap(wx.Rect(72, 78, 25, 27))
    lib["periodicTableVSel"] = ptableSel.GetSubBitmap(wx.Rect(96, 78, 25, 27))
    lib["periodicTableCrSel"] = ptableSel.GetSubBitmap(wx.Rect(
        120, 78, 25, 27))
    lib["periodicTableMnSel"] = ptableSel.GetSubBitmap(wx.Rect(
        144, 78, 25, 27))
    lib["periodicTableFeSel"] = ptableSel.GetSubBitmap(wx.Rect(
        168, 78, 25, 27))
    lib["periodicTableCoSel"] = ptableSel.GetSubBitmap(wx.Rect(
        192, 78, 25, 27))
    lib["periodicTableNiSel"] = ptableSel.GetSubBitmap(wx.Rect(
        216, 78, 25, 27))
    lib["periodicTableCuSel"] = ptableSel.GetSubBitmap(wx.Rect(
        240, 78, 25, 27))
    lib["periodicTableZnSel"] = ptableSel.GetSubBitmap(wx.Rect(
        264, 78, 25, 27))
    lib["periodicTableGaSel"] = ptableSel.GetSubBitmap(wx.Rect(
        288, 78, 25, 27))
    lib["periodicTableGeSel"] = ptableSel.GetSubBitmap(wx.Rect(
        312, 78, 25, 27))
    lib["periodicTableAsSel"] = ptableSel.GetSubBitmap(wx.Rect(
        336, 78, 25, 27))
    lib["periodicTableSeSel"] = ptableSel.GetSubBitmap(wx.Rect(
        360, 78, 25, 27))
    lib["periodicTableBrSel"] = ptableSel.GetSubBitmap(wx.Rect(
        384, 78, 25, 27))
    lib["periodicTableKrSel"] = ptableSel.GetSubBitmap(wx.Rect(
        408, 78, 25, 27))
    lib["periodicTableRbSel"] = ptableSel.GetSubBitmap(wx.Rect(0, 104, 25, 27))
    lib["periodicTableSrSel"] = ptableSel.GetSubBitmap(wx.Rect(
        24, 104, 25, 27))
    lib["periodicTableYSel"] = ptableSel.GetSubBitmap(wx.Rect(48, 104, 25, 27))
    lib["periodicTableZrSel"] = ptableSel.GetSubBitmap(wx.Rect(
        72, 104, 25, 27))
    lib["periodicTableNbSel"] = ptableSel.GetSubBitmap(wx.Rect(
        96, 104, 25, 27))
    lib["periodicTableMoSel"] = ptableSel.GetSubBitmap(
        wx.Rect(120, 104, 25, 27))
    lib["periodicTableTcSel"] = ptableSel.GetSubBitmap(
        wx.Rect(144, 104, 25, 27))
    lib["periodicTableRuSel"] = ptableSel.GetSubBitmap(
        wx.Rect(168, 104, 25, 27))
    lib["periodicTableRhSel"] = ptableSel.GetSubBitmap(
        wx.Rect(192, 104, 25, 27))
    lib["periodicTablePdSel"] = ptableSel.GetSubBitmap(
        wx.Rect(216, 104, 25, 27))
    lib["periodicTableAgSel"] = ptableSel.GetSubBitmap(
        wx.Rect(240, 104, 25, 27))
    lib["periodicTableCdSel"] = ptableSel.GetSubBitmap(
        wx.Rect(264, 104, 25, 27))
    lib["periodicTableInSel"] = ptableSel.GetSubBitmap(
        wx.Rect(288, 104, 25, 27))
    lib["periodicTableSnSel"] = ptableSel.GetSubBitmap(
        wx.Rect(312, 104, 25, 27))
    lib["periodicTableSbSel"] = ptableSel.GetSubBitmap(
        wx.Rect(336, 104, 25, 27))
    lib["periodicTableTeSel"] = ptableSel.GetSubBitmap(
        wx.Rect(360, 104, 25, 27))
    lib["periodicTableISel"] = ptableSel.GetSubBitmap(wx.Rect(
        384, 104, 25, 27))
    lib["periodicTableXeSel"] = ptableSel.GetSubBitmap(
        wx.Rect(408, 104, 25, 27))
    lib["periodicTableCsSel"] = ptableSel.GetSubBitmap(wx.Rect(0, 130, 25, 27))
    lib["periodicTableBaSel"] = ptableSel.GetSubBitmap(wx.Rect(
        24, 130, 25, 27))
    lib["periodicTableLaSel"] = ptableSel.GetSubBitmap(wx.Rect(
        48, 130, 25, 27))
    lib["periodicTableHfSel"] = ptableSel.GetSubBitmap(wx.Rect(
        72, 130, 25, 27))
    lib["periodicTableTaSel"] = ptableSel.GetSubBitmap(wx.Rect(
        96, 130, 25, 27))
    lib["periodicTableWSel"] = ptableSel.GetSubBitmap(wx.Rect(
        120, 130, 25, 27))
    lib["periodicTableReSel"] = ptableSel.GetSubBitmap(
        wx.Rect(144, 130, 25, 27))
    lib["periodicTableOsSel"] = ptableSel.GetSubBitmap(
        wx.Rect(168, 130, 25, 27))
    lib["periodicTableIrSel"] = ptableSel.GetSubBitmap(
        wx.Rect(192, 130, 25, 27))
    lib["periodicTablePtSel"] = ptableSel.GetSubBitmap(
        wx.Rect(216, 130, 25, 27))
    lib["periodicTableAuSel"] = ptableSel.GetSubBitmap(
        wx.Rect(240, 130, 25, 27))
    lib["periodicTableHgSel"] = ptableSel.GetSubBitmap(
        wx.Rect(264, 130, 25, 27))
    lib["periodicTableTlSel"] = ptableSel.GetSubBitmap(
        wx.Rect(288, 130, 25, 27))
    lib["periodicTablePbSel"] = ptableSel.GetSubBitmap(
        wx.Rect(312, 130, 25, 27))
    lib["periodicTableBiSel"] = ptableSel.GetSubBitmap(
        wx.Rect(336, 130, 25, 27))
    lib["periodicTablePoSel"] = ptableSel.GetSubBitmap(
        wx.Rect(360, 130, 25, 27))
    lib["periodicTableAtSel"] = ptableSel.GetSubBitmap(
        wx.Rect(384, 130, 25, 27))
    lib["periodicTableRnSel"] = ptableSel.GetSubBitmap(
        wx.Rect(408, 130, 25, 27))
    lib["periodicTableFrSel"] = ptableSel.GetSubBitmap(wx.Rect(0, 156, 25, 27))
    lib["periodicTableRaSel"] = ptableSel.GetSubBitmap(wx.Rect(
        24, 156, 25, 27))
    lib["periodicTableAcSel"] = ptableSel.GetSubBitmap(wx.Rect(
        48, 156, 25, 27))
    lib["periodicTableCeSel"] = ptableSel.GetSubBitmap(wx.Rect(
        72, 202, 25, 27))
    lib["periodicTablePrSel"] = ptableSel.GetSubBitmap(wx.Rect(
        96, 202, 25, 27))
    lib["periodicTableNdSel"] = ptableSel.GetSubBitmap(
        wx.Rect(120, 202, 25, 27))
    lib["periodicTablePmSel"] = ptableSel.GetSubBitmap(
        wx.Rect(144, 202, 25, 27))
    lib["periodicTableSmSel"] = ptableSel.GetSubBitmap(
        wx.Rect(168, 202, 25, 27))
    lib["periodicTableEuSel"] = ptableSel.GetSubBitmap(
        wx.Rect(192, 202, 25, 27))
    lib["periodicTableGdSel"] = ptableSel.GetSubBitmap(
        wx.Rect(216, 202, 25, 27))
    lib["periodicTableTbSel"] = ptableSel.GetSubBitmap(
        wx.Rect(240, 202, 25, 27))
    lib["periodicTableDySel"] = ptableSel.GetSubBitmap(
        wx.Rect(264, 202, 25, 27))
    lib["periodicTableHoSel"] = ptableSel.GetSubBitmap(
        wx.Rect(288, 202, 25, 27))
    lib["periodicTableErSel"] = ptableSel.GetSubBitmap(
        wx.Rect(312, 202, 25, 27))
    lib["periodicTableTmSel"] = ptableSel.GetSubBitmap(
        wx.Rect(336, 202, 25, 27))
    lib["periodicTableYbSel"] = ptableSel.GetSubBitmap(
        wx.Rect(360, 202, 25, 27))
    lib["periodicTableLuSel"] = ptableSel.GetSubBitmap(
        wx.Rect(384, 202, 25, 27))
    lib["periodicTableThSel"] = ptableSel.GetSubBitmap(wx.Rect(
        72, 228, 25, 27))
    lib["periodicTablePaSel"] = ptableSel.GetSubBitmap(wx.Rect(
        96, 228, 25, 27))
    lib["periodicTableUSel"] = ptableSel.GetSubBitmap(wx.Rect(
        120, 228, 25, 27))
    lib["periodicTableNpSel"] = ptableSel.GetSubBitmap(
        wx.Rect(144, 228, 25, 27))
    lib["periodicTablePuSel"] = ptableSel.GetSubBitmap(
        wx.Rect(168, 228, 25, 27))
    lib["periodicTableAmSel"] = ptableSel.GetSubBitmap(
        wx.Rect(192, 228, 25, 27))
    lib["periodicTableCmSel"] = ptableSel.GetSubBitmap(
        wx.Rect(216, 228, 25, 27))
    lib["periodicTableBkSel"] = ptableSel.GetSubBitmap(
        wx.Rect(240, 228, 25, 27))
    lib["periodicTableCfSel"] = ptableSel.GetSubBitmap(
        wx.Rect(264, 228, 25, 27))
    lib["periodicTableEsSel"] = ptableSel.GetSubBitmap(
        wx.Rect(288, 228, 25, 27))
    lib["periodicTableFmSel"] = ptableSel.GetSubBitmap(
        wx.Rect(312, 228, 25, 27))
    lib["periodicTableMdSel"] = ptableSel.GetSubBitmap(
        wx.Rect(336, 228, 25, 27))
    lib["periodicTableNoSel"] = ptableSel.GetSubBitmap(
        wx.Rect(360, 228, 25, 27))
    lib["periodicTableLrSel"] = ptableSel.GetSubBitmap(
        wx.Rect(384, 228, 25, 27))
示例#11
0
 def on_mouse_left_up(self, event):
     self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
     self.previous_window_position = None
     self.previous_scene_position = None
     self.corner_drag = None
示例#12
0
文件: legend.py 项目: lanery/odemis
 def on_mouse_leave(self, _=None):
     self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
示例#13
0
 def SetMode(self, mode):
     self.mode = mode
     if self.mode == "Draw":
         self.SetCursor(wx.Cursor(wx.CURSOR_PENCIL))
     else:
         self.SetCursor(wx.STANDARD_CURSOR)
示例#14
0
    def handle_interaction(self, pixel_data, image_set_number):
        """Run a UI that gets an angle from the user"""
        import wx

        if pixel_data.ndim == 2:
            # make a color matrix for consistency
            pixel_data = np.dstack((pixel_data, pixel_data, pixel_data))
        pd_min = np.min(pixel_data)
        pd_max = np.max(pixel_data)
        if pd_min == pd_max:
            pixel_data[:, :, :] = 0
        else:
            pixel_data = (pixel_data - pd_min) * 255.0 / (pd_max - pd_min)
        #
        # Make a 100 x 100 image so it's manageable
        #
        isize = 200
        i, j, k = np.mgrid[
            0:isize, 0 : int(isize * pixel_data.shape[1] / pixel_data.shape[0]), 0:3
        ].astype(float)
        i *= float(pixel_data.shape[0]) / float(isize)
        j *= float(pixel_data.shape[0]) / float(isize)
        pixel_data = scind.map_coordinates(pixel_data, (i, j, k))
        #
        # Make a dialog box that contains the image
        #
        dialog_title = "Rotate image - Cycle #%d:" % (image_set_number)
        dialog = wx.Dialog(None, title=dialog_title)
        sizer = wx.BoxSizer(wx.VERTICAL)
        dialog.SetSizer(sizer)
        sizer.Add(
            wx.StaticText(dialog, label="Drag image to rotate, hit OK to continue"),
            0,
            wx.ALIGN_CENTER_HORIZONTAL,
        )
        canvas = wx.StaticBitmap(dialog)
        canvas.SetDoubleBuffered(True)
        sizer.Add(
            canvas, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5
        )
        angle = [0]
        angle_text = wx.StaticText(dialog, label="Angle: %d" % angle[0])
        sizer.Add(angle_text, 0, wx.ALIGN_CENTER_HORIZONTAL)

        def imshow():
            angle_text.Label = "Angle: %d" % int(angle[0])
            angle_text.Refresh()
            my_angle = -angle[0] * np.pi / 180.0
            transform = np.array(
                [
                    [np.cos(my_angle), -np.sin(my_angle)],
                    [np.sin(my_angle), np.cos(my_angle)],
                ]
            )
            # Make it rotate about the center
            offset = affine_offset(pixel_data.shape, transform)
            x = np.dstack(
                (
                    scind.affine_transform(
                        pixel_data[:, :, 0], transform, offset, order=0
                    ),
                    scind.affine_transform(
                        pixel_data[:, :, 1], transform, offset, order=0
                    ),
                    scind.affine_transform(
                        pixel_data[:, :, 2], transform, offset, order=0
                    ),
                )
            )
            buff = x.astype(np.uint8).tostring()
            bitmap = wx.Bitmap.FromBuffer(x.shape[1], x.shape[0], buff)
            canvas.SetBitmap(bitmap)

        imshow()
        #
        # Install handlers for mouse down, mouse move and mouse up
        #
        dragging = [False]
        initial_angle = [0]
        hand_cursor = wx.Cursor(wx.CURSOR_HAND)
        arrow_cursor = wx.Cursor(wx.CURSOR_ARROW)

        def get_angle(event):
            center = np.array(canvas.Size) / 2
            point = np.array(event.GetPosition())
            offset = point - center
            return -np.arctan2(offset[1], offset[0]) * 180.0 / np.pi

        def on_mouse_down(event):
            canvas.Cursor = hand_cursor
            dragging[0] = True
            initial_angle[0] = get_angle(event) - angle[0]
            canvas.CaptureMouse()

        wx.EVT_LEFT_DOWN(canvas, on_mouse_down)

        def on_mouse_up(event):
            if dragging[0]:
                canvas.ReleaseMouse()
                dragging[0] = False
                canvas.Cursor = arrow_cursor

        wx.EVT_LEFT_UP(canvas, on_mouse_up)

        def on_mouse_lost(event):
            dragging[0] = False
            canvas.Cursor = arrow_cursor

        wx.EVT_MOUSE_CAPTURE_LOST(canvas, on_mouse_lost)

        def on_mouse_move(event):
            if dragging[0]:
                angle[0] = get_angle(event) - initial_angle[0]
                imshow()
                canvas.Refresh(eraseBackground=False)

        wx.EVT_MOTION(canvas, on_mouse_move)
        #
        # Put the OK and Cancel buttons on the bottom
        #
        btnsizer = wx.StdDialogButtonSizer()

        btn = wx.Button(dialog, wx.ID_OK)
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(dialog, wx.ID_CANCEL)
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5)
        dialog.Fit()
        result = dialog.ShowModal()
        dialog.Destroy()
        if result == wx.ID_OK:
            return angle[0]
        raise ValueError("Canceled by user in FlipAndRotate")
示例#15
0
 def OnLeave(self, evt):
     self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
     self.entered = False
示例#16
0
 def OnMouseLeave(self, e):
     if not self.sizing:
         self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
示例#17
0
 def OnEnter(self, evt):
     self.SetCursor(wx.Cursor(wx.CURSOR_BULLSEYE))
     self.entered = True
示例#18
0
 def OnMouseEnter(self, e):
     self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
     for child in self.GetChildren():
         child.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
 def _capture_mouse(self):
     self.canvas.SetCursor(wx.Cursor(wx.CURSOR_BLANK))
     self.canvas.mouse.warp_middle()
     self.canvas.mouse.reset_delta()
     self.canvas.camera.rotating = True
示例#20
0
文件: basic.py 项目: raboof/sk1-wx
def cursor(path, bitmap_type, x=None, y=None):
    if x is None:
        return wx.Cursor(path, bitmap_type)
    return wx.Cursor(path, bitmap_type, x, y)
示例#21
0
try:
    from icons import ico_pdf  # PDF icon in upper left screen corner
    do_icon = True
except ImportError:
    do_icon = False

app = None
app = wx.App()
assert wx.VERSION[0:3] >= (3, 0, 2), "need wxPython 3.0.2 or later"
assert tuple(map(
    int,
    fitz.VersionBind.split("."))) >= (1, 9, 2), "need PyMuPDF 1.9.2 or later"

# make some adjustments for differences between wxPython versions 3.0.2 / 3.0.3
if wx.VERSION[0:3] >= (3, 0, 3):
    cursor_hand = wx.Cursor(wx.CURSOR_HAND)
    cursor_norm = wx.Cursor(wx.CURSOR_DEFAULT)
    bmp_buffer = wx.Bitmap.FromBuffer
    phoenix = True
else:
    cursor_hand = wx.StockCursor(wx.CURSOR_HAND)
    cursor_norm = wx.StockCursor(wx.CURSOR_DEFAULT)
    bmp_buffer = wx.BitmapFromBuffer
    phoenix = False

if str != bytes:
    stringtypes = (str, bytes)
else:
    stringtypes = (str, unicode)

 def LeftUp(self, evt):
     self.ShowToolTip(False)
     self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
     self.doc.Bind(stc.EVT_STC_UPDATEUI, self.DocPosChanged)
示例#23
0
文件: LMS_Admin.py 项目: mp5lii/LMS
 def _on_btn_import_users(self, event):
     file_dialog = wx.FileDialog(
         self,
         "选择要导入的用户数据文件",
         wildcard="Excel 文件(*.xlsx)|*.xlsx|Excel97-2003 文件(*.xls)|*.xls",
         style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
     if file_dialog.ShowModal() == wx.ID_OK:
         # 导入操作进行时设置鼠标形状为箭头等待状态
         self.SetCursor(wx.Cursor(wx.CURSOR_ARROWWAIT))
         # 记录是否覆盖数据状态
         b_cover_data = self._chk_cover_users_data.GetValue()
         # 获取待导入的文件
         file = file_dialog.GetPath()
         # 打开Excel文件
         conn_str = (
             r'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=%s;'
             % file)
         conn_excel = pyodbc.connect(conn_str, autocommit=True)
         cursor_excel = conn_excel.cursor()
         cursor_excel_tmp = conn_excel.cursor()
         # 连接数据库
         conn = pyodbc.connect(
             'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=%s\\LMSdb.accdb'
             % os.getcwd())
         cursor = conn.cursor()
         # 逐个表读取数据
         for worksheet in cursor_excel.tables():
             # 获取表名
             table_name = worksheet[2]
             # 读取表内容
             sel_str = (r'SELECT * FROM [%s]' % table_name)
             excel_rows = cursor_excel_tmp.execute(sel_str).fetchall()
             # 逐行读取
             for index, excel_row in enumerate(excel_rows):
                 # 行数据不完善(用户Id、用户名字或用户班级为空)时,跳过该行
                 if (excel_row[0] is None) or (excel_row[1] is None) or (
                         excel_row[3] is None):
                     continue
                 # 在数据库中查找是否存在该Id的用户
                 cursor.execute(
                     "SELECT user_id FROM users WHERE user_id = ?",
                     excel_row[0])
                 user = cursor.fetchone()
                 if user is None:  # 无此用户,则将该用户添加到数据库中
                     cursor.execute(
                         """
                         INSERT INTO users(user_id, user_name, user_photo, user_class)
                         VALUES(?, ?, ?, ?)""", excel_row[0], excel_row[1],
                         excel_row[2], excel_row[3])
                 elif b_cover_data:  # 有此用户,且需要覆盖原数据时,则更新该用户信息。(不能覆盖原数据时不进行操作)
                     cursor.execute(
                         """
                         UPDATE users SET user_name=?, user_photo=?, user_class=?
                         WHERE user_id=?""", excel_row[1], excel_row[2],
                         excel_row[3], excel_row[0])
                 conn.commit()
         # 关闭Excel文件
         cursor_excel_tmp.close()
         cursor_excel.close()
         conn_excel.close()
         # 关闭数据库
         cursor.close()
         conn.close()
         # 恢复鼠标形状
         self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
         # 弹出提示框
         wx.MessageBox("导入完成!")
         # 更新显示当前班级用户
         wx.QueueEvent(self, wx.PyCommandEvent(wx.EVT_CHOICE))
     event.Skip()
    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=0,
                 agwStyle=0,
                 name="FourWaySplitter"):
        """
        Default class constructor.

        :param `parent`: parent window. Must not be ``None``;
        :param `id`: window identifier. A value of -1 indicates a default value;
        :param `pos`: the control position. A value of (-1, -1) indicates a default position,
         chosen by either the windowing system or wxPython, depending on platform;
        :param `size`: the control size. A value of (-1, -1) indicates a default size,
         chosen by either the windowing system or wxPython, depending on platform;
        :param `style`: the underlying :class:`Panel` window style;
        :param `agwStyle`: the AGW-specific window style. It can be a combination of the
         following bits:

         ================== =========== ==================================================
         Window Styles      Hex Value   Description
         ================== =========== ==================================================
         ``SP_NOSASH``             0x10 No sash will be drawn on :class:`FourWaySplitter`.
         ``SP_LIVE_UPDATE``        0x80 Don't draw XOR line but resize the child windows immediately.
         ``SP_3DBORDER``          0x200 Draws a 3D effect border.
         ================== =========== ==================================================

        :param `name`: the window name.
        """

        # always turn on tab traversal
        style |= wx.TAB_TRAVERSAL

        # and turn off any border styles
        style &= ~wx.BORDER_MASK
        style |= wx.BORDER_NONE

        self._agwStyle = agwStyle

        # initialize the base class
        wx.Panel.__init__(self, parent, id, pos, size, style, name)
        self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)

        self._windows = []

        self._splitx = 0
        self._splity = 0
        self._expanded = -1
        self._fhor = 5000
        self._fver = 5000
        self._offx = 0
        self._offy = 0
        self._mode = NOWHERE
        self._flags = 0
        self._isHot = False

        self._sashTrackerPen = wx.Pen(wx.BLACK, 2, wx.PENSTYLE_SOLID)

        self._sashCursorWE = wx.Cursor(wx.CURSOR_SIZEWE)
        self._sashCursorNS = wx.Cursor(wx.CURSOR_SIZENS)
        self._sashCursorSIZING = wx.Cursor(wx.CURSOR_SIZING)

        self.Bind(wx.EVT_PAINT, self.OnPaint)
        self.Bind(wx.EVT_MOTION, self.OnMotion)
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
        self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
        self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
        self.Bind(wx.EVT_ENTER_WINDOW, self.OnEnterWindow)
示例#25
0
文件: LMS_Admin.py 项目: mp5lii/LMS
 def _on_btn_import_books(self, event):
     file_dialog = wx.FileDialog(
         self,
         u"选择要导入的图书数据文件",
         wildcard=u"Excel 文件(*.xlsx)|*.xlsx|Excel97-2003 文件(*.xls)|*.xls",
         style=wx.FD_OPEN | wx.FD_FILE_MUST_EXIST)
     if file_dialog.ShowModal() == wx.ID_OK:
         # 导入操作进行时设置鼠标形状为箭头等待状态
         self.SetCursor(wx.Cursor(wx.CURSOR_ARROWWAIT))
         # 记录是否覆盖数据状态
         b_cover_data = self._chk_cover_books_data.GetValue()
         # 获取待导入的文件
         file = file_dialog.GetPath()
         # 打开Excel文件
         conn_str = (
             r'DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=%s;'
             % file)
         conn_excel = pyodbc.connect(conn_str, autocommit=True)
         cursor_excel = conn_excel.cursor()
         cursor_excel_tmp = conn_excel.cursor()
         # 连接数据库
         conn = pyodbc.connect(
             'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=%s\\LMSdb.accdb'
             % os.getcwd())
         cursor = conn.cursor()
         # 逐个表读取数据
         for worksheet in cursor_excel.tables():
             # 获取表名
             table_name = worksheet[2]
             # 读取表内容
             sel_str = (r'SELECT * FROM [%s]' % table_name)
             excel_rows = cursor_excel_tmp.execute(sel_str).fetchall()
             # 逐行读取
             for index, excel_row in enumerate(excel_rows):
                 # 行数据不完善(图书ISBN或图书名字为空)时,跳过该行
                 if (excel_row[0] is None) or (excel_row[1] is None):
                     continue
                 # 在数据库中查找是否存在该图书
                 cursor.execute(
                     "SELECT book_isbn FROM books WHERE book_isbn = ?",
                     excel_row[0])
                 book = cursor.fetchone()
                 if book is None:  # 无此图书,则将该图书添加到数据库中
                     cursor.execute(
                         """
                         INSERT INTO books(book_isbn, book_name, book_photo, book_position)
                         VALUES(?, ?, ?, ?)""", excel_row[0], excel_row[1],
                         excel_row[2], excel_row[3])
                 elif b_cover_data:  # 有此图书,且需要覆盖原数据时,则更新该图书信息。(不能覆盖原数据时不进行操作)
                     cursor.execute(
                         """
                         UPDATE books SET book_name=?, book_photo=?, book_position=?
                         WHERE book_isbn=?""", excel_row[1], excel_row[2],
                         excel_row[3], excel_row[0])
                 conn.commit()
         # 关闭Excel文件
         cursor_excel_tmp.close()
         cursor_excel.close()
         conn_excel.close()
         # 关闭数据库
         cursor.close()
         conn.close()
         # 恢复鼠标形状
         self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
         # 弹出提示框
         wx.MessageBox(u"导入完成!")
         # 更新显示图书
         self._get_books()
     event.Skip()
示例#26
0
 def OnLeave(self, evt):
     self.SetCursor(wx.Cursor(wx.CURSOR_ARROW))
示例#27
0
    def populatePanel(self, panel):
        self.mainFrame = gui.mainFrame.MainFrame.getInstance()
        self.dirtySettings = False
        self.openFitsSettings = SettingsProvider.getInstance().getSettings(
            "pyfaPrevOpenFits", {
                "enabled": False,
                "pyfaOpenFits": []
            })

        mainSizer = wx.BoxSizer(wx.VERTICAL)

        self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title,
                                     wx.DefaultPosition, wx.DefaultSize, 0)
        self.stTitle.Wrap(-1)
        self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))

        helpCursor = wx.Cursor(wx.CURSOR_QUESTION_ARROW)
        mainSizer.Add(self.stTitle, 0, wx.ALL, 5)

        self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY,
                                           wx.DefaultPosition, wx.DefaultSize,
                                           wx.LI_HORIZONTAL)
        mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY,
                                        "Use global character",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)

        self.cbDefaultCharImplants = wx.CheckBox(
            panel, wx.ID_ANY, "Use character implants by default for new fits",
            wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbDefaultCharImplants, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY,
                                              "Use global damage pattern",
                                              wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)

        self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY,
                                           "Compact skills needed tooltip",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)

        self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY,
                                           "Color fitting view by slot",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY,
                                        "Reopen previous fits on startup",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)

        self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, "Separate Racks",
                                       wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)

        labelSizer = wx.BoxSizer(wx.VERTICAL)
        self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, "Show Rack Labels",
                                        wx.DefaultPosition, wx.DefaultSize, 0)
        labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)

        self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY,
                                         "Show fitting tab tooltips",
                                         wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, "Animate gauges",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)

        self.cbOpenFitInNew = wx.CheckBox(
            panel, wx.ID_ANY, "Open fittings in a new page by default",
            wx.DefaultPosition, wx.DefaultSize, 0)
        mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)

        self.cbShowShipBrowserTooltip = wx.CheckBox(
            panel, wx.ID_ANY, "Show ship browser tooltip", wx.DefaultPosition,
            wx.DefaultSize, 0)
        mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)

        self.cbReloadAll = wx.CheckBox(
            panel, wx.ID_ANY, "Change charge in all modules of the same type",
            wx.DefaultPosition, wx.DefaultSize, 0)
        if "wxGTK" not in wx.PlatformInfo:
            self.cbReloadAll.SetCursor(helpCursor)
        self.cbReloadAll.SetToolTip(
            wx.ToolTip(
                'When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl key while changing charge.'
            ))
        mainSizer.Add(self.cbReloadAll, 0, wx.ALL | wx.EXPAND, 5)

        self.sFit = Fit.getInstance()

        self.cbGlobalChar.SetValue(
            self.sFit.serviceFittingOptions["useGlobalCharacter"])
        self.cbDefaultCharImplants.SetValue(
            self.sFit.serviceFittingOptions["useCharacterImplantsByDefault"])
        self.cbGlobalDmgPattern.SetValue(
            self.sFit.serviceFittingOptions["useGlobalDamagePattern"])
        self.cbFitColorSlots.SetValue(
            self.sFit.serviceFittingOptions["colorFitBySlot"] or False)
        self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"]
                                  or False)
        self.cbRackLabels.SetValue(
            self.sFit.serviceFittingOptions["rackLabels"] or False)
        self.cbCompactSkills.SetValue(
            self.sFit.serviceFittingOptions["compactSkills"] or False)
        self.cbReopenFits.SetValue(self.openFitsSettings["enabled"])
        self.cbShowTooltip.SetValue(
            self.sFit.serviceFittingOptions["showTooltip"] or False)
        self.cbGaugeAnimation.SetValue(
            self.sFit.serviceFittingOptions["enableGaugeAnimation"])
        self.cbOpenFitInNew.SetValue(
            self.sFit.serviceFittingOptions["openFitInNew"])
        self.cbShowShipBrowserTooltip.SetValue(
            self.sFit.serviceFittingOptions["showShipBrowserTooltip"])
        self.cbReloadAll.SetValue(
            self.sFit.serviceFittingOptions["ammoChangeAll"])

        self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
        self.cbDefaultCharImplants.Bind(
            wx.EVT_CHECKBOX, self.OnCBDefaultCharImplantsStateChange)
        self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX,
                                     self.OnCBGlobalDmgPatternStateChange)
        self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot)
        self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots)
        self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels)
        self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills)
        self.cbReopenFits.Bind(wx.EVT_CHECKBOX, self.onCBReopenFits)
        self.cbShowTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowTooltip)
        self.cbGaugeAnimation.Bind(wx.EVT_CHECKBOX, self.onCBGaugeAnimation)
        self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
        self.cbShowShipBrowserTooltip.Bind(wx.EVT_CHECKBOX,
                                           self.onCBShowShipBrowserTooltip)
        self.cbReloadAll.Bind(wx.EVT_CHECKBOX, self.onCBReloadAll)

        self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"]
                                 or False)

        panel.SetSizer(mainSizer)
        panel.Layout()
示例#28
0
 def OnEnter(self, evt):
     if self.side == MV_HOR:
         self.SetCursor(wx.Cursor(wx.CURSOR_HAND))
     else:
         self.SetCursor(wx.Cursor(wx.CURSOR_POINT_LEFT))
示例#29
0
 def on_mouse_enter(self, _=None):
     if self._orientation == wx.HORIZONTAL:
         self.SetCursor(wx.Cursor(wx.CURSOR_SIZEWE))
     else:
         self.SetCursor(wx.Cursor(wx.CURSOR_SIZENS))
示例#30
0
 def ChangeCursor(self, event):
     self.figure_canvas.SetCursor(wx.Cursor(wx.CURSOR_BULLSEYE))