Foros del Web » Programando para Internet » Python »

ayuda con codigo!!

Estas en el tema de ayuda con codigo!! en el foro de Python en Foros del Web. hola me pueden hechar una mano con este codigo no puedo lograr que el textCtrl rellene el resto de el panel en la clase MDIChildFrame ...
  #1 (permalink)  
Antiguo 11/01/2009, 15:10
 
Fecha de Ingreso: mayo-2008
Mensajes: 499
Antigüedad: 15 años, 11 meses
Puntos: 1
Busqueda ayuda con codigo!!

hola me pueden hechar una mano con este codigo

no puedo lograr que el textCtrl rellene el resto de el panel en la clase MDIChildFrame

Código python:
Ver original
  1. # -*- coding: cp1252 -*-
  2.  
  3. import wx
  4.  
  5. ID_TOOL = 1
  6. class prog(wx.MDIParentFrame):
  7.     def __init__(self):
  8.         wx.MDIParentFrame.__init__(self,  None, -1, title="Mi Aplicacion", size=(500, 620))
  9.  
  10. #contenedor
  11.  
  12. #menu
  13.         menubar = wx.MenuBar()
  14.         file = wx.Menu()
  15.         file.Append(10, '&Nuevo\tCtrl+N', 'Nuevo Archivo')
  16.         file.AppendSeparator()
  17.         file.Append(11, '&Salir\tCtrl+S', 'Salir del programa')
  18.         ver = wx.Menu()
  19.         self.toold = ver.Append(ID_TOOL, 'H&erramientas\tCtrl+T', 'Show Toolbox', kind=wx.ITEM_CHECK)
  20.         self.itool = ver.Append(500, '&Propiedades\tCtrl+U', 'Propiedades', kind=wx.ITEM_CHECK)
  21.         ver.Check(ID_TOOL, True)
  22.        
  23.         help = wx.Menu()
  24.         help.Append(20, 'A&yuda\tCtrl+H', 'ayuda' )
  25.        
  26.         menubar.Append(file, "&Archivo")
  27.         menubar.Append(ver, "&Herramientas")
  28.         menubar.Append(help, 'A&yuda')
  29.         self.SetMenuBar(menubar)
  30. #erramientas
  31.         self.count = 5
  32.        
  33.         self.toolbar = self.CreateToolBar()
  34.         self.toolbar.AddLabelTool(wx.ID_ANY, 'Nuevo', wx.Bitmap('icns/Nuevo.png'))
  35.         self.toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Guardar.png'))
  36.         self.toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Abrir.png'))
  37.         self.toolbar.AddSeparator()
  38.         self.toolbar.AddLabelTool(30, '', wx.Bitmap('icns/des.png'))
  39.         self.toolbar.AddLabelTool(31, '', wx.Bitmap('icns/rea.png'))
  40.         self.toolbar.AddSeparator()
  41.         self.toolbar.AddLabelTool(wx.ID_ANY, '', wx.Bitmap('icns/Cortar.png'))
  42.         self.toolbar.AddSeparator()
  43.         self.toolbar.Realize()
  44.  
  45. #Eventos
  46.         self.Bind(wx.EVT_MENU, self.OnNuev, id=10)
  47.         self.Bind(wx.EVT_MENU, self.OnSalir, id=11)
  48.         self.Bind(wx.EVT_MENU, self.ToogleTool, id=ID_TOOL)
  49.         self.Bind(wx.EVT_MENU, self.OnDial, id=20)
  50.         self.Bind(wx.EVT_MENU, self.OnUnd, id=30)
  51.         self.Bind(wx.EVT_MENU, self.OnRed, id=31)
  52.         self.Bind(wx.EVT_MENU, self.OnTools, id=500)
  53. #mostrar
  54.         self.Centre()
  55.         self.CreateStatusBar()
  56.  
  57. #caja de herramientas    
  58.         self.mini = wx.MiniFrame(self,  title="Herramientas", size=(300, 560))
  59.         self.mini.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
  60.  
  61. #caja
  62.         self.ids = wx.MiniFrame(self,  title="Propiedades", size=(90, 600))
  63.         self.ids.Bind(wx.EVT_CLOSE, self.OnCloseWin)
  64.    
  65.  
  66.     def OnCloseWindow(self, event):
  67.         self.Destroy()
  68.  
  69.     def OnCloseWin(self, event):
  70.         self.Destroy()
  71.        
  72.     def OnUnd(self, event):
  73.         if self.count >1 and self.count <= 5:
  74.             self.count = self.count - 1
  75.  
  76.         if self.count == 1:
  77.             self.toolbar.EnableTool(30, False)
  78.  
  79.         if self.count == 4:
  80.             self.toolbar.EnableTool(31, True)
  81.  
  82.     def OnRed(self, event):
  83.         if self.count < 5 and self.count >= 1:
  84.             self.count = self.count + 1
  85.  
  86.         if self.count == 5:
  87.             self.toolbar.EnableTool(31, False)
  88.  
  89.         if self.count == 2:
  90.             self.toolbar.EnableTool(30, True)
  91.            
  92.     def OnNuev(self, evt):
  93.         win = wx.MDIChildFrame(self, -1, "Nuevo")
  94.         panel = wx.Panel(win)
  95.     #barra de herramientas
  96.         toolbr = wx.ToolBar(panel, -1)
  97.         toolbr.AddLabelTool(wx.ID_ANY, 'Nuevo', wx.Bitmap('icns/Nuevo.png'))
  98.         sample = ['uno', 'dos', 'tres']
  99.         wx.StaticText(toolbr, -1, "Modo", (210, 3))
  100.         wx.Choice(toolbr, -1, (260, 0),  choices = sample)
  101.         toolbr.Realize()
  102.         #texto
  103.         text = wx.TextCtrl(panel, wx.TE_MULTILINE)
  104.         mains = wx.BoxSizer(wx.VERTICAL)
  105.         mains.Add(toolbr, 0, wx.EXPAND)
  106.         asizer = wx.GridSizer(rows=2, hgap=1, vgap=2)
  107.         asizer.Add(text, 0, wx.EXPAND)
  108.         mains.Add(asizer, 0, wx.EXPAND|wx.ALL, 1, 5)
  109.         panel.SetSizer(mains)
  110.         mains.Fit(win)
  111.         mains.SetSizeHints(win)
  112.         win.Show(True)
  113.        
  114.     def OnSalir(self, event):
  115.         self.Close()
  116.        
  117.     def OnDial(self, event):
  118.         dial = wx.MessageDialog(self, 'esta aplicacion es para windows ', 'Acerca de Mi #1er Aplicacion', wx.OK| wx.ICON_EXCLAMATION)
  119.         dial.ShowModal()
  120.  
  121.     def ToogleTool(self, event):
  122.         if self.toold.IsChecked():
  123.             self.mini.Show()
  124.         else:
  125.             self.mini.Hide()
  126.  
  127.     def OnTools(self, event):
  128.         if self.itool.IsChecked():
  129.             self.ids.Show()
  130.         else:
  131.             self.ids.Hide()
  132.  
  133.    
  134. if __name__ == '__main__':
  135.     app= wx.App()
  136.     frame = prog().Show()
  137.     app.MainLoop()

Última edición por iozk; 11/01/2009 a las 15:11 Razón: highlight`s
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:54.