Esempio n. 1
0
 def __init__(self,):
     wx.Frame.__init__(self, util.getMainFrame(), wx.ID_ANY)
     mainSizer = wx.BoxSizer(wx.VERTICAL)
     self.SetTitle("PVS GUI Help")
     help = wx.html.HtmlWindow(self, wx.ID_ANY, style=wx.NO_BORDER)
     helpFile = os.path.join(config.PVSIDEConfiguration().applicationFolder, "src", "help.html")
     mainSizer.Add(help, 1, wx.EXPAND, 5)
     self.SetSizer(mainSizer)
     help.LoadPage(helpFile)
     self.SetSize((500, 600))
Esempio n. 2
0
 def _initialize(self):
     self.testContext = "/Users/saadati/projects/pvs/Examples"
     self.testPVSFile = "sum"
     self.tobeProved = ("/Users/saadati/projects/pvs/Examples/sum.pvs",
                        "sum", "closed_form")
     self.proofCommand = "(grind)"
     logging.getLogger(constants.LROOT).setLevel(logging.DEBUG)
     configDirectory = os.path.dirname(config.__file__)
     applicationFolder = os.path.abspath(
         os.path.join(configDirectory, os.path.pardir))
     config.PVSIDEConfiguration().initialize(applicationFolder)
Esempio n. 3
0
 def __init__(self, parent):
     stc.StyledTextCtrl.__init__(self, parent, wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TE_MULTILINE | wx.HSCROLL | wx.TE_RICH | wx.TE_RICH2)
     self.SetMarginType(0, stc.STC_MARGIN_NUMBER)
     self.SetMarginWidth(0, 30)
     self.SetMarginSensitive(0, True)
     self.SetCodePage(stc.STC_CP_UTF8)
     self.namesInformation = []
     cfg = config.PVSIDEConfiguration()
     faces['default_color'] = cfg.default_color
     faces['identity_color'] = cfg.identity_color
     faces['keyword_color'] = cfg.keyword_color
     faces['comment_color'] = cfg.comment_color
     faces['number_color'] = cfg.number_color
     faces['operator_color'] = cfg.operator_color
     faces['string_color'] = cfg.string_color
     faces['size'] = cfg.font_size
     faces['font'] = cfg.font
     
     self.StyleSetSpec(stc.STC_STYLE_LINENUMBER, "size:%d,face:%s" % (faces['size2'], faces['times']))
     self.SetMarginType(1, stc.STC_MARGIN_SYMBOL)
     self.SetMouseDownCaptures(True)
     self.UsePopUp(0)
     self.MarkerDefine(0, stc.STC_MARK_ROUNDRECT, "#CCFF00", "RED")
     #self.MarkerDefineBitmap(1, ui.images.getBitmap("debug.png"))
     self.MarkerDefine(1, stc.STC_MARK_CIRCLE, "RED", "RED")
     #self.MarkerDefine(1, stc.STC_MARK_CIRCLE, "FOREST GREEN", "SIENNA")
     self.MarkerDefine(2, stc.STC_MARK_SHORTARROW, "blue", "blue")
     self.MarkerDefine(3, stc.STC_MARK_ARROW, "#00FF00", "#00FF00")
     self.SetStyleBits(7)
     self.SetMouseDwellTime(300)
     
     self.RegisterImage(1, ui.images.getBulletImage())
     self.autoCompleteWords = constants.PVS_KEYWORDS.upper().split()
     self.autoCompleteWords = self.autoCompleteWords + constants.MATH_SYMBOLS.keys()
     self.autoCompleteWords.sort()
     self.autoCompleteWords = " ".join(self.autoCompleteWords)
     
     self.setSyntaxHighlighting_usingmatlab()
     
     self.Bind(wx.EVT_SET_CURSOR, self.onCursor)  #TODO: what is this?
     self.Bind(stc.EVT_STC_DWELLSTART, self.onMouseDwellStarted)
     #self.Bind(stc.EVT_STC_DWELLEND, self.onMouseDwellEnded)
     self.Bind(wx.EVT_RIGHT_UP, self.onMouseRightClicked)
     self.Bind(stc.EVT_STC_MARGINCLICK, self.onMarginClicked)
     self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPressed)
     self.Bind(wx.stc.EVT_STC_AUTOCOMP_SELECTION, self.OnAutoCompItemSelected)
Esempio n. 4
0
def getBitmap(filename):
    import config
    cfg = config.PVSIDEConfiguration()
    return wx.Bitmap(os.path.join(cfg.imageFolderPath, filename),
                     wx.BITMAP_TYPE_ANY)
Esempio n. 5
0
 def initializeCommandList(self):
     self.commandList = config.PVSIDEConfiguration().proverCommands.keys()
     self.commandList.sort()
Esempio n. 6
0
 def OnSelectCommand(self, event):
     item = event.GetSelection()
     command = self.commandList[item]
     self.commandTextControl.SetValue(config.PVSIDEConfiguration().proverCommands[command])
Esempio n. 7
0
 def getLastFrameSize(self):
     return self.getValue(Preferences.FRAMESIZE,
                          config.PVSIDEConfiguration().ideSize)