Пример #1
0
def main(stdscr):
    (y, x) = stdscr.getmaxyx()
    ed = Editor.Editor(y - 1, x)
    if len(sys.argv) > 1:
        filename = sys.argv[1]
        ed.buffer.load_from_file(filename)
    else:
        filename = ""
    curses.curs_set(0)
    update(stdscr, ed)
    event = -2
    while True:
        if ed.exit:
            break
        elif event == curses.KEY_RESIZE:
            (y, x) = stdscr.getmaxyx()
            ed.set_win(0, y - 1, x)
            update(stdscr, ed)
        else:
            try:
                ed.handle_key(event2key(event))
            except KeyChainError, e:
                curses.flash()
            update(stdscr, ed)

        if not ed.exit:
            stdscr.addstr(y - 2, x - 15, "%d: %s" % (event, event2key(event)))
            stdscr.chgat(ed.cursor.y - ed.win.top, ed.cursor.x, 1,
                         curses.A_STANDOUT)
            stdscr.refresh()
            event = stdscr.getch()
Пример #2
0
def CheckPassword(user, password):
    """Check a user's password."""
    if user == "admin":
        return CheckAdminPassword(password)
    if user in GetModule.GetEditors():
        m = Editor.Editor(user)
        return password == m.password
    return 0
Пример #3
0
def GetPassword(user):
    """Get a user's password."""
    if user == "admin":
        return GetAdminPassword()
    if user in GetModule.GetEditors():
        m = Editor.Editor(user)
        return hashlib.new('sha1', m.password).hexdigest()
    return None
Пример #4
0
 def create_central_area(self):
     self.editor = Editor.Editor(self.master,
             set_status_text=self.set_status_text,
             font=self.create_font(), maxundo=0, undo=True,
             wrap=tk.WORD)
     self.editor.grid(row=1, column=1, sticky=(tk.N, tk.S, tk.W, tk.E),
             padx=PAD, pady=PAD)
     self.editor.text.bind("<<Selection>>", self.on_selection)
     self.editor.text.bind("<<Modified>>", self.on_modified)
     self.editor.text.bind("<KeyRelease>", self.on_moved, "+")
     self.editor.text.bind("<ButtonRelease>", self.on_moved, "+")
     self.editor.text.focus()
Пример #5
0
def main():
    """ Our main function is going to do lots of setup from the setup module,
        it will setup the level size and name, then pygame display information,
        then it will draw everything to the screen and start the "game" loop.
    """

    level_width, level_height = setup_level_size()
    level_name = setup_level_name()

    editor_screen = setup_pygame_display()

    background = setup_background(editor_screen.get_size())

    level = Level.Level(width=level_width, height=level_height)
    level_editor = Editor.Editor(level)

    # Editor draw position will be the center of the screen
    level_editor.set_draw_pos(
        background.get_width() / 2 -
        level_editor.editor_surface.get_width() / 2,
        background.get_height() / 2 -
        level_editor.editor_surface.get_height() / 2)

    background.blit(level_editor.editor_surface, level_editor.get_draw_pos())
    editor_screen.blit(background, (0, 0))

    # Main "game" loop, it handles input and renders the editor(as well as any changes that occur)
    while level_editor.running:
        for event in pygame.event.get():
            if event.type == pygame.VIDEORESIZE:
                editor_screen = setup_pygame_display(event.dict['size'])
                background = setup_background(editor_screen.get_size())
                level_editor.set_draw_pos(
                    background.get_width() / 2 -
                    level_editor.editor_surface.get_width() / 2,
                    background.get_height() / 2 -
                    level_editor.editor_surface.get_height() / 2)
            elif event.type == pygame.QUIT:
                level_editor.save_level(level_name)
                level_editor.close()
            else:
                level_editor.handle_event(event)

        level_editor.render()

        background.blit(level_editor.editor_surface,
                        level_editor.get_draw_pos())

        editor_screen.blit(background, (0, 0))
        pygame.display.flip()

    # Exit when we leave the main loop
    sys.exit()
