Пример #1
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, -1)
        self.list = wx.ListCtrl(
            self,
            -1,
            style=wx.LC_LIST
            #| wx.BORDER_SUNKEN
            #| wx.BORDER_NONE
            #| wx.LC_EDIT_LABELS
            #| wx.LC_SORT_ASCENDING
            #| wx.LC_NO_HEADER
            #| wx.LC_VRULES
            #| wx.LC_HRULES
            | wx.LC_SINGLE_SEL)
        self.imagelist = wx.ImageList(16, 16)
        self.imagelist.Add(IconImages.getPythonBitmap())
        self.imagelist.Add(IconImages.getIfBitmap())
        self.imagelist.Add(IconImages.getLoopBitmap())
        self.imagelist.Add(IconImages.getBlockBitmap())

        self.list.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL)
        self.list.InsertImageStringItem(0, 'SCRIPT', 0)
        self.list.InsertImageStringItem(1, 'IF', 1)
        self.list.InsertImageStringItem(2, 'LOOP', 2)
        self.list.InsertImageStringItem(3, 'BLOCK', 3)

        # layout
        import Layout
        Layout.SingleLayout(self, self.list)

        # event binding
        self.list.Bind(wx.EVT_LIST_BEGIN_DRAG, self.OnBeginDrag)

        #
        self.BindGetUserData()
Пример #2
0
	def __init__(self, parent, id, project = None, reporter = None):
		wx.Toolbook.__init__(self, parent, id, style=wx.BK_TOP)

		images = wx.ImageList(32, 32)
		if sys.platform == 'linux2':
			# Must set icons for Linux
			images.Add(IconImages.getRecordTabBitmap())
			images.Add(IconImages.getEditTabBitmap())
			images.Add(IconImages.getPlayTabBitmap())
			images.Add(IconImages.getReportTabBitmap())
		self.AssignImageList(images)

		self.recordTab = RecordTab(self)
		self.AddPage(self.recordTab, 'Record', imageId=0)
		self.recordTab.ResetSize()

		self.editTab = EditTab(self)
		self.AddPage(self.editTab, 'Edit', imageId=1)
		self.editTab.ResetSize()

		self.editTab.recordPanel.SetMirrorOf(self.recordTab.tree)
		self.recordTab.tree.AddObserver(self.editTab.specialsPanel.UpdateSome)

		self.playTab = PlayTab(self, project, reporter)
		self.AddPage(self.playTab, 'Play', imageId=2)
		self.playTab.ResetSize()

		self.editTab.specialsPanel.onNewSpecialCallback = self.playTab.policyPanel.UpdateSpecials

		self.reportTab = ReportTab(self)
		self.AddPage(self.reportTab, 'Report', imageId=3)
		self.reportTab.ResetSize()
Пример #3
0
	def __init__(self, parent):
		wx.Panel.__init__(self, parent, -1)
		self.list = wx.ListCtrl(self, -1,
				style=wx.LC_LIST 
				#| wx.BORDER_SUNKEN
				#| wx.BORDER_NONE
				#| wx.LC_EDIT_LABELS
				#| wx.LC_SORT_ASCENDING
				#| wx.LC_NO_HEADER
				#| wx.LC_VRULES
				#| wx.LC_HRULES
				| wx.LC_SINGLE_SEL
				)
		self.imagelist = wx.ImageList(16, 16)
		self.imagelist.Add(IconImages.getPythonBitmap())
		self.imagelist.Add(IconImages.getIfBitmap())
		self.imagelist.Add(IconImages.getLoopBitmap())
		self.imagelist.Add(IconImages.getBlockBitmap())

		self.list.SetImageList(self.imagelist, wx.IMAGE_LIST_SMALL)
		self.list.InsertImageStringItem(0, 'SCRIPT', 0)
		self.list.InsertImageStringItem(1, 'IF', 1)
		self.list.InsertImageStringItem(2, 'LOOP', 2)
		self.list.InsertImageStringItem(3, 'BLOCK', 3)

		# layout
		import Layout
		Layout.SingleLayout(self, self.list)

		# event binding
		self.list.Bind(wx.EVT_LIST_BEGIN_DRAG, self.OnBeginDrag)

		#
		self.BindGetUserData()
