40bd5263
—
pyros2097 13 years ago
savev
- Widget/editor.py +6 -6
- Widget/editor.pyc +0 -0
- Widget/{LexerSquirrel.py → lexersquirrel.py} +11 -9
- config.yaml +1 -2
Widget/editor.py
CHANGED
|
@@ -2,7 +2,7 @@ from PyQt4.QtCore import SIGNAL
|
|
|
2
2
|
from PyQt4.QtGui import QFontMetrics, QFont, QPixmap, QColor
|
|
3
3
|
from PyQt4.Qsci import QsciScintilla, QsciLexerPython ,QsciAPIs ,QsciLexerCPP
|
|
4
4
|
from globals import ospathjoin,workDir,fontSize,fontName
|
|
5
|
-
from
|
|
5
|
+
from lexersquirrel import LexerSquirrel
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class Style:
|
|
@@ -19,7 +19,7 @@ class Style:
|
|
|
19
19
|
|
|
20
20
|
class Editor(QsciScintilla):
|
|
21
21
|
ARROW_MARKER_NUM = 8
|
|
22
|
-
def __init__(self,parent,text,styleIndex = 0,lang =
|
|
22
|
+
def __init__(self,parent,text,styleIndex = 0,lang = 2):
|
|
23
23
|
QsciScintilla.__init__(self,parent)
|
|
24
24
|
self.parent = parent
|
|
25
25
|
self.styleIndex = styleIndex
|
|
@@ -335,10 +335,10 @@ class Editor(QsciScintilla):
|
|
|
335
335
|
self.api.add("emo.Net.request?1(MY_REQUEST_NAME_BY_POST, 'http://www.example.com/','POST', 1000, 'key1', 'value1', 'key2', 'value2')")
|
|
336
336
|
self.api.add("onNetCallback?1(name, response, err)")
|
|
337
337
|
#Physics
|
|
338
|
-
self.api.add("")
|
|
338
|
+
self.api.add("_add")
|
|
339
|
-
self.api.add("")
|
|
339
|
+
self.api.add("_sub")
|
|
340
|
-
self.api.add("")
|
|
340
|
+
self.api.add("_mul")
|
|
341
|
-
self.api.add("")
|
|
341
|
+
self.api.add("_div")
|
|
342
342
|
self.api.add("")
|
|
343
343
|
self.api.add("")
|
|
344
344
|
|
Widget/editor.pyc
CHANGED
|
Binary file
|
Widget/{LexerSquirrel.py → lexersquirrel.py}
RENAMED
|
@@ -5,7 +5,9 @@ from PyQt4.QtGui import *
|
|
|
5
5
|
class LexerSquirrel(QsciLexerCustom):
|
|
6
6
|
def __init__(self, parent = None):
|
|
7
7
|
QsciLexerCustom.__init__(self, parent)
|
|
8
|
+
#self.parent = parent
|
|
8
9
|
self.sci = None
|
|
10
|
+
#self.colorStyle = colorStyle
|
|
9
11
|
self.plainFont = QFont()
|
|
10
12
|
self.plainFont.setPointSize(10)
|
|
11
13
|
self.plainFont.setFamily("Courier New")
|
|
@@ -17,7 +19,7 @@ class LexerSquirrel(QsciLexerCustom):
|
|
|
17
19
|
self.boldFont.setFamily("Courier New")
|
|
18
20
|
self.boldFont.setBold(True)
|
|
19
21
|
self.styles = [
|
|
20
|
-
QsciStyle(0, QString("base"), QColor("#000000"), QColor("#ffffff"), self.plainFont,
|
|
22
|
+
QsciStyle(0, QString("base"), QColor("#000000"), QColor("#ffffff"), self.plainFont, False),
|
|
21
23
|
QsciStyle(1, QString("comment"), QColor("#008000"), QColor("#eeffee"), self.marginFont, True),
|
|
22
24
|
QsciStyle(2, QString("keyword"), QColor("#000080"), QColor("#ffffff"), self.boldFont, True),
|
|
23
25
|
QsciStyle(3, QString("string"), QColor("#800000"), QColor("#ffffff"), self.marginFont, True),
|
|
@@ -25,7 +27,7 @@ class LexerSquirrel(QsciLexerCustom):
|
|
|
25
27
|
QsciStyle(5, QString("macro"), QColor("#808000"), QColor("#ffffff"), self.boldFont, True),
|
|
26
28
|
QsciStyle(6, QString("error"), QColor("#000000"), QColor("#ffd0d0"), self.plainFont, True),
|
|
27
29
|
]
|
|
28
|
-
print("LexerErlang created")
|
|
30
|
+
#print("LexerErlang created")
|
|
29
31
|
|
|
30
32
|
def description(self, ix):
|
|
31
33
|
for i in self.styles:
|
|
@@ -35,31 +37,31 @@ class LexerSquirrel(QsciLexerCustom):
|
|
|
35
37
|
def setEditor(self, sci):
|
|
36
38
|
self.sci = sci
|
|
37
39
|
Qsci.QsciLexerCustom.setEditor(self, sci)
|
|
38
|
-
print("LexerErlang.setEditor()")
|
|
40
|
+
#print("LexerErlang.setEditor()")
|
|
39
41
|
def styleText(self, start, end):
|
|
40
|
-
print("LexerErlang.styleText(%d,%d)" % (start, end))
|
|
42
|
+
#print("LexerErlang.styleText(%d,%d)" % (start, end))
|
|
41
43
|
lines = self.getText(start, end)
|
|
42
44
|
offset = start
|
|
43
45
|
self.startStyling(offset, 0)
|
|
44
|
-
print("startStyling()")
|
|
46
|
+
#print("startStyling()")
|
|
45
47
|
for i in lines:
|
|
46
48
|
if i == "":
|
|
47
49
|
self.setStyling(1, self.styles[0])
|
|
48
|
-
print("setStyling(1)")
|
|
50
|
+
#print("setStyling(1)")
|
|
49
51
|
offset += 1
|
|
50
52
|
continue
|
|
51
53
|
if i[0] == '%':
|
|
52
54
|
self.setStyling(len(i)+1, self.styles[1])
|
|
53
|
-
print("setStyling(%)")
|
|
55
|
+
#print("setStyling(%)")
|
|
54
56
|
offset += len(i)+1
|
|
55
57
|
continue
|
|
56
58
|
self.setStyling(len(i)+1, self.styles[0])
|
|
57
|
-
print("setStyling(n)")
|
|
59
|
+
#print("setStyling(n)")
|
|
58
60
|
offset += len(i)+1
|
|
59
61
|
|
|
60
62
|
def getText(self, start, end):
|
|
61
63
|
data = self.sci.text()
|
|
62
|
-
print("LexerErlang.getText(): " + str(len(data)) + " chars")
|
|
64
|
+
#print("LexerErlang.getText(): " + str(len(data)) + " chars")
|
|
63
65
|
return data[start:end].split('\n')
|
|
64
66
|
|
|
65
67
|
|
config.yaml
CHANGED
|
@@ -5,8 +5,7 @@ ADB:
|
|
|
5
5
|
- adb -d shell ps | grep com.emo_framework.examples | awk '{print $2}' | xargs adb
|
|
6
6
|
shell kill
|
|
7
7
|
File:
|
|
8
|
-
- C:/CODE/assetsdd/howtoscene.nut
|
|
9
|
-
- C:/CODE/assetsdd/
|
|
8
|
+
- C:/CODE/assetsdd/physics.nut
|
|
10
9
|
Project:
|
|
11
10
|
- C:/CODE/data/
|
|
12
11
|
- C:/CODE/assetsdd/
|