Beispiel #1
0
    def __init__(self, parent, id = -1, pos=wx.wxPyDefaultPosition,
                 size=wx.wxPyDefaultSize, **attr):
        wx.wxWindow.__init__(self, parent, id, pos,size)
        wx.EVT_PAINT(self,self.on_paint)
        property_object.__init__(self, attr)
        background = wx.wxNamedColour(self.background_color)
        self.SetBackgroundColour(background)
        ##self.title = text_object('')
        ##self.x_title = text_object('')
        ##self.y_title = text_object('')
        self.title = text_window(self,'')
        self.x_title = text_window(self,'')
        self.y_title = text_window(self,'')
        self.all_titles = [self.title,self.x_title,self.y_title] #handy to have
        ##self.x_axis = axis_object(graph_location='above',rotate=0)
        ##self.y_axis = axis_object(graph_location='right',rotate=90)
        self.x_axis = axis_window(self,graph_location='above',rotate=0)
        self.y_axis = axis_window(self,graph_location='right',rotate=90)

        self.image_list = graphic_list()
        self.line_list = auto_line_list()  # make this the data object.
        self.legend = legend_object()
        self.text_list = None  # list of text objects to place on screen
        self.overlays = None   # list of objects to draw on top of graph
                               # (boxes, circles, etc.)
        ##self.y2_axis = axis_object(graph_location='left',rotate=90)
        self.client_size = (0,0)
        # zoom selection helpers
        self._mouse_selection = 0
        self._mouse_selection_start = wx.wxPoint(0,0)
        self._mouse_selection_stop = wx.wxPoint(0,0)
        # mouse events
        wx.EVT_RIGHT_DOWN(self,self.on_right_down)
        wx.EVT_LEFT_DOWN(self, self.on_mouse_event)
        wx.EVT_LEFT_UP(self, self.on_mouse_event)
        wx.EVT_MOTION(self, self.on_mouse_event)
        wx.EVT_MOTION(self, self.on_mouse_event)
        wx.EVT_SIZE(self, self.update)
Beispiel #2
0
    def __init__(self):
        frame = wx.wxFrame(None, -1, 'BitTorrent Torrent File Maker',
                           size=wx.wxSize(550, 410))
        self.frame = frame

        panel = wx.wxPanel(frame, -1)

        gridSizer = wx.wxFlexGridSizer(cols=2, rows=2, vgap=0, hgap=8)

        gridSizer.Add(wx.wxStaticText(panel, -1, 'make torrent of:'))

        b = wx.wxBoxSizer(wx.wxHORIZONTAL)
        self.dirCtl = wx.wxTextCtrl(panel, -1, '')
        b.Add(self.dirCtl, 1, wx.wxEXPAND)
