def __init__(self, parent):
attribs = (glcanvas.WX_GL_RGBA, glcanvas.WX_GL_DOUBLEBUFFER, glcanvas.WX_GL_DEPTH_SIZE, 24)
glcanvas.GLCanvas.__init__(self, parent, -1, attribList = attribs)
self.context = glcanvas.GLContext(self)
self.parent = parent
#Camera state variables
self.size = self.GetClientSize()
#self.camera = MouseSphericalCamera(self.size.x, self.size.y)
self.camera = MousePolarCamera(self.size.width, self.size.height)
#Main state variables
self.MousePos = [0, 0]
self.bbox = BBox3D()
#Face mesh variables and manipulation variables
self.mesh = None
self.meshCentroid = None
self.displayMeshFaces = True
self.displayMeshEdges = False
self.displayMeshVertices = True
self.displayVertexNormals = False
self.displayFaceNormals = False
self.useLighting = True
self.useTexture = False
self.GLinitialized = False
#GL-related events
wx.EVT_ERASE_BACKGROUND(self, self.processEraseBackgroundEvent)
wx.EVT_SIZE(self, self.processSizeEvent)
wx.EVT_PAINT(self, self.processPaintEvent)
#Mouse Events
wx.EVT_LEFT_DOWN(self, self.MouseDown)
wx.EVT_LEFT_UP(self, self.MouseUp)
wx.EVT_RIGHT_DOWN(self, self.MouseDown)
wx.EVT_RIGHT_UP(self, self.MouseUp)
wx.EVT_MIDDLE_DOWN(self, self.MouseDown)
wx.EVT_MIDDLE_UP(self, self.MouseUp)
wx.EVT_MOTION(self, self.MouseMotion)
python类EVT_LEFT_DOWN的实例源码
def __init__( self, parent, id, server, mech ):
wx.StaticText.__init__( self, parent )
self.ScoreServer = server
self.Mech = mech
self.Bind( wx.EVT_LEFT_DOWN, self.LeftClick )
self.Bind( wx.EVT_RIGHT_DOWN, self.RightClick )
def __init__( self, parent, id, match ):
wx.StaticText.__init__( self, parent )
self.Match = match
self.Bind( wx.EVT_LEFT_DOWN, self.LeftClick )
self.Bind( wx.EVT_RIGHT_DOWN, self.RightClick )
def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=(0, 0), size=(480, 320))
self.bitmap_1 = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap("./gui/start.png", wx.BITMAP_TYPE_ANY), pos=(0, 0))
if not settings.hideGuiList:
self.Bind(wx.EVT_LEFT_DOWN, parent.onStart)
self.bitmap_1.Bind(wx.EVT_LEFT_DOWN, parent.onStart)
def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=(0, 0), size=(480, 320))
self.bitmap_1 = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap("./gui/sorry.png", wx.BITMAP_TYPE_ANY), pos=(0, 0))
self.bitmap_1.Bind(wx.EVT_LEFT_DOWN, parent.onExit)
self.label_1 = wx.StaticText(self, wx.ID_ANY, 'bla blub', pos=(100,100))
self.label_1.SetFont(wx.Font(30, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=(0, 0), size=(480, 320))
self.bitmap_1 = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap("./gui/rfid.png", wx.BITMAP_TYPE_ANY), pos=(0, 0))
self.bitmap_1.Bind(wx.EVT_LEFT_DOWN, parent.onExit)
self.label_1 = wx.StaticText(self, wx.ID_ANY, 'bla blub', pos=(100,100), size=(100,220))
self.label_1.SetFont(wx.Font(30, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=(0, 0), size=(480, 320))
self.bitmap_1 = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap("./gui/products.png", wx.BITMAP_TYPE_ANY), pos=(0, 0))
products = get_products()
buttonids = []
i = 0
for product in products:
if product.isshown:
#480x320
self.but = wx.Button(self, id=wx.ID_ANY, label=product.name + u"\n" + u"%0.2f" % product.price, pos=((i%4)*120, int(i/4)*120), size=(120, 120))
self.but.SetBackgroundColour((255-((i+int(i/4))*20 % 40), (160+((i+int(i/4))*50 % 100)), 0))
#self.but.SetForegroundColour("#006699")
self.but.SetFont(wx.Font(23, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
self.but.Bind(wx.EVT_LEFT_DOWN, parent.onProduct, id=self.but.Id)
i += 1
if not settings.onlyOneDrink:
self.b_less = wx.Button(self, id = wx.ID_ANY, label=u"-", pos=(0,250), size=(120, 70))
self.b_less.SetFont(wx.Font(60, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
self.b_less.Bind(wx.EVT_LEFT_DOWN, self.onLess, id=self.b_less.Id)
self.l_amount = wx.StaticText(self, wx.ID_ANY, "%2d" % 0, pos=(137, 245), style=wx.ALIGN_CENTER)
self.l_amount.SetFont(wx.Font(50, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Sans"))
self.b_more = wx.Button(self, id = wx.ID_ANY, label=u"+", pos=(240,250), size=(120, 70))
self.b_more.SetFont(wx.Font(60, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
self.b_more.Bind(wx.EVT_LEFT_DOWN, self.onMore, id=self.b_more.Id)
self.b_exit = wx.Button(self, id = wx.ID_ANY, label=u"x", pos=(360,250), size=(120, 70))
self.b_exit.SetFont(wx.Font(30, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
self.b_exit.Bind(wx.EVT_LEFT_DOWN, parent.onExit, id=self.b_exit.Id)
if i <= 4:
self.l_user = wx.StaticText(self, wx.ID_ANY, "todo", pos=(20,170), style=wx.ALIGN_CENTER)
else:
self.l_user = wx.StaticText(self, wx.ID_ANY, "todo", pos=((i%4)*120+20,170), style=wx.ALIGN_CENTER)
self.l_user.SetFont(wx.Font(25, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
def __init__(self, parent):
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=(0, 0), size=(480, 320))
self.parent = parent
self.bitmap_1 = wx.StaticBitmap(self, wx.ID_ANY, wx.Bitmap("./gui/users.png", wx.BITMAP_TYPE_ANY), pos=(0, 0))
users = get_users()
self.names = list()
for user in users:
if user.isshown and not user.onlyrfid:
self.names.append(user.longname)
self.but_names = list()
self.position = 0
self.lines = 4
self.items = len(self.names)
for i in range(self.lines):
#480x320
self.but = wx.lib.platebtn.PlateButton(self, label=self.names[self.position+i] if self.position+i < len(self.names) else "", pos=(3, 3+i*80),
style=wx.BU_EXACTFIT | wx.lib.platebtn.PB_STYLE_SQUARE)
self.but.SetSize((365, 74))
self.but.SetBackgroundColour((255-(i*20 % 40), (160+(i*50 % 100)), 0))
#self.but.SetForegroundColour("#006699")
self.but.SetPressColor(wx.Colour(255,255,255,0))
self.but.SetFont(wx.Font(25, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
self.but.Bind(wx.EVT_LEFT_DOWN, parent.onUser, id=self.but.Id)
self.but_names.append(self.but)
self.b_up = wx.Button(self, id=wx.ID_ANY, label=u"\u25B2", pos=(374, 0), size=(106, 106))
self.b_up.SetFont(wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
self.b_up.Bind(wx.EVT_LEFT_DOWN, self.on_up, id=self.b_up.Id)
self.b_down = wx.Button(self, id=wx.ID_ANY, label=u"\u25BC", pos=(374, 214), size=(106, 106))
self.b_down.SetFont(wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
self.b_down.Bind(wx.EVT_LEFT_DOWN, self.on_down, id=self.b_down.Id)
self.b_exit = wx.Button(self, id=wx.ID_ANY, label="X", pos=(374, 107), size=(106, 106))
self.b_exit.SetFont(wx.Font(20, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "Humor Sans"))
self.b_exit.Bind(wx.EVT_LEFT_DOWN, parent.onExit, id=self.b_exit.Id)
self.Layout()
def __init__(self, parent):
wx.Panel.__init__(self, parent = parent)
file_drop_target = FileDropTarget(self)
lbl = wx.StaticText(self, label="Drag Transactions File here:")
self.fileTextCtrl = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.VSCROLL|wx.TE_READONLY)
self.fileTextCtrl.SetDropTarget(file_drop_target)
button = wx.Button(self, label = "Process File")
button.Bind(wx.EVT_LEFT_DOWN, self.process_file)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(lbl, 1, wx.ALL, 5)
sizer.Add(self.fileTextCtrl, 10, wx.EXPAND|wx.ALL, 10)
sizer.Add(button, 1, wx.ALIGN_CENTER, 5)
self.SetSizer(sizer)
self.text = ""
def on_event(self, event):
if event.GetEventType() == wx.EVT_LEFT_DOWN.typeId:
if self.is_selrange():
val = self.get_position(event)
if val < self.GetValue():
self.SetSelection(val, self.GetSelEnd())
elif val > self.GetValue():
self.SetSelection(self.GetSelStart(), val)
self.send_change()
else:
event.Skip()
elif event.GetEventType() == wx.EVT_SLIDER.typeId:
self.send_change()
def __init__(self, wx_parent, view_object):
super(PlotLabel, self).__init__(wx_parent)
self.track_view_object = view_object
self._title = None
self._visual_objects = []
self.SetBackgroundColour('white')
self.SetSizer(wx.BoxSizer(wx.VERTICAL))
self.Bind(wx.EVT_LEFT_DOWN, self._on_press)
self.Bind(wx.EVT_MIDDLE_DOWN, self._on_press)
self.Bind(wx.EVT_RIGHT_DOWN, self._on_press)
self._selected = False
def __init__(self, parent, pos=(0,0), size=(100,100), numSpeakers=2):
wx.Panel.__init__(self, parent, pos=pos, size=size)
self.SetBackgroundStyle(wx.BG_STYLE_CUSTOM)
self.audio = vars.getVars("Audio")
self.pos = None
self.size = size
self.currentCircle = None
self.currentSpeaker = None
self.isAList = False
self.catch = False
self.catchSpeaker = False
self.shift = False
self.alt = False
self.s = False
self.numSpeakers = numSpeakers # FL 29/05/17
#OSC Variables
self.incs = [0, 0, 0, 0]
self.absPos = [0, 0, 0, 0] # FL 04/09/2017
self.mode2 = False # FL 04/09/2017
# Creation des cercles/sources
self.blueCircle = Source(self.size[0]*BLUE_START[0], self.size[1]*BLUE_START[1], CIRCLE_RADIUS)
self.redCircle = Source(self.size[0]*RED_START[0], self.size[1]*RED_START[1], CIRCLE_RADIUS)
speakers = []
for i in range(self.numSpeakers):
setup = vars.getVars("Speakers_setup")
x, y = self.size[0]*setup[i][0], self.size[1]*setup[i][1] #FL 02/09/2017
speakers.append(Speaker(x, y, SPEAKER_RADIUS))
vars.setVars("Speakers", speakers)
# print vars.getVars("Speakers")[0].c
self.speakerAdjusted() # FL 29/05/17
# méthode pour les controles
self.Bind(wx.EVT_PAINT, self.onPaint)
self.Bind(wx.EVT_LEFT_DOWN, self.onLeftDown)
self.Bind(wx.EVT_LEFT_UP, self.onLeftUp)
self.Bind(wx.EVT_RIGHT_DOWN, self.onRightDown)
self.Bind(wx.EVT_MOTION, self.onMotion)
self.Bind(wx.EVT_KEY_DOWN, self.onKeyDown)
self.Bind(wx.EVT_KEY_UP, self.onKeyUp)
self.on_timer()
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize,
style=0, agwStyle=0, name="ImageContainer"):
"""
Default class constructor.
:param `parent`: parent window. Must not be ``None``;
:param `id`: window identifier. A value of -1 indicates a default value;
:param `pos`: the control position. A value of (-1, -1) indicates a default position,
chosen by either the windowing system or wxPython, depending on platform;
:param `size`: the control size. A value of (-1, -1) indicates a default size,
chosen by either the windowing system or wxPython, depending on platform;
:param `style`: the underlying :class:`Panel` window style;
:param `agwStyle`: the AGW-specific window style. This can be a combination of the
following bits:
=========================== =========== ==================================================
Window Styles Hex Value Description
=========================== =========== ==================================================
``INB_BOTTOM`` 0x1 Place labels below the page area. Available only for :class:`FlatImageBook`.
``INB_LEFT`` 0x2 Place labels on the left side. Available only for :class:`FlatImageBook`.
``INB_RIGHT`` 0x4 Place labels on the right side.
``INB_TOP`` 0x8 Place labels above the page area.
``INB_BORDER`` 0x10 Draws a border around :class:`LabelBook` or :class:`FlatImageBook`.
``INB_SHOW_ONLY_TEXT`` 0x20 Shows only text labels and no images. Available only for :class:`LabelBook`.
``INB_SHOW_ONLY_IMAGES`` 0x40 Shows only tab images and no label texts. Available only for :class:`LabelBook`.
``INB_FIT_BUTTON`` 0x80 Displays a pin button to show/hide the book control.
``INB_DRAW_SHADOW`` 0x100 Draw shadows below the book tabs. Available only for :class:`LabelBook`.
``INB_USE_PIN_BUTTON`` 0x200 Displays a pin button to show/hide the book control.
``INB_GRADIENT_BACKGROUND`` 0x400 Draws a gradient shading on the tabs background. Available only for :class:`LabelBook`.
``INB_WEB_HILITE`` 0x800 On mouse hovering, tabs behave like html hyperlinks. Available only for :class:`LabelBook`.
``INB_NO_RESIZE`` 0x1000 Don't allow resizing of the tab area.
``INB_FIT_LABELTEXT`` 0x2000 Will fit the tab area to the longest text (or text+image if you have images) in all the tabs.
``INB_BOLD_TAB_SELECTION`` 0x4000 Show the selected tab text using a bold font.
=========================== =========== ==================================================
:param `name`: the window name.
"""
ImageContainerBase.__init__(self, parent, id, pos, size, style, agwStyle, name)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_SIZE, self.OnSize)
self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseLeftDown)
self.Bind(wx.EVT_LEFT_UP, self.OnMouseLeftUp)
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
self.Bind(wx.EVT_MOTION, self.OnMouseMove)
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnMouseLeaveWindow)
def GenerateSearchResultsTreeBranch(self, root, infos):
to_delete = []
if infos["name"] == "body":
item_name = "%d:" % infos["data"][1][0]
else:
item_name = infos["name"]
self.SearchResultsTree.SetItemText(root, item_name)
self.SearchResultsTree.SetPyData(root, infos["data"])
self.SearchResultsTree.SetItemBackgroundColour(root, wx.WHITE)
self.SearchResultsTree.SetItemTextColour(root, wx.BLACK)
if infos["type"] is not None:
if infos["type"] == ITEM_POU:
self.SearchResultsTree.SetItemImage(root, self.TreeImageDict[self.ParentWindow.Controler.GetPouType(infos["name"])])
else:
self.SearchResultsTree.SetItemImage(root, self.TreeImageDict[infos["type"]])
text = None
if infos["text"] is not None:
text = infos["text"]
start, end = infos["data"][1:3]
text_lines = infos["text"].splitlines()
start_idx = start[1]
end_idx = reduce(lambda x, y: x + y, map(lambda x: len(x) + 1, text_lines[:end[0] - start[0]]), end[1] + 1)
style = wx.TextAttr(wx.BLACK, wx.Colour(206, 204, 247))
elif infos["type"] is not None and infos["matches"] > 1:
text = _("(%d matches)") % infos["matches"]
start_idx, end_idx = 0, len(text)
style = wx.TextAttr(wx.Colour(0, 127, 174))
if text is not None:
text_ctrl_style = wx.BORDER_NONE | wx.TE_READONLY | wx.TE_RICH2
if wx.Platform != '__WXMSW__' or len(text.splitlines()) > 1:
text_ctrl_style |= wx.TE_MULTILINE
text_ctrl = wx.TextCtrl(id=-1, parent=self.SearchResultsTree, pos=wx.Point(0, 0),
value=text, style=text_ctrl_style)
width, height = text_ctrl.GetTextExtent(text)
text_ctrl.SetClientSize(wx.Size(width + 1, height))
text_ctrl.SetBackgroundColour(self.SearchResultsTree.GetBackgroundColour())
text_ctrl.Bind(wx.EVT_LEFT_DOWN, self.GetTextCtrlClickFunction(root))
text_ctrl.Bind(wx.EVT_LEFT_DCLICK, self.GetTextCtrlDClickFunction(root))
text_ctrl.SetInsertionPoint(0)
text_ctrl.SetStyle(start_idx, end_idx, style)
self.SearchResultsTree.SetItemWindow(root, text_ctrl)
if wx.VERSION >= (2, 6, 0):
item, root_cookie = self.SearchResultsTree.GetFirstChild(root)
else:
item, root_cookie = self.SearchResultsTree.GetFirstChild(root, 0)
for child in infos["children"]:
if item is None:
item = self.SearchResultsTree.AppendItem(root, "")
item, root_cookie = self.SearchResultsTree.GetNextChild(root, root_cookie)
self.GenerateSearchResultsTreeBranch(item, child)
item, root_cookie = self.SearchResultsTree.GetNextChild(root, root_cookie)
def __init__(self, parent, folder, filter=None, editable=True):
wx.Panel.__init__(self, parent, style=wx.TAB_TRAVERSAL)
main_sizer = wx.BoxSizer(wx.VERTICAL)
self.Tree = wx.TreeCtrl(self,
style=(wx.TR_HAS_BUTTONS |
wx.TR_SINGLE |
wx.SUNKEN_BORDER |
wx.TR_HIDE_ROOT |
wx.TR_LINES_AT_ROOT |
wx.TR_EDIT_LABELS))
if wx.Platform == '__WXMSW__':
self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnTreeItemExpanded, self.Tree)
self.Tree.Bind(wx.EVT_LEFT_DOWN, self.OnTreeLeftDown)
else:
self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnTreeItemExpanded, self.Tree)
self.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnTreeItemCollapsed, self.Tree)
self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnTreeBeginLabelEdit, self.Tree)
self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnTreeEndLabelEdit, self.Tree)
main_sizer.AddWindow(self.Tree, 1, flag=wx.GROW)
if filter is not None:
self.Filter = wx.ComboBox(self, style=wx.CB_READONLY)
self.Bind(wx.EVT_COMBOBOX, self.OnFilterChanged, self.Filter)
main_sizer.AddWindow(self.Filter, flag=wx.GROW)
else:
self.Filter = None
self.SetSizer(main_sizer)
self.Folder = folder
self.Editable = editable
self.TreeImageList = wx.ImageList(16, 16)
self.TreeImageDict = {}
for item_type, bitmap in [(DRIVE, "tree_drive"),
(FOLDER, "tree_folder"),
(FILE, "tree_file")]:
self.TreeImageDict[item_type] = self.TreeImageList.Add(GetBitmap(bitmap))
self.Tree.SetImageList(self.TreeImageList)
self.Filters = {}
if self.Filter is not None:
filter_parts = filter.split("|")
for idx in xrange(0, len(filter_parts), 2):
if filter_parts[idx + 1] == "*.*":
self.Filters[filter_parts[idx]] = ""
else:
self.Filters[filter_parts[idx]] = filter_parts[idx + 1].replace("*", "")
self.Filter.Append(filter_parts[idx])
if idx == 0:
self.Filter.SetStringSelection(filter_parts[idx])
self.CurrentFilter = self.Filters[self.Filter.GetStringSelection()]
else:
self.CurrentFilter = ""
def __init__( self, parent ):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = "Plugins Tree",
pos = wx.DefaultPosition, size = wx.Size( 452,300 ),
style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
logopath = os.path.join(root_dir, 'data/logo.ico')
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
bSizer1 = wx.BoxSizer( wx.HORIZONTAL )
self.tre_plugins = wx.TreeCtrl( self, wx.ID_ANY, wx.DefaultPosition,
wx.DefaultSize, wx.TR_DEFAULT_STYLE )
self.tre_plugins.SetMinSize( wx.Size( 200,-1 ) )
bSizer1.Add( self.tre_plugins, 0, wx.ALL|wx.EXPAND, 5 )
bSizer3 = wx.BoxSizer( wx.VERTICAL )
bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, "Plugin Infomation:",
wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText2.Wrap( -1 )
bSizer4.Add( self.m_staticText2, 0, wx.ALL, 5 )
self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, "[SourceCode]",
wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText3.Wrap( -1 )
self.m_staticText3.SetForegroundColour(
wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) )
bSizer4.Add( self.m_staticText3, 0, wx.ALL, 5 )
bSizer3.Add( bSizer4, 0, wx.EXPAND, 5 )
self.txt_info = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString,
wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE )
bSizer3.Add( self.txt_info, 1, wx.ALL|wx.EXPAND, 5 )
bSizer1.Add( bSizer3, 1, wx.EXPAND, 5 )
self.SetSizer( bSizer1 )
self.Layout()
self.Centre( wx.BOTH )
# Connect Events
self.tre_plugins.Bind( wx.EVT_TREE_ITEM_ACTIVATED, self.on_run )
self.tre_plugins.Bind( wx.EVT_TREE_SEL_CHANGED, self.on_select )
self.m_staticText3.Bind( wx.EVT_LEFT_DOWN, self.on_source )
self.plg = None
self.load()
def __init__( self, parent ):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = "Tools Tree",
pos = wx.DefaultPosition, size = wx.Size( 452,300 ),
style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
logopath = os.path.join(root_dir, 'data/logo.ico')
self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_3DLIGHT ) )
self.SetIcon(wx.Icon(logopath, wx.BITMAP_TYPE_ICO))
self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
bSizer1 = wx.BoxSizer( wx.HORIZONTAL )
self.tre_plugins = wx.TreeCtrl( self, wx.ID_ANY, wx.DefaultPosition,
wx.DefaultSize, wx.TR_DEFAULT_STYLE )
self.tre_plugins.SetMinSize( wx.Size( 200,-1 ) )
bSizer1.Add( self.tre_plugins, 0, wx.ALL|wx.EXPAND, 5 )
bSizer3 = wx.BoxSizer( wx.VERTICAL )
bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, "Tool Infomation:",
wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText2.Wrap( -1 )
bSizer4.Add( self.m_staticText2, 0, wx.ALL, 5 )
self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, "[SourceCode]",
wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_staticText3.Wrap( -1 )
self.m_staticText3.SetForegroundColour(
wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHT ) )
bSizer4.Add( self.m_staticText3, 0, wx.ALL, 5 )
bSizer3.Add( bSizer4, 0, wx.EXPAND, 5 )
self.txt_info = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString,
wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE )
bSizer3.Add( self.txt_info, 1, wx.ALL|wx.EXPAND, 5 )
bSizer1.Add( bSizer3, 1, wx.EXPAND, 5 )
self.SetSizer( bSizer1 )
self.Layout()
self.Centre( wx.BOTH )
# Connect Events
self.tre_plugins.Bind( wx.EVT_TREE_ITEM_ACTIVATED, self.on_run )
self.tre_plugins.Bind( wx.EVT_TREE_SEL_CHANGED, self.on_select )
self.m_staticText3.Bind( wx.EVT_LEFT_DOWN, self.on_source )
self.plg = None
self.load()