Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Creado Por LED
- # -*- coding: utf-8 -*-
- import wx
- import wx.xrc
- import sys
- ###########################################################################
- ## Class MyFrame1
- ###########################################################################
- class MyFrame2 ( wx.Frame ):
- def __init__( self, parent ):
- wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Diccionario de objetos wx", pos = wx.DefaultPosition, size = wx.Size( 500,454 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
- self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
- bSizer1 = wx.BoxSizer( wx.VERTICAL )
- self.m_panel1 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
- bSizer2 = wx.BoxSizer( wx.VERTICAL )
- bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
- bSizer5 = wx.BoxSizer( wx.VERTICAL )
- self.m_staticText2 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Objetos", wx.DefaultPosition, wx.DefaultSize, 0 )
- self.m_staticText2.Wrap( -1 )
- bSizer5.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5 )
- m_listBox2Choices = [ u"wx.Frame", u"wx.Button", u"wx.StaticText",u'wx.ListBox',u'wx.BitmapButton',u'wx.TextCtrl',u'wx.BoxSizer',u'wx.ComboBox',u'wx.lib.calendar',u'wx.ComboBox',u'wx.CheckBox',u'wx.StaticBoxSizer']
- self.m_listBox2 = wx.ListBox( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_listBox2Choices, 0 )
- bSizer5.Add( self.m_listBox2, 1, wx.ALL|wx.EXPAND, 5 )
- bSizer7.Add( bSizer5, 3, wx.EXPAND, 5 )
- bSizer3 = wx.BoxSizer( wx.VERTICAL )
- self.m_staticText1 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Funciones y Propiedades", wx.DefaultPosition, wx.DefaultSize, 0 )
- self.m_staticText1.Wrap( -1 )
- bSizer3.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5 )
- m_listBox1Choices = []
- self.m_listBox1 = wx.ListBox( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_listBox1Choices, 0 )
- bSizer3.Add( self.m_listBox1, 1, wx.ALL|wx.EXPAND, 5 )
- bSizer7.Add( bSizer3, 3, wx.EXPAND, 5 )
- bSizer2.Add( bSizer7, 3, wx.EXPAND, 5 )
- bSizer8 = wx.BoxSizer( wx.VERTICAL )
- self.m_textCtrl1 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize,wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH )
- bSizer8.Add( self.m_textCtrl1, 1, wx.ALL|wx.EXPAND, 5 )
- bSizer2.Add( bSizer8, 1, wx.EXPAND, 5 )
- self.m_panel1.SetSizer( bSizer2 )
- self.m_panel1.Layout()
- bSizer2.Fit( self.m_panel1 )
- bSizer1.Add( self.m_panel1, 1, wx.EXPAND |wx.ALL, 0 )
- self.SetSizer( bSizer1 )
- self.Layout()
- self.Centre( wx.BOTH )
- self.Bind(wx.EVT_LISTBOX,self.este, self.m_listBox2)
- self.Bind(wx.EVT_LISTBOX,self.este2, self.m_listBox1)
- def este(self, event): # wxGlade: Principal.<event_handler>
- self.m_listBox1.Set(dir(eval(self.m_listBox2.GetStringSelection())))
- def este2(self, event): # wxGlade: Principal.<event_handler>
- try:
- self.m_textCtrl1.SetValue(eval(self.m_listBox2.GetStringSelection()+"."+self.m_listBox1.GetStringSelection()+".im_func.func_doc"))
- except:
- self.m_textCtrl1.SetValue("No funca")
- def __del__( self ):
- pass
- class Inicio(wx.App):
- def OnInit(self):
- frame = MyFrame2(None)
- self.SetTopWindow(frame)
- frame.Show(True)
- return True
- if __name__ == '__main__':
- app = Inicio()
- app.MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement