[W2k, wxPython 2.6.1.0] - MDISashDemo bug?
When i run MDISashDemo and maximize main frame, minimize and maximize again - LayoutMDIFrame in OnSize dont work more... Why? I need this feature for main MDI frame with toolbar and statusbar with panels&sizers&bitmapbuttons :) Windows 2000, wxPython 2.6.1.0 w.p. -- -- http://mail.python.org/mailman/listinfo/python-list
Re: [W2k, wxPython 2.6.1.0] - MDISashDemo bug?
w.p. wrote: > When i run MDISashDemo and maximize main frame, minimize and maximize > again - LayoutMDIFrame in OnSize dont work more... > Why? > > I need this feature for main MDI frame with toolbar and statusbar with > panels&sizers&bitmapbuttons :) > > Windows 2000, wxPython 2.6.1.0 > > w.p. > When i add this code: self.Bind(wx.EVT_ACTIVATE, self.OnActivate) and def OnActivate(self, event): if event.GetActive(): wx.LayoutAlgorithm().LayoutMDIFrame(self) all is ok. Small improvement in demo :) w.p. -- http://mail.python.org/mailman/listinfo/python-list
Re: [W2k, wxPython 2.6.1.0] - MDISashDemo bug?
Steve Holden wrote: >> > Well done! Do you know how to feed this information on to the developers > (probably Robin Dunn)? All such changes are valuable. > Hmm... i dont know. wxpython.org -> "submit a patch" or "Report a bug" ? w.p. -- http://mail.python.org/mailman/listinfo/python-list
[wxPython] own maximize for wxMDIChildFrame - bugs?
I use code below: 1) frame receive too many maximize events on create and on close child window - why? 2) how to catch key events for wxMDIParentFrame ? 3) childWin.SetSize() in OnMaximize send additional maximize event (?) 4) wxMDIChildFrame is initially visible! 5) sorry for english :) 6) wxPython 2.5.4.1 (Windows) import wx #-- class MyParentFrame(wx.MDIParentFrame): def __init__(self): wx.MDIParentFrame.__init__(self, None, -1, "MDI Parent", size=(600,400), style=wx.DEFAULT_FRAME_STYLE|wx.FRAME_NO_WINDOW_MENU) self.winCount = 0 self.CreateStatusBar() self.MainTb=self.CreateToolBar(wx.TB_HORIZONTAL|wx.NO_BORDER|wx.TB_FLAT) biblioBut=wx.Button(self.MainTb,1231,label="&Biblio") newWndBut=wx.Button(self.MainTb,1213,label="&NewWnd") wx.EVT_BUTTON(self,newWndBut.GetId(), self.OnNewWindow) self.MainTb.AddControl(biblioBut) self.MainTb.AddSeparator() self.MainTb.AddControl(newWndBut) self.MainTb.Realize() self.SetToolBar(self.MainTb) self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDownParent) def OnKeyDownParent(self, event): print "OnKeyDownParent" def OnKeyDownChild(self, event): print "OnKeyDownChild" def OnClose(self, evt): self.GetActiveChild().Close(True) def OnMaximize(self, event): childWin = event.GetEventObject() win = childWin.GetParent() print "maximize "+self.GetTitle() childWin.SetSize(wx.Size(win.GetClientSize().GetWidth(),win.GetClientSize().GetHeight()-1)) childWin.SetPosition(wx.Point(0,-1*win.GetClientAreaOrigin().y+1)) event.Skip() def OnNewWindow(self,event): self.winCount = self.winCount + 1 win = wx.MDIChildFrame(self, -1, "Child Window: %d" % self.winCount) win.Maximize() #win.Show() # !! MainTb=win.CreateToolBar(wx.TB_HORIZONTAL|wx.NO_BORDER|wx.TB_FLAT) SBut=wx.Button(MainTb,1213,label="&Func") MainTb.AddControl(SBut) MainTb.Realize() win.SetToolBar(MainTb) win.Bind(wx.EVT_MAXIMIZE, self.OnMaximize) win.Bind(wx.EVT_KEY_DOWN, self.OnKeyDownChild) win.Show(True) #-- if __name__ == '__main__': class MyApp(wx.App): def OnInit(self): wx.InitAllImageHandlers() frame = MyParentFrame() frame.Show(True) self.SetTopWindow(frame) return True app = MyApp(False) app.MainLoop() -- http://mail.python.org/mailman/listinfo/python-list
[wxPython] How to change deafult tab traversing (radiobuttons & panel)
Hello! I want change default tab traversing in my app. But i don't know how to do it :( Belowe i include simple example - i want change default tab order: radiobutton "mode11" -> radiobutton "mode31" -> button OK I can't find any option, flag, or another way. I try use wx.EVT_KEY_DOWN macro, or Bind - but without success. When i use Borland Builder C++ i must only set tabStop=False sorry for my english ! w.p. ### import wx class MyFrame(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title) mainPanel = wx.Panel(self) mainSizer = wx.BoxSizer(wx.VERTICAL) panel1=wx.Panel(mainPanel,style=wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER,size=(200,100)) mainSizer.Add(panel1,flag=wx.ALL,border=5) panel2=wx.Panel(mainPanel,style=wx.TAB_TRAVERSAL|wx.SUNKEN_BORDER,size=(200,100)) mainSizer.Add(panel2,flag=wx.ALL,border=5) # group 1 gridSiz1 = wx.FlexGridSizer(2,2) panel1.SetSizer(gridSiz1) self.rb11 = wx.RadioButton(panel1, -1, style=wx.RB_GROUP, label="mode 11") self.rb12 = wx.RadioButton(panel1, -1, label="mode 12") self.rb21 = wx.RadioButton(panel1, -1, style=wx.RB_GROUP, label="mode 21") self.rb22 = wx.RadioButton(panel1, -1, label="mode 22") gridSiz1.Add(self.rb11,flag=wx.ALL,border=3) gridSiz1.Add(self.rb12,flag=wx.ALL,border=3) gridSiz1.Add(self.rb21,flag=wx.ALL,border=3) gridSiz1.Add(self.rb22,flag=wx.ALL,border=3) # group 2 gridSiz2 = wx.FlexGridSizer(2,2) panel2.SetSizer(gridSiz2) self.rb31 = wx.RadioButton(panel2, -1, style=wx.RB_GROUP, label="mode 31") self.rb32 = wx.RadioButton(panel2, -1, label="mode 32") self.rb41 = wx.RadioButton(panel2, -1, style=wx.RB_GROUP, label="mode 41") self.rb42 = wx.RadioButton(panel2, -1, label="mode 42") gridSiz2.Add(self.rb31,flag=wx.ALL,border=3) gridSiz2.Add(self.rb32,flag=wx.ALL,border=3) gridSiz2.Add(self.rb41,flag=wx.ALL,border=3) gridSiz2.Add(self.rb42,flag=wx.ALL,border=3) okBut = wx.Button(mainPanel,label="-- OK --") mainSizer.Add(okBut,flag=wx.ALL|wx.ALIGN_CENTER,border=10) mainPanel.SetSizer(mainSizer) self.Layout() #wx.EVT_KEY_DOWN(self.rb11,self.OnRBKD) self.rb11.Bind(wx.EVT_KEY_DOWN, self.OnRBKD) def OnRBKD(self,event): print "OnKey!" event.Skip() class MyApp(wx.App): def OnInit(self): frame = MyFrame(None, "Simple wxPython App") self.SetTopWindow(frame) frame.Show(True) return True app = MyApp(0) app.MainLoop() -- http://mail.python.org/mailman/listinfo/python-list
wxPython - 2 x foldpanelbar with tree...
Hello! I have some trouble with my GUI. I have left panel with foldpanelbar, but i need one item but not collapsed - simple button. I split my left panel into two foldpanelbars with one button between. But a have trouble... Sorry for english :/ Simple code: #-- import sys import wx import wx.html as html import wx.lib.foldpanelbar as fpb import os import sys ID_New = wx.NewId() ID_Exit = wx.NewId() #-- class MyMDIChildFrame(wx.MDIChildFrame): #-- def __init__(self,parent,id,name=""): wx.MDIChildFrame.__init__(self,parent, id, name) self.InitGUI() #-- def InitGUI(self): #-- self.mainSplitter = wx.SplitterWindow(self, -1, style=wx.SP_NOBORDER) self.infoViewer = html.HtmlWindow(self.mainSplitter, -1, style=wx.NO_FULL_REPAINT_ON_RESIZE) #self.infoViewer.LoadPage("http://wxwidgets.org/manuals/2.5.4/ wx_wxbutton.html") self.infoViewer.SetPage("Here is some formatted text loaded from a string.") self.leftPanel = wx.Panel(self.mainSplitter) self.CreateFoldPanel() self.mainSplitter.Initialize(self.infoViewer) self.mainSplitter.SplitVertically(self.leftPanel, self.infoViewer, 180) #-- def CreateFoldPanel(self): #-- # foldpanel #1 self.foldPanel1 = fpb.FoldPanelBar(self.leftPanel, -1, wx.DefaultPosition, wx.Size(-1,-1), fpb.FPB_DEFAULT_STYLE, fpb.FPB_SINGLE_FOLD) self.bs = wx.BoxSizer(wx.VERTICAL) self.leftPanel.SetSizer(self.bs) self.leftPanel.SetBackgroundColour(wx.BLACK) item = self.foldPanel1.AddFoldPanel("Documents", collapsed=False) item.SetBackgroundColour(wx.RED) button1 = wx.Button(item, wx.ID_ANY, "In") button2 = wx.Button(item, wx.ID_ANY, "Out") self.foldPanel1.AddFoldPanelWindow(item, button1) self.foldPanel1.AddFoldPanelWindow(item, button2) item = self.foldPanel1.AddFoldPanel("Projects", collapsed=False) item.SetBackgroundColour(wx.BLUE) button1 = wx.Button(item, wx.ID_ANY, "Name") button2 = wx.Button(item, wx.ID_ANY, "Type") button3 = wx.Button(item, wx.ID_ANY, "Data") self.foldPanel1.AddFoldPanelWindow(item, button1) self.foldPanel1.AddFoldPanelWindow(item, button2) self.foldPanel1.AddFoldPanelWindow(item, button3) item = self.foldPanel1.AddFoldPanel("Contacts", collapsed=False) item.SetBackgroundColour(wx.CYAN) button1 = wx.Button(item, wx.ID_ANY, "Name") button2 = wx.Button(item, wx.ID_ANY, "Mail") button3 = wx.Button(item, wx.ID_ANY, "City") self.foldPanel1.AddFoldPanelWindow(item, button1) self.foldPanel1.AddFoldPanelWindow(item, button2) self.foldPanel1.AddFoldPanelWindow(item, button3) self.bs.Add(self.foldPanel1, 0, wx.EXPAND) # button button1 = wx.Button(self.leftPanel, wx.ID_ANY, "Calendar") self.bs.Add(button1, 0, wx.ALL|wx.EXPAND, 4) # foldpanel #2 self.foldPanel2 = fpb.FoldPanelBar(self.leftPanel, -1, wx.DefaultPosition, wx.Size(-1,-1), fpb.FPB_DEFAULT_STYLE, fpb.FPB_SINGLE_FOLD) item = self.foldPanel2.AddFoldPanel("Treenote", collapsed=True) item.SetBackgroundColour(wx.GREEN) self.tree = wx.TreeCtrl(item, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize,wx.TR_HAS_BUTTONS| wx.TR_EDIT_LABELS| wx.TR_HIDE_ROOT)#| wx.TR_MULTIPLE#| wx.TR_HIDE_ROOT) self.foldPanel2.AddFoldPanelWindow(item, self.tree) self.LoadTree() self.bs.Add(self.foldPanel2, 0, wx.EXPAND) self.foldPanel1.Bind(fpb.EVT_CAPTIONBAR, self.OnPressCaption) self.foldPanel2.Bind(fpb.EVT_CAPTIONBAR, self.OnPressCaption) self.bs.Fit(self) self.bs.Layout() self.foldPanel1.Layout() self.foldPanel2.Layout() #-- def OnPressCaption(self, event): #-- self.bs.Layout() event.Skip() #-- def LoadTree(self): #-- self.root = self.tree.AddRoot("The Root Item") for x in range(15): child = self.tree.AppendItem(self.root, "Test item %d" % x) for y in range(5): last = self.tree.AppendItem(child, "test item %d-%s" % (x, chr(ord("a")+y))) for z in range(5): item = self.tree.AppendItem(last, "t
cx_freeze - cannot get importer instance
Hello! My application is frozen with cx_freeze. Everything is ok, but on one PC with Windows 2003 64bit i got cx_freeze fatal error "cannot get importer instance". I don't use zipimport in my python code and i don't know why i get this error :/ Any idea? How test this error? w.p. -- http://mail.python.org/mailman/listinfo/python-list