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

Method __init__

imagepy/ui/mainframe.py:28–87  ·  view source on GitHub ↗
( self, parent )

Source from the content-addressed store, hash-verified

26
27class ImagePy(wx.Frame):
28 def __init__( self, parent ):
29 wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = 'ImagePy',
30 size = wx.Size(-1,-1), pos = wx.DefaultPosition,
31 style = wx.RESIZE_BORDER|wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
32 self.auimgr = aui.AuiManager()
33 self.auimgr.SetManagedWindow( self )
34 #self.auimgr.SetFlags(aui.AUI_MGR_DEFAULT)
35
36 logopath = os.path.join(root_dir, 'data/logo.ico')
37 #self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
38 self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
39 IPy.curapp = self
40 self.SetSizeHints( wx.Size(900,700) if IPy.uimode() == 'ipy' else wx.Size( 580,-1 ))
41
42
43 self.menubar = pluginloader.buildMenuBarByPath(self, 'menus', 'plugins', None, True)
44 self.SetMenuBar( self.menubar )
45 self.shortcut = pluginloader.buildShortcut(self)
46 self.SetAcceleratorTable(self.shortcut)
47 #sizer = wx.BoxSizer(wx.VERTICAL)
48 self.toolbar = toolsloader.build_tools(self, 'tools', 'plugins', None, True)
49
50
51 print(IPy.uimode())
52 if IPy.uimode()=='ipy': self.load_aui()
53 else: self.load_ijui()
54 self.load_document()
55 self.Fit()
56
57
58 self.stapanel = stapanel = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
59 sizersta = wx.BoxSizer( wx.HORIZONTAL )
60 self.txt_info = wx.StaticText( stapanel, wx.ID_ANY, "ImagePy v0.2", wx.DefaultPosition, wx.DefaultSize, 0 )
61 self.txt_info.Wrap( -1 )
62 #self.txt_info.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INFOBK ) )
63 sizersta.Add( self.txt_info, 1, wx.ALIGN_BOTTOM|wx.BOTTOM|wx.LEFT|wx.RIGHT, 2 )
64 self.pro_bar = wx.Gauge( stapanel, wx.ID_ANY, 100, wx.DefaultPosition, wx.Size( 100,15 ), wx.GA_HORIZONTAL )
65 sizersta.Add( self.pro_bar, 0, wx.ALIGN_BOTTOM|wx.BOTTOM|wx.LEFT|wx.RIGHT, 2 )
66 stapanel.SetSizer(sizersta)
67 stapanel.SetDropTarget(FileDrop())
68 self.auimgr.AddPane( stapanel, aui.AuiPaneInfo() .Bottom() .CaptionVisible( False ).PinButton( True )
69 .PaneBorder( False ).Dock().Resizable().FloatingSize( wx.DefaultSize ).DockFixed( True )
70 . MinSize(wx.Size(-1, 20)). MaxSize(wx.Size(-1, 20)).Layer( 10 ) )
71
72
73 self.Centre( wx.BOTH )
74 self.Layout()
75 self.auimgr.Update()
76 self.Fit()
77 self.Centre( wx.BOTH )
78 if(IPy.uimode()=='ij'):
79 self.SetMaxSize((-1, self.GetSize()[1]))
80 self.SetMinSize(self.GetSize())
81 self.update = False
82
83 self.Bind(wx.EVT_CLOSE, self.on_close)
84 self.Bind(aui.EVT_AUI_PANE_CLOSE, self.on_pan_close)
85 thread = threading.Thread(None, self.hold, ())

Callers

nothing calls this directly

Calls 6

load_auiMethod · 0.95
load_ijuiMethod · 0.95
load_documentMethod · 0.95
FileDropClass · 0.85
BindMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected