#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import wx
class MyDialog1(wx.Dialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: MyDialog1.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.label_4 =wx.StaticText(self, -1, "Press Alt + &a")
        self.text_ctrl_6 =wx.TextCtrl(self, -1, "")
        self.label_5 = wx.StaticText(self, -1, "Press Alt + &b")
        self.text_ctrl_7 = wx.TextCtrl(self, -1, "")
        self.label_6 = wx.StaticText(self, -1, "Press Alt + &c")
        self.text_ctrl_8 = wx.TextCtrl(self, -1, "")
        self.rbutton = wx.RadioButton(self, -1, "Press Alt + &d")
        
        self.button_3 = wx.Button(self, -1, "Press Alt + &x")
        self.button_4 = wx.Button(self, -1, "Press Alt + &y")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade
        self.text_ctrl_6.Bind(wx.EVT_SET_FOCUS, self.textSetFocus)
        self.text_ctrl_7.Bind(wx.EVT_SET_FOCUS, self.textSetFocus)
        self.text_ctrl_8.Bind(wx.EVT_SET_FOCUS, self.textSetFocus)        
        self.text_ctrl_6.Bind(wx.EVT_KILL_FOCUS, self.TextKillFocus)
        self.text_ctrl_7.Bind(wx.EVT_KILL_FOCUS, self.TextKillFocus)
        self.text_ctrl_8.Bind(wx.EVT_KILL_FOCUS, self.TextKillFocus)        
        
        self.button_3.Bind(wx.EVT_BUTTON, self.OnBtn3)
        self.button_4.Bind(wx.EVT_BUTTON, self.OnBtn4)

    def __set_properties(self):
        # begin wxGlade: MyDialog1.__set_properties
        self.SetTitle("dialog_2")
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: MyDialog1.__do_layout
        sizer_3 = wx.BoxSizer(wx.VERTICAL)
        sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
        grid_sizer_1 = wx.FlexGridSizer(3, 2, 0, 0)
        grid_sizer_1.Add(self.label_4, 0, wx.ALL, 3)
        grid_sizer_1.Add(self.text_ctrl_6, 0, wx.ALL, 3)
        grid_sizer_1.Add(self.label_5, 0, wx.ALL, 3)
        grid_sizer_1.Add(self.text_ctrl_7, 0, wx.ALL, 3)
        grid_sizer_1.Add(self.label_6, 0, wx.ALL, 3)
        grid_sizer_1.Add(self.text_ctrl_8, 0, wx.ALL, 3)
        grid_sizer_1.Add(self.rbutton, 0, wx.ALL, 3)        
        sizer_3.Add(grid_sizer_1, 1, wx.EXPAND, 0)
        sizer_4.Add(self.button_3, 0, wx.ALL, 3)
        sizer_4.Add(self.button_4, 0, wx.ALL, 3)
        sizer_3.Add(sizer_4, 1, wx.EXPAND, 0)
        self.SetAutoLayout(True)
        self.SetSizer(sizer_3)
        sizer_3.Fit(self)
        sizer_3.SetSizeHints(self)
        self.Layout()
        # end wxGlade

# end of class MyDialog1

    def OnBtn3(self, event):
        print "On Btn3"
        event.Skip()
        
    def OnBtn4(self, event):
        print "On Btn4"
        event.Skip()

    def textSetFocus(self, event):
        print "Set Focus on TextBox"
        event.Skip()
        
    def TextKillFocus(self, event):
        print "Kill Focus on TextBox"
        event.Skip()
        
        
if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    dialog_1 = MyDialog1(None, -1, "")
    app.SetTopWindow(dialog_1)
    dialog_1.Show()
    app.MainLoop()
