OSDN Git Service

Ring 1.10 以来となる開発環境の日本語ローカライズ版 (評価版) を追加 (ノートパッド、フォームデザイナー、対話型実行環境、ファイルの検索)。
[ring-lang-081/ring.git] / applications / rnote / source / rnotestyle.ring
1 # The Ring Notepad Application (RNote)
2 # Author : Mahmoud Fayed <msfclipper@yahoo.com>
3
4 class RNoteStyle
5
6         func CheckCustomColors
7                 if True # Switch to Use the Style or Not
8                         SelectStyleColor(nDefaultStyle)
9                         LoadSettings()
10                 ok
11
12         func SetActiveLineColor
13                 textedit1.SetActiveLineColor(aStyleColors[:ActiveLineBackColor])
14
15         func SetStyleColor(nStyle)
16                 SelectStyleColor(nStyle)
17                 RestoreSettings()
18                 SetEditorColors()
19
20         func SelectStyleColor nStyle
21                 switch nStyle
22                 on 0 StyleWindows()
23                 on 1 StyleWhite()
24                 on 2 StyleBlue()
25                 on 3 StyleBlack()
26                 on 4 StyleModern()
27                 on 5 StyleModernBlack()
28                 on 6 StyleModernBlack2()
29                 on 7 StyleNotepadWhite()
30                 on 8 StyleNotepadPurple()
31                 on 9 StyleNotepadDarkBlue()
32                 on 10 StyleNotepadBlack()
33                 on 11 StyleArt()
34                 on 12 StyleArt2()
35                 on 13 StyleArt3()
36                 on 14 StyleImage()
37                 on 15 StyleImage2()
38                 off
39                 if nStyle >= 7 
40                         lKeywordsBold = False 
41                 else
42                         lKeywordsBold = True
43                 ok
44
45         func SelectStyleColor2 nStyle
46                 for oObj in [this.tree1,this.oFunctionsList,this.oClassesList,this.oOutputWindow] 
47                         oObj {
48                                 setstylesheet("")
49                         }
50                 next
51                 if nStyle = STYLECOLOR_ART or nStyle = STYLECOLOR_ART2
52                         StyleArt_AfterControls()
53                 but nStyle = STYLECOLOR_IMAGE 
54                         StyleImage_AfterControls(1)
55                 but nStyle = STYLECOLOR_IMAGE2 
56                         StyleImage_AfterControls(2)
57                 ok
58
59         func SetEditorColors
60                 textedit1.setLineNumbersAreaColor(aStyleColors[:LineNumbersAreaColor])
61                 textedit1.setLineNumbersAreaBackColor(aStyleColors[:LineNumbersAreaBackColor])
62                 new RingCodeHighLighter(textedit1.document() ) {
63                         if ismethod(self,:setkeywordsbold) 
64                                 setKeywordsbold(this.lKeywordsBold)
65                         ok
66                         setColors(
67                                 this.aStyleColors[:SyntaxKeywordsColor],
68                                 this.aStyleColors[:SyntaxClassNamesColor],
69                                 this.aStyleColors[:SyntaxCommentsColor],
70                                 this.aStyleColors[:SyntaxLiteralsColor],
71                                 this.aStyleColors[:SyntaxFunctionCallsColor]
72                         )
73                 }
74
75         func StyleBlue()
76                         nDefaultStyle  = STYLECOLOR_BLUE
77                         aCustomStyleColors = [
78                                 :LineNumbersAreaColor           = colorWhite ,
79                                 :LineNumbersAreaBackColor       = colordarkBlue,
80                                 :ActiveLineBackColor            = colordarkBlue,
81                                 :SyntaxKeywordsColor            = colorWhite,
82                                 :SyntaxClassNamesColor          = ColorWhite,
83                                 :SyntaxCommentsColor            = ColorSilver,
84                                 :SyntaxLiteralsColor            = ColorCyan,
85                                 :SyntaxFunctionCallsColor       = ColorGreen
86                         ]
87                         aStyleColors = aCustomStyleColors
88                         aTextColor = [255,255,255]
89                         aBackColor = [0,0,135]
90                         oApp.StylefusionCustom(
91                                 new qColor() { setrgb(0,0,128,255) },
92                                 new qColor() { setrgb(255,255,255,255) },
93                                 new qColor() { setrgb(0,0,128,255) },
94                                 new qColor() { setrgb(0,0,128,255) },
95                                 new qColor() { setrgb(255,255,255,255) },
96                                 new qColor() { setrgb(255,255,255,255) },
97                                 new qColor() { setrgb(255,255,255,255) },
98                                 new qColor() { setrgb(0,0,128,255) },
99                                 new qColor() { setrgb(255,255,255,255) },
100                                 new qColor() { setrgb(255,0,0,255) },
101                                 new qColor() { setrgb(142,45,197,255) },
102                                 new qColor() { setrgb(0,0,128,255)}
103                         )
104
105         func StyleBlack()
106                         nDefaultStyle  = STYLECOLOR_BLACK
107                         oApp.StyleFusionBlack()
108                         aCustomStyleColors = [
109                                 :LineNumbersAreaColor           = colorWhite ,
110                                 :LineNumbersAreaBackColor       = colorBlack,
111                                 :ActiveLineBackColor            = colorBlack,
112                                 :SyntaxKeywordsColor            = colorWhite,
113                                 :SyntaxClassNamesColor          = ColorWhite,
114                                 :SyntaxCommentsColor            = ColorSilver,
115                                 :SyntaxLiteralsColor            = ColorCyan,
116                                 :SyntaxFunctionCallsColor       = ColorGreen
117                         ]
118                         aStyleColors = aCustomStyleColors
119                         aTextColor = [255,255,255]
120                         aBackColor = [0,0,0]
121
122         func StyleWhite()
123                         nDefaultStyle  = STYLECOLOR_WHITE 
124                         oApp.StyleFusion()
125                         StyleWhiteColors()
126
127         func StyleWhiteColors
128                         aCustomStyleColors = [
129                                 :LineNumbersAreaColor           = colorBlack ,
130                                 :LineNumbersAreaBackColor       = colorCyan,
131                                 :ActiveLineBackColor            = colorCyan,
132                                 :SyntaxKeywordsColor            = colordarkBlue,
133                                 :SyntaxClassNamesColor          = ColordarkMagenta,
134                                 :SyntaxCommentsColor            = ColorSilver,
135                                 :SyntaxLiteralsColor            = ColorDarkGreen,
136                                 :SyntaxFunctionCallsColor       = ColorBlue
137                         ]
138                         aStyleColors = aCustomStyleColors
139                         aTextColor = [0,0,0]
140                         aBackColor = [255,255,255]
141
142         func StyleWindows
143                         nDefaultStyle  = STYLECOLOR_WINDOWS
144                         if isWindows()
145                                 oApp.StyleWindowsVista()
146                         else 
147                                 oApp.StyleWindows()
148                         ok
149                         StyleWhiteColors()
150
151         func StyleModern()
152                         nDefaultStyle  = STYLECOLOR_MODERN
153                         aCustomStyleColors = [
154                                 :LineNumbersAreaColor           = new qcolor() { setrgb(143,144,138,255) },
155                                 :LineNumbersAreaBackColor       = new qcolor() { setrgb(39,60,64,255) },
156                                 :ActiveLineBackColor            = new qcolor() { setrgb(39,110,114,255) },
157                                 :SyntaxKeywordsColor            = new qcolor() { setrgb(80,187,177,255) },
158                                 :SyntaxClassNamesColor          = new qcolor() { setrgb(166,226,46,255) },
159                                 :SyntaxCommentsColor            = new qcolor() { setrgb(117,160,172,157) },
160                                 :SyntaxLiteralsColor            = new qcolor() { setrgb(230,191,77,255) },
161                                 :SyntaxFunctionCallsColor       = new qcolor() { setrgb(240,127,224,255) }
162                         ]
163                         aStyleColors = aCustomStyleColors
164                         aTextColor = [248,248,242]
165                         aBackColor = [39,60,64]
166                         oApp.StylefusionCustom(
167                                 new qColor() { setrgb(39,60,64,255)     },
168                                 new qColor() { setrgb(255,255,255,255)  },
169                                 new qColor() { setrgb(39,60,64,255)     },
170                                 new qColor() { setrgb(39,60,64,255)     },
171                                 new qColor() { setrgb(255,255,255,255)  },
172                                 new qColor() { setrgb(255,255,255,255)  },
173                                 new qColor() { setrgb(255,255,255,255)  },
174                                 new qColor() { setrgb(39,60,64,255)     },
175                                 new qColor() { setrgb(255,255,255,255)  },
176                                 new qColor() { setrgb(255,0,0,255)      },
177                                 new qColor() { setrgb(142,45,197,255)   },
178                                 new qColor() { setrgb(39,60,64,255)     }
179                         )
180
181         func StyleModernBlack()
182                         nDefaultStyle  = STYLECOLOR_MODERNBLACK
183                         oApp.StyleFusionBlack()
184                         aCustomStyleColors = [
185                                 :LineNumbersAreaColor           = new qcolor() { setrgb(255,255,255,255)},
186                                 :LineNumbersAreaBackColor       = new qcolor() { setrgb(0,0,0,255)      },
187                                 :ActiveLineBackColor            = new qcolor() { setrgb(0,0,0,255)      },
188                                 :SyntaxKeywordsColor            = new qcolor() { setrgb(30,220,175,255) },
189                                 :SyntaxClassNamesColor          = new qcolor() { setrgb(166,226,46,255) },
190                                 :SyntaxCommentsColor            = new qcolor() { setrgb(117,160,172,157)},
191                                 :SyntaxLiteralsColor            = new qcolor() { setrgb(230,191,77,255) },
192                                 :SyntaxFunctionCallsColor       = new qcolor() { setrgb(240,127,224,255)}
193                         ]
194                         aStyleColors = aCustomStyleColors
195                         aTextColor = [255,255,255]
196                         aBackColor = [33,33,33]
197
198         func StyleModernBlack2()
199                         nDefaultStyle  = STYLECOLOR_MODERNBLACK2
200                         oApp.StyleFusionBlack()
201                         aCustomStyleColors = [
202                                 :LineNumbersAreaColor           = new qcolor() { setrgb(255,255,255,255)},
203                                 :LineNumbersAreaBackColor       = new qcolor() { setrgb(0,0,0,255)      },
204                                 :ActiveLineBackColor            = new qcolor() { setrgb(33,33,33,255)   },
205                                 :SyntaxKeywordsColor            = new qcolor() { setrgb(30,220,175,255) },
206                                 :SyntaxClassNamesColor          = new qcolor() { setrgb(166,226,46,255) },
207                                 :SyntaxCommentsColor            = new qcolor() { setrgb(117,160,172,157)},
208                                 :SyntaxLiteralsColor            = new qcolor() { setrgb(230,191,77,255) },
209                                 :SyntaxFunctionCallsColor       = new qcolor() { setrgb(240,127,224,255)}
210                         ]
211                         aStyleColors = aCustomStyleColors
212                         aTextColor = [255,255,255]
213                         aBackColor = [0,0,0]
214
215         func StyleNotepadWhite()
216                         nDefaultStyle  = STYLECOLOR_NOTEPADWHITE
217                         oApp.StyleFusion()
218                         aCustomStyleColors = [
219                                 :LineNumbersAreaColor           = colorBlack ,
220                                 :LineNumbersAreaBackColor       = colorWhite,
221                                 :ActiveLineBackColor            = colorWhite,
222                                 :SyntaxKeywordsColor            = colorBlack,
223                                 :SyntaxClassNamesColor          = ColorBlack,
224                                 :SyntaxCommentsColor            = ColorBlack,
225                                 :SyntaxLiteralsColor            = ColorBlack,
226                                 :SyntaxFunctionCallsColor       = ColorBlack
227                         ]
228                         aStyleColors = aCustomStyleColors
229                         aTextColor = [0,0,0]
230                         aBackColor = [255,255,255]
231
232         func StyleNotepadPurple()
233                         nDefaultStyle  = STYLECOLOR_NOTEPADPURPLE
234                         oApp.StyleFusion()
235                         aCustomStyleColors = [
236                                 :LineNumbersAreaColor           = colorWhite ,
237                                 :LineNumbersAreaBackColor       = colorPurple,
238                                 :ActiveLineBackColor            = colorPurple,
239                                 :SyntaxKeywordsColor            = colorWhite,
240                                 :SyntaxClassNamesColor          = ColorWhite,
241                                 :SyntaxCommentsColor            = ColorWhite,
242                                 :SyntaxLiteralsColor            = ColorWhite,
243                                 :SyntaxFunctionCallsColor       = ColorWhite
244                         ]
245                         aStyleColors = aCustomStyleColors
246                         aTextColor = [255,255,255]
247                         aBackColor = [128,0,128]
248
249         func StyleNotepadDarkBlue()
250                         nDefaultStyle  = STYLECOLOR_NOTEPADDARKBLUE
251                         oApp.StyleFusion()
252                         aCustomStyleColors = [
253                                 :LineNumbersAreaColor           = colorWhite ,
254                                 :LineNumbersAreaBackColor       = colordarkBlue,
255                                 :ActiveLineBackColor            = colordarkBlue,
256                                 :SyntaxKeywordsColor            = colorWhite,
257                                 :SyntaxClassNamesColor          = ColorWhite,
258                                 :SyntaxCommentsColor            = ColorWhite,
259                                 :SyntaxLiteralsColor            = ColorWhite,
260                                 :SyntaxFunctionCallsColor       = ColorWhite
261                         ]
262                         aStyleColors = aCustomStyleColors
263                         aTextColor = [255,255,255]
264                         aBackColor = [0,0,128]
265
266         func StyleNotepadBlack()
267                         nDefaultStyle  = STYLECOLOR_NOTEPADBLACK
268                         oApp.StyleFusion()
269                         aCustomStyleColors = [
270                                 :LineNumbersAreaColor           = colorWhite ,
271                                 :LineNumbersAreaBackColor       = colorBlack,
272                                 :ActiveLineBackColor            = colorBlack,
273                                 :SyntaxKeywordsColor            = colorWhite,
274                                 :SyntaxClassNamesColor          = ColorWhite,
275                                 :SyntaxCommentsColor            = ColorWhite,
276                                 :SyntaxLiteralsColor            = ColorWhite,
277                                 :SyntaxFunctionCallsColor       = ColorWhite
278                         ]
279                         aStyleColors = aCustomStyleColors
280                         aTextColor = [255,255,255]
281                         aBackColor = [0,0,0]
282
283
284         func StyleArt()
285                         nDefaultStyle  = STYLECOLOR_ART
286                         oApp.StyleFusion()
287                         aCustomStyleColors = [
288                                 :LineNumbersAreaColor           = new qcolor() { setrgb(255,255,255,255)},
289                                 :LineNumbersAreaBackColor       = new qcolor() { setrgb(50,50,42,255)   },
290                                 :ActiveLineBackColor            = new qcolor() { setrgb(50,50,42,255)   },
291                                 :SyntaxKeywordsColor            = new qcolor() { setrgb(30,220,175,255) },
292                                 :SyntaxClassNamesColor          = new qcolor() { setrgb(166,226,46,255) },
293                                 :SyntaxCommentsColor            = new qcolor() { setrgb(117,160,172,157)},
294                                 :SyntaxLiteralsColor            = new qcolor() { setrgb(230,191,77,255) },
295                                 :SyntaxFunctionCallsColor       = new qcolor() { setrgb(240,127,224,255)}
296                         ]
297                         aStyleColors = aCustomStyleColors
298                         aTextColor = [255,255,255]
299                         aBackColor = [39,40,34]
300
301         func StyleArt2()
302                         nDefaultStyle  = STYLECOLOR_ART2
303                         oApp.StyleFusion()
304                         aCustomStyleColors = [
305                                 :LineNumbersAreaColor           = new qcolor() { setrgb(255,255,255,255)},
306                                 :LineNumbersAreaBackColor       = new qcolor() { setrgb(0,0,0,255)      },
307                                 :ActiveLineBackColor            = new qcolor() { setrgb(0,0,0,255)      },
308                                 :SyntaxKeywordsColor            = new qcolor() { setrgb(30,220,175,255) },
309                                 :SyntaxClassNamesColor          = new qcolor() { setrgb(166,226,46,255) },
310                                 :SyntaxCommentsColor            = new qcolor() { setrgb(117,160,172,157)},
311                                 :SyntaxLiteralsColor            = new qcolor() { setrgb(230,191,77,255) },
312                                 :SyntaxFunctionCallsColor       = new qcolor() { setrgb(240,127,224,255)}
313                         ]
314                         aStyleColors = aCustomStyleColors
315                         aTextColor = [255,255,255]
316                         aBackColor = [11,11,11]
317
318         func StyleArt3()
319                         nDefaultStyle  = STYLECOLOR_ART3
320                         oApp.StyleFusion()
321                         aCustomStyleColors = [
322                                 :LineNumbersAreaColor           = new qcolor() { setrgb(255,255,255,255)},
323                                 :LineNumbersAreaBackColor       = new qcolor() { setrgb(0,0,0,255)      },
324                                 :ActiveLineBackColor            = new qcolor() { setrgb(0,0,0,255)      },
325                                 :SyntaxKeywordsColor            = new qcolor() { setrgb(30,220,175,255) },
326                                 :SyntaxClassNamesColor          = new qcolor() { setrgb(166,226,46,255) },
327                                 :SyntaxCommentsColor            = new qcolor() { setrgb(117,160,172,157)},
328                                 :SyntaxLiteralsColor            = new qcolor() { setrgb(230,191,77,255) },
329                                 :SyntaxFunctionCallsColor       = new qcolor() { setrgb(240,127,224,255)}
330                         ]
331                         aStyleColors = aCustomStyleColors
332                         aTextColor = [255,255,255]
333                         aBackColor = [11,11,11]
334
335         func StyleImage()
336                         nDefaultStyle  = STYLECOLOR_IMAGE
337                         oApp.StyleFusionBlack()
338                         aCustomStyleColors = [
339                                 :LineNumbersAreaColor           = new qcolor() { setrgb(255,255,255,255)},
340                                 :LineNumbersAreaBackColor       = new qcolor() { setrgb(0,0,0,255)      },
341                                 :ActiveLineBackColor            = new qcolor() { setrgb(0,0,0,255)      },
342                                 :SyntaxKeywordsColor            = new qcolor() { setrgb(30,220,175,255) },
343                                 :SyntaxClassNamesColor          = new qcolor() { setrgb(166,226,46,255) },
344                                 :SyntaxCommentsColor            = new qcolor() { setrgb(117,160,172,157)},
345                                 :SyntaxLiteralsColor            = new qcolor() { setrgb(230,191,77,255) },
346                                 :SyntaxFunctionCallsColor       = new qcolor() { setrgb(240,127,224,255)}
347                         ]
348                         aStyleColors = aCustomStyleColors
349                         aTextColor = [255,255,255]
350                         aBackColor = [11,11,11]
351
352         func StyleImage2()
353                         nDefaultStyle  = STYLECOLOR_IMAGE2
354                         oApp.StyleFusion()
355                         aCustomStyleColors = [
356                                 :LineNumbersAreaColor           = new qcolor() { setrgb(255,255,255,255)},
357                                 :LineNumbersAreaBackColor       = new qcolor() { setrgb(0,0,0,255)      },
358                                 :ActiveLineBackColor            = new qcolor() { setrgb(0,0,0,255)      },
359                                 :SyntaxKeywordsColor            = new qcolor() { setrgb(30,220,175,255) },
360                                 :SyntaxClassNamesColor          = new qcolor() { setrgb(166,226,46,255) },
361                                 :SyntaxCommentsColor            = new qcolor() { setrgb(117,160,172,157)},
362                                 :SyntaxLiteralsColor            = new qcolor() { setrgb(230,191,77,255) },
363                                 :SyntaxFunctionCallsColor       = new qcolor() { setrgb(240,127,224,255)}
364                         ]
365                         aStyleColors = aCustomStyleColors
366                         aTextColor = [255,255,255]
367                         aBackColor = [11,11,11]
368
369
370         func StyleArt_AfterControls
371                 # Called After we have all of the Ring Notepad Window Controls
372                 for oObj in [this.tree1,this.oFunctionsList,this.oClassesList,this.oOutputWindow] 
373                         oObj {
374                                 setstylesheet("background-color: rgba(230,230,230,255);")
375                         }
376                 next
377
378         func StyleImage_AfterControls nIndex
379                 # Called After we have all of the Ring Notepad Window Controls
380                 if nIndex = 1
381                         cBackImage = cCurrentDir + "image/back.jpg"
382                         cBackImage = substr(cBackImage,"\","/")
383                         for oObj in [this.tree1,this.oFunctionsList,this.oClassesList,this.oOutputWindow] 
384                                 oObj {
385                                         setstylesheet("color:white;background-image: url('" + cBackImage + "');")
386                                 }
387                         next
388                         textedit1.setstylesheet("color:white;background-image: url('" + cBackImage + "');")
389                 else 
390                         cBackImage = cCurrentDir + "image/back2.jpg"
391                         cBackImage = substr(cBackImage,"\","/")
392                         textedit1.setstylesheet("color:white;background-image: url('" + cBackImage + "');")
393                         textedit1.verticalscrollbar().setStyleSheet("color:black;")
394                         textedit1.horizontalscrollbar().setStyleSheet("color:black;")
395                 ok
396