forked from kuina/Kuin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
390 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
------------------------------------------------------------------------------- | ||
Kuin Programming Language | ||
v.2018.6.17 | ||
v.2018.7.17 | ||
(C) Kuina-chan | ||
------------------------------------------------------------------------------- | ||
|
||
|
@@ -43,6 +43,17 @@ v.2018.6.17 | |
4. 変更履歴 | ||
------------------------------------------------------------------------------- | ||
|
||
v.2018.7.17 | ||
- よく使うコードを簡単に挿入できる、スニペット機能の追加 | ||
- 互換性が失われる変更 | ||
- [email protected]を[email protected]に変更 | ||
- 細かな機能追加 | ||
- [email protected]、[email protected]、 | ||
[email protected]メソッドの追加 | ||
- [email protected]、[email protected]イベントの追加 | ||
- 細かな不具合の修正 | ||
- math@lcm関数に渡す値が大きいとオーバーフローする不具合の修正 | ||
|
||
v.2018.6.17 | ||
- 互換性が失われる変更 | ||
- 「+**」構文の廃止と、オーバーライド元メソッドを参照する「super」構文の | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<snippets> | ||
<snippet> | ||
<name>mainと空のウインドウ</name> | ||
<code>var wndMain: wnd@Wnd | ||
|
||
func main() | ||
do @wndMain :: wnd@makeWnd(null, %normal, 800, 450, "Title") | ||
|
||
while(wnd@act()) | ||
end while | ||
end func | ||
</code> | ||
</snippet> | ||
<snippet> | ||
<name>mainとdrawコントロール</name> | ||
<code>var wndMain: wnd@Wnd | ||
var drawMain: wnd@Draw | ||
|
||
func main() | ||
do @wndMain :: wnd@makeWnd(null, %aspect, 1600, 900, "Title") | ||
do @drawMain :: wnd@makeDraw(@wndMain, 0, 0, 1600, 900, %scale, %scale, false) | ||
|
||
while(wnd@act()) | ||
do draw@render(60) | ||
end while | ||
end func | ||
</code> | ||
</snippet> | ||
<snippet> | ||
<name>listの走査</name> | ||
<code>do _0.head() | ||
while(!_0.term()) | ||
var _1: _2 :: _0.get() | ||
|
||
do _0.next() | ||
end while | ||
</code> | ||
</snippet> | ||
<snippet> | ||
<name>dictの走査</name> | ||
<code>do _0.forEach(_1, null) | ||
|
||
func _1(key: _2, value: _3, data: kuin@Class): bool | ||
ret true | ||
end func | ||
</code> | ||
</snippet> | ||
</snippets> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,7 +197,7 @@ end func | |
end func | ||
|
||
+*func updateList(list_: wnd@List) | ||
; TODO: | ||
do \snippet@updateList(list_) | ||
end func | ||
|
||
+*func treeItemOnSel() | ||
|
@@ -208,19 +208,37 @@ end func | |
; TODO: | ||
end func | ||
|
||
+*func listInfoOnSel() | ||
; TODO: | ||
{ | ||
var sel: int :: \[email protected]() | ||
if(sel <> -1 & sel < ^me.listInfoItem) | ||
do me.listInfoItem.head() | ||
var item: @ErrListItem :: me.listInfoItem.getOffset(sel) | ||
if(\src@jumpSrc(item.pos)) | ||
do me.propText :: item.text | ||
do \form@updateProp() | ||
end if | ||
+*func listObjOnSel() | ||
var sel: int :: \[email protected]() | ||
if(sel = -1) | ||
ret | ||
end if | ||
var code: []char :: \snippet@getCode(\[email protected](sel)) | ||
if(code =& null) | ||
do \form@updateList() | ||
ret | ||
end if | ||
do me.undo.recordBegin() | ||
if(me.areaSel()) | ||
do me.delAreaStr() | ||
end if | ||
do me.ins(me.cursorX, me.cursorY, code, true) | ||
do me.interpret1SetDirty(me.cursorY, true) | ||
do me.undo.recordEnd() | ||
do me.refreshCursor(false, true) | ||
do \form@paintDrawEditor() | ||
end func | ||
|
||
+*func listPropOnSel(listView: wnd@ListView) | ||
end func | ||
|
||
+*func listPropOnMouseClick(listView: wnd@ListView) | ||
var sel: int :: listView.getSel() | ||
if(sel <> -1 & sel < ^me.errList) | ||
do me.errList.head() | ||
var item: @ErrListItem :: me.errList.getOffset(sel) | ||
do \src@jumpSrc(item.pos) | ||
end if | ||
} | ||
end func | ||
|
||
+*func mouseDownL(x: int, y: int) | ||
|
@@ -634,6 +652,31 @@ end func | |
end if | ||
end func | ||
|
||
+*func getSelCode(): []char | ||
if(!me.areaSel()) | ||
ret null | ||
end if | ||
var x1: int :: me.areaX | ||
var y1: int :: me.areaY | ||
var x2: int :: me.cursorX | ||
var y2: int :: me.cursorY | ||
if(y1 > y2 | y1 = y2 & x1 > x2) | ||
do x1 :$ x2 | ||
do y1 :$ y2 | ||
end if | ||
var str: []char | ||
if(y1 = y2) | ||
do str :: me.src.src[y1].sub(x1, x2 - x1).trim() | ||
else | ||
do str :: me.src.src[y1].sub(x1, -1).trim() ~ "\n" | ||
for i(y1 + 1, y2 - 1) | ||
do str :~ me.src.src[i].trim() ~ "\n" | ||
end for | ||
do str :~ me.src.src[y2].sub(0, x2).trim() | ||
end if | ||
ret str | ||
end func | ||
|
||
func setSrc(src: [][]char) | ||
if(src =& null | ^src = 0) | ||
do me.src.src :: [""] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.