OSDN Git Service

Ring 1.10 以来となる開発環境の日本語ローカライズ版 (評価版) を追加 (ノートパッド、フォームデザイナー、対話型実行環境、ファイルの検索)。
[ring-lang-081/ring.git] / applications / rnote / source / rnotetools.ring
1 # The Ring Notepad Application (RNote)
2 # Author : Mahmoud Fayed <msfclipper@yahoo.com>
3
4 class RNoteTools
5
6         func RunTool cFileName
7                 oProcessEditbox.setplaintext("")
8                 oProcessText.setFocus(0)
9                 chdir(JustFilePath(cFileName))
10                 oProcess = RunProcess(cRingEXE,cFileName,cGetProcessData)
11                 chdir(exefolder())
12
13         func RunToolConsole cFileName
14                 if iswindows()
15                         System('start '+exefolder()+'ring "' + cFileName + '"' + nl)
16                 else
17                         cCode = 'cd $(dirname "'+cFileName+'") ; ' + ' ring "' + cFileName + '"' + nl
18                         system(cCode)
19                 ok
20
21         func OpenFormDesigner           
22                 cFormFileName = cCurrentDir + "../formdesigner/formdesigner.ring"
23                 RunTool(cFormFileName)
24
25         func REPLConsole
26                 cAppFileName = cCurrentDir + "../ringrepl/repl.ring"
27                 RunToolConsole(cAppFileName)
28
29         func REPLGUI
30                 cAppFileName = cCurrentDir + "../ringrepl/replw.ring"
31                 # RunTool will split parameters using "," as separator 
32                 if nDefaultStyle <= 3 or nDefaultStyle = STYLECOLOR_IMAGE2
33                         cAppFileName += ",1"    # Style Fusion White
34                 else
35                         cAppFileName += ",2"    # Style Fusion Black
36                 ok
37                 RunTool(cAppFileName)
38
39         func OSTerminal
40                 if isWindows()
41                         cCommand = 'start cmd /K "cd ' + cStartupFolder + '"'
42                 but isLinux()
43                         cCommand = "gnome-terminal"
44                 but isMacosx()
45                         cCommand = "open /Applications/Utilities/Terminal.app"
46                 else 
47                         return
48                 ok
49                 system(cCommand)
50
51         func OSFilesManager 
52                 if cActiveFileName != Null
53                         cStartupFolder = justfilepath(cActiveFileName)
54                 ok
55                 new QDesktopServices {
56                         OpenURL(new qURL("file:///"+this.cStartupFolder))
57                 }
58
59