Lorenz Glaser authored onThu/Sep/2020 13:0:rd
Showing1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,421 @@
1
+#!/boot/home/config/bin/yab
2
+//localize
3
+
4
+##### Allgemeines ##### 
5
+
6
+Programmname$="HtmlEditor"
7
+Version$="1.0"
8
+Versionsdatum$="11.10.2006"
9
+Entwickler$="Christian Albrecht"
10
+Nickname$="Lelldorin"
11
+Url_Label$="BeSly Projects"
12
+Url_Text$="http://www.besly.de"
13
+
14
+##### Fensternamen #####
15
+Hpt_Fenster$=Programmname$
16
+Lade_Fenster$=""
17
+
18
+##### Bildschirmgröße #####
19
+B_Breite = peek("desktopwidth")
20
+B_Hoehe = peek("desktopheight")
21
+
22
+##### Fenstergröße #####
23
+
24
+F_Hoehe1=((B_Hoehe/2)-300)
25
+F_Hoehe2=((B_Hoehe/2)+300)
26
+
27
+F_Breite1=((B_Breite/2)-300)
28
+F_Breite2=((B_Breite/2)+300)
29
+
30
+F_minBreite=800
31
+F_maxBreite=800
32
+F_minHoehe=600
33
+F_maxHoehe=600
34
+
35
+##### Editor View Groesse #####
36
+
37
+Editor_Breite1=240
38
+Editor_Breite2= 790
39
+Editor_Hoehe1=120
40
+Editor_Hoehe2=590
41
+
42
+##### Texteditor Groesse #####
43
+
44
+TE_Breite1=5
45
+TE_Breite2=535
46
+TE_Hoehe1=30
47
+TE_Hoehe2=420
48
+
49
+##### Tab Optionen #####
50
+
51
+Opt_Breite1=240
52
+Opt_Breite2=790
53
+Opt_Hoehe1=30
54
+Opt_Hoehe2=110
55
+
56
+##### Tab Auswahl #####
57
+
58
+Sel_Breite1=10
59
+Sel_Breite2=230
60
+Sel_Hoehe1=120
61
+Sel_Hoehe2=590
62
+
63
+##### Listbox Programmiersprache Auswahl #####
64
+
65
+LB_HTML_Breite1=10
66
+LB_HTML_Breite2=200
67
+LB_HTML_Hoehe1=40
68
+LB_HTML_Hoehe2=420
69
+
70
+##### Programmverzeichnis ######
71
+
72
+Prg_Ordner$=""
73
+Gfx_Ordner$=""
74
+Hlp_Ordner$=""
75
+Sfx_Ordner$=""
76
+
77
+##### Programmstart #####
78
+
79
+Prg_Fenster()
80
+
81
+################################	
82
+	
83
+	
84
+	
85
+	
86
+dim part$(1)
87
+
88
+inloop = true
89
+while(inloop)
90
+
91
+	msg$ = message$
92
+	
93
+	if (split(msg$, part$(), ":|") > 2) then
94
+		PartOne$=part$(1)
95
+		PartTwo$ = part$(2)
96
+		PartThree$ = part$(3)
97
+	fi
98
+	
99
+	if (split(msg$, part$(), ":|") > 3) then
100
+		PartFour$ = part$(4)
101
+	fi
102
+
103
+	if (msg$ <> "") print msg$
104
+
105
+	switch msg$
106
+	
107
+	case Hpt_Fenster$+":_QuitRequested|"
108
+		window close Hpt_Fenster$
109
+		window close "View_Ueber"
110
+		window close "View_Hilfe"
111
+	break
112
+	
113
+	case translate$(Hpt_Fenster$+":Program:Quit")+"|"
114
+		window close Hpt_Fenster$
115
+		window close "View_Ueber"
116
+		window close "View_Hilfe"
117
+	break
118
+	
119
+	case "Beenden_View_Ueber|"
120
+		window close "View_Ueber"
121
+	break
122
+	
123
+	case "Beenden_View_Hilfe|"
124
+		window close "View_Hilfe"
125
+	break
126
+
127
+	
128
+	
129
+	//Funktionen
130
+	
131
+	case "DB_Drives:"+PartTwo$+"|"
132
+		Drive_Selection$=PartTwo$
133
+		read_folders()
134
+	break
135
+	
136
+	case Programmname$+":View:Fullscreen|"
137
+		F_Hoehe1=0
138
+		F_Hoehe2=B_Hoehe
139
+
140
+		F_Breite1=0
141
+		F_Breite2=B_Breite
142
+
143
+		F_minBreite=800
144
+		F_maxBreite=B_Breite
145
+		F_minHoehe=600
146
+		F_maxHoehe=B_Hoehe
147
+		
148
+		Editor_Breite2=F_Breite2-20
149
+		Editor_Hoehe2=F_Hoehe2-20
150
+		
151
+		TE_Breite2=Editor_Breite2-255
152
+		TE_Hoehe2=Editor_Hoehe2-190
153
+		
154
+		Opt_Breite2=Editor_Breite2
155
+		
156
+		Sel_Hoehe2=Editor_Hoehe2
157
+		
158
+		LB_HTML_Hoehe2=TE_Hoehe2
159
+		
160
+		window close Hpt_Fenster$
161
+		Prg_Fenster()
162
+	break
163
+	
164
+	case Programmname$+":View:Default|"
165
+		F_Hoehe1=((B_Hoehe/2)-300)
166
+		F_Hoehe2=((B_Hoehe/2)+300)
167
+
168
+		F_Breite1=((B_Breite/2)-300)
169
+		F_Breite2=((B_Breite/2)+300)
170
+
171
+		F_minBreite=800
172
+		F_maxBreite=800
173
+		F_minHoehe=600
174
+		F_maxHoehe=600
175
+		
176
+		Editor_Breite2=790
177
+		Editor_Hoehe2=590
178
+		
179
+		TE_Breite2=535
180
+		TE_Hoehe2=420
181
+		
182
+		Opt_Breite2=790
183
+		
184
+		Sel_Hoehe2=590
185
+		
186
+		LB_HTML_Hoehe2=420
187
+		
188
+		window close Hpt_Fenster$
189
+		Prg_Fenster()
190
+	break
191
+	
192
+	case "CB_Files:_Invoke:"+PartThree$+"|"
193
+		dateiauswahl$=COLUMNBOX GET$ "CB_Files", 2, val(PartThree$)
194
+		print dateiauswahl$
195
+		DateiLaden()
196
+	break
197
+	
198
+	case "CB_Folders:_Invoke:"+PartThree$+"|"
199
+		foldername$=COLUMNBOX GET$ "CB_Folders", 2, val(PartThree$)
200
+		if(foldername$="..")then
201
+			VerzeichnisZurueck()
202
+		else
203
+			Drive_Selection$=Drive_Selection$+"/"+foldername$
204
+			read_folders()
205
+		endif
206
+	break
207
+	
208
+	default:
209
+
210
+	end switch
211
+
212
+	if(window count<1) inloop = false
213
+	sleep 0.1
214
+wend
215
+
216
+sub Prg_Fenster()
217
+	window open F_Breite1,F_Hoehe1 to F_Breite2,F_Hoehe2, Hpt_Fenster$, "BeSly Software "+Programmname$
218
+		window set Hpt_Fenster$, "MinimumTo", F_minBreite,F_minHoehe
219
+		window set Hpt_Fenster$, "MaximumTo", F_maxBreite,F_maxHoehe
220
+		WINDOW SET Hpt_Fenster$, "Flags", "not-zoomable"
221
+		
222
+	menu "Program", translate$("About"), "", Hpt_Fenster$
223
+	menu "Program", translate$("Help"), "", Hpt_Fenster$
224
+	menu "Program", translate$("Documentation"), "", Hpt_Fenster$
225
+	menu "Program", translate$("Options"), "", Hpt_Fenster$
226
+	menu "Program", translate$("Quit"), "", Hpt_Fenster$
227
+	menu "View", translate$("Fullscreen"), "", Hpt_Fenster$
228
+	menu "View", translate$("Default"), "", Hpt_Fenster$
229
+	
230
+	TABVIEW Sel_Breite1,Sel_Hoehe1 TO Sel_Breite2,Sel_Hoehe2, "Tab_Selection", "bottom", Hpt_Fenster$
231
+		TABVIEW ADD "Tab_Selection", "File"
232
+			DROPBOX 4,10 TO 125,20, "DB_Drives", "", "Tab_Selection1"
233
+				DROPBOX ADD "DB_Drives", "Select Drive"
234
+				DROPBOX ADD "DB_Drives", "--"
235
+			COLUMNBOX 10,40 TO 200,200, "CB_Folders",true, "movable", "Tab_Selection1"
236
+				COLUMNBOX COLUMN "CB_Folders", "__Icon__", 1, 60, 20, 20, "align-left"
237
+				COLUMNBOX COLUMN "CB_Folders", "Name", 2, 60, 200, 20, "align-left"			
238
+			COLUMNBOX 10,220 TO 200,420, "CB_Files",true, "movable", "Tab_Selection1"
239
+				COLUMNBOX COLUMN "CB_Files", "__Icon__", 1, 60, 20, 20, "align-left"
240
+				COLUMNBOX COLUMN "CB_Files", "Name", 2, 60, 200, 20, "align-left"
241
+		TABVIEW ADD "Tab_Selection", "Code"
242
+			DROPBOX 4,10 TO 125,20, "DB_Language", "", "Tab_Selection2"
243
+				DROPBOX ADD "DB_Language", "Select Language"
244
+				DROPBOX ADD "DB_Language", "--"
245
+				DROPBOX ADD "DB_Language", "HTML"
246
+				DROPBOX ADD "DB_Language", "PHP"
247
+				DROPBOX ADD "DB_Language", "XML"
248
+				DROPBOX ADD "DB_Language", "JavaScript"
249
+				DROPBOX ADD "DB_Language", "CGI"
250
+				DROPBOX ADD "DB_Language", "Perl"
251
+				DROPBOX ADD "DB_Language", "CSS"
252
+			COLUMNBOX LB_HTML_Breite1,LB_HTML_Hoehe1 TO LB_HTML_Breite2,LB_HTML_Hoehe2, "CB_HTML", true, "movable", "Tab_Selection2"
253
+				columnbox column "CB_HTML", "__Icon__", 1, 60, 20, 20, "align-left"
254
+				columnbox column "CB_HTML", "Name", 2, 60, 200, 20, "align-left"
255
+
256
+	TABVIEW Opt_Breite1,Opt_Hoehe1 TO Opt_Breite2,Opt_Hoehe2, "Tab_Options", "top", Hpt_Fenster$
257
+		TABVIEW ADD "Tab_Options", "Frames" 
258
+		TABVIEW ADD "Tab_Options", "Tables" 
259
+		TABVIEW ADD "Tab_Options", "Fonts"
260
+		TABVIEW ADD "Tab_Options", "Images"  
261
+	
262
+	TABVIEW Editor_Breite1, Editor_Hoehe1 TO Editor_Breite2,Editor_Hoehe2, "Tab_Editor", "bottom", Hpt_Fenster$
263
+		TABVIEW ADD "Tab_Editor", "Default" 		
264
+		TEXTEDIT TE_Breite1,TE_Hoehe1 TO TE_Breite2,TE_Hoehe2, "editor", 3, "Tab_Editor1"
265
+			TEXTEDIT COLOR "editor", "char-color", "<"
266
+			TEXTEDIT COLOR "editor", "char-color", ">"
267
+			TEXTEDIT COLOR "editor", "char-color", "="
268
+			TEXTEDIT COLOR "editor", "char-color", "/"
269
+			TEXTEDIT COLOR "editor", "char-color", "#"
270
+			TEXTEDIT COLOR "editor", "char-color", "<?"
271
+			TEXTEDIT COLOR "editor", "char-color", "?>"
272
+	read_drives()
273
+	
274
+	
275
+	
276
+end sub
277
+
278
+
279
+
280
+sub ueber()
281
+	REM ###### Fenstergröße #######
282
+	
283
+	F_Hoehe_Ueber1=((B_Hoehe/2)-100)
284
+	F_Hoehe_Ueber2=((B_Hoehe/2)+100)
285
+	
286
+	F_Breite_Ueber1=((B_Breite/2)-100)
287
+	F_Breite_Ueber2=((B_Breite/2)+100)
288
+	
289
+	window open F_Breite_Ueber1,F_Hoehe_Ueber1 to F_Breite_Ueber2,F_Hoehe_Ueber2, "View_Ueber", "About"
290
+		window set "View_Ueber", "MinimumTo", 260,200
291
+		window set "View_Ueber", "MaximumTo", 260,200
292
+		window set "View_Ueber", "look", "modal"
293
+		
294
+	draw text 10, 20, Programmname$, "View_Ueber"
295
+	draw text 10, 60, translate$("Version/Date: ")+Version$+" / "+Versionsdatum$, "View_Ueber"
296
+	draw text 10, 80, translate$("Developer: ")+Entwickler$, "View_Ueber"
297
+	draw text 10, 100, translate$("Nickname: ")+Nickname$, "View_Ueber"
298
+	draw text 10, 120, translate$("Webside: "), "View_Ueber"
299
+	texturl 90,112, "", Url_Label$, Url_Text$, "View_Ueber"
300
+	BUTTON 80,160 TO 180,180, "Beenden_View_Ueber", translate$("Schließen"), "View_Ueber"
301
+end sub
302
+
303
+sub hilfe()
304
+	REM ###### Fenstergröße #######
305
+	
306
+	F_Hoehe_Hilfe1=((B_Hoehe/2)-150)
307
+	F_Hoehe_Hilfe2=((B_Hoehe/2)+150)
308
+	
309
+	F_Breite_Hilfe1=((B_Breite/2)-150)
310
+	F_Breite_Hilfe2=((B_Breite/2)+150)
311
+	
312
+	window open F_Breite_Hilfe1,F_Hoehe_Hilfe1 to F_Breite_Hilfe2,F_Hoehe_Hilfe2, "View_Hilfe", "Help"
313
+		window set "View_Hilfe", "MinimumTo", 300,300
314
+		window set "View_Hilfe", "MaximumTo", 300,300
315
+		window set "View_Hilfe", "look", "modal"		
316
+		
317
+	BUTTON 100,260 TO 200,280, "Beenden_View_Hilfe", translate$("Close"), "View_Hilfe"
318
+end sub
319
+
320
+sub read_drives()
321
+	rDrives$=system$("ls -G -1 /")	
322
+	dim SplitDrives$(1)
323
+	rda=0
324
+	rdb=0
325
+	rda = split(rDrives$, SplitDrives$(), "\n")            
326
+	for rdb = 1 to rda-1
327
+		dropbox add "DB_Drives", SplitDrives$(rdb)
328
+	next rdb
329
+end sub
330
+
331
+sub read_folders()
332
+	COLUMNBOX CLEAR "CB_Files"
333
+	COLUMNBOX CLEAR "CB_Folders"
334
+	COLUMNBOX ADD "CB_Folders", 2, 1, 15, ".."
335
+	x=1
336
+	dim SplitFolderEntrys$(1)
337
+	CheckFolderEntrys$=system$("ls -1 /"+"\""+Drive_Selection$+"\"")
338
+	entrys=split(CheckFolderEntrys$, SplitFolderEntrys$(), "\n")
339
+	
340
+	dim SplitEntrys$(1)
341
+	for look = 2 to entrys
342
+		x=x+1
343
+		Folder$="/"+Drive_Selection$+"/"+SplitFolderEntrys$(x)
344
+		CheckFolder$=system$("ls -allAd "+"\""+Folder$+"\"")
345
+		g = split(CheckFolder$, SplitEntrys$(), " ")
346
+		if(mid$(SplitEntrys$(1),1,1)="-")then
347
+			COLUMNBOX ADD "CB_Files", 2, x, 15, SplitFolderEntrys$(x)
348
+		elseif(mid$(SplitEntrys$(1),1,1)="d")then
349
+			COLUMNBOX ADD "CB_Folders", 2, x, 15, SplitFolderEntrys$(x)
350
+		elseif(mid$(SplitEntrys$(1),1,1)="l")then
351
+		endif
352
+	next look
353
+end sub
354
+
355
+sub DateiLaden()
356
+	auslesen=open("/"+Drive_Selection$+"/"+dateiauswahl$, "r")
357
+	x=0
358
+	while (not EOF(auslesen))
359
+   		x=x+1
360
+		dim FileLoad$(x)
361
+   	 	line input #auslesen b$
362
+		FileLoad$(x)=b$
363
+		FullSizeFile=x
364
+	wend
365
+	close(auslesen)
366
+	ladebalken()
367
+end sub
368
+
369
+sub ladebalken()
370
+	F_Hoehe_Ueber1=((B_Hoehe/2)-100)
371
+	F_Hoehe_Ueber2=((B_Hoehe/2)+100)
372
+	
373
+	F_Breite_Ueber1=((B_Breite/2)-200)
374
+	F_Breite_Ueber2=((B_Breite/2)+200)
375
+	
376
+	window open F_Breite_Ueber1,F_Hoehe_Ueber1 to F_Breite_Ueber2,F_Hoehe_Ueber2, "View_Ladebalken", "xxx"
377
+		window set "View_Ladebalken", "MinimumTo", 400,200
378
+		window set "View_Ladebalken", "MaximumTo", 400,200
379
+		window set "View_Ladebalken", "look", "modal"
380
+	
381
+	view 20,60 to 380,80, "DrawView", "View_Ladebalken"
382
+		draw set "BgColor", 255,255,255, "DrawView"
383
+ 		draw set "HighColor", 108,166,205,"DrawView"
384
+		draw set 0, "HighSolidFill"
385
+		BalkenPosition=0
386
+		TextLadebalken$="loading document"
387
+		TextLadebalken=len(TextLadebalken$) 
388
+		draw text (160-(TextLadebalken/2)), 15, TextLadebalken$, "DrawView"
389
+		
390
+	x=0
391
+	for size=1 to FullSizeFile
392
+		ProzentSize=(size*100)/320
393
+		BalkenPosition=(320*ProzentSize)/100
394
+		draw rect 0,0 to BalkenPosition,20, "DrawView"
395
+		TEXTEDIT ADD "editor", FileLoad$(size)
396
+		TEXTEDIT ADD "editor", "\n"
397
+	next size
398
+	
399
+	DRAW FLUSH "DrawView"
400
+	TextLadebalken$="ready!"
401
+	TextLadebalken=len(TextLadebalken$)
402
+	//WINDOW CLOSE "View_Ladebalken"
403
+	end sub
404
+
405
+sub VerzeichnisZurueck()
406
+	SizeFolderString=0
407
+	BackFolder=0
408
+	SizeFoldername=0
409
+	dim FolderBack$(1)
410
+	SizeFolderString=len(Drive_Selection$)
411
+	BackFolder=split(Drive_Selection$, FolderBack$(), "/")
412
+	SizeFoldername=len(FolderBack$(BackFolder))
413
+	BackDriveName$=left$(Drive_Selection$, (SizeFolderString-(SizeFoldername+1)))
414
+	if(BackDriveName$="")then
415
+		read_folders()
416
+	else
417
+		Drive_Selection$=BackDriveName$
418
+		read_folders()
419
+	endif
420
+end sub
421
+