-
Notifications
You must be signed in to change notification settings - Fork 0
/
optimize_view.py
69 lines (49 loc) · 1.54 KB
/
optimize_view.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# -*- encoding: utf-8 -*-
# Copyright (C) 2010 Takakazu Ishikura
#
# $Date: 2010-02-22 21:35:39 +0900 (月, 22 2 2010) $
# $Rev: 105 $
# $Author: ishikura $
#
import os, sys
import wx
# nagara modules
nagara_path = os.environ['NAGARA_PATH']
sys.path.append( os.path.join(nagara_path, 'src') )
from utils.deco import nproperty
from core.model import *
class IOptimizeView(Interface):
def appendView(view, title):
"""Append the view into the book view."""
def getContainer():
"""Get the container to append the view."""
from utils.wxutils import ViewBase
from optimize_xrc import xrcOptimize
# class OptimizeView(xrcOptimize, ViewComponent):
class OptimizeView(xrcOptimize, ViewBase):
implements(IOptimizeView)
def __init__(self, parent):
"""Constructor."""
xrcOptimize.__init__(self, parent)
ViewBase.__init__(self)
def appendView(self, view, title):
ctrl = self.getCtrl('ID_MultiBook')
ctrl.AddPage(view, title)
def getContainer(self):
return self.getCtrl('ID_MultiBook')
from utils.wxutils import BindManager
class OptimizeInteracter(object):
binder = BindManager()
def __init__(self, view, presen):
self.presen = presen
self.binder.bindAll(view, self)
def main():
app = wx.App(redirect=False)
frame = wx.Frame(None, -1, 'Optimize Panel')
view = OptimizeView(frame)
panel = wx.Panel(view.getContainer(), -1)
view.appendView(panel, 'Test')
frame.Show()
app.MainLoop()
if __name__ == '__main__':
main()