DownloadNumberDialog.py 2.04 KB
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Wed Sep 28 10:10:39 2011

import wx

import i18n
_ = i18n.language.ugettext #use ugettext instead of getttext to avoid unicode errors

# begin wxGlade: dependencies
# end wxGlade

# begin wxGlade: extracode

# end wxGlade

class DownloadNumberDialog(wx.Dialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: DownloadNumberDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.label_4 = wx.StaticText(self, -1, _("Download count")+":")
        self.checkout_number = wx.SpinCtrl(self, -1, "1", min=1, max=300)
        self.button_4 = wx.Button(self, wx.ID_YES, _("OK"))
        self.button_5 = wx.Button(self, wx.ID_NO, _("Cancel"))

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.on_ok, id=wx.ID_YES)
        self.Bind(wx.EVT_BUTTON, self.on_cancel, id=wx.ID_NO)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: DownloadNumberDialog.__set_properties
        self.SetTitle(_("Download"))
        self.label_4.SetToolTipString(_("Number of files to download"))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: DownloadNumberDialog.__do_layout
        grid_sizer_2 = wx.GridSizer(2, 2, 20, 20)
        grid_sizer_2.Add(self.label_4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        grid_sizer_2.Add(self.checkout_number, 0, 0, 0)
        grid_sizer_2.Add(self.button_4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        grid_sizer_2.Add(self.button_5, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        self.SetSizer(grid_sizer_2)
        grid_sizer_2.Fit(self)
        self.Layout()
        self.Centre()
        # end wxGlade

    def on_ok(self, event): # wxGlade: DownloadNumberDialog.<event_handler>
        self.EndModal(wx.ID_OK)

    def on_cancel(self, event): # wxGlade: DownloadNumberDialog.<event_handler>
        self.EndModal(wx.ID_CANCEL)

# end of class DownloadNumberDialog