Пример #4
0
    def __init__(self, parent, id, project=None, reporter=None):
        wx.Toolbook.__init__(self, parent, id, style=wx.BK_TOP)

        images = wx.ImageList(32, 32)
        if sys.platform == 'linux2':
            # Must set icons for Linux
            images.Add(IconImages.getRecordTabBitmap())
            images.Add(IconImages.getEditTabBitmap())
            images.Add(IconImages.getPlayTabBitmap())
            images.Add(IconImages.getReportTabBitmap())
        self.AssignImageList(images)

        self.recordTab = RecordTab(self)
        self.AddPage(self.recordTab, 'Record', imageId=0)
        self.recordTab.ResetSize()

        self.editTab = EditTab(self)
        self.AddPage(self.editTab, 'Edit', imageId=1)
        self.editTab.ResetSize()

        self.editTab.recordPanel.SetMirrorOf(self.recordTab.tree)
        self.recordTab.tree.AddObserver(self.editTab.specialsPanel.UpdateSome)

        self.playTab = PlayTab(self, project, reporter)
        self.AddPage(self.playTab, 'Play', imageId=2)
        self.playTab.ResetSize()

        self.editTab.specialsPanel.onNewSpecialCallback = self.playTab.policyPanel.UpdateSpecials

        self.reportTab = ReportTab(self)
        self.AddPage(self.reportTab, 'Report', imageId=3)
        self.reportTab.ResetSize()
Пример #5
0
    def InitializeRoot(self):
        self.tree = Tree(self, multiple=True)
        self.root = self.tree.root

        import ContentTypeHandler
        icons = {
            Record.Record: IconImages.getRecordBitmap(),
            Record.Page: IconImages.getPageBitmap(),
            Record.Hit: IconImages.getHitBitmap(),
            ContentTypeHandler.DefaultContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.AMFContentType: IconImages.getFlexBitmap(),
            ContentTypeHandler.HTMLContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.XMLContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.PythonContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.BinContentType: IconImages.getWebBitmap(),
        }
        self.tree.SetIcons(icons)

        def GetType(data):
            if isinstance(data, Record.Hit):
                # TODO: this check is for compatibility, remove it in future
                if isinstance(data.req_handler,
                              ContentTypeHandler.ContentType):
                    return data.req_handler.__class__
                else:
                    # You see, really dirty trick,  so remove it in future...
                    if 'AMF' in str(data.req_handler.coder):
                        return ContentTypeHandler.AMFContentType
                    else:
                        return data.__class__
            else:
                return data.__class__

        self.tree.GetType = GetType
Пример #6
0
    def InitializeRoot(self):
        self.tree = Tree(self, multiple=True)
        self.root = self.tree.root

        import ContentTypeHandler

        icons = {
            Record.Record: IconImages.getRecordBitmap(),
            Record.Page: IconImages.getPageBitmap(),
            Record.Hit: IconImages.getHitBitmap(),
            ContentTypeHandler.DefaultContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.AMFContentType: IconImages.getFlexBitmap(),
            ContentTypeHandler.HTMLContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.XMLContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.PythonContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.BinContentType: IconImages.getWebBitmap(),
        }
        self.tree.SetIcons(icons)

        def GetType(data):
            if isinstance(data, Record.Hit):
                # TODO: this check is for compatibility, remove it in future
                if isinstance(data.req_handler, ContentTypeHandler.ContentType):
                    return data.req_handler.__class__
                else:
                    # You see, really dirty trick,  so remove it in future...
                    if "AMF" in str(data.req_handler.coder):
                        return ContentTypeHandler.AMFContentType
                    else:
                        return data.__class__
            else:
                return data.__class__

        self.tree.GetType = GetType
Пример #7
0
	def InitIcons(self):
		if sys.platform == 'linux2':
			iconSize = (24, 24)
		else:
			iconSize = (16, 16)
		self.newIcon = wx.ArtProvider_GetBitmap(wx.ART_NEW, wx.ART_OTHER, iconSize)
		self.newIconOff = wx.ArtProvider_GetBitmap(wx.ART_ERROR, wx.ART_OTHER, iconSize) #TODO: add correct icon
		self.openIcon = wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, wx.ART_OTHER, iconSize)
		self.openIconOff = wx.ArtProvider_GetBitmap(wx.ART_ERROR, wx.ART_OTHER, iconSize) #TODO: add correct icon
		self.saveIcon = wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE, wx.ART_OTHER, iconSize)
		self.saveIconOff = wx.ArtProvider_GetBitmap(wx.ART_ERROR, wx.ART_OTHER, iconSize) #TODO: add correct icon
		self.saveAsIcon = wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS, wx.ART_OTHER, iconSize)
		self.saveAsIconOff = wx.ArtProvider_GetBitmap(wx.ART_ERROR, wx.ART_OTHER, iconSize) #TODO: add correct icon

		self.startIcon = IconImages.getStartBitmap()
		self.startIconOff = IconImages.getStartOffBitmap()

		self.stopIcon = IconImages.getStopBitmap()
		self.stopIconOff = IconImages.getStopOffBitmap()

		self.playIcon = IconImages.getRunBitmap()
		self.playIconOff = IconImages.getRunOffBitmap()

		self.terminateIcon = IconImages.getTerminateBitmap()
		self.terminateIconOff = IconImages.getTerminateOffBitmap()
