MCPcopy Create free account
hub / github.com/Image-Py/imagepy / CanvasFrame

Class CanvasFrame

imagepy/ui/canvasframe.py:120–154  ·  view source on GitHub ↗

CanvasFrame: derived from the wx.core.Frame

Source from the content-addressed store, hash-verified

118 def __del__(self):pass
119
120class CanvasFrame(wx.Frame):
121 """CanvasFrame: derived from the wx.core.Frame"""
122 ## TODO: Main frame ???
123 def __init__(self, parent=None):
124 wx.Frame.__init__ ( self, parent, id = wx.ID_ANY,
125 title = wx.EmptyString,
126 pos = wx.DefaultPosition,
127 size = wx.Size( -1,-1 ),
128 style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
129 self.canvaspanel = CanvasPanel(self)
130 logopath = os.path.join(root_dir, 'data/logo.ico')
131 self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
132 self.Bind(wx.EVT_ACTIVATE, self.on_valid)
133 self.SetAcceleratorTable(IPy.curapp.shortcut)
134 self.Bind(wx.EVT_CLOSE, self.on_close)
135 self.canvaspanel.set_handler(self.set_title)
136
137 def set_ips(self, ips):
138 self.canvaspanel.set_ips(ips)
139
140 def set_title(self, ips, resized):
141 title = ips.title + '' if ips.tool==None else ' [%s]'%ips.tool.title
142 self.SetTitle(ips.title)
143 if resized: self.Fit()
144
145 def on_valid(self, event):
146 if event.GetActive():
147 ImageManager.add(self.canvaspanel.ips)
148 WindowsManager.add(self.canvaspanel)
149
150 def on_close(self, event):
151 self.canvaspanel.set_handler()
152 self.canvaspanel.canvas.set_handler()
153 WindowsManager.remove(self.canvaspanel)
154 event.Skip()
155
156
157class ImgArtProvider(aui.AuiDefaultDockArt):

Callers 4

imageplus.pyFile · 0.90
mouse_downMethod · 0.90
showipsFunction · 0.85
canvasframe.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected