#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Thu Jan 13 21:44:56 2011

import wx

# begin wxGlade: extracode
# end wxGlade



class ComboDialog(wx.Dialog):
    def __init__(self, parent,ichoice=[],ititle='',idesc=''):
        # begin wxGlade: MyDialog.__init__
        wx.Dialog.__init__(self, parent=parent,title=ititle)
        self.sizer_1_staticbox = wx.StaticBox(self, -1, idesc)
        self.combo_box_1 = wx.ComboBox(self, -1, choices=ichoice, style=wx.CB_DROPDOWN)
        self.button_1 = wx.Button(self, -1, u" 确定")
        self.button_2 = wx.Button(self, -1, u"取消")
        self.Bind(wx.EVT_BUTTON,self.OnOK,self.button_1)
        self.Bind(wx.EVT_BUTTON,self.OnCancell,self.button_2)

        self.__do_layout()
        # end wxGlade


    def __do_layout(self):
        # begin wxGlade: MyDialog.__do_layout
        sizer_1 = wx.StaticBoxSizer(self.sizer_1_staticbox, wx.VERTICAL)
        sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_2.Add(self.combo_box_1, 1, wx.EXPAND, 0)
        sizer_1.Add(sizer_2, 0, wx.EXPAND, 0)
        sizer_3.Add(self.button_1, 0, 0, 0)
        sizer_3.Add(self.button_2, 0, 0, 0)
        sizer_1.Add(sizer_3, 1, wx.EXPAND, 0)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        self.Layout()
        # end wxGlade

    def GetValue(self):
        return self.combo_box_1.GetValue()
    def OnOK(self,evt):
        self.EndModal(wx.ID_OK)
    def OnCancell(self,evt):
        self.EndModal(wx.ID_CANCEL)

# end of class MyDialog


if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    dialog_1 = MyDialog(None, -1, "")
    app.SetTopWindow(dialog_1)
    dialog_1.Show()
    app.MainLoop()