Пример #8
0
    def InitIcons(self):
        if sys.platform == 'linux2':
            iconSize = (24, 24)
        else:
            iconSize = (16, 16)
        self.newIcon = wx.ArtProvider_GetBitmap(wx.ART_NEW, wx.ART_OTHER,
                                                iconSize)
        self.newIconOff = wx.ArtProvider_GetBitmap(
            wx.ART_ERROR, wx.ART_OTHER, iconSize)  #TODO: add correct icon
        self.openIcon = wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN,
                                                 wx.ART_OTHER, iconSize)
        self.openIconOff = wx.ArtProvider_GetBitmap(
            wx.ART_ERROR, wx.ART_OTHER, iconSize)  #TODO: add correct icon
        self.saveIcon = wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE,
                                                 wx.ART_OTHER, iconSize)
        self.saveIconOff = wx.ArtProvider_GetBitmap(
            wx.ART_ERROR, wx.ART_OTHER, iconSize)  #TODO: add correct icon
        self.saveAsIcon = wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS,
                                                   wx.ART_OTHER, iconSize)
        self.saveAsIconOff = wx.ArtProvider_GetBitmap(
            wx.ART_ERROR, wx.ART_OTHER, iconSize)  #TODO: add correct icon

        self.startIcon = IconImages.getStartBitmap()
        self.startIconOff = IconImages.getStartOffBitmap()

        self.stopIcon = IconImages.getStopBitmap()
        self.stopIconOff = IconImages.getStopOffBitmap()

        self.playIcon = IconImages.getRunBitmap()
        self.playIconOff = IconImages.getRunOffBitmap()

        self.terminateIcon = IconImages.getTerminateBitmap()
        self.terminateIconOff = IconImages.getTerminateOffBitmap()
Пример #9
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, -1)

        self.searchField = wx.SearchCtrl(self,
                                         -1,
                                         size=(200, -1),
                                         style=wx.TE_PROCESS_ENTER)
        self.searchField.ShowSearchButton(True)
        self.searchField.ShowCancelButton(True)
        self.InitHistory()

        iconSize = (16, 16)
        #self.downButton = wx.Button(self, -1, 'Next')
        downIcon = IconImages.getDownBitmap()
        self.downButton = wx.BitmapButton(self, -1, downIcon, iconSize,
                                          (26, 26))
        self.downButton.SetToolTipString("Next")
        #self.upButton = wx.Button(self, -1, 'Prev')
        upIcon = IconImages.getUpBitmap()
        self.upButton = wx.BitmapButton(self, -1, upIcon, iconSize, (26, 26))
        self.upButton.SetToolTipString("Prvious")

        self.caseCheck = wx.CheckBox(self, -1, "Match Case")
        self.caseCheck.SetToolTipString("Match Case")
        self.reCheck = wx.CheckBox(self, -1, "RE")
        self.reCheck.SetToolTipString("Use Regular Expression")

        sizer = wx.FlexGridSizer(cols=5, hgap=4, vgap=10)
        sizer.AddGrowableCol(4)
        sizer.Add(self.searchField, 1, wx.EXPAND)
        sizer.Add(self.downButton, 2, wx.ALIGN_CENTER_VERTICAL)
        sizer.Add(self.upButton, 3, wx.ALIGN_CENTER_VERTICAL)
        sizer.Add(self.caseCheck, 4, wx.ALIGN_CENTER_VERTICAL)
        sizer.Add(self.reCheck, 5, wx.ALIGN_CENTER_VERTICAL)

        self.SetSizer(sizer)

        # bindings
        self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.OnCallMenu,
                  self.searchField)
        self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnCancel,
                  self.searchField)
        self.Bind(wx.EVT_TEXT_ENTER, self.OnEnterSearch, self.searchField)
        self.Bind(wx.EVT_TEXT, self.OnIncrSearch, self.searchField)

        self.Bind(wx.EVT_MENU, self.OnUseHistory)

        self.Bind(wx.EVT_BUTTON, self.OnNext, self.downButton)
        self.Bind(wx.EVT_BUTTON, self.OnPrev, self.upButton)
