def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = 'ImageApp', size = wx.Size(800,600), pos = wx.DefaultPosition, style = wx.RESIZE_BORDER|wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) App.__init__(self) self.SetSizeHints( wx.Size(600,-1) ) sizer = wx.BoxSizer(wx.VERTICAL) self.toolbar = ToolBar(self) self.toolbar.Fit() sizer.Add(self.toolbar, 0, wx.EXPAND |wx.ALL, 0) self.canvasnb = CanvasNoteBook(self) self.canvasnb.Bind( wx.lib.agw.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.on_new_img) self.canvasnb.Bind( wx.lib.agw.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.on_close_img) sizer.Add(self.canvasnb, 1, wx.EXPAND |wx.ALL, 0) self.stapanel = stapanel = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) sizersta = wx.BoxSizer( wx.HORIZONTAL ) self.txt_info = wx.StaticText( stapanel, wx.ID_ANY, "ImageApp", wx.DefaultPosition, wx.DefaultSize, 0 ) sizersta.Add( self.txt_info, 1, wx.ALIGN_BOTTOM|wx.BOTTOM|wx.LEFT|wx.RIGHT, 2 ) self.pro_bar = ProgressBar(stapanel) sizersta.Add( self.pro_bar, 0, wx.ALL, 2 ) stapanel.SetSizer(sizersta) sizer.Add(self.stapanel, 0, wx.EXPAND | wx.ALL, 0) self.SetSizer(sizer) self.Layout() self.Centre( wx.BOTH ) self.Bind(wx.EVT_CLOSE, self.on_close)
def init_status(self): self.stapanel = stapanel = wx.Panel(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL) sizersta = wx.BoxSizer(wx.HORIZONTAL) self.txt_info = wx.StaticText(stapanel, wx.ID_ANY, "ImagePy v0.2", wx.DefaultPosition, wx.DefaultSize, 0) self.txt_info.Wrap(-1) sizersta.Add(self.txt_info, 1, wx.ALIGN_BOTTOM | wx.BOTTOM | wx.LEFT | wx.RIGHT, 2) #self.pro_bar = wx.Gauge( stapanel, wx.ID_ANY, 100, wx.DefaultPosition, wx.Size( 100,15 ), wx.GA_HORIZONTAL ) self.pro_bar = ProgressBar(stapanel) sizersta.Add(self.pro_bar, 0, wx.ALL, 2) stapanel.SetSizer(sizersta) class OpenDrop(wx.FileDropTarget): def __init__(self, app): wx.FileDropTarget.__init__(self) self.app = app def OnDropFiles(self, x, y, path): self.app.run_macros([ "Open>{'path':'%s'}" % i.replace('\\', '/') for i in path ]) stapanel.SetDropTarget(OpenDrop(self)) self.auimgr.AddPane( stapanel, aui.AuiPaneInfo().Bottom().CaptionVisible(False).PinButton( True).PaneBorder(False).Dock().Resizable().FloatingSize( wx.DefaultSize).DockFixed(True).MinSize(wx.Size( -1, 20)).MaxSize(wx.Size(-1, 20)).Layer(10))