File: Index.py

package info (click to toggle)
spe 0.8.2a%2Brepack-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,812 kB
  • ctags: 6,555
  • sloc: python: 45,491; makefile: 146; sh: 2
file content (36 lines) | stat: -rwxr-xr-x 948 bytes parent folder | download | duplicates (5)
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
####(c)www.stani.be-------------------------------------------------------------

import _spe.info
INFO=_spe.info.copy()

INFO['description']=\
"""Index as tab."""

__doc__=INFO['doc']%INFO

####Panel class-----------------------------------------------------------------

import wx

import sys
import _spe.help

if sys.platform == 'win32':
    LIST_STYLE  = wx.LC_LIST|wx.LC_SMALL_ICON
else:
    LIST_STYLE  = wx.LC_LIST

class Panel(wx.ListCtrl):
    def __init__(self,panel,*args,**kwds):
        self.panel  = panel
        wx.ListCtrl.__init__(self,parent=panel,style=panel.LIST_STYLE)
        self.SetImageList(panel.iconsList,wx.IMAGE_LIST_SMALL)
        self.SetHelpText(_spe.help.INDEX)
        #---events
        wx.EVT_LIST_ITEM_SELECTED(self,-1,self.onSelect)
        
    #---events
    def onSelect(self,event):
        stripped,entry,line,colour,icon,file=self.list[event.GetData()]
        self.panel.openList(file,line-1)