Пример #10
0
	def __init__(self, parent):
		Tree.__init__(self, parent)

		iconSize = self.iconSize
		icons = {
			'element': IconImages.getXMLElementBitmap(),
			}
		self.SetIcons(icons)
Пример #11
0
    def __init__(self, parent):
        Tree.__init__(self, parent)

        iconSize = self.iconSize
        icons = {
            'element': IconImages.getXMLElementBitmap(),
        }
        self.SetIcons(icons)
Пример #12
0
	def __init__(self, parent):
		wx.Panel.__init__(self, parent, -1)

		self.searchField = wx.SearchCtrl(self, -1, size=(200,-1), style=wx.TE_PROCESS_ENTER)
		self.searchField.ShowSearchButton(True)
		self.searchField.ShowCancelButton(True)
		self.InitHistory()

		iconSize = (16, 16)
		#self.downButton = wx.Button(self, -1, 'Next')
		downIcon = IconImages.getDownBitmap()
		self.downButton = wx.BitmapButton(self, -1, downIcon, iconSize, (26, 26))
		self.downButton.SetToolTipString("Next")
		#self.upButton = wx.Button(self, -1, 'Prev')
		upIcon = IconImages.getUpBitmap()
		self.upButton = wx.BitmapButton(self, -1, upIcon, iconSize, (26, 26))
		self.upButton.SetToolTipString("Prvious")

		self.caseCheck = wx.CheckBox(self, -1, "Match Case")
		self.caseCheck.SetToolTipString("Match Case")
		self.reCheck = wx.CheckBox(self, -1, "RE")
		self.reCheck.SetToolTipString("Use Regular Expression")

		sizer = wx.FlexGridSizer(cols=5, hgap=4, vgap=10)
		sizer.AddGrowableCol(4)
		sizer.Add(self.searchField, 1, wx.EXPAND)
		sizer.Add(self.downButton, 2, wx.ALIGN_CENTER_VERTICAL)
		sizer.Add(self.upButton, 3, wx.ALIGN_CENTER_VERTICAL)
		sizer.Add(self.caseCheck, 4, wx.ALIGN_CENTER_VERTICAL)
		sizer.Add(self.reCheck, 5, wx.ALIGN_CENTER_VERTICAL)

		self.SetSizer(sizer)

		# bindings
		self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.OnCallMenu, self.searchField)
		self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnCancel, self.searchField)
		self.Bind(wx.EVT_TEXT_ENTER, self.OnEnterSearch, self.searchField)
		self.Bind(wx.EVT_TEXT, self.OnIncrSearch, self.searchField)        

		self.Bind(wx.EVT_MENU, self.OnUseHistory)
 
		self.Bind(wx.EVT_BUTTON, self.OnNext, self.downButton)
		self.Bind(wx.EVT_BUTTON, self.OnPrev, self.upButton)
Пример #13
0
	def InitTree(self):
		self.tree = Tree(self, multiple = True)
		self.root = self.tree.root

		# FIXME: duplicated code in RecordPanel.py
		import ContentTypeHandler
		icons = {
				Special       : (IconImages.getSpecialOffBitmap(),
								 IconImages.getSpecialBitmap()),

				Record.Record : IconImages.getRecordBitmap(),
				Record.Page   : IconImages.getPageBitmap(),
				Record.Hit    : IconImages.getHitBitmap(),

				Controller.Script: IconImages.getPythonBitmap(),
				Controller.If    : IconImages.getIfBitmap(),
				Controller.Loop  : IconImages.getLoopBitmap(),
				Controller.Block : IconImages.getBlockBitmap(),

				ContentTypeHandler.DefaultContentType : IconImages.getWebBitmap(),
				ContentTypeHandler.AMFContentType     : IconImages.getFlexBitmap(),
				ContentTypeHandler.HTMLContentType    : IconImages.getWebBitmap(),
				ContentTypeHandler.XMLContentType     : IconImages.getXMLBitmap(),
				ContentTypeHandler.PythonContentType  : IconImages.getPythonBitmap(),
				ContentTypeHandler.BinContentType     : IconImages.getBinaryBitmap(),
				}
		self.tree.SetIcons(icons)

		def GetType(data):
			if isinstance(data, Record.Hit):
				# TODO: this check is for compatibility, remove it in future
				if isinstance(data.req_handler, ContentTypeHandler.ContentType):
					return data.req_handler.__class__
				else:
					# You see, really dirty trick,  so remove it in future...
					if 'AMF' in str(data.req_handler.coder):
						return ContentTypeHandler.AMFContentType
					else:
						return data.__class__
			else:
				return data.__class__

		self.tree.GetType = GetType