コード例 #1
0
    def __init__(self, parent, categorie=None):
        wx.Panel.__init__(self, parent, style=wx.TAB_TRAVERSAL)

        if categorie == None:
            categorie = Categorie()

        self.categorie = categorie

        self.label_IDCategorie = wx.StaticText(self, -1, u"ID Cat�gorie :")
        self.combo_box_IDCategorie = wx.ComboBox(self,
                                                 -1,
                                                 choices=[],
                                                 style=wx.CB_DROPDOWN
                                                 | wx.CB_READONLY)
        self.label_IDCategorieV = wx.StaticText(self, -1, "IDCategorieV")
        self.label_NomCategorie = wx.StaticText(self, -1, "Nom :")
        self.text_NomCategorie = wx.TextCtrl(self,
                                             -1,
                                             "",
                                             style=wx.TE_PROCESS_ENTER,
                                             validator=GenericTextValidator())
        self.button_ok = wx.Button(self, wx.ID_OK, "Ok")
        self.button_annuler = wx.Button(self, wx.ID_CANCEL, "Annuler")

        self.button_ok.Bind(wx.EVT_BUTTON, self.OnEnregistre)
        self.Bind(wx.EVT_TEXT_ENTER, self.OnEnregistre, self.text_NomCategorie)

        self.Bind(wx.EVT_CLOSE, self.OnClose, self)
        self.Bind(wx.EVT_BUTTON, self.OnClose, self.button_annuler)

        self.__set_properties()
        self.__set_valeurs()
        self.__do_layout()