#        b.Add(10, 10, 0, wxEXPAND)

        button = wx.wxButton(panel, -1, 'dir', size=(30, 20))
        wx.EVT_BUTTON(frame, button.GetId(), self.selectdir)
        b.Add(button, 0)

        button2 = wx.wxButton(panel, -1, 'file', size=(30, 20))
        wx.EVT_BUTTON(frame, button2.GetId(), self.selectfile)
        b.Add(button2, 0)

        gridSizer.Add(b, 0, wx.wxEXPAND)
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))

        gridSizer.Add(wx.wxStaticText(panel, -1, 'announce url:'))
        self.annCtl = wx.wxTextCtrl(panel, -1,
                                    'http://my.tracker:6969/announce')
        gridSizer.Add(self.annCtl, 0, wx.wxEXPAND)
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))

        a = wx.wxFlexGridSizer(cols=1)
        a.Add(wx.wxStaticText(panel, -1, 'announce list:'))
        a.Add(wx.wxStaticText(panel, -1, ''))
        abutton = wx.wxButton(panel, -1, 'copy\nannounces\nfrom\ntorrent',
                              size=(50, 70))
        wx.EVT_BUTTON(frame, abutton.GetId(), self.announcecopy)
        a.Add(abutton, 0, wx.wxEXPAND)
        gridSizer.Add(a, 0, wx.wxEXPAND)

        self.annListCtl = wx.wxTextCtrl(
            panel, -1, '\n\n\n\n\n', wx.wxPoint(-1, -1), (400, 120),
            wx.wxTE_MULTILINE | wx.wxHSCROLL | wx.wxTE_DONTWRAP)
        gridSizer.Add(self.annListCtl, -1, wx.wxEXPAND)

        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        exptext = wx.wxStaticText(
            panel, -1, 'a list of announces separated by commas or whitespace '
            'and on several lines -\ntrackers on the same line will be tried '
            'randomly, and all the trackers on one line\nwill be tried before '
            'the trackers on the next line.')
        exptext.SetFont(wx.wxFont(6, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL,
                                  False))
        gridSizer.Add(exptext)

        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))

        gridSizer.Add(wx.wxStaticText(panel, -1, 'piece size:'))
        self.piece_length = wx.wxChoice(
            panel, -1, choices=['automatic', '2MiB', '1MiB', '512KiB',
                                '256KiB', '128KiB', '64KiB', '32KiB'])
        self.piece_length_list = [0, 21, 20, 19, 18, 17, 16, 15]
        self.piece_length.SetSelection(0)
        gridSizer.Add(self.piece_length)

        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))

        gridSizer.Add(wx.wxStaticText(panel, -1, 'comment:'))
        self.commentCtl = wx.wxTextCtrl(panel, -1, '')
        gridSizer.Add(self.commentCtl, 0, wx.wxEXPAND)

        gridSizer.AddGrowableCol(1)

        border = wx.wxBoxSizer(wx.wxVERTICAL)
        border.Add(gridSizer, 0,
                   wx.wxEXPAND | wx.wxNORTH | wx.wxEAST | wx.wxWEST, 25)
        b2 = wx.wxButton(panel, -1, 'make')
#        border.Add(10, 10, 1, wxEXPAND)
        border.Add(b2, 0, wx.wxALIGN_CENTER | wx.wxSOUTH, 20)
        wx.EVT_BUTTON(frame, b2.GetId(), self.complete)
        panel.SetSizer(border)
        panel.SetAutoLayout(True)