Пример #6
0
    def __init__(self, name, text, parent=None):
        super(ActivityTab, self).__init__(parent)
        self.name = name
        self.text = text

        self.mainLayout = QtGui.QVBoxLayout()

        self.editor = Editor.Editor()
        self.mainLayout.addWidget(self.editor)
        self.highlight = Highlighter.Highlighter(self.editor.document())
        self.editor.setPlainText(self.text[0])

        #self.setFixedSize(500,500)
        self.setLayout(self.mainLayout)
        self.editor.textCursor().setPosition(0, QtGui.QTextCursor.MoveAnchor)
Пример #7
0
    def initMainUi(self):
        self.tab_widget = QTabWidget()

        self.tab_widget.setTabsClosable(True)
        self.tab_widget.tabCloseRequested.connect(self.closeTab)

        self.resize(400, 400)
        #self.showMaximized()

        self.new_tab1 = Editor(self)
        self.tab_widget.addTab(self.new_tab1, 'test')

        self.toolbar = self.addToolBar('New')
        newAction = QAction('新增', self)
        newAction.triggered.connect(self.setValue)
        self.toolbar.addAction(newAction)

        self.setCentralWidget(self.tab_widget)
Пример #8
0
    def readSelectedArea(self, file_name, x1, y1, x2, y2):
        print()
        print("Please mark your forest.", file_name)
        e = Editor.Editor(file_name)

        im = Image.open("files/" + file_name + "bitmask" + '.png')
        imarray = np.array(im)
        height = imarray.shape[0]
        width = imarray.shape[1]
        #print(height)
        #print(width)
        bitmask = np.zeros((height // cell_size, width // cell_size), np.int)
        print("Reading bitmask:")
        pb = ProgressBar.ProgressBar()
        for i in range(5, bitmask.shape[0] * cell_size, cell_size):
            for j in range(5, bitmask.shape[1] * cell_size, cell_size):
                y = i // cell_size
                x = j // cell_size
                if (imarray[i][j] == [255, 0, 0]).all():
                    bitmask[y][x] = 1
                elif (imarray[i][j] == [255, 255, 0]).all():
                    bitmask[y][x] = 2
                elif (imarray[i][j] == [0, 128, 0]).all():
                    bitmask[y][x] = 3
                else:
                    bitmask[y][x] = 0
            pb.printProgress(i, height // cell_size)
        pb.printProgress(100, 100)
        print()
        for i in range(0, bitmask.shape[0]):
            for j in range(0, bitmask.shape[1]):
                if bitmask[i][j] == 1:
                    print("R", end=" ")
                elif bitmask[i][j] == 2:
                    print("Y", end=" ")
                elif bitmask[i][j] == 3:
                    print("G", end=" ")
                else:
                    print(".", end=" ")
            print()

        total_carbon = self.calculateCarbon(file_name, bitmask, x1, y1, x2, y2,
                                            width, height)
        return (bitmask, total_carbon, x1, y1, datetime.datetime.now())
Пример #9
0
def main(stdscr):
    (y, x) = stdscr.getmaxyx()
    ed = Editor.Editor(y - 1, x)
    ed.buffer.load_from_file("test.txt")
    curses.curs_set(0)
    update(stdscr, ed)
    event = -1
    while True:
        if event == 4:
            break
        elif event == curses.KEY_RESIZE:
            (y, x) = stdscr.getmaxyx()
            ed.set_win(0, y, x)
            update(stdscr, ed)
        elif event == curses.KEY_UP:
            ed.move_cursor(row=ed.cursor.y - 1, col=ed.cursor.x)
            update(stdscr, ed)
        elif event == curses.KEY_DOWN:
            ed.move_cursor(row=ed.cursor.y + 1, col=ed.cursor.x)
            update(stdscr, ed)
        elif event == curses.KEY_LEFT:
            ed.move_cursor(row=ed.cursor.y, col=ed.cursor.x - 1)
            update(stdscr, ed)
        elif event == curses.KEY_RIGHT:
            ed.move_cursor(row=ed.cursor.y, col=ed.cursor.x + 1)
            update(stdscr, ed)
        elif event == 5:
            ed.move_window(ed.win.top + 1)
            update(stdscr, ed)
        elif event == 25:
            ed.move_window(ed.win.top - 1)
            update(stdscr, ed)
        stdscr.addstr(y - 1, min(20, x - 15), str(event) + "   ")
        stdscr.chgat(ed.cursor.y - ed.win.top, ed.cursor.x, 1,
                     curses.A_STANDOUT)
        stdscr.refresh()
        event = stdscr.getch()
Пример #10
0
                menu = 0
                game = 1
                game_board = Map(
                    game_menu.list_map[game_menu.index_map])  #map basic
                liste_name_pawn = game_board.generate_list_name(
                )  #name's pawn list
                list_box_owner = game_board.generate_list_owner(
                )  #owner box list
                list_direction_pawn = game_board.generate_list_direction()
                game_board.generate_map(fenetre, COLOR_LIST,
                                        list_box_owner)  #Generate the map

            if game_menu.start_editor(position):
                menu = 0
                editor = 1
                game_board_edit = Editor()
                game_board_edit.starter_pawn(fenetre_editor)
                game_board_edit.generate_map(fenetre_editor, COLOR_LIST)

        if event.type == MOUSEMOTION:
            position = pygame.mouse.get_pos()
            game_menu.display_menu(fenetre_menu)
            if game_menu.start_game(position):
                game_menu.hand_cursor(position, fenetre_menu)
                pygame.mouse.set_visible(0)
            else:
                pygame.mouse.set_cursor(*pygame.cursors.arrow)
                pygame.mouse.set_visible(1)

        pygame.display.flip()
Пример #11
0
fond = pygame.image.load("../resources/fond.jpg").convert()
screen.blit(fond, (0, 0))

ant = pygame.image.load("../resources/ant.png").convert_alpha()
screen.blit(ant, (20, 20))

perso = pygame.image.load("../resources/perso.png").convert_alpha()

#Green = pygame.Color(255,0,255)

#titre
pygame.display.set_caption("AntsMustDie")

map = MapEdit(20, 20)
edit = Editor(map)

#BOUCLE PRINCIPALE
stop = False

while not stop:
    #affichage de l ecran d accueil
    welcome_screen = pygame.image.load("../resources/welcom_screen.png")
    screen.blit(welcome_screen, (0, 0))

    #Refresh
    pygame.display.flip()

    continue_menu = True

    #BOUCLE MENU
Пример #12
0
output_pickle_path_local = "./detected_faces.pickle"
output_pickle_path_remote ="/home/oop8917/minseok/detected_faces.pickle"
print("==========Upload file start==========")
ssh.directory_upload(input_dataset_path_local, input_dataset_path_remote)
ssh.file_upload(input_video_path_local, input_video_path_remote)
print("==========Upload file done===========")

ssh.ssh_execute("pwd;source ~/.bashrc; source cuda9-env; conda activate cuda9; conda env list; cd minseok; pwd;python main.py -i videos/hacksmall.mp4 -d dataset")
print("==========Donwload file start==========")
ssh.file_download(output_pickle_path_remote, output_pickle_path_local)
print("==========Download file done===========")
'''
#load made pickle file to mosaic list
mosaic_list = pickle.loads(open("sjhalf_detected_faces.pickle", "rb").read())

editor = Editor.Editor(mosaic_list, "videos/sjhalff.mp4")
setEditor(editor)
frame = editor.length
# video processing......
# load all images and videos (with multiple extensions) from a directory using OpenCV
IMAGE_PATH_LIST = [[], [], [], []]

setImgPL(IMAGE_PATH_LIST, frame)

# fill IMAGE_PATH_LIST
search_filedir(INPUT_DIR, -1)
last_img_index = frame
setlasti(last_img_index)

# load class list
with open('class_list.txt') as f:
Пример #13
0
def GetEditor(name):
    """Return the Editor object identified by 'name'"""
    for user in GetEditors():
        e = Editor.Editor(user)
        if e.name == name:
            return e
Пример #14
0
def edit(patient):
    return Editor(patient)
Пример #15
0
 def __init__(self, res):
     SDIMainFrame.__init__(
         self,
         res,
         'MainFrame',
         'songpress',
         'Skeed',
         _('song'),
         'crd',
         _('Songpress - Il Canzonatore'),
         glb.AddPath('img/songpress.ico'),
         glb.VERSION,
         _("http://www.skeed.it/songpress"),
         (_(u"Copyright (c) 2009-{year} Luca Allulli - Skeed\nLocalization:\n{translations}"
            )).format(year=glb.YEAR,
                      translations="\n".join([
                          u"- {}: {}".format(glb.languages[x],
                                             glb.translators[x])
                          for x in glb.languages
                      ])),
         _("Licensed under the terms and conditions of the GNU General Public License, version 2"
           ),
         _("Special thanks to:\n  * The Pyhton programming language (http://www.python.org)\n  * wxWidgets (http://www.wxwidgets.org)\n  * wxPython (http://www.wxpython.org)\n  * Editra (http://editra.org/) (for the error reporting dialog and... the editor itself!)\n  * python-pptx (for PowerPoint export)"
           ),
         _import_formats,
     )
     self.pref = Preferences()
     self.SetDefaultExtension(self.pref.defaultExtension)
     self.text = Editor(self)
     dt = SDIDropTarget(self)
     self.text.SetDropTarget(dt)
     self.frame.Bind(wx.stc.EVT_STC_UPDATEUI, self.OnUpdateUI, self.text)
     # Other objects
     self.previewCanvas = PreviewCanvas(self.frame, self.pref.format,
                                        self.pref.notations,
                                        self.pref.decorator)
     self.AddMainPane(self.text)
     self.AddPane(self.previewCanvas.main_panel,
                  aui.AuiPaneInfo().Right().BestSize(240, 400),
                  _('Preview'), 'preview')
     if self.previewCanvas.link is not None:
         self.previewCanvas.main_panel.Bind(wx.adv.EVT_HYPERLINK,
                                            self.OnCopyAsImage,
                                            self.previewCanvas.link)
     self.mainToolBar = aui.AuiToolBar(self.frame,
                                       wx.ID_ANY,
                                       wx.DefaultPosition,
                                       agwStyle=aui.AUI_TB_PLAIN_BACKGROUND)
     self.mainToolBar.SetToolBitmapSize(wx.Size(16, 16))
     self.AddTool(self.mainToolBar, 'new', 'img/new.png', _("New"),
                  _("Create a new song"))
     self.AddTool(self.mainToolBar, 'open', 'img/open.png', _("Open"),
                  _("Open an existing song"))
     self.AddTool(self.mainToolBar, 'save', 'img/save.png', _("Save"),
                  _("Save song with the current filename"))
     self.mainToolBar.AddSeparator()
     self.undoTool = self.AddTool(self.mainToolBar, 'undo', 'img/undo.png',
                                  _("Undo"), _("Undo last edit"))
     self.redoTool = self.AddTool(self.mainToolBar, 'redo', 'img/redo.png',
                                  _("Redo"),
                                  _("Redo previously undone edit"))
     self.redoTool = wx.xrc.XRCID('redo')
     self.mainToolBar.AddSeparator()
     self.cutTool = self.AddTool(self.mainToolBar, 'cut', 'img/cut.png',
                                 _("Cut"),
                                 _("Move selected text in the clipboard"))
     self.copyTool = self.AddTool(self.mainToolBar, 'copy', 'img/copy.png',
                                  _("Copy"),
                                  _("Copy selected text in the clipboard"))
     self.copyOnlyTextTool = wx.xrc.XRCID('copyOnlyText')
     if platform.system() == 'Windows':
         self.AddTool(
             self.mainToolBar, 'copyAsImage', 'img/copyAsImage2.png',
             _("Copy as Image"),
             _("Copy the whole FORMATTED song (or selected verses) to the clipboard"
               ))
     self.pasteTool = self.AddTool(
         self.mainToolBar, 'paste', 'img/paste.png', _("Paste"),
         _("Read text from the clipboard and place it at the cursor position"
           ))
     self.pasteChordsTool = self.AddTool(
         self.mainToolBar, 'pasteChords', 'img/pasteChords.png',
         _("PasteChords"),
         _("Integrate chords of copied text into current selection"))
     self.mainToolBar.Realize()
     self.mainToolBarPane = self.AddPane(
         self.mainToolBar,
         aui.AuiPaneInfo().ToolbarPane().Top().Row(1).Position(1),
         _('Standard'), 'standard')
     self.formatToolBar = aui.AuiToolBar(
         self.frame, wx.ID_ANY, agwStyle=aui.AUI_TB_PLAIN_BACKGROUND)
     self.formatToolBar.SetExtraStyle(aui.AUI_TB_PLAIN_BACKGROUND)
     self.fontChooser = FontComboBox(self.formatToolBar, -1,
                                     self.pref.format.face)
     self.formatToolBar.AddControl(self.fontChooser)
     self.frame.Bind(wx.EVT_COMBOBOX, self.OnFontSelected, self.fontChooser)
     wx.UpdateUIEvent.SetUpdateInterval(500)
     self.frame.Bind(wx.EVT_UPDATE_UI, self.OnIdle, self.frame)
     self.frame.Bind(wx.EVT_TEXT_CUT, self.OnTextCutCopy, self.text)
     self.frame.Bind(wx.EVT_TEXT_COPY, self.OnTextCutCopy, self.text)
     self.fontChooser.Bind(wx.EVT_TEXT_ENTER, self.OnFontSelected,
                           self.fontChooser)
     self.fontChooser.Bind(wx.EVT_KILL_FOCUS, self.OnFontSelected,
                           self.fontChooser)
     self.AddTool(self.formatToolBar, 'title', 'img/title.png',
                  _("Insert title"),
                  _("Insert a command to display song title"))
     self.AddTool(self.formatToolBar, 'chord', 'img/chord.png',
                  _("Insert chord"),
                  _("Insert square brackets that will host a chord"))
     self.AddTool(self.formatToolBar, 'chorus', 'img/chorus.png',
                  _("Insert chorus"),
                  _("Insert a couple of commands that will contain chorus"))
     self.AddTool(
         self.formatToolBar,
         'verseWithCustomLabelOrWithoutLabel',
         'img/verse.png',
         _("Insert verse with custom label or without label"),
         _("Insert a commands that will display a verse with a custom label"
           ),
     )
     labelVersesTool = self.formatToolBar.AddToggleTool(  # AddToggleTool (agw) or AddTool
         wx.xrc.XRCID('labelVerses'),
         wx.Bitmap(wx.Image(glb.AddPath("img/labelVerses.png"))),
         wx.NullBitmap,
         True,
         None,
         _("Show verse labels"),
         _("Show or hide verse and chorus labels"),
     )
     self.labelVersesToolId = labelVersesTool.GetId()
     showChordsIcon = wx.StaticBitmap(
         self.formatToolBar, -1,
         wx.Bitmap(wx.Image(glb.AddPath('img/showChords.png'))))
     self.formatToolBar.AddControl(showChordsIcon)
     self.showChordsChooser = wx.Slider(self.formatToolBar, -1, 0, 0, 2,
                                        wx.DefaultPosition, (100, -1),
                                        wx.SL_AUTOTICKS | wx.SL_HORIZONTAL)
     tt1 = wx.ToolTip(_("Hide or show chords in formatted song"))
     tt2 = wx.ToolTip(_("Hide or show chords in formatted song"))
     self.showChordsChooser.SetToolTip(tt1)
     showChordsIcon.SetToolTip(tt2)
     self.frame.Bind(wx.EVT_SCROLL, self.OnFontSelected,
                     self.showChordsChooser)
     self.formatToolBar.AddControl(self.showChordsChooser, "pippo")
     self.formatToolBar.Realize()
     self.formatToolBarPane = self.AddPane(
         self.formatToolBar,
         aui.AuiPaneInfo().ToolbarPane().Top().Row(1).Position(2),
         _('Format'), 'format')
     self.BindMyMenu()
     self.frame.Bind(EVT_TEXT_CHANGED, self.OnTextChanged)
     self.exportMenuId = xrc.XRCID('export')
     self.exportToClipboardAsAVectorImage = xrc.XRCID(
         'exportToClipboardAsAVectorImage')
     self.exportAsEmfMenuId = xrc.XRCID('exportAsEmf')
     self.cutMenuId = xrc.XRCID('cut')
     self.copyMenuId = xrc.XRCID('copy')
     self.copyAsImageMenuId = xrc.XRCID('copyAsImage')
     self.pasteMenuId = xrc.XRCID('paste')
     self.pasteChordsMenuId = xrc.XRCID('pasteChords')
     self.removeChordsMenuId = xrc.XRCID('removeChords')
     self.labelVersesMenuId = xrc.XRCID('labelVerses')
     self.noChordsMenuId = xrc.XRCID('noChords')
     self.oneVerseForEachChordPatternMenuId = xrc.XRCID(
         'oneVerseForEachChordPattern')
     self.wholeSongMenuId = xrc.XRCID('wholeSong')
     if platform.system() != 'Windows':
         self.menuBar.GetMenu(0).FindItemById(
             self.exportMenuId).GetSubMenu().Delete(
                 self.exportToClipboardAsAVectorImage)
         self.menuBar.GetMenu(1).Delete(self.copyAsImageMenuId)
         self.menuBar.GetMenu(0).FindItemById(
             self.exportMenuId).GetSubMenu().Delete(self.exportAsEmfMenuId)
     self.findReplaceDialog = None
     self.CheckLabelVerses()
     self.SetFont()
     self.text.SetFont(self.pref.editorFace, self.pref.editorSize)
     self.FinalizePaneInitialization()
     # Reassign caption value to override caption saved in preferences (it could be another language)
     self._mgr.GetPane('preview').caption = _('Preview')
     self._mgr.GetPane('standard').caption = _('Standard')
     self._mgr.GetPane('format').caption = _('Format')
     if 'firstTimeEasyKey' in self.pref.notices:
         msg = _(
             "You are not a skilled guitarist? Songpress can help you: when you open a song, it can detect if chords are difficult. If this is the case, Songpress will alert you, and offer to transpose your song to the easiest key, automatically.\n\nDo you want to turn this option on?"
         )
         d = wx.MessageDialog(self.frame, msg, _("Songpress"),
                              wx.YES_NO | wx.ICON_QUESTION)
         if d.ShowModal() == wx.ID_YES:
             self.pref.autoAdjustEasyKey = True
             msg = _(
                 "Please take a minute to set up your skill as a guitarist. For each group of chords, tell Songpress how much you like them."
             )
             d = wx.MessageDialog(self.frame, msg, _("Songpress"), wx.OK)
             d.ShowModal()
             f = MyPreferencesDialog(self.frame, self.pref, easyChords)
             f.notebook.SetSelection(1)
             if f.ShowModal() == wx.ID_OK:
                 self.text.SetFont(self.pref.editorFace,
                                   int(self.pref.editorSize))
                 self.SetDefaultExtension(self.pref.defaultExtension)
     MyUpdateDialog.check_and_update(self.frame, self.pref)
     self.frame.Maximize(True)
Пример #16
0
    def __init__(self, parent):
        wx.Dialog.__init__(self,
                           parent,
                           id=wx.ID_ANY,
                           title=_(u"Songpress options"),
                           pos=wx.DefaultPosition,
                           size=wx.Size(535, 500),
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)

        bSizer10 = wx.BoxSizer(wx.VERTICAL)

        self.notebook = wx.Notebook(self, wx.ID_ANY, wx.DefaultPosition,
                                    wx.DefaultSize, 0)
        self.general = wx.Panel(self.notebook, wx.ID_ANY, wx.DefaultPosition,
                                wx.DefaultSize, wx.TAB_TRAVERSAL)
        bSizer11 = wx.BoxSizer(wx.VERTICAL)

        bSizer12 = wx.BoxSizer(wx.HORIZONTAL)

        self.label1 = wx.StaticText(self.general, wx.ID_ANY, _(u"Editor font"),
                                    wx.DefaultPosition, wx.DefaultSize, 0)
        self.label1.Wrap(-1)
        bSizer12.Add(self.label1, 0, wx.ALL, 5)

        self.fontCB = FontComboBox(self.general, wx.ID_ANY,
                                   self.pref.editorFace)
        bSizer12.Add(self.fontCB, 1, wx.ALL, 5)

        self.m_staticText8 = wx.StaticText(self.general, wx.ID_ANY, _(u"Size"),
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText8.Wrap(-1)
        bSizer12.Add(self.m_staticText8, 0, wx.ALL, 5)

        sizeCBChoices = [
            _(u"7"),
            _(u"8"),
            _(u"9"),
            _(u"10"),
            _(u"11"),
            _(u"12"),
            _(u"13"),
            _(u"14"),
            _(u"16"),
            _(u"18"),
            _(u"20")
        ]
        self.sizeCB = wx.ComboBox(self.general, wx.ID_ANY, _(u"12"),
                                  wx.DefaultPosition, wx.DefaultSize,
                                  sizeCBChoices, 0)
        self.sizeCB.SetMinSize(wx.Size(100, -1))

        bSizer12.Add(self.sizeCB, 0, wx.ALL, 5)

        bSizer11.Add(bSizer12, 0, wx.EXPAND, 5)

        bSizer13 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText9 = wx.StaticText(self.general, wx.ID_ANY,
                                           _(u"Preview"), wx.DefaultPosition,
                                           wx.DefaultSize, 0)
        self.m_staticText9.Wrap(-1)
        bSizer13.Add(self.m_staticText9, 0, wx.ALL, 5)

        self.editor = Editor.Editor(self.general, False, self.general)
        bSizer13.Add(self.editor, 1, wx.ALL | wx.EXPAND, 5)

        bSizer11.Add(bSizer13, 1, wx.EXPAND, 5)

        bSizer141 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText101 = wx.StaticText(self.general, wx.ID_ANY,
                                             _(u"Default notation"),
                                             wx.DefaultPosition,
                                             wx.DefaultSize, 0)
        self.m_staticText101.Wrap(-1)
        bSizer141.Add(self.m_staticText101, 0, wx.ALL, 5)

        notationChChoices = []
        self.notationCh = wx.Choice(self.general, wx.ID_ANY,
                                    wx.DefaultPosition, wx.DefaultSize,
                                    notationChChoices, 0)
        self.notationCh.SetSelection(0)
        bSizer141.Add(self.notationCh, 1, wx.ALL, 5)

        bSizer11.Add(bSizer141, 0, wx.EXPAND, 5)

        bSizer1411 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText1011 = wx.StaticText(self.general, wx.ID_ANY,
                                              _(u"Check for updates every"),
                                              wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        self.m_staticText1011.Wrap(-1)
        bSizer1411.Add(self.m_staticText1011, 0, wx.ALL, 5)

        frequencyChoices = []
        self.frequency = wx.Choice(self.general, wx.ID_ANY, wx.DefaultPosition,
                                   wx.DefaultSize, frequencyChoices, 0)
        self.frequency.SetSelection(0)
        bSizer1411.Add(self.frequency, 1, wx.ALL, 5)

        bSizer11.Add(bSizer1411, 0, wx.EXPAND, 5)

        bSizer1412 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText1012 = wx.StaticText(self.general, wx.ID_ANY,
                                              _(u"Default file extension"),
                                              wx.DefaultPosition,
                                              wx.DefaultSize, 0)
        self.m_staticText1012.Wrap(-1)
        bSizer1412.Add(self.m_staticText1012, 0, wx.ALL, 5)

        extensionChoices = []
        self.extension = wx.Choice(self.general, wx.ID_ANY, wx.DefaultPosition,
                                   wx.DefaultSize, extensionChoices, 0)
        self.extension.SetSelection(0)
        bSizer1412.Add(self.extension, 1, wx.ALL, 5)

        bSizer11.Add(bSizer1412, 0, wx.EXPAND, 5)

        bSizer14 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText10 = wx.StaticText(self.general, wx.ID_ANY,
                                            _(u"Language"), wx.DefaultPosition,
                                            wx.DefaultSize, 0)
        self.m_staticText10.Wrap(-1)
        bSizer14.Add(self.m_staticText10, 0, wx.ALL, 5)

        langChChoices = []
        self.langCh = wx.Choice(self.general, wx.ID_ANY, wx.DefaultPosition,
                                wx.DefaultSize, langChChoices, 0)
        self.langCh.SetSelection(0)
        bSizer14.Add(self.langCh, 1, wx.ALL, 5)

        bSizer11.Add(bSizer14, 0, wx.EXPAND, 5)

        self.general.SetSizer(bSizer11)
        self.general.Layout()
        bSizer11.Fit(self.general)
        self.notebook.AddPage(self.general, _(u"General"), True)
        self.autoAdjust = wx.Panel(self.notebook, wx.ID_ANY,
                                   wx.DefaultPosition, wx.DefaultSize,
                                   wx.TAB_TRAVERSAL)
        bSizer18 = wx.BoxSizer(wx.VERTICAL)

        self.autoRemoveBlankLines = wx.CheckBox(
            self.autoAdjust, wx.ID_ANY, _(u"Offer to remove blank lines"),
            wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer18.Add(self.autoRemoveBlankLines, 0, wx.ALL, 5)

        self.autoTab2Chordpro = wx.CheckBox(
            self.autoAdjust, wx.ID_ANY, _(u"Offer to convert songs in tab"),
            wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer18.Add(self.autoTab2Chordpro, 0, wx.ALL, 5)

        self.autoAdjustEasyKey = wx.CheckBox(
            self.autoAdjust, wx.ID_ANY,
            _(u"Offer to transpose songs to simplify chords"),
            wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer18.Add(self.autoAdjustEasyKey, 0, wx.ALL, 5)

        self.simplifyPanel = wx.ScrolledWindow(
            self.autoAdjust, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize,
            wx.HSCROLL | wx.SUNKEN_BORDER | wx.VSCROLL)
        self.simplifyPanel.SetScrollRate(5, 5)
        self.simplifyPanel.SetBackgroundColour(
            wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))

        bSizer18.Add(self.simplifyPanel, 1, wx.EXPAND | wx.ALL, 5)

        self.autoAdjust.SetSizer(bSizer18)
        self.autoAdjust.Layout()
        bSizer18.Fit(self.autoAdjust)
        self.notebook.AddPage(self.autoAdjust, _(u"AutoAdjust"), False)

        bSizer10.Add(self.notebook, 1, wx.EXPAND | wx.ALL, 5)

        m_sdbSizer3 = wx.StdDialogButtonSizer()
        self.m_sdbSizer3OK = wx.Button(self, wx.ID_OK)
        m_sdbSizer3.AddButton(self.m_sdbSizer3OK)
        self.m_sdbSizer3Cancel = wx.Button(self, wx.ID_CANCEL)
        m_sdbSizer3.AddButton(self.m_sdbSizer3Cancel)
        m_sdbSizer3.Realize()

        bSizer10.Add(m_sdbSizer3, 0, wx.ALL | wx.EXPAND, 5)

        self.SetSizer(bSizer10)
        self.Layout()

        self.Centre(wx.BOTH)

        # Connect Events
        self.fontCB.Bind(wx.EVT_KILL_FOCUS, self.OnFontSelected)
        self.sizeCB.Bind(wx.EVT_COMBOBOX, self.OnFontSelected)
        self.sizeCB.Bind(wx.EVT_KILL_FOCUS, self.OnFontSelected)
        self.sizeCB.Bind(wx.EVT_TEXT_ENTER, self.OnFontSelected)
        self.m_sdbSizer3OK.Bind(wx.EVT_BUTTON, self.OnOk)