ReturnReasonDialog.py 2.46 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 ReturnReasonDialog(wx.Dialog):
    def __init__(self, parent, names):
        # begin wxGlade: ReturnReasonDialog.__init__
        wx.Dialog.__init__(self, parent, -1)
        
        info = ( _("Why do you want to return the following files?")+"\n"
               + "\n".join(names) )
        
        self.label_1 = wx.StaticText(self, -1, info)         
        self.label_4 = wx.StaticText(self, -1, _("Reason")+":")
        self.reason = wx.TextCtrl(self, -1, "", size=(250, 80), style=wx.TE_MULTILINE|wx.TE_PROCESS_ENTER)
        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: ReturnReasonDialog.__set_properties
        self.SetTitle(_("Return files"))        
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: ReturnReasonDialog.__do_layout                
        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)        
        sizer_2.Add(self.label_4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_2.Add(self.reason, 0, 0, 0)
        
        sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_3.Add(self.button_4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_3.Add(self.button_5, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        
        sizer_1 = wx.BoxSizer(wx.VERTICAL)    
        sizer_1.Add(self.label_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 1)
        sizer_1.Add(sizer_2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 1)
        sizer_1.Add(sizer_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 1)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        self.Layout()
        # end wxGlade

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

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

# end of class ReturnReasonDialog