Beispiel #3
0
    def __init__(self, config, calls):
        self.config = config
        self.calls = calls

        self.uiflag = threading.Event()
        self.cancelflag = threading.Event()
        self.switchlock = threading.Lock()
        self.working = False
        self.queue = []
        wx.wxInitAllImageHandlers()
        self.thostselection = self.calls['getCurrentTHost']()
        self.thostselectnum = 0
        self.choices = None
        self.choices1 = None

        self.windowStyle = wx.wxSYSTEM_MENU | wx.wxCAPTION | wx.wxMINIMIZE_BOX
        if self.config['stayontop']:
            self.windowStyle |= wx.wxSTAY_ON_TOP
        frame = wx.wxFrame(None,
                           -1,
                           'T-Make',
                           size=wx.wxSize(-1, -1),
                           style=self.windowStyle)
        self.frame = frame
        panel = wx.wxPanel(frame, -1)

        fullSizer = wx.wxFlexGridSizer(cols=1, vgap=0, hgap=8)

        colSizer = wx.wxFlexGridSizer(cols=2, vgap=0, hgap=8)
        leftSizer = wx.wxFlexGridSizer(cols=1, vgap=3)

        self.stayontop_checkbox = wx.wxCheckBox(panel, -1, "stay on top")
        self.stayontop_checkbox.SetValue(self.config['stayontop'])
        wx.EVT_CHECKBOX(frame, self.stayontop_checkbox.GetId(),
                        self.setstayontop)
        leftSizer.Add(self.stayontop_checkbox, -1, wx.wxALIGN_CENTER)
        leftSizer.Add(wx.wxStaticText(panel, -1, ''))

        button = wx.wxButton(panel, -1, 'use image...')
        wx.EVT_BUTTON(frame, button.GetId(), self.selectDropTarget)
        leftSizer.Add(button, -1, wx.wxALIGN_CENTER)

        self.groupSizer1Box = wx.wxStaticBox(panel, -1, '')
        groupSizer1 = wx.wxStaticBoxSizer(self.groupSizer1Box, wx.wxHORIZONTAL)
        groupSizer = wx.wxFlexGridSizer(cols=1, vgap=0)
        self.dropTarget = self.calls['newDropTarget']((200, 200))
        #        self.dropTarget = self.calls['newDropTarget']()
        self.dropTargetPtr = wx.wxStaticBitmap(panel, -1, self.dropTarget)
        self.calls['setDropTargetRefresh'](self.dropTargetPtr.Refresh)
        self.dropTargetWidth = self.dropTarget.GetWidth()
        wx.EVT_LEFT_DOWN(self.dropTargetPtr, self.dropTargetClick)
        wx.EVT_ENTER_WINDOW(self.dropTargetPtr,
                            self.calls['dropTargetHovered'])
        wx.EVT_LEAVE_WINDOW(self.dropTargetPtr,
                            self.calls['dropTargetUnhovered'])
        groupSizer.Add(self.dropTargetPtr, 0, wx.wxALIGN_CENTER)
        lowerSizer1 = wx.wxGridSizer(cols=3)
        dirlink = wx.wxStaticText(panel, -1, 'dir')
        dirlink.SetFont(
            wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, True))
        dirlink.SetForegroundColour('blue')
        wx.EVT_LEFT_UP(dirlink, self.selectdir)
        lowerSizer1.Add(dirlink, -1, wx.wxALIGN_LEFT)
        lowerSizer1.Add(wx.wxStaticText(panel, -1, ''), -1, wx.wxALIGN_CENTER)
        filelink = wx.wxStaticText(panel, -1, 'file')
        filelink.SetFont(
            wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, True))
        filelink.SetForegroundColour('blue')
        wx.EVT_LEFT_UP(filelink, self.selectfile)
        lowerSizer1.Add(filelink, -1, wx.wxALIGN_RIGHT)

        groupSizer.Add(lowerSizer1, -1, wx.wxALIGN_CENTER)

        self.gauge = wx.wxGauge(panel,
                                -1,
                                range=1000,
                                style=wx.wxGA_HORIZONTAL,
                                size=(-1, 15))
        groupSizer.Add(self.gauge, 0, wx.wxEXPAND)
        self.statustext = wx.wxStaticText(panel,
                                          -1,
                                          'ready',
                                          style=wx.wxALIGN_CENTER
                                          | wx.wxST_NO_AUTORESIZE)
        self.statustext.SetFont(
            wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxBOLD, False))
        groupSizer.Add(self.statustext, -1, wx.wxEXPAND)
        self.choices = wx.wxChoice(panel,
                                   -1, (-1, -1), (self.dropTargetWidth, -1),
                                   choices=[])
        self.choices.SetFont(
            wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, False))
        wx.EVT_CHOICE(self.choices, -1, self.set_thost)
        groupSizer.Add(self.choices, 0, wx.wxEXPAND)
        cancellink = wx.wxStaticText(panel, -1, 'cancel')
        cancellink.SetFont(
            wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, True))
        cancellink.SetForegroundColour('red')
        wx.EVT_LEFT_UP(cancellink, self.cancel)
        groupSizer.Add(cancellink, -1, wx.wxALIGN_CENTER)
        dummyadvlink = wx.wxStaticText(panel, -1, 'advanced')
        dummyadvlink.SetFont(
            wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, False))
        dummyadvlink.SetForegroundColour('blue')
        wx.EVT_LEFT_UP(dirlink, self.selectdir)
        groupSizer.Add(dummyadvlink, -1, wx.wxALIGN_CENTER)
        groupSizer1.Add(groupSizer)
        leftSizer.Add(groupSizer1, -1, wx.wxALIGN_CENTER)

        leftSizer.Add(wx.wxStaticText(panel, -1, 'make torrent of:'), 0,
                      wx.wxALIGN_CENTER)

        self.dirCtl = wx.wxTextCtrl(panel, -1, '', size=(250, -1))
        leftSizer.Add(self.dirCtl, 1, wx.wxEXPAND)

        b = wx.wxBoxSizer(wx.wxHORIZONTAL)
        button = wx.wxButton(panel, -1, 'dir')
        wx.EVT_BUTTON(frame, button.GetId(), self.selectdir)
        b.Add(button, 0)

        button2 = wx.wxButton(panel, -1, 'file')
        wx.EVT_BUTTON(frame, button2.GetId(), self.selectfile)
        b.Add(button2, 0)

        leftSizer.Add(b, 0, wx.wxALIGN_CENTER)

        leftSizer.Add(wx.wxStaticText(panel, -1, ''))

        simple_link = wx.wxStaticText(panel, -1, 'back to basic mode')
        simple_link.SetFont(
            wx.wxFont(-1, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, True))
        simple_link.SetForegroundColour('blue')
        wx.EVT_LEFT_UP(simple_link, self.calls['switchToBasic'])
        leftSizer.Add(simple_link, -1, wx.wxALIGN_CENTER)

        colSizer.Add(leftSizer, -1, wx.wxALIGN_CENTER_VERTICAL)

        gridSizer = wx.wxFlexGridSizer(cols=2, vgap=6, hgap=8)

        gridSizer.Add(wx.wxStaticText(panel, -1, 'Torrent host:'), -1,
                      wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)

        self.choices1 = wx.wxChoice(panel, -1, (-1, -1), (-1, -1), choices=[])
        wx.EVT_CHOICE(self.choices1, -1, self.set_thost1)
        gridSizer.Add(self.choices1, 0, wx.wxEXPAND)

        b = wx.wxBoxSizer(wx.wxHORIZONTAL)
        button1 = wx.wxButton(panel, -1, 'set default')
        wx.EVT_BUTTON(frame, button1.GetId(), self.set_default_thost)
        b.Add(button1, 0)
        b.Add(wx.wxStaticText(panel, -1, '       '))
        button2 = wx.wxButton(panel, -1, 'delete')
        wx.EVT_BUTTON(frame, button2.GetId(), self.delete_thost)
        b.Add(button2, 0)
        b.Add(wx.wxStaticText(panel, -1, '       '))
        button3 = wx.wxButton(panel, -1, 'save as...')
        wx.EVT_BUTTON(frame, button3.GetId(), self.save_thost)
        b.Add(button3, 0)

        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        gridSizer.Add(b, 0, wx.wxALIGN_CENTER)

        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))

        gridSizer.Add(wx.wxStaticText(panel, -1, 'single tracker url:'), 0,
                      wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)
        self.annCtl = wx.wxTextCtrl(panel, -1,
                                    'http://my.tracker:6969/announce')
        gridSizer.Add(self.annCtl, 0, wx.wxEXPAND)

        a = wx.wxFlexGridSizer(cols=1, vgap=3)
        a.Add(wx.wxStaticText(panel, -1, 'tracker list:'), 0, wx.wxALIGN_RIGHT)
        a.Add(wx.wxStaticText(panel, -1, ''))
        abutton = wx.wxButton(panel,
                              -1,
                              'copy\nannounces\nfrom\ntorrent',
                              size=(70, 70))
        wx.EVT_BUTTON(frame, abutton.GetId(), self.announcecopy)
        a.Add(abutton, -1, wx.wxALIGN_CENTER)
        a.Add(wx.wxStaticText(panel, -1, DROP_HERE), -1, wx.wxALIGN_CENTER)
        gridSizer.Add(a, -1, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)

        self.annListCtl = wx.wxTextCtrl(
            panel, -1, '\n\n\n\n\n', wx.wxPoint(-1, -1), (300, 120),
            wx.wxTE_MULTILINE | wx.wxHSCROLL | wx.wxTE_DONTWRAP)
        gridSizer.Add(self.annListCtl, -1, wx.wxEXPAND)

        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        exptext = wx.wxStaticText(
            panel, -1, 'a list of tracker urls separated by commas or '
            'whitespace\nand on several lines -trackers on the same line will '
            'be\ntried randomly, and all the trackers on one line\nwill be '
            'tried before the trackers on the next line.')
        exptext.SetFont(
            wx.wxFont(6, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, False))
        gridSizer.Add(exptext, -1, wx.wxALIGN_CENTER)

        self.refresh_thostlist()
        self._set_thost()

        if sys.platform == 'win32':
            self.dropTargetPtr.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(self.dropTargetPtr, self.selectdrop)
            self.groupSizer1Box.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(self.groupSizer1Box, self.selectdrop)
            abutton.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(abutton, self.announcedrop)
            self.annCtl.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(self.annCtl, self.announcedrop)
            self.annListCtl.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(self.annListCtl, self.announcedrop)

        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))

        gridSizer.Add(wx.wxStaticText(panel, -1, 'piece size:'), 0,
                      wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)
        self.piece_length = wx.wxChoice(panel,
                                        -1,
                                        choices=[
                                            'automatic', '2MiB', '1MiB',
                                            '512KiB', '256KiB', '128KiB',
                                            '64KiB', '32KiB'
                                        ])
        self.piece_length_list = [0, 21, 20, 19, 18, 17, 16, 15]
        self.piece_length.SetSelection(0)
        gridSizer.Add(self.piece_length)

        gridSizer.Add(wx.wxStaticText(panel, -1, 'comment:'), 0,
                      wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)
        self.commentCtl = wx.wxTextCtrl(panel, -1, '')
        gridSizer.Add(self.commentCtl, 0, wx.wxEXPAND)

        gridSizer.Add(wx.wxStaticText(panel, -1, ''))
        gridSizer.Add(wx.wxStaticText(panel, -1, ''))

        b1 = wx.wxButton(panel, -1, 'Cancel', size=(-1, 30))
        wx.EVT_BUTTON(frame, b1.GetId(), self.cancel)
        gridSizer.Add(b1, 0, wx.wxEXPAND)
        b2 = wx.wxButton(panel, -1, 'MAKE TORRENT', size=(-1, 30))
        wx.EVT_BUTTON(frame, b2.GetId(), self.complete)
        gridSizer.Add(b2, 0, wx.wxEXPAND)

        gridSizer.AddGrowableCol(1)
        colSizer.Add(gridSizer, -1, wx.wxALIGN_CENTER_VERTICAL)
        fullSizer.Add(colSizer)

        border = wx.wxBoxSizer(wx.wxHORIZONTAL)
        border.Add(fullSizer, 1, wx.wxEXPAND | wx.wxALL, 15)
        panel.SetSizer(border)
        panel.SetAutoLayout(True)
        border.Fit(panel)
        frame.Fit()
        frame.Show(True)

        EVT_INVOKE(frame, self.onInvoke)
        wx.EVT_CLOSE(frame, self._close)
Beispiel #4
0
    def __init__(self, config, calls):
        self.config = config
        self.calls = calls

        self.uiflag = threading.Event()
        self.cancelflag = threading.Event()
        self.switchlock = threading.Lock()
        self.working = False
        self.queue = []
        wx.wxInitAllImageHandlers()
        self.thostselection = self.calls["getCurrentTHost"]()
        self.thostselectnum = 0
        self.choices = None
        self.choices1 = None

        self.windowStyle = wx.wxSYSTEM_MENU | wx.wxCAPTION | wx.wxMINIMIZE_BOX
        if self.config["stayontop"]:
            self.windowStyle |= wx.wxSTAY_ON_TOP
        frame = wx.wxFrame(None, -1, "T-Make", size=wx.wxSize(-1, -1), style=self.windowStyle)
        self.frame = frame
        panel = wx.wxPanel(frame, -1)

        fullSizer = wx.wxFlexGridSizer(cols=1, vgap=0, hgap=8)

        colSizer = wx.wxFlexGridSizer(cols=2, vgap=0, hgap=8)
        leftSizer = wx.wxFlexGridSizer(cols=1, vgap=3)

        self.stayontop_checkbox = wx.wxCheckBox(panel, -1, "stay on top")
        self.stayontop_checkbox.SetValue(self.config["stayontop"])
        wx.EVT_CHECKBOX(frame, self.stayontop_checkbox.GetId(), self.setstayontop)
        leftSizer.Add(self.stayontop_checkbox, -1, wx.wxALIGN_CENTER)
        leftSizer.Add(wx.wxStaticText(panel, -1, ""))

        button = wx.wxButton(panel, -1, "use image...")
        wx.EVT_BUTTON(frame, button.GetId(), self.selectDropTarget)
        leftSizer.Add(button, -1, wx.wxALIGN_CENTER)

        self.groupSizer1Box = wx.wxStaticBox(panel, -1, "")
        groupSizer1 = wx.wxStaticBoxSizer(self.groupSizer1Box, wx.wxHORIZONTAL)
        groupSizer = wx.wxFlexGridSizer(cols=1, vgap=0)
        self.dropTarget = self.calls["newDropTarget"]((200, 200))
        #        self.dropTarget = self.calls['newDropTarget']()
        self.dropTargetPtr = wx.wxStaticBitmap(panel, -1, self.dropTarget)
        self.calls["setDropTargetRefresh"](self.dropTargetPtr.Refresh)
        self.dropTargetWidth = self.dropTarget.GetWidth()
        wx.EVT_LEFT_DOWN(self.dropTargetPtr, self.dropTargetClick)
        wx.EVT_ENTER_WINDOW(self.dropTargetPtr, self.calls["dropTargetHovered"])
        wx.EVT_LEAVE_WINDOW(self.dropTargetPtr, self.calls["dropTargetUnhovered"])
        groupSizer.Add(self.dropTargetPtr, 0, wx.wxALIGN_CENTER)
        lowerSizer1 = wx.wxGridSizer(cols=3)
        dirlink = wx.wxStaticText(panel, -1, "dir")
        dirlink.SetFont(wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, True))
        dirlink.SetForegroundColour("blue")
        wx.EVT_LEFT_UP(dirlink, self.selectdir)
        lowerSizer1.Add(dirlink, -1, wx.wxALIGN_LEFT)
        lowerSizer1.Add(wx.wxStaticText(panel, -1, ""), -1, wx.wxALIGN_CENTER)
        filelink = wx.wxStaticText(panel, -1, "file")
        filelink.SetFont(wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, True))
        filelink.SetForegroundColour("blue")
        wx.EVT_LEFT_UP(filelink, self.selectfile)
        lowerSizer1.Add(filelink, -1, wx.wxALIGN_RIGHT)

        groupSizer.Add(lowerSizer1, -1, wx.wxALIGN_CENTER)

        self.gauge = wx.wxGauge(panel, -1, range=1000, style=wx.wxGA_HORIZONTAL, size=(-1, 15))
        groupSizer.Add(self.gauge, 0, wx.wxEXPAND)
        self.statustext = wx.wxStaticText(panel, -1, "ready", style=wx.wxALIGN_CENTER | wx.wxST_NO_AUTORESIZE)
        self.statustext.SetFont(wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxBOLD, False))
        groupSizer.Add(self.statustext, -1, wx.wxEXPAND)
        self.choices = wx.wxChoice(panel, -1, (-1, -1), (self.dropTargetWidth, -1), choices=[])
        self.choices.SetFont(wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, False))
        wx.EVT_CHOICE(self.choices, -1, self.set_thost)
        groupSizer.Add(self.choices, 0, wx.wxEXPAND)
        cancellink = wx.wxStaticText(panel, -1, "cancel")
        cancellink.SetFont(wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, True))
        cancellink.SetForegroundColour("red")
        wx.EVT_LEFT_UP(cancellink, self.cancel)
        groupSizer.Add(cancellink, -1, wx.wxALIGN_CENTER)
        dummyadvlink = wx.wxStaticText(panel, -1, "advanced")
        dummyadvlink.SetFont(wx.wxFont(7, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, False))
        dummyadvlink.SetForegroundColour("blue")
        wx.EVT_LEFT_UP(dirlink, self.selectdir)
        groupSizer.Add(dummyadvlink, -1, wx.wxALIGN_CENTER)
        groupSizer1.Add(groupSizer)
        leftSizer.Add(groupSizer1, -1, wx.wxALIGN_CENTER)

        leftSizer.Add(wx.wxStaticText(panel, -1, "make torrent of:"), 0, wx.wxALIGN_CENTER)

        self.dirCtl = wx.wxTextCtrl(panel, -1, "", size=(250, -1))
        leftSizer.Add(self.dirCtl, 1, wx.wxEXPAND)

        b = wx.wxBoxSizer(wx.wxHORIZONTAL)
        button = wx.wxButton(panel, -1, "dir")
        wx.EVT_BUTTON(frame, button.GetId(), self.selectdir)
        b.Add(button, 0)

        button2 = wx.wxButton(panel, -1, "file")
        wx.EVT_BUTTON(frame, button2.GetId(), self.selectfile)
        b.Add(button2, 0)

        leftSizer.Add(b, 0, wx.wxALIGN_CENTER)

        leftSizer.Add(wx.wxStaticText(panel, -1, ""))

        simple_link = wx.wxStaticText(panel, -1, "back to basic mode")
        simple_link.SetFont(wx.wxFont(-1, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, True))
        simple_link.SetForegroundColour("blue")
        wx.EVT_LEFT_UP(simple_link, self.calls["switchToBasic"])
        leftSizer.Add(simple_link, -1, wx.wxALIGN_CENTER)

        colSizer.Add(leftSizer, -1, wx.wxALIGN_CENTER_VERTICAL)

        gridSizer = wx.wxFlexGridSizer(cols=2, vgap=6, hgap=8)

        gridSizer.Add(wx.wxStaticText(panel, -1, "Torrent host:"), -1, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)

        self.choices1 = wx.wxChoice(panel, -1, (-1, -1), (-1, -1), choices=[])
        wx.EVT_CHOICE(self.choices1, -1, self.set_thost1)
        gridSizer.Add(self.choices1, 0, wx.wxEXPAND)

        b = wx.wxBoxSizer(wx.wxHORIZONTAL)
        button1 = wx.wxButton(panel, -1, "set default")
        wx.EVT_BUTTON(frame, button1.GetId(), self.set_default_thost)
        b.Add(button1, 0)
        b.Add(wx.wxStaticText(panel, -1, "       "))
        button2 = wx.wxButton(panel, -1, "delete")
        wx.EVT_BUTTON(frame, button2.GetId(), self.delete_thost)
        b.Add(button2, 0)
        b.Add(wx.wxStaticText(panel, -1, "       "))
        button3 = wx.wxButton(panel, -1, "save as...")
        wx.EVT_BUTTON(frame, button3.GetId(), self.save_thost)
        b.Add(button3, 0)

        gridSizer.Add(wx.wxStaticText(panel, -1, ""))
        gridSizer.Add(b, 0, wx.wxALIGN_CENTER)

        gridSizer.Add(wx.wxStaticText(panel, -1, ""))
        gridSizer.Add(wx.wxStaticText(panel, -1, ""))

        gridSizer.Add(
            wx.wxStaticText(panel, -1, "single tracker url:"), 0, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL
        )
        self.annCtl = wx.wxTextCtrl(panel, -1, "http://my.tracker:6969/announce")
        gridSizer.Add(self.annCtl, 0, wx.wxEXPAND)

        a = wx.wxFlexGridSizer(cols=1, vgap=3)
        a.Add(wx.wxStaticText(panel, -1, "tracker list:"), 0, wx.wxALIGN_RIGHT)
        a.Add(wx.wxStaticText(panel, -1, ""))
        abutton = wx.wxButton(panel, -1, "copy\nannounces\nfrom\ntorrent", size=(70, 70))
        wx.EVT_BUTTON(frame, abutton.GetId(), self.announcecopy)
        a.Add(abutton, -1, wx.wxALIGN_CENTER)
        a.Add(wx.wxStaticText(panel, -1, DROP_HERE), -1, wx.wxALIGN_CENTER)
        gridSizer.Add(a, -1, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)

        self.annListCtl = wx.wxTextCtrl(
            panel, -1, "\n\n\n\n\n", wx.wxPoint(-1, -1), (300, 120), wx.wxTE_MULTILINE | wx.wxHSCROLL | wx.wxTE_DONTWRAP
        )
        gridSizer.Add(self.annListCtl, -1, wx.wxEXPAND)

        gridSizer.Add(wx.wxStaticText(panel, -1, ""))
        exptext = wx.wxStaticText(
            panel,
            -1,
            "a list of tracker urls separated by commas or "
            "whitespace\nand on several lines -trackers on the same line will "
            "be\ntried randomly, and all the trackers on one line\nwill be "
            "tried before the trackers on the next line.",
        )
        exptext.SetFont(wx.wxFont(6, wx.wxDEFAULT, wx.wxNORMAL, wx.wxNORMAL, False))
        gridSizer.Add(exptext, -1, wx.wxALIGN_CENTER)

        self.refresh_thostlist()
        self._set_thost()

        if sys.platform == "win32":
            self.dropTargetPtr.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(self.dropTargetPtr, self.selectdrop)
            self.groupSizer1Box.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(self.groupSizer1Box, self.selectdrop)
            abutton.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(abutton, self.announcedrop)
            self.annCtl.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(self.annCtl, self.announcedrop)
            self.annListCtl.DragAcceptFiles(True)
            wx.EVT_DROP_FILES(self.annListCtl, self.announcedrop)

        gridSizer.Add(wx.wxStaticText(panel, -1, ""))
        gridSizer.Add(wx.wxStaticText(panel, -1, ""))

        gridSizer.Add(wx.wxStaticText(panel, -1, "piece size:"), 0, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)
        self.piece_length = wx.wxChoice(
            panel, -1, choices=["automatic", "2MiB", "1MiB", "512KiB", "256KiB", "128KiB", "64KiB", "32KiB"]
        )
        self.piece_length_list = [0, 21, 20, 19, 18, 17, 16, 15]
        self.piece_length.SetSelection(0)
        gridSizer.Add(self.piece_length)

        gridSizer.Add(wx.wxStaticText(panel, -1, "comment:"), 0, wx.wxALIGN_RIGHT | wx.wxALIGN_CENTER_VERTICAL)
        self.commentCtl = wx.wxTextCtrl(panel, -1, "")
        gridSizer.Add(self.commentCtl, 0, wx.wxEXPAND)

        gridSizer.Add(wx.wxStaticText(panel, -1, ""))
        gridSizer.Add(wx.wxStaticText(panel, -1, ""))

        b1 = wx.wxButton(panel, -1, "Cancel", size=(-1, 30))
        wx.EVT_BUTTON(frame, b1.GetId(), self.cancel)
        gridSizer.Add(b1, 0, wx.wxEXPAND)
        b2 = wx.wxButton(panel, -1, "MAKE TORRENT", size=(-1, 30))
        wx.EVT_BUTTON(frame, b2.GetId(), self.complete)
        gridSizer.Add(b2, 0, wx.wxEXPAND)

        gridSizer.AddGrowableCol(1)
        colSizer.Add(gridSizer, -1, wx.wxALIGN_CENTER_VERTICAL)
        fullSizer.Add(colSizer)

        border = wx.wxBoxSizer(wx.wxHORIZONTAL)
        border.Add(fullSizer, 1, wx.wxEXPAND | wx.wxALL, 15)
        panel.SetSizer(border)
        panel.SetAutoLayout(True)
        border.Fit(panel)
        frame.Fit()
        frame.Show(True)

        EVT_INVOKE(frame, self.onInvoke)
        wx.EVT_CLOSE(frame, self._close)