Browse code

ink added

Lorenz Glaser authored onWed/Sep/2020 18:0:nd
Showing58 changed files
1 1
new file mode 100755
2 2
Binary files /dev/null and b/ink/Ink_64 differ
3 3
new file mode 100644
... ...
@@ -0,0 +1,15 @@
1
+Hallo zusammen,
2
+
3
+anbei eine Liste zu den bekannten Fehlern in diesen expertimentalen Programm.
4
+
5
+- Code nicht aufgeräumt
6
+- Drucker nicht fertig
7
+- Darstellungsfehler bei Fontauswahl
8
+ 
9
+Hi there,
10
+
11
+attached a list of the known bugs in these expertimentalen program.
12
+
13
+- Not cleaned up code
14
+- Printer not ready
15
+- Display error when font selection
0 16
new file mode 100644
... ...
@@ -0,0 +1,15 @@
1
+datei1;New;newp.png;newn.png;newd.png
2
+datei2;Close;closep.png;closen.png;closed.png
3
+datei3;Load;loadp.png;loadn.png;loadd.png
4
+datei4;Save;savep.png;saven.png;saved.png
5
+datei5;Save_As;saveasp.png;saveasn.png;saveasd.png
6
+datei6;Printer;printerp.png;printern.png;printerd.png
7
+Brush1;Brush_Filled_Rect;squarefillp.png;squarefilln.png;squarefilld.png
8
+Brush2;Brush_Filled_Round;circlefillp.png;circlefilln.png;circlefilld.png
9
+Brush3;Brush_Outerline_Rect;squarep.png;squaren.png;squared.png
10
+Brush4;Brush_Outerline_Round;circlep.png;circlen.png;circled.png
11
+Brush5;Text;textp.png;textn.png;textd.png
12
+Brush6;Eraser_rect;eraserrectp.png;eraserrectn.png;eraserrectd.png
13
+Brush7;Eraser_round;eraserroundp.png;eraserroundn.png;eraserround.png
14
+resize1;resize;eraserroundp.png;eraserroundn.png;eraserround.png
15
+drawline;drawline;eraserroundp.png;eraserroundn.png;eraserround.png
0 16
\ No newline at end of file
1 17
new file mode 100644
2 18
Binary files /dev/null and b/ink/TLB/img/circled.png differ
3 19
new file mode 100644
4 20
Binary files /dev/null and b/ink/TLB/img/circlefilld.png differ
5 21
new file mode 100644
6 22
Binary files /dev/null and b/ink/TLB/img/circlefilln.png differ
7 23
new file mode 100644
8 24
Binary files /dev/null and b/ink/TLB/img/circlefillp.png differ
9 25
new file mode 100644
10 26
Binary files /dev/null and b/ink/TLB/img/circlen.png differ
11 27
new file mode 100644
12 28
Binary files /dev/null and b/ink/TLB/img/circlep.png differ
13 29
new file mode 100644
14 30
Binary files /dev/null and b/ink/TLB/img/closed.png differ
15 31
new file mode 100644
16 32
Binary files /dev/null and b/ink/TLB/img/closen.png differ
17 33
new file mode 100644
18 34
Binary files /dev/null and b/ink/TLB/img/closep.png differ
19 35
new file mode 100644
20 36
Binary files /dev/null and b/ink/TLB/img/eraserrectd.png differ
21 37
new file mode 100644
22 38
Binary files /dev/null and b/ink/TLB/img/eraserrectn.png differ
23 39
new file mode 100644
24 40
Binary files /dev/null and b/ink/TLB/img/eraserrectp.png differ
25 41
new file mode 100644
26 42
Binary files /dev/null and b/ink/TLB/img/eraserroundd.png differ
27 43
new file mode 100644
28 44
Binary files /dev/null and b/ink/TLB/img/eraserroundn.png differ
29 45
new file mode 100644
30 46
Binary files /dev/null and b/ink/TLB/img/eraserroundp.png differ
31 47
new file mode 100644
32 48
Binary files /dev/null and b/ink/TLB/img/loadd.png differ
33 49
new file mode 100644
34 50
Binary files /dev/null and b/ink/TLB/img/loadn.png differ
35 51
new file mode 100644
36 52
Binary files /dev/null and b/ink/TLB/img/loadp.png differ
37 53
new file mode 100644
38 54
Binary files /dev/null and b/ink/TLB/img/newd.png differ
39 55
new file mode 100644
40 56
Binary files /dev/null and b/ink/TLB/img/newn.png differ
41 57
new file mode 100644
42 58
Binary files /dev/null and b/ink/TLB/img/newp.png differ
43 59
new file mode 100644
44 60
Binary files /dev/null and b/ink/TLB/img/opend.png differ
45 61
new file mode 100644
46 62
Binary files /dev/null and b/ink/TLB/img/openn.png differ
47 63
new file mode 100644
48 64
Binary files /dev/null and b/ink/TLB/img/openp.png differ
49 65
new file mode 100644
50 66
Binary files /dev/null and b/ink/TLB/img/printerd.png differ
51 67
new file mode 100644
52 68
Binary files /dev/null and b/ink/TLB/img/printern.png differ
53 69
new file mode 100644
54 70
Binary files /dev/null and b/ink/TLB/img/printerp.png differ
55 71
new file mode 100644
56 72
Binary files /dev/null and b/ink/TLB/img/saveasd.png differ
57 73
new file mode 100644
58 74
Binary files /dev/null and b/ink/TLB/img/saveasn.png differ
59 75
new file mode 100644
60 76
Binary files /dev/null and b/ink/TLB/img/saveasp.png differ
61 77
new file mode 100644
62 78
Binary files /dev/null and b/ink/TLB/img/saved.png differ
63 79
new file mode 100644
64 80
Binary files /dev/null and b/ink/TLB/img/saven.png differ
65 81
new file mode 100644
66 82
Binary files /dev/null and b/ink/TLB/img/savep.png differ
67 83
new file mode 100644
68 84
Binary files /dev/null and b/ink/TLB/img/squared.png differ
69 85
new file mode 100644
70 86
Binary files /dev/null and b/ink/TLB/img/squarefilld.png differ
71 87
new file mode 100644
72 88
Binary files /dev/null and b/ink/TLB/img/squarefilln.png differ
73 89
new file mode 100644
74 90
Binary files /dev/null and b/ink/TLB/img/squarefillp.png differ
75 91
new file mode 100644
76 92
Binary files /dev/null and b/ink/TLB/img/squaren.png differ
77 93
new file mode 100644
78 94
Binary files /dev/null and b/ink/TLB/img/squarep.png differ
79 95
new file mode 100644
80 96
Binary files /dev/null and b/ink/TLB/img/textd.png differ
81 97
new file mode 100644
82 98
Binary files /dev/null and b/ink/TLB/img/textn.png differ
83 99
new file mode 100644
84 100
Binary files /dev/null and b/ink/TLB/img/textp.png differ
85 101
new file mode 100644
86 102
Binary files /dev/null and b/ink/documentation/ink.png differ
87 103
new file mode 100644
88 104
Binary files /dev/null and b/ink/documentation/ink2.png differ
89 105
new file mode 100644
90 106
Binary files /dev/null and b/ink/documentation/ink_blur.png differ
91 107
new file mode 100644
92 108
Binary files /dev/null and b/ink/documentation/ink_resize.png differ
93 109
new file mode 100755
94 110
Binary files /dev/null and b/ink/ink differ
95 111
new file mode 100644
... ...
@@ -0,0 +1,170 @@
1
+here
2
+MessageImporter::Import() - error importing paths: Name not found
3
+MessageImporter::Import() - error importing paths: Name not found
4
+MessageImporter::Import() - error importing paths: Name not found
5
+MessageImporter::Import() - error importing paths: Name not found
6
+MessageImporter::Import() - error importing paths: Name not found
7
+MessageImporter::Import() - error importing paths: Name not found
8
+MessageImporter::Import() - error importing paths: Name not found
9
+MessageImporter::Import() - error importing paths: Name not found
10
+MessageImporter::Import() - error importing paths: Name not found
11
+MessageImporter::Import() - error importing paths: Name not found
12
+MessageImporter::Import() - error importing paths: Name not found
13
+MessageImporter::Import() - error importing paths: Name not found
14
+MessageImporter::Import() - error importing paths: Name not found
15
+MessageImporter::Import() - error importing paths: Name not found
16
+MessageImporter::Import() - error importing paths: Name not found
17
+MessageImporter::Import() - error importing paths: Name not found
18
+MessageImporter::Import() - error importing paths: Name not found
19
+MessageImporter::Import() - error importing paths: Name not found
20
+MessageImporter::Import() - error importing paths: Name not found
21
+MessageImporter::Import() - error importing paths: Name not found
22
+MessageImporter::Import() - error importing paths: Name not found
23
+MessageImporter::Import() - error importing paths: Name not found
24
+MessageImporter::Import() - error importing paths: Name not found
25
+MessageImporter::Import() - error importing paths: Name not found
26
+MessageImporter::Import() - error importing paths: Name not found
27
+MessageImporter::Import() - error importing paths: Name not found
28
+MessageImporter::Import() - error importing paths: Name not found
29
+MessageImporter::Import() - error importing paths: Name not found
30
+MessageImporter::Import() - error importing paths: Name not found
31
+MessageImporter::Import() - error importing paths: Name not found
32
+MessageImporter::Import() - error importing paths: Name not found
33
+MessageImporter::Import() - error importing paths: Name not found
34
+MessageImporter::Import() - error importing paths: Name not found
35
+MessageImporter::Import() - error importing paths: Name not found
36
+MessageImporter::Import() - error importing paths: Name not found
37
+MessageImporter::Import() - error importing paths: Name not found
38
+MessageImporter::Import() - error importing paths: Name not found
39
+MessageImporter::Import() - error importing paths: Name not found
40
+MessageImporter::Import() - error importing paths: Name not found
41
+MessageImporter::Import() - error importing paths: Name not found
42
+MessageImporter::Import() - error importing paths: Name not found
43
+MessageImporter::Import() - error importing paths: Name not found
44
+second here
45
+MessageImporter::Import() - error importing paths: Name not found
46
+MessageImporter::Import() - error importing paths: Name not found
47
+MessageImporter::Import() - error importing paths: Name not found
48
+MessageImporter::Import() - error importing paths: Name not found
49
+MessageImporter::Import() - error importing paths: Name not found
50
+MessageImporter::Import() - error importing paths: Name not found
51
+MessageImporter::Import() - error importing paths: Name not found
52
+MessageImporter::Import() - error importing paths: Name not found
53
+MessageImporter::Import() - error importing paths: Name not found
54
+MessageImporter::Import() - error importing paths: Name not found
55
+MessageImporter::Import() - error importing paths: Name not found
56
+MessageImporter::Import() - error importing paths: Name not found
57
+MessageImporter::Import() - error importing paths: Name not found
58
+MessageImporter::Import() - error importing paths: Name not found
59
+MessageImporter::Import() - error importing paths: Name not found
60
+MessageImporter::Import() - error importing paths: Name not found
61
+MessageImporter::Import() - error importing paths: Name not found
62
+MessageImporter::Import() - error importing paths: Name not found
63
+MessageImporter::Import() - error importing paths: Name not found
64
+MessageImporter::Import() - error importing paths: Name not found
65
+MessageImporter::Import() - error importing paths: Name not found
66
+MessageImporter::Import() - error importing paths: Name not found
67
+MessageImporter::Import() - error importing paths: Name not found
68
+MessageImporter::Import() - error importing paths: Name not found
69
+MessageImporter::Import() - error importing paths: Name not found
70
+MessageImporter::Import() - error importing paths: Name not found
71
+MessageImporter::Import() - error importing paths: Name not found
72
+MessageImporter::Import() - error importing paths: Name not found
73
+MessageImporter::Import() - error importing paths: Name not found
74
+MessageImporter::Import() - error importing paths: Name not found
75
+MessageImporter::Import() - error importing paths: Name not found
76
+MessageImporter::Import() - error importing paths: Name not found
77
+MessageImporter::Import() - error importing paths: Name not found
78
+MessageImporter::Import() - error importing paths: Name not found
79
+MessageImporter::Import() - error importing paths: Name not found
80
+MessageImporter::Import() - error importing paths: Name not found
81
+MessageImporter::Import() - error importing paths: Name not found
82
+MessageImporter::Import() - error importing paths: Name not found
83
+MessageImporter::Import() - error importing paths: Name not found
84
+MessageImporter::Import() - error importing paths: Name not found
85
+MessageImporter::Import() - error importing paths: Name not found
86
+MessageImporter::Import() - error importing paths: Name not found
87
+MessageImporter::Import() - error importing paths: Name not found
88
+MessageImporter::Import() - error importing paths: Name not found
89
+MessageImporter::Import() - error importing paths: Name not found
90
+MessageImporter::Import() - error importing paths: Name not found
91
+MessageImporter::Import() - error importing paths: Name not found
92
+MessageImporter::Import() - error importing paths: Name not found
93
+MessageImporter::Import() - error importing paths: Name not found
94
+MessageImporter::Import() - error importing paths: Name not found
95
+MessageImporter::Import() - error importing paths: Name not found
96
+MessageImporter::Import() - error importing paths: Name not found
97
+MessageImporter::Import() - error importing paths: Name not found
98
+MessageImporter::Import() - error importing paths: Name not found
99
+MessageImporter::Import() - error importing paths: Name not found
100
+MessageImporter::Import() - error importing paths: Name not found
101
+MessageImporter::Import() - error importing paths: Name not found
102
+MessageImporter::Import() - error importing paths: Name not found
103
+MessageImporter::Import() - error importing paths: Name not found
104
+MessageImporter::Import() - error importing paths: Name not found
105
+MessageImporter::Import() - error importing paths: Name not found
106
+MessageImporter::Import() - error importing paths: Name not found
107
+MessageImporter::Import() - error importing paths: Name not found
108
+MessageImporter::Import() - error importing paths: Name not found
109
+MessageImporter::Import() - error importing paths: Name not found
110
+MessageImporter::Import() - error importing paths: Name not found
111
+MessageImporter::Import() - error importing paths: Name not found
112
+MessageImporter::Import() - error importing paths: Name not found
113
+MessageImporter::Import() - error importing paths: Name not found
114
+MessageImporter::Import() - error importing paths: Name not found
115
+MessageImporter::Import() - error importing paths: Name not found
116
+MessageImporter::Import() - error importing paths: Name not found
117
+MessageImporter::Import() - error importing paths: Name not found
118
+MessageImporter::Import() - error importing paths: Name not found
119
+MessageImporter::Import() - error importing paths: Name not found
120
+MessageImporter::Import() - error importing paths: Name not found
121
+MessageImporter::Import() - error importing paths: Name not found
122
+MessageImporter::Import() - error importing paths: Name not found
123
+MessageImporter::Import() - error importing paths: Name not found
124
+MessageImporter::Import() - error importing paths: Name not found
125
+MessageImporter::Import() - error importing paths: Name not found
126
+MessageImporter::Import() - error importing paths: Name not found
127
+MessageImporter::Import() - error importing paths: Name not found
128
+MessageImporter::Import() - error importing paths: Name not found
129
+MessageImporter::Import() - error importing paths: Name not found
130
+MessageImporter::Import() - error importing paths: Name not found
131
+MessageImporter::Import() - error importing paths: Name not found
132
+MessageImporter::Import() - error importing paths: Name not found
133
+MessageImporter::Import() - error importing paths: Name not found
134
+MessageImporter::Import() - error importing paths: Name not found
135
+MessageImporter::Import() - error importing paths: Name not found
136
+MessageImporter::Import() - error importing paths: Name not found
137
+MessageImporter::Import() - error importing paths: Name not found
138
+MessageImporter::Import() - error importing paths: Name not found
139
+MessageImporter::Import() - error importing paths: Name not found
140
+MessageImporter::Import() - error importing paths: Name not found
141
+MessageImporter::Import() - error importing paths: Name not found
142
+MessageImporter::Import() - error importing paths: Name not found
143
+MessageImporter::Import() - error importing paths: Name not found
144
+MessageImporter::Import() - error importing paths: Name not found
145
+MessageImporter::Import() - error importing paths: Name not found
146
+MessageImporter::Import() - error importing paths: Name not found
147
+MessageImporter::Import() - error importing paths: Name not found
148
+MessageImporter::Import() - error importing paths: Name not found
149
+MessageImporter::Import() - error importing paths: Name not found
150
+MessageImporter::Import() - error importing paths: Name not found
151
+MessageImporter::Import() - error importing paths: Name not found
152
+MessageImporter::Import() - error importing paths: Name not found
153
+MessageImporter::Import() - error importing paths: Name not found
154
+MessageImporter::Import() - error importing paths: Name not found
155
+MessageImporter::Import() - error importing paths: Name not found
156
+MessageImporter::Import() - error importing paths: Name not found
157
+MessageImporter::Import() - error importing paths: Name not found
158
+MessageImporter::Import() - error importing paths: Name not found
159
+MessageImporter::Import() - error importing paths: Name not found
160
+MessageImporter::Import() - error importing paths: Name not found
161
+MessageImporter::Import() - error importing paths: Name not found
162
+MessageImporter::Import() - error importing paths: Name not found
163
+MessageImporter::Import() - error importing paths: Name not found
164
+MessageImporter::Import() - error importing paths: Name not found
165
+MessageImporter::Import() - error importing paths: Name not found
166
+MessageImporter::Import() - error importing paths: Name not found
167
+MessageImporter::Import() - error importing paths: Name not found
168
+MessageImporter::Import() - error importing paths: Name not found
169
+MessageImporter::Import() - error importing paths: Name not found
170
+MessageImporter::Import() - error importing paths: Name not found
0 171
new file mode 100644
... ...
@@ -0,0 +1,1034 @@
1
+#!/boot/system/yab
2
+
3
+//programmvariablen
4
+PRGMenu=1 //Programmmenu ja/nein
5
+TLB=1//Toolbar ja/nein
6
+aktiv=1
7
+bitmap 1,1, "Pinsel"
8
+bitmap 1,1, "BrushSize"
9
+
10
+WorkDirectory()
11
+
12
+StartWindow(PRGMenu,TLB,WorkDir$)
13
+
14
+
15
+
16
+// Style für die Eintraege festlegen
17
+fonts_ermitteln()
18
+
19
+main()
20
+
21
+sub main()
22
+		
23
+	dim part$(1)
24
+	dim mesg$(1)
25
+	dim mouse$(1)
26
+	dim ViewMouse$(1)
27
+	inloop = true
28
+	while(inloop)
29
+		r = COLORCONTROL GET "Farbauswahl", "Red"
30
+		b = COLORCONTROL GET "Farbauswahl", "Blue"
31
+		g = COLORCONTROL GET "Farbauswahl", "Green"
32
+		Pinselgroesse = SPINCONTROL GET "BrushSize"
33
+		if (r or b or g or Pinselgroesse) then
34
+			Anzeige_Brushsize(Pinselgroesse,TypeOfBrush$,r,g,b)
35
+		endif
36
+		
37
+	//Tastaturabfragen
38
+	keymsg$ = keyboard message$(Start_FensterName$+"1") //
39
+	if(keymsg$<>"" and keymsg$<>old_keymsg$) then
40
+		//print keymsg$
41
+		old_keymsg$ = keymsg$
42
+	endif
43
+	
44
+	switch(keymsg$)
45
+		case "left"
46
+			draw text 10, 140, "Case Abfrage auf Pfeil Taste nach links", "MouseView"
47
+		break
48
+		case "n"			
49
+			option set "ToolbarNew", "Enabled", false
50
+			resizen=0
51
+			ToolbarSubmenu(PRGMenu,resizen)
52
+		break
53
+		case "s"
54
+			//option set "ToolbarNew", "Enabled", true
55
+			//option set "ToolbarNew", "Enabled", false
56
+			casestring$=""
57
+			view_existing()
58
+			if (Filename$="")then
59
+				hint()
60
+				ImageFile$ = FILEPANEL "Save-File", "Save-File", "", Filename$					
61
+				picture_save(ImageFile$)
62
+			else				
63
+				picture_save(ImageFile$)
64
+			endif
65
+		break
66
+		
67
+		default:
68
+			
69
+		break
70
+	end switch
71
+	
72
+	//Fenster und Menu abfragen
73
+		msg$ = message$
74
+		numSplit = split(msg$,mesg$(),"|")
75
+		for countMessages = 1 to numSplit
76
+			msg$ = mesg$(countMessages) + "|"
77
+			if (split(msg$, part$(), ":|") > 3) then
78
+				PartOne$=part$(1)
79
+				PartTwo$ = part$(2)
80
+				PartThree$ = part$(3)
81
+				PartFour$= part$(4)				
82
+				if (PartTwo$="Fonts") then
83
+					ausgewaehlter_Font_style$=PartThree$+","+PartFour$
84
+					//print ausgewaehlter_Font_style$
85
+				endif
86
+				
87
+			endif
88
+			if (msg$ <> "") then
89
+				//print msg$
90
+			endif
91
+			switch (msg$)
92
+				case Start_FensterName_stack$+":_QuitRequested|"
93
+					window close Start_FensterName_stack$
94
+				break
95
+				case Start_FensterName$+"1:Program:Quit|"
96
+				case Start_FensterName$+"1:Programm:Beenden|"
97
+					window close Start_FensterName_stack$
98
+				break				
99
+				case Start_FensterName$+"1:Program:About|"
100
+				case Start_FensterName$+"1:Programm:Über|"
101
+					about()
102
+				break	
103
+				case "AboutClose|"
104
+					Stackview set Start_FensterName$,1
105
+				break						
106
+				case toolbarview$+"Fonts"
107
+					gewaehlter_font_inkl_style$=PartThree$
108
+				//	print gewaehlter_font_inkl_style$
109
+					
110
+				break
111
+				default:
112
+				break
113
+			end switch
114
+			
115
+			if(window count<1) then
116
+				inloop = false
117
+				//sleep 0.1
118
+			endif
119
+		next countMessages	
120
+		
121
+		//Mausabfragen
122
+			mmsg$ = MOUSE MESSAGE$
123
+			if (mmsg$<>"" and mmsg$<>old_mmsg$) then
124
+				//print mmsg$
125
+				old_mmsg$= mmsg$ 
126
+				nx = split(mmsg$, mouse$(), ":")
127
+				Viewname$=mouse$(1)
128
+				if (Viewname$="scroll") then
129
+					Viewname$="CanVas_1"
130
+				//elseif(Viewname$="_HSB_" or Viewname$="_VSB_") then
131
+				//	Viewname$="scroll"
132
+				endif
133
+				
134
+				Xmouse = val(mouse$(2))
135
+				Ymouse = val(mouse$(3))
136
+				BLmouse= val(mouse$(4))
137
+				BCmouse= val(mouse$(5))
138
+				BRmouse= val(mouse$(6))
139
+				casestring$=Viewname$+":"+mouse$(4)+":"+mouse$(5)+":"+mouse$(6)
140
+				//print casestring$+":"+str$(Xmouse)+":"+str$(Ymouse)
141
+				//if (casestring$="drawline:1:0:0") then				
142
+				//	XMouse1=Xmouse
143
+				//	YMouse1=Ymouse
144
+				//	drawline(XMouse1,YMouse1,XMouse2,YMouse2)	
145
+				//elseif (casestring$="drawline:0:0:0") then				
146
+				//	XMouse2=Xmouse
147
+				//	YMouse2=Ymouse
148
+				//	drawline(XMouse1,YMouse1,XMouse2,YMouse2)	
149
+				//endif
150
+				
151
+				mmsg$=""
152
+			endif
153
+		
154
+		switch (casestring$)
155
+			case "Exit:0:0:1"
156
+				//button_setzen(Xmouse,Ymouse)				
157
+			break
158
+			case "CanVas_1:0:0:1"
159
+				BITMAP GET Xmouse,Ymouse to Xmouse+1,Ymouse+1, "Pipette","CanVas_1"
160
+					b_color = BITMAP COLOR 0,0,"Pipette", "red"
161
+					g_color = BITMAP COLOR 0,0,"Pipette", "green"
162
+					r_color = BITMAP COLOR 0,0,"Pipette", "blue"
163
+					//print r_color
164
+					//print g_color
165
+					//print b_color
166
+					COLORCONTROL SET "Farbauswahl", r_color,g_color,b_color
167
+					
168
+				BITMAP REMOVE "Pipette"
169
+				BRmouse=0
170
+			break
171
+			case "Brush1:1:0:0"
172
+				TypeOfBrush$="Rectangle"
173
+				option set "BrushSize", "Enabled", true
174
+				option set "Brush1", "Enabled", true
175
+				option set "Brush2", "Enabled", true	
176
+				option set "Brush3", "Enabled", true
177
+				option set "Brush4", "Enabled", true			
178
+			break
179
+			case "Brush2:1:0:0"
180
+				TypeOfBrush$="Round"
181
+				option set "BrushSize", "Enabled", true
182
+				option set "Brush2", "Enabled", true
183
+				option set "Brush1", "Enabled", true
184
+				option set "Brush3", "Enabled", true
185
+				option set "Brush4", "Enabled", true
186
+				
187
+			break
188
+			case "Brush3:1:0:0"
189
+				TypeOfBrush$="Rectangle_only_outerline"
190
+				option set "BrushSize", "Enabled", true
191
+				option set "Brush3", "Enabled", true
192
+				option set "Brush1", "Enabled", true
193
+				option set "Brush2", "Enabled", true
194
+				option set "Brush4", "Enabled", true
195
+			break
196
+			case "Brush4:1:0:0"
197
+				TypeOfBrush$="Round_only_outerline"
198
+				option set "BrushSize", "Enabled", true
199
+				option set "Brush4", "Enabled", true
200
+				option set "Brush1", "Enabled", true
201
+				option set "Brush2", "Enabled", true
202
+				option set "Brush3", "Enabled", true
203
+			break
204
+			case "Brush5:1:0:0"
205
+				TypeOfBrush$="text_malen"
206
+				option set "BrushSize", "Enabled", true
207
+				option set "Brush5", "Enabled", true
208
+				option set "Brush1", "Enabled", true
209
+				option set "Brush2", "Enabled", true
210
+				option set "Brush3", "Enabled", true
211
+			break
212
+			case "Brush6:1:0:0"
213
+				
214
+				TypeOfBrush$="eraser_Rectangle"
215
+				option set "BrushSize", "Enabled", true
216
+				option set "Brush5", "Enabled", true
217
+				option set "Brush1", "Enabled", true
218
+				option set "Brush2", "Enabled", true
219
+				option set "Brush3", "Enabled", true
220
+			break
221
+			case "Brush7:1:0:0"
222
+				TypeOfBrush$="eraser_Round"
223
+				option set "BrushSize", "Enabled", true
224
+				option set "Brush2", "Enabled", true
225
+				option set "Brush1", "Enabled", true
226
+				option set "Brush3", "Enabled", true
227
+				option set "Brush4", "Enabled", true
228
+			break
229
+			
230
+			case "Brush8:1:0:0"
231
+				option set "BrushSize", "Enabled", false
232
+				option set "Brush5", "Enabled", true
233
+				option set "Brush1", "Enabled", true
234
+				option set "Brush2", "Enabled", true
235
+				option set "Brush3", "Enabled", true
236
+				
237
+				get_bitmap_color=1
238
+			break
239
+			//case "drawline:1:0:0"
240
+			//	draw line 0,0 to Xmouse,Ymouse 
241
+			//	TypeOfBrush$="gerade_Line"
242
+			//	option set "BrushSize", "Enabled", true
243
+			//	option set "Brush5", "Enabled", true
244
+			//	option set "Brush1", "Enabled", true
245
+			//	option set "Brush2", "Enabled", true
246
+			//	option set "Brush3", "Enabled", true
247
+			//break
248
+			case "Brush3:1:0:0"
249
+				//bitmap 32,32, "Pinsel"
250
+				//err = draw image 0,0 to 31,31, "/boot/home/Projekte/yab/Malprogramm/Brush/baer.png", "Pinsel"
251
+			break
252
+			case "BrushSize:0:0:0"
253
+				r = COLORCONTROL GET "Farbauswahl", "Red"
254
+				b = COLORCONTROL GET "Farbauswahl", "Blue"
255
+				g = COLORCONTROL GET "Farbauswahl", "Green"
256
+				//print r,g,b
257
+				Pinselgroesse = SPINCONTROL GET "BrushSize"
258
+			//	print "BrushSize"+TypeOfBrush$
259
+				if (old_TypeOfBrush$<>TypeOfBrush$) then
260
+					//Draw flush "BrushSize"
261
+				else
262
+					old_TypeOfBrush$=TypeOfBrush$
263
+				endif
264
+				Anzeige_Brushsize(Pinselgroesse,TypeOfBrush$,r,g,b)
265
+			break
266
+			
267
+			case "datei1:1:0:0" //new
268
+			    //option set "ToolbarNew", "Enabled", true
269
+				//option set "ToolbarNew", "Enabled", false
270
+				casestring$=""
271
+				resizen=0
272
+				If (CanVas_1=1) then
273
+				else
274
+					ToolbarSubmenu(PRGMenu,resizen)
275
+					option set "datei1", "Enabled", false 
276
+				endif
277
+			break
278
+			case "datei2:1:0:0" //close
279
+			    //option set "ToolbarNew", "Enabled", true
280
+				//option set "ToolbarNew", "Enabled", false
281
+				casestring$=""
282
+				view_exists=view get "Malflaeche","exists"
283
+				print view_exists
284
+  				if (view_exists=1) then
285
+  					view remove "Malflaeche"
286
+  				endif
287
+				FileType$=""
288
+  				Picturesize$=""
289
+				ImageFile$=""
290
+  				Filetype(ImageFile$)
291
+  				filetype()
292
+  				option set "datei1", "Enabled", true 
293
+			break
294
+			case "datei3:1:0:0" //load
295
+			    //option set "ToolbarNew", "Enabled", true
296
+				//option set "ToolbarNew", "Enabled", false
297
+				BITMAP 0,0, "first_init"
298
+				casestring$=""
299
+				ImageFile$ = FILEPANEL  "Load-File",  "Load-File", ""
300
+				if (ImageFile$<>"") then
301
+					pos=rinstr(ImageFile$,".")
302
+					FileType$=right$(ImageFile$,len(ImageFile$)-pos)
303
+					ErrCode = BITMAP IMAGE ImageFile$, "first_init"
304
+					Create_Malflaeche(WindowSize_x,WindowSize_y,Start_FensterName$)
305
+					LoadError = DRAW IMAGE 0,0, ImageFile$, "CanVas_1"
306
+					Bitmap Remove "first_init"
307
+					Filename$=ImageFile$
308
+					Filetype(ImageFile$)
309
+					filetype()
310
+				else
311
+				endif
312
+			break
313
+			case "datei4:1:0:0" //save
314
+			    //option set "ToolbarNew", "Enabled", true
315
+				//option set "ToolbarNew", "Enabled", false
316
+				casestring$=""
317
+				view_exists=view get "Malflaeche","Exists"
318
+  				if (view_exists=1) then
319
+  					if (Filename$="")then
320
+						hint()
321
+						ImageFile$ = FILEPANEL "Save-File", "Save-File", "", Filename$		
322
+						if (ImageFile$<>"") then
323
+							picture_save(ImageFile$)
324
+						else
325
+						endif			
326
+					else					
327
+						picture_save(ImageFile$)
328
+					endif	
329
+				endif
330
+			break
331
+			case "datei5:1:0:0" //saveas
332
+			    //option set "ToolbarNew", "Enabled", true
333
+				//option set "ToolbarNew", "Enabled", false
334
+				casestring$=""
335
+				view_exists=view get "Malflaeche","Exists"
336
+  				if (view_exists=1) then
337
+					hint()
338
+					ImageFile$ = FILEPANEL "Save-File", "Save-File", "", Filename$
339
+					if (ImageFile$<>"") then
340
+						picture_save(ImageFile$)
341
+					else
342
+					endif
343
+				endif
344
+			break
345
+			
346
+			case "datei6:1:0:0" //printer
347
+			    //option set "ToolbarNew", "Enabled", true
348
+				//option set "ToolbarNew", "Enabled", false
349
+				casestring$=""
350
+				
351
+			break
352
+			case "CreateCanvas:1:0:0"
353
+				option set "datei1", "Enabled", true
354
+				Create_Malflaeche(WindowSize_x,WindowSize_y,Start_FensterName$)
355
+				casestring$=""
356
+				option set "Brush1", "Enabled", true
357
+				option set "Brush2", "Enabled", true
358
+				option set "Brush3", "Enabled", true
359
+				option set "Brush4", "Enabled", true				
360
+			break
361
+			case "CanVas_1:1:0:0"							
362
+				view_exists=view get "Malflaeche","Exists"
363
+				if (view_exists=1) then
364
+					
365
+					//draw line 0,0 to Xmouse,Ymouse, "CanVas_1"
366
+					draw bitmap Xmouse,Ymouse, "Pinsel", "alpha", "CanVas_1"				
367
+				endif
368
+			break
369
+			case "resize1:1:0:0"
370
+				resizen=1
371
+				If (CanVas_1=1) then
372
+				else
373
+					ToolbarSubmenu(PRGMenu,resizen)
374
+					option set "datei1", "Enabled", false 
375
+				endif
376
+			break
377
+			case "ResizeCanvas:1:0:0"
378
+				//Canvas_X_new=400
379
+				//Canvas_Y_new=400
380
+				//bitmap Canvas_X_new,Canvas_Y_new, "zwischenspeicher" 
381
+				BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
382
+				ErrCode = BITMAP SAVE "save",  daten_dir$+"/test.bmp", "bmp"	
383
+			if (view get "Neue_Canvas","Exists"=1) then				
384
+				Canvas_X_new=val(TEXTCONTROL GET$ "groesse_x")
385
+				Canvas_Y_new=val(TEXTCONTROL GET$ "groesse_y")
386
+				if (view get "Malflaeche","Exists"=1) then
387
+					view remove "Malflaeche"
388
+					Create_Canvas(Canvas_X_new,Canvas_Y_new) 		
389
+  				else
390
+ 			 	  	Create_Canvas(Canvas_X_new,Canvas_Y_new) 
391
+ 			 	endif
392
+				Canvas_X=Canvas_X_new
393
+				Canvas_Y=Canvas_Y_new	
394
+				LoadError = DRAW IMAGE 0,0 to Canvas_X,Canvas_Y, daten_dir$+"/test.bmp", "CanVas_1"		
395
+				OPTION SET "_HSB_", "Focus", true
396
+  					OPTION SET "_VSB_", "Focus", true
397
+			endif
398
+			break
399
+			case "Brightness:1:0:0"
400
+				AlphaValue=slider get "Brightness"
401
+			break
402
+			
403
+			default:
404
+				view_exists=view get "Malflaeche","Exists"
405
+  				if (view_exists=0) then
406
+  					Viewname$=""
407
+  					
408
+  				endif
409
+			break
410
+			
411
+		end switch
412
+	wend
413
+end sub
414
+sub WorkDirectory()
415
+REM ######Verzeichnis bestimmen######
416
+
417
+if(ready_to_compile=1)then
418
+	if (peek("isbound")) then
419
+		WorkDir$ = trim$(peek$("directory"))
420
+	else
421
+		WorkDir$ = trim$(system$("pwd"))
422
+		
423
+	endif
424
+else
425
+		//WorkDir$="/boot/system/apps/Ink/TLB/img"
426
+		WorkDir$="/Share/Projekte/yab_hpkg/ink"
427
+		
428
+endif
429
+end sub
430
+sub IfExists(filename$)
431
+	return not system("test -e "+filename$)
432
+end sub
433
+Sub StartWindow(PRGMenu,TLB,WorkDir$)
434
+REM ######Fenteraufbau######
435
+
436
+
437
+	screenWidth = peek("desktopwidth")
438
+	screenHeight = peek("desktopheight")
439
+	WindowSize_x=800
440
+	WindowSize_y=620
441
+	
442
+	ProgrammName$="ink"
443
+	Start_FensterName_stack$="stack_ink"
444
+	Start_FensterName$="ink"
445
+	NameView$="Programme"
446
+	FileView$="Filename"
447
+	Hoehe_Toolbar=115
448
+	//TLB_Verzeichnis$="/Share/Projekte/yab_hpkg/ink/TLB/"
449
+	TLB_Verzeichnis$=WorkDir$+"/TLB/"
450
+	//print TLB_Verzeichnis$
451
+	ToolbarVerzeichnisImg$=TLB_Verzeichnis$+"img/"
452
+	//ToolbarVerzeichnisImg$="/boot/system/apps/Ink/TLB/img/"
453
+	
454
+	daten_dir$="/boot/home/.besly/ink/data"
455
+	rem ###### Ueberpruefungen #########
456
+	if(IfExists(daten_dir$)) then
457
+		//start=1
458
+		if(IfExists(local_directory$)) then
459
+		else
460
+			output$=system$("mkdir -p "+local_directory$)
461
+		endif	
462
+	else
463
+		output$=system$("mkdir -p "+daten_dir$)
464
+	endif
465
+	
466
+	
467
+	window open ((screenWidth/2)-(WindowSize_x/2)), ((screenHeight/2)-(WindowSize_y/2)) to ((screenWidth/2)+(WindowSize_x/2)), ((screenHeight/2)+(WindowSize_y/2)), Start_FensterName_stack$,ProgrammName$
468
+	window set  Start_FensterName_stack$, "MinimumTo", WindowSize_x,WindowSize_y
469
+	window set  Start_FensterName_stack$, "MaximumTo", WindowSize_x,WindowSize_y
470
+	stackview 0,0 to  WindowSize_x,WindowSize_y, Start_FensterName$,2,Start_FensterName_stack$
471
+	if (PRGMenu=1) then
472
+		menu "Program", "About", "",Start_FensterName$+"1"
473
+		menu "Program", "Quit", "", Start_FensterName$+"1"
474
+		
475
+	else
476
+	endif
477
+	
478
+	If (TLB=1) then
479
+		TLB_auslesen(TLB_Verzeichnis$)
480
+			If (PRGMenu=1) then
481
+				local y
482
+				y=20
483
+				ToolbarCreate(0,y,WindowSize_x-300,Hoehe_Toolbar-5, "Toolbar",ToolbarVerzeichnisImg$, Start_FensterName$+"1") //NameView$)	
484
+				//ToolbarCreate(0,y+Hoehe_Toolbar,WindowSize_x-1,y+(4*Hoehe_Toolbar), "2.Toolbar",ToolbarVerzeichnisImg$, Start_FensterName$) //NameView$)			
485
+			else
486
+				ToolbarCreate(0,0,WindowSize_x-300,Hoehe_Toolbar-y, "Toolbar", ToolbarVerzeichnisImg$, Start_FensterName$+"1") //NameView$)
487
+			endif
488
+		    ge=1
489
+			for gc = 1 to anzahlzeilen
490
+			  //for gb = 1 to anzahlspalten
491
+			  	if (TLB_eintraege$(ge)="Seperator") then
492
+			  		ToolbarAddSeparator(Breite_Toolbar,"vertikal","Toolbar")	
493
+			  	else
494
+					ToolbarAddIcon(TLB_eintraege$(ge), ToolbarVerzeichnisImg$+TLB_eintraege$(ge+1),ToolbarVerzeichnisImg$+TLB_eintraege$(ge+2), (ToolbarVerzeichnisImg$+TLB_eintraege$(ge+3)), ToolbarVerzeichnisImg$+TLB_eintraege$(ge+4),"horizontal","Toolbar")									
495
+					//print ToolbarVerzeichnisImg$+TLB_eintraege$(ge+2)+"hhh"
496
+				endif
497
+			  //next gb
498
+			ge=ge+5			
499
+			next gc
500
+			SPINCONTROL WindowSize_x-300-135,5, "BrushSize", "", 1, 30, 1, "Toolbar"	
501
+			SPINCONTROL SET  "BrushSize", 1
502
+			TEXTCONTROL WindowSize_x-556,35 TO WindowSize_x-385 ,55, "Eingabetext" , "", "Put here your text" , "Toolbar"
503
+			
504
+			SLIDER WindowSize_x-300,85 to WindowSize_x-100,95, "Brightness", "",0,255, Start_FensterName$+"1" //"Toolbar"
505
+			//Slider label "Brightness", "0", "255"
506
+			SLIDER SET "Brightness", 255
507
+			AlphaValue=255
508
+			//SLIDER SET "Brightness", "top", 10
509
+			COLORCONTROL WindowSize_x-300,25, "Farbauswahl",  Start_FensterName$+"1" //"Toolbar"	
510
+			
511
+			
512
+			//DRAW SET "system-plain,regular,6" ,"Brightness" 
513
+			//DRAW TEXT WindowSize_x-330,100,"Brightness", Start_FensterName$ //"Toolbar" 
514
+			//return
515
+		else	
516
+	endif
517
+		option set "BrushSize", "Enabled", false
518
+		//alle Brushes deaktivieren
519
+		//option set "Brush1", "Enabled", false
520
+		//option set "Brush2", "Enabled", false
521
+		//option set "Brush3", "Enabled", false
522
+		//option set "Brush4", "Enabled", false
523
+		//option set "Brush5", "Enabled", false
524
+		//option set "Brush6", "Enabled", false
525
+		//option set "Brush7", "Enabled", false
526
+		// alle weiteren Funktionen deaktivieren
527
+		//option set "datei2", "Enabled", false
528
+		//option set "datei4", "Enabled", false
529
+		//option set "datei5", "Enabled", false
530
+		//option set "datei6", "Enabled", false
531
+		
532
+	//Texteingabe	
533
+	Pinselgroesse=0
534
+	TypeOfBrush$=""
535
+	//BITMAP 0,0, "Pinsel"
536
+	Anzeige_Brushsize(Pinselgroesse, TypeOfBrush$)	
537
+	draw set "highcolor", 0,0,0, Start_FensterName$+"1"
538
+	//obere Linie
539
+	
540
+	draw line 0,Hoehe_Toolbar to WindowSize_x,Hoehe_Toolbar,Start_FensterName$+"1"
541
+	//untere Linie
542
+	
543
+	draw line 0,WindowSize_y-19 to WindowSize_x,WindowSize_y-19, Start_FensterName$+"1"
544
+	View 0,WindowSize_y-18 to WindowSize_x,WindowSize_y, "Filename", Start_FensterName$+"1"
545
+	filetype()
546
+End sub
547
+
548
+sub TLB_auslesen(TLB_Verzeichnis$)
549
+	
550
+local x
551
+local d
552
+local i
553
+x=0
554
+d=0
555
+i=0			
556
+	fileload$=TLB_Verzeichnis$+"Toolbar.csv"
557
+	//print fileload$
558
+	auslesen=open(fileload$, "r")
559
+	while (not EOF(auslesen))
560
+		line input #auslesen b$
561
+		dim elements$(1)
562
+		numElements = split(b$, elements$(),";")
563
+		for i = 1 to numElements
564
+			x=x+1
565
+			dim TLB_eintraege$(x)
566
+			TLB_eintraege$(x) = trim$(elements$(i))
567
+			//print TLB_eintraege$(x)
568
+		next i
569
+	wend
570
+	close(auslesen)
571
+	
572
+	anzahlspalten=numElements
573
+	anzahlzeilen=x/anzahlspalten	
574
+	return
575
+end sub
576
+
577
+sub ToolbarSubmenu(PRGMenu,resizen)
578
+	
579
+	if (PRGMenu=1) then
580
+		local y
581
+		y=20
582
+		if (view get "Neue_Canvas","Exists"=0) then
583
+			View 0,y+6 to 210,y+65 , "Neue_Canvas", "Toolbar"
584
+		endif
585
+		
586
+		//draw set "bgcolor", 222,200,222, "Neue_Canvas"
587
+	else
588
+	 	if (view get "Neue_Canvas","Exists"=0) then
589
+			View 0,6 to 210,65, "Neue_Canvas", "Toolbar"
590
+		endif
591
+		
592
+	 	//draw set "bgcolor", 222,200,222,"Neue_Canvas"
593
+	endif
594
+		
595
+	if (resizen=1) then
596
+		TEXTCONTROL 10,10 TO 100,20, "groesse_x", "X", "800","Neue_Canvas"
597
+		TEXTCONTROL 110,10 TO 200,20, "groesse_y", "Y", "600","Neue_Canvas"
598
+		BUTTON 22,35 to 200,55, "ResizeCanvas", "Resize Canvas", "Neue_Canvas"
599
+	else
600
+		TEXTCONTROL 10,10 TO 100,20, "groesse_x", "X", "800","Neue_Canvas"
601
+		TEXTCONTROL 110,10 TO 200,20, "groesse_y", "Y", "600","Neue_Canvas"
602
+		BUTTON 22,35 to 200,55, "CreateCanvas", "Create Canvas", "Neue_Canvas"
603
+	endif
604
+end sub
605
+
606
+sub Anzeige_Brushsize(Pinselgroesse,TypeOfBrush$, r,g,b)
607
+			
608
+//print "Anzeige"+str$(Pinselgroesse)+str$(r)+str$(g)+str$(b)
609
+	//print  toolbarview$
610
+	if (Pinselgroesse=0) then
611
+		local x1:local x2:local y1:local y2
612
+		x1=WindowSize_x-300-75
613
+		y1=5
614
+		x2=WindowSize_x-305
615
+		y2=80
616
+		
617
+		mittelpunkt_x=(x2-x1)/2
618
+		mittelpunkt_y=(y2-y1)/2
619
+		//print mittelpunkt
620
+		//print x1:print y2: print x2: print y2
621
+		view x1,y1 to x2,y2, "BrushSize", toolbarview$
622
+		Draw flush "BrushSize"
623
+		//canvas x1,y1 to x2,y2, "BrushSize", toolbarview$
624
+		DRAW SET "BGcolor", 255,255,255, "BrushSize"
625
+		
626
+	endif		
627
+		
628
+	if (TypeOfBrush$="Rectangle") then
629
+		DRAW SET "Alpha", AlphaValue 
630
+		//print AlphaValue
631
+		Draw flush "BrushSize"
632
+		
633
+		DRAW SET 0,"LowSolidFill"
634
+		DRAW SET 0,"HighSolidFill"
635
+		draw set "Lowcolor", r,g,b, "BrushSize"
636
+		draw set "Highcolor", r,g,b, "BrushSize"
637
+		DRAW RECT mittelpunkt_x-(Pinselgroesse/2),mittelpunkt_y-(Pinselgroesse/2) TO mittelpunkt_x+(Pinselgroesse/2),mittelpunkt_y+(Pinselgroesse/2), "BrushSize"	
638
+		Bitmap remove "Pinsel"
639
+		Bitmap Pinselgroesse, Pinselgroesse, "Pinsel"
640
+		draw set "Lowcolor", r,g,b, "Pinsel"
641
+		draw set "Highcolor", r,g,b, "Pinsel"
642
+		DRAW RECT 0,0 to Pinselgroesse, Pinselgroesse, "Pinsel"
643
+		return
644
+	elseif (TypeOfBrush$="Round") then
645
+		DRAW SET "Alpha", AlphaValue 
646
+		Draw flush "BrushSize"
647
+		//DRAW SET 0,"LowSolidFill"
648
+		DRAW SET 0,"HighSolidFill"
649
+	
650
+		draw set "Lowcolor", r,g,b, "BrushSize"
651
+		draw set "Highcolor", r,g,b, "BrushSize"			
652
+		DRAW CIRCLE mittelpunkt_x,mittelpunkt_y, (Pinselgroesse/2) , "BrushSize"			
653
+		Bitmap remove "Pinsel"
654
+		Bitmap (Pinselgroesse*2), (Pinselgroesse*2), "Pinsel"
655
+		
656
+		//draw set "Lowcolor", r,g,b, "Pinsel"
657
+		draw set "Highcolor", r,g,b, "Pinsel"
658
+		
659
+		DRAW CIRCLE Pinselgroesse/2,Pinselgroesse/2, (Pinselgroesse/2) , "Pinsel"
660
+		
661
+		return
662
+	elseif (TypeOfBrush$="Round_only_outerline") then
663
+		DRAW SET "Alpha", AlphaValue 
664
+		Draw flush "BrushSize"
665
+		
666
+		draw set "Lowcolor", r,g,b, "BrushSize"
667
+		draw set "Highcolor", r,g,b, "BrushSize"	
668
+		DRAW SET 1,"HighSolidFill"		
669
+		DRAW CIRCLE mittelpunkt_x,mittelpunkt_y, Pinselgroesse/2 , "BrushSize"			
670
+		Bitmap remove "Pinsel"
671
+		Bitmap Pinselgroesse*2, Pinselgroesse*2, "Pinsel"
672
+		draw set "Lowcolor", r,g,b, "Pinsel"
673
+		draw set "Highcolor", r,g,b, "Pinsel"
674
+		//		DRAW SET 1,"HighSolidFill"
675
+		DRAW CIRCLE Pinselgroesse/2,Pinselgroesse/2, Pinselgroesse/2 , "Pinsel"	
676
+		return
677
+	elseif (TypeOfBrush$="Rectangle_only_outerline") then	
678
+		DRAW SET "Alpha", AlphaValue 
679
+		Draw flush "BrushSize"
680
+		draw set "Lowcolor", r,g,b, "BrushSize"
681
+		draw set "Highcolor", r,g,b, "BrushSize"
682
+		DRAW SET 1,"LowSolidFill"
683
+		DRAW SET 1,"HighSolidFill"
684
+		DRAW RECT mittelpunkt_x-(Pinselgroesse/2),mittelpunkt_y-(Pinselgroesse/2) TO mittelpunkt_x+(Pinselgroesse/2),mittelpunkt_y+(Pinselgroesse/2), "BrushSize"	
685
+		Bitmap remove "Pinsel"
686
+		Bitmap Pinselgroesse+1, Pinselgroesse+1, "Pinsel"
687
+		draw set "Lowcolor", r,g,b, "Pinsel"
688
+		draw set "Highcolor", r,g,b, "Pinsel"
689
+		DRAW SET 1,"LowSolidFill"
690
+		DRAW SET 1,"HighSolidFill"
691
+		DRAW RECT 0,0 to Pinselgroesse, Pinselgroesse, "Pinsel"	
692
+		return
693
+	elseif (TypeOfBrush$="gerade_Line") then
694
+		
695
+		//Draw flush "BrushSize"
696
+		//draw set "Lowcolor", r,g,b, "BrushSize"
697
+		//draw set "Highcolor", r,g,b, "BrushSize"
698
+		//DRAW SET 1,"LowSolidFill"
699
+		//DRAW SET 1,"HighSolidFill"
700
+		
701
+		//draw set "Lowcolor", r,g,b, "Pinsel"
702
+		//draw set "Highcolor", r,g,b, "Pinsel"
703
+	//	DRAW SET 1,"LowSolidFill"
704
+	//	DRAW SET 1,"HighSolidFill"
705
+		
706
+	//	DRAW line XMouse1,YMouse1 to XMouse2, YMouse2, "Pinsel"	
707
+		//return
708
+	elseif (TypeOfBrush$="text_malen") then
709
+		DRAW SET "Alpha", AlphaValue 
710
+		eingabetext$=textcontrol get$ "Eingabetext"
711
+		textbreite = draw get "text-width", eingabetext$, toolbarview$
712
+		texthoehe = draw get "text-height", eingabetext$, toolbarview$
713
+		//print "textbreite"
714
+		//print texthoehe
715
+		Draw flush "BrushSize"
716
+		draw set "Lowcolor", r,g,b, "BrushSize"
717
+		draw set "Highcolor", r,g,b, "BrushSize"
718
+		DRAW SET 2,"LowSolidFill"
719
+		DRAW SET 2,"HighSolidFill"
720
+		//"Zurich, Roman, 25"			
721
+		DRAW SET  ausgewaehlter_Font_style$+","+str$(Pinselgroesse), "BrushSize"
722
+		DRAW TEXT mittelpunkt_x-25,mittelpunkt_y, "ABC","BrushSize"
723
+				
724
+		Bitmap remove "Pinsel"
725
+		Bitmap Pinselgroesse+(textbreite*2.5), Pinselgroesse+5, "Pinsel"		
726
+		draw set "Lowcolor", r,g,b, "Pinsel"
727
+		draw set "Highcolor", r,g,b, "Pinsel"
728
+		DRAW SET 2,"LowSolidFill"
729
+		DRAW SET 2,"HighSolidFill"
730
+		DRAW SET ausgewaehlter_Font_style$+","+str$(Pinselgroesse), "Pinsel"		
731
+		DRAW TEXT 1,Pinselgroesse , eingabetext$,"Pinsel"
732
+		//DRAW RECT 0,0 to Pinselgroesse, Pinselgroesse, "Pinsel"	
733
+		return
734
+	elseif (TypeOfBrush$="eraser_Rectangle")  then
735
+		
736
+		Draw flush "BrushSize"
737
+		DRAW SET 0,"LowSolidFill"
738
+		DRAW SET 0,"HighSolidFill"
739
+		draw set "Lowcolor", r,g,b, "BrushSize"
740
+		draw set "Highcolor", r,g,b, "BrushSize"
741
+		DRAW RECT mittelpunkt_x-(Pinselgroesse/2),mittelpunkt_y-(Pinselgroesse/2) TO mittelpunkt_x+(Pinselgroesse/2),mittelpunkt_y+(Pinselgroesse/2), "BrushSize"	
742
+		
743
+		Bitmap remove "Pinsel"
744
+		Bitmap Pinselgroesse, Pinselgroesse, "Pinsel"
745
+		draw set "Lowcolor", 255,255,255, "Pinsel"
746
+		draw set "Highcolor", 255,255,255, "Pinsel"
747
+		DRAW RECT 0,0 to Pinselgroesse, Pinselgroesse, "Pinsel"
748
+		return
749
+	elseif (TypeOfBrush$="eraser_Round")  then
750
+		Draw flush "BrushSize"
751
+		DRAW SET 0,"LowSolidFill"
752
+		DRAW SET 0,"HighSolidFill"
753
+		draw set "Lowcolor", r,g,b, "BrushSize"
754
+		draw set "Highcolor", r,g,b, "BrushSize"			
755
+		DRAW CIRCLE mittelpunkt_x,mittelpunkt_y, Pinselgroesse/2 , "BrushSize"			
756
+		Bitmap remove "Pinsel"
757
+		Bitmap Pinselgroesse*2, Pinselgroesse*2, "Pinsel"
758
+		draw set "Lowcolor", 255,255,255, "Pinsel"
759
+		draw set "Highcolor", 255,255,255, "Pinsel"
760
+		DRAW CIRCLE Pinselgroesse/2,Pinselgroesse/2, Pinselgroesse/2 , "Pinsel"
761
+		return
762
+	else	
763
+	endif
764
+	return
765
+end sub
766
+
767
+sub fonts_ermitteln()
768
+	dim fonts$(1)
769
+	dim styles$(1)
770
+
771
+	fontfamilies$ = draw get$ "fontfamily"
772
+	numFonts = token(fontfamilies$, fonts$(), "|")
773
+	for i = 1 to numFonts
774
+		menu "Fonts", fonts$(i), "", Start_FensterName$+"1"
775
+		fontstyles$ = draw get$ fonts$(i)
776
+		numStyles = token(fontstyles$, styles$(), "|")
777
+		for j = 1 to numStyles
778
+			submenu "Fonts", fonts$(i), styles$(j), "", Start_FensterName$+"1"
779
+		next j
780
+		submenu set "Fonts", fonts$(i), true, Start_FensterName$+"1"
781
+	next i
782
+	return
783
+end sub
784
+sub Filetype(ImageFile$)
785
+	
786
+	if (rinstr(ImageFile$,".")<1) then
787
+		FileType$="all"
788
+		ImageFileA$=ImageFile$
789
+	elseif (rinstr(ImageFile$,".")>1) then
790
+		pos=rinstr(ImageFile$,".")
791
+		//print pos
792
+		FileType$=right$(ImageFile$,len(ImageFile$)-pos)
793
+		laenge=len(ImageFile$)-pos
794
+		ImageFileA$=left$(ImageFile$,len(ImageFile$)-laenge-1)
795
+		//print ImageFileA$
796
+	endif
797
+	if (ImageFile$="") then
798
+		FileType$=""
799
+	endif	
800
+end sub
801
+
802
+sub filetype()
803
+	draw flush FileView$
804
+	draw text 5,14, "Picturetype:",FileView$
805
+	draw text 125,14, "Picturesize:", FileView$
806
+	draw text 300,14, "Filename:", FileView$
807
+
808
+	// Ausgabe
809
+	draw text 84,14, FileType$, FileView$
810
+	draw text 200,14, Picturesize$, FileView$
811
+	draw text 365,14, ImageFileA$, FileView$
812
+end sub
813
+
814
+sub picture_save(ImageFile$)
815
+	Filetype(ImageFile$)	
816
+	switch (FileType$)
817
+		case "png"	
818
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
819
+			ErrCode = BITMAP SAVE "save", ImageFile$, "png"
820
+		break
821
+		case "tiff"
822
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
823
+ 			ErrCode = BITMAP SAVE "save", ImageFile$, "tiff"
824
+ 		break
825
+ 		case "ppm"
826
+ 			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
827
+			ErrCode = BITMAP SAVE "save", ImageFile$, "ppm"
828
+		break
829
+		case "bmp"
830
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
831
+			ErrCode = BITMAP SAVE "save", ImageFile$, "bmp"
832
+		break
833
+		case "jpg"
834
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
835
+			ErrCode = BITMAP SAVE "save", ImageFile$, "jpg"
836
+		break
837
+		case "tga"
838
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
839
+			ErrCode = BITMAP SAVE "save", ImageFile$, "tga"
840
+		break
841
+		case "all"
842
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
843
+			ErrCode = BITMAP SAVE "save", ImageFile$+".png", "png"
844
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
845
+ 			ErrCode = BITMAP SAVE "save", ImageFile$+".tiff", "tiff"
846
+ 			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
847
+			ErrCode = BITMAP SAVE "save", ImageFile$+".ppm", "ppm"
848
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
849
+			ErrCode = BITMAP SAVE "save", ImageFile$+".bmp", "bmp"
850
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
851
+			ErrCode = BITMAP SAVE "save", ImageFile$+".jpg", "jpg"
852
+			BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
853
+			ErrCode = BITMAP SAVE "save", ImageFile$+".tga", "tga"			
854
+		break
855
+		default
856
+		break
857
+	end switch	
858
+	filetype()
859
+end sub
860
+
861
+sub ToolbarAddSeparator(Breite_Toolbar,ausrichtung$,Toolbarname$)
862
+	// Add a separator to the toolbar.
863
+	if (ausrichtung$="horizontal") then
864
+		draw set "highcolor", 185,185,185, toolbarview$
865
+		draw line 5,position-2 to Breite_Toolbar-7,position-2,Toolbarname$ 
866
+		draw set "highcolor", 239,239,239, toolbarview$
867
+		draw line 5,position-1 to Breite_Toolbar-7,position-1, Toolbarname$
868
+		position = position + 5
869
+	elseif (ausrichtung$="vertikal") then
870
+		draw set "highcolor", 185,185,185, toolbarview$
871
+		draw line position-2,5 to position-2,Breite_Toolbar-7,Toolbarname$ 
872
+		draw set "highcolor", 239,239,239, toolbarview$
873
+		draw line position-1,5 to position-1,Breite_Toolbar-7, Toolbarname$
874
+		position = position + 5
875
+	endif
876
+	return
877
+end sub
878
+
879
+// Add an icon to the toolbar.
880
+//
881
+// id$ is the ID of the icon; this ID is send as a message, when the icon is clicked on
882
+// pressed$ is the image of the pressed icon 
883
+// normal$ is the image of the normal icon 
884
+// disabled$ is the image of the disabled icon 
885
+
886
+sub ToolbarAddIcon(id$, tooltip$, pressed$, normal$, disabled$, ausrichtung$, Toolbarname$)
887
+	//print pressed$
888
+	//print normal$
889
+	//print disabled$
890
+	//print directory$
891
+	if (ausrichtung$="horizontal") then	
892
+		//button image position,10, id$, pressed$, normal$, disabled$, Toolbarname$
893
+		button image position,10, id$, pressed$, normal$, disabled$, Toolbarname$	
894
+	elseif (ausrichtung$="vertikal") then
895
+		button image 10,position, id$,  pressed$, normal$, disabled$, Toolbarname$	
896
+	elseif (ausrichtung$="kreis") then
897
+		button image xwert,ywert, id$, directory$+pressed$, directory$+normal$, directory$+disabled$, Toolbarname$	
898
+	endif
899
+	tooltip id$, tooltip$
900
+	position = position + 24
901
+	return
902
+end sub
903
+
904
+doc Toolbar.yab is a library to easily create a toolbar.
905
+doc This is suitable for 16x16 icons
906
+
907
+// Create a new toolbar.
908
+// 
909
+// x1,y1 is the upper left starting point
910
+// x2 is the right border of the toolbar
911
+// note: the toolbar is always 30 pixels in height!
912
+// id$ is the toolbar ID
913
+// dir$ is the directory, where the icons can be found
914
+// view$ is the view on which the Toolbar is created
915
+// 
916
+// Note: this will change the layout of your view view$.
917
+sub ToolbarCreate(x1,y1,x2,y2, toolbar_id$, dir$, view$)
918
+		
919
+	if (toolbar_id$<>toolbarview$) then
920
+		anzahl_toolbars=anzahl_toolbars+1			
921
+	endif
922
+	
923
+	layout "left, right", view$
924
+	view x1,y1 to x2,y2, toolbar_id$, view$
925
+
926
+	//layout "left,right", id$
927
+	//draw set "bgcolor", 222,200,222, toolbar_id$
928
+	// view 0,30 to x2,32, id$+"line", id$
929
+	layout "none", toolbar_id$
930
+	position = 10
931
+	//directory$ = dir$
932
+	toolbarview$ = toolbar_id$
933
+	return 
934
+end sub
935
+
936
+sub Create_Malflaeche(WindowSize_x,WindowSize_y,Start_FensterName$)
937
+	
938
+	if (view get "Neue_Canvas","Exists"=1) then
939
+		Canvas_X=val(TEXTCONTROL GET$ "groesse_x")
940
+		Canvas_Y=val(TEXTCONTROL GET$ "groesse_y")
941
+		Picturesize$=str$(Canvas_X)+"x"+str$(Canvas_Y)
942
+		filetype()
943
+	else	 
944
+		Canvas_Y=BITMAP GET "first_init", "height"
945
+		Canvas_X=BITMAP GET "first_init", "width"
946
+		Picturesize$=str$(Canvas_X)+"x"+str$(Canvas_Y)
947
+	endif
948
+ 	//print view get "Malflaeche","exists"
949
+
950
+   	if (view get "Malflaeche","exists"=1) then
951
+		view remove "Malflaeche"
952
+		Create_Canvas(Canvas_X,Canvas_Y) 		
953
+  	else
954
+  		Create_Canvas(Canvas_X,Canvas_Y)
955
+  	endif
956
+	return
957
+end sub
958
+sub Create_Canvas(Canvas_X,Canvas_Y)
959
+	
960
+	View 2,120 to WindowSize_x,WindowSize_y, "Malflaeche", Start_FensterName$+"1"
961
+	zwischenview_hoehe=view get "Malflaeche", "Height"
962
+	View 0,0 to WindowSize_x-15,zwischenview_hoehe-35,  "Zwischenview","Malflaeche"
963
+	//draw set "Bgcolor", 244,125,125, "Malflaeche"
964
+	//
965
+	//layout "all", "Malflaeche"
966
+	
967
+	SCROLLBAR "scroll", 3, "Zwischenview" //"Malflaeche"
968
+	SCROLLBAR SET "scroll", "plain-border" 
969
+	SCROLLBAR SET "scroll", "Vertical Position", 0
970
+	SCROLLBAR SET "scroll", "Horizontal Position", 0
971
+	
972
+	
973
+	CANVAS 0,0 to Canvas_X,Canvas_Y, "CanVas_1",  "Zwischenview" //"Malflaeche"	
974
+	if (view get "Neue_Canvas","Exists"=1) then
975
+		View remove "Neue_Canvas"
976
+	endif
977
+	return
978
+end sub
979
+
980
+sub hint()
981
+	ALERT "If you don't type a Fileformat on the end "+chr$(10)+"of the filename, the program will be save the Picture as:"+chr$(10)+"bmp"+chr$(10)+"png"+chr$(10)+"jpg"+chr$(10)+"ppm"+chr$(10)+"tga"+chr$(10)+"tiff", "OK", "Info"
982
+end sub
983
+
984
+
985
+sub about()
986
+	local View_breite
987
+	local View_hoehe
988
+	View_breite = VIEW GET  Start_FensterName$+"1", "Width"
989
+	View_hoehe = VIEW GET  Start_FensterName$+"1", "Height"
990
+	Stackview set  Start_FensterName$, 2
991
+	LAYOUT "All",  Start_FensterName$+"2"
992
+	boxview 20,20 to View_breite-20,View_hoehe-60, "View_About","About",2, Start_FensterName$+"2"
993
+	 LAYOUT "H-Center, Bottom, Top", "View_About"
994
+  
995
+	View_breite_box = VIEW GET  "View_About", "Width"
996
+	View_hoehe_box = VIEW GET  "View_About", "Height"
997
+	  	
998
+  	DRAW SET "system-bold", "View_About"
999
+  	DRAW TEXT 10,30, "BeSly Software Solutions", "View_About"
1000
+  	 LAYOUT "H-Center, Bottom, Top", "View_About"
1001
+  	DRAW LINE 0,40 TO View_breite_box,41, "View_About" 
1002
+  	 	  	
1003
+  	DRAW TEXT 10,60, "Name:", "View_About"
1004
+  	DRAW TEXT 10,80, "Version / Build:", "View_About"
1005
+  	DRAW TEXT 10,100, "Version Status:", "View_About"
1006
+  	DRAW TEXT 10,120, "Developers:", "View_About"  
1007
+  	DRAW TEXT 10,140, "Contact:", "View_About"
1008
+  	DRAW TEXT 10,160, "Website:", "View_About"
1009
+  	DRAW TEXT 10,180, "Bug-Reporting:", "View_About"	
1010
+   	
1011
+   	DRAW TEXT 150,60, ProgrammName$, "View_About"
1012
+  	DRAW TEXT 150,80, "0.2.0/ 16.11.2018", "View_About"
1013
+  	DRAW TEXT 150,100, "Alpha", "View_About"
1014
+  	DRAW TEXT 150,120, "Lorglas", "View_About"
1015
+  	TEXTURL 150,127, "email", "webmaster@besly.de", "webmaster@besly.de", "View_About"  	
1016
+  	TEXTURL 150,147, "website", "http://software.besly.de", "http://software.besly.de", "View_About"   	
1017
+  	TEXTURL 150,167, "Bug-Report", "http://trac.besly.de", "http://trac.besly.de", "View_About" 
1018
+  	
1019
+  	TEXTEDIT 10,220 TO View_breite_box-20,View_hoehe_box-30, "not_implemented", 0, "View_About"
1020
+  	TEXTEDIT SET "not_implemented", "bold", "12"
1021
+  	textedit add "not_implemented", "New in this Revision:\n"
1022
+  	TEXTEDIT SET "not_implemented", "plain", "12"
1023
+  	textedit add "not_implemented", "Brightness Slider under Colorcontrol\n"
1024
+  		textedit add "not_implemented", "New in this Revision:\n"
1025
+  	TEXTEDIT SET "not_implemented", "editable", false
1026
+  	
1027
+  	 BUTTON (View_breite/2)-100,(View_hoehe)-40 TO (View_breite/2)+100,View_hoehe-20, "AboutClose", "OK",  Start_FensterName$+"2"
1028
+  	
1029
+end sub
1030
+sub drawline(XMouse1,YMouse1,XMouse2,YMouse2)
1031
+
1032
+Draw flush "BrushSize" //"Pinsel"
1033
+	DRAW line XMouse1,YMouse1 to XMouse2, YMouse2, "Pinsel"
1034
+end sub
0 1035
new file mode 100644
... ...
@@ -0,0 +1,1033 @@
1
+#!/boot/home/config/bin/yab
2
+
3
+//programmvariablen
4
+PRGMenu=1 //Programmmenu ja/nein
5
+TLB=1 //Toolbar ja/nein
6
+aktiv=1
7
+bitmap 1,1, "Pinsel"
8
+bitmap 1,1, "BrushSize"
9
+
10
+//Import Create_Malflaeche
11
+
12
+
13
+WorkDirectory()
14
+StartWindow(PRGMenu,TLB,WorkDir$)
15
+
16
+
17
+
18
+// Style für die Eintraege festlegen
19
+fonts_ermitteln()
20
+
21
+main()
22
+
23
+sub main()
24
+		
25
+	dim part$(1)
26
+	dim mesg$(1)
27
+	dim mouse$(1)
28
+	dim ViewMouse$(1)
29
+	inloop = true
30
+	while(inloop)
31
+		r = COLORCONTROL GET "Farbauswahl", "Red"
32
+		b = COLORCONTROL GET "Farbauswahl", "Blue"
33
+		g = COLORCONTROL GET "Farbauswahl", "Green"
34
+		Pinselgroesse = SPINCONTROL GET "BrushSize"
35
+		if (r or b or g or Pinselgroesse) then
36
+			Anzeige_Brushsize(Pinselgroesse,TypeOfBrush$,r,g,b)
37
+		endif
38
+		
39
+	//Tastaturabfragen
40
+	keymsg$ = keyboard message$(Start_FensterName$+"1") //
41
+	if(keymsg$<>"" and keymsg$<>old_keymsg$) then
42
+		//print keymsg$
43
+		old_keymsg$ = keymsg$
44
+	endif
45
+	
46
+	switch(keymsg$)
47
+		case "left"
48
+			draw text 10, 140, "Case Abfrage auf Pfeil Taste nach links", "MouseView"
49
+		break
50
+		case "n"			
51
+			option set "ToolbarNew", "Enabled", false
52
+			resizen=0
53
+			ToolbarSubmenu(PRGMenu,resizen)
54
+		break
55
+		case "s"
56
+			//option set "ToolbarNew", "Enabled", true
57
+			//option set "ToolbarNew", "Enabled", false
58
+			casestring$=""
59
+			view_existing()
60
+			if (Filename$="")then
61
+				hint()
62
+				ImageFile$ = FILEPANEL "Save-File", "Save-File", "", Filename$					
63
+				picture_save(ImageFile$)
64
+			else				
65
+				picture_save(ImageFile$)
66
+			endif
67
+		break
68
+		
69
+		default:
70
+			
71
+		break
72
+	end switch
73
+	
74
+	//Fenster und Menu abfragen
75
+		msg$ = message$
76
+		numSplit = split(msg$,mesg$(),"|")
77
+		for countMessages = 1 to numSplit
78
+			msg$ = mesg$(countMessages) + "|"
79
+			if (split(msg$, part$(), ":|") > 3) then
80
+				PartOne$=part$(1)
81
+				PartTwo$ = part$(2)
82
+				PartThree$ = part$(3)
83
+				PartFour$= part$(4)				
84
+				if (PartTwo$="Fonts") then
85
+					ausgewaehlter_Font_style$=PartThree$+","+PartFour$
86
+					//print ausgewaehlter_Font_style$
87
+				endif
88
+				
89
+			endif
90
+			if (msg$ <> "") then
91
+				//print msg$
92
+			endif
93
+			switch (msg$)
94
+				case Start_FensterName_stack$+":_QuitRequested|"
95
+					window close Start_FensterName_stack$
96
+				break
97
+				case Start_FensterName$+"1:Program:Quit|"
98
+				case Start_FensterName$+"1:Programm:Beenden|"
99
+					window close Start_FensterName_stack$
100
+				break				
101
+				case Start_FensterName$+"1:Program:About|"
102
+				case Start_FensterName$+"1:Programm:Über|"
103
+					about()
104
+				break	
105
+				case "AboutClose|"
106
+					Stackview set Start_FensterName$,1
107
+				break						
108
+				case toolbarview$+"Fonts"
109
+					gewaehlter_font_inkl_style$=PartThree$
110
+				//	print gewaehlter_font_inkl_style$
111
+					
112
+				break
113
+				default:
114
+				break
115
+			end switch
116
+			
117
+			if(window count<1) then
118
+				inloop = false
119
+				//sleep 0.1
120
+			endif
121
+		next countMessages	
122
+		
123
+		//Mausabfragen
124
+			mmsg$ = MOUSE MESSAGE$
125
+			if (mmsg$<>"" and mmsg$<>old_mmsg$) then
126
+				//print mmsg$
127
+				old_mmsg$= mmsg$ 
128
+				nx = split(mmsg$, mouse$(), ":")
129
+				Viewname$=mouse$(1)
130
+				if (Viewname$="scroll") then
131
+					Viewname$="CanVas_1"
132
+				//elseif(Viewname$="_HSB_" or Viewname$="_VSB_") then
133
+				//	Viewname$="scroll"
134
+				endif
135
+				
136
+				Xmouse = val(mouse$(2))
137
+				Ymouse = val(mouse$(3))
138
+				BLmouse= val(mouse$(4))
139
+				BCmouse= val(mouse$(5))
140
+				BRmouse= val(mouse$(6))
141
+				casestring$=Viewname$+":"+mouse$(4)+":"+mouse$(5)+":"+mouse$(6)
142
+				//print casestring$+":"+str$(Xmouse)+":"+str$(Ymouse)
143
+				//if (casestring$="drawline:1:0:0") then				
144
+				//	XMouse1=Xmouse
145
+				//	YMouse1=Ymouse
146
+				//	drawline(XMouse1,YMouse1,XMouse2,YMouse2)	
147
+				//elseif (casestring$="drawline:0:0:0") then				
148
+				//	XMouse2=Xmouse
149
+				//	YMouse2=Ymouse
150
+				//	drawline(XMouse1,YMouse1,XMouse2,YMouse2)	
151
+				//endif
152
+				
153
+				mmsg$=""
154
+			endif
155
+		
156
+		switch (casestring$)
157
+			case "Exit:0:0:1"
158
+				//button_setzen(Xmouse,Ymouse)				
159
+			break
160
+			case "CanVas_1:0:0:1"
161
+				BITMAP GET Xmouse,Ymouse to Xmouse+1,Ymouse+1, "Pipette","CanVas_1"
162
+					b_color = BITMAP COLOR 0,0,"Pipette", "red"
163
+					g_color = BITMAP COLOR 0,0,"Pipette", "green"
164
+					r_color = BITMAP COLOR 0,0,"Pipette", "blue"
165
+					//print r_color
166
+					//print g_color
167
+					//print b_color
168
+					COLORCONTROL SET "Farbauswahl", r_color,g_color,b_color
169
+					
170
+				BITMAP REMOVE "Pipette"
171
+				BRmouse=0
172
+			break
173
+			case "Brush1:1:0:0"
174
+				TypeOfBrush$="Rectangle"
175
+				option set "BrushSize", "Enabled", true
176
+				option set "Brush1", "Enabled", true
177
+				option set "Brush2", "Enabled", true	
178
+				option set "Brush3", "Enabled", true
179
+				option set "Brush4", "Enabled", true			
180
+			break
181
+			case "Brush2:1:0:0"
182
+				TypeOfBrush$="Round"
183
+				option set "BrushSize", "Enabled", true
184
+				option set "Brush2", "Enabled", true
185
+				option set "Brush1", "Enabled", true
186
+				option set "Brush3", "Enabled", true
187
+				option set "Brush4", "Enabled", true
188
+				
189
+			break
190
+			case "Brush3:1:0:0"
191
+				TypeOfBrush$="Rectangle_only_outerline"
192
+				option set "BrushSize", "Enabled", true
193
+				option set "Brush3", "Enabled", true
194
+				option set "Brush1", "Enabled", true
195
+				option set "Brush2", "Enabled", true
196
+				option set "Brush4", "Enabled", true
197
+			break
198
+			case "Brush4:1:0:0"
199
+				TypeOfBrush$="Round_only_outerline"
200
+				option set "BrushSize", "Enabled", true
201
+				option set "Brush4", "Enabled", true
202
+				option set "Brush1", "Enabled", true
203
+				option set "Brush2", "Enabled", true
204
+				option set "Brush3", "Enabled", true
205
+			break
206
+			case "Brush5:1:0:0"
207
+				TypeOfBrush$="text_malen"
208
+				option set "BrushSize", "Enabled", true
209
+				option set "Brush5", "Enabled", true
210
+				option set "Brush1", "Enabled", true
211
+				option set "Brush2", "Enabled", true
212
+				option set "Brush3", "Enabled", true
213
+			break
214
+			case "Brush6:1:0:0"
215
+				
216
+				TypeOfBrush$="eraser_Rectangle"
217
+				option set "BrushSize", "Enabled", true
218
+				option set "Brush5", "Enabled", true
219
+				option set "Brush1", "Enabled", true
220
+				option set "Brush2", "Enabled", true
221
+				option set "Brush3", "Enabled", true
222
+			break
223
+			case "Brush7:1:0:0"
224
+				TypeOfBrush$="eraser_Round"
225
+				option set "BrushSize", "Enabled", true
226
+				option set "Brush2", "Enabled", true
227
+				option set "Brush1", "Enabled", true
228
+				option set "Brush3", "Enabled", true
229
+				option set "Brush4", "Enabled", true
230
+			break
231
+			
232
+			case "Brush8:1:0:0"
233
+				option set "BrushSize", "Enabled", false
234
+				option set "Brush5", "Enabled", true
235
+				option set "Brush1", "Enabled", true
236
+				option set "Brush2", "Enabled", true
237
+				option set "Brush3", "Enabled", true
238
+				
239
+				get_bitmap_color=1
240
+			break
241
+			//case "drawline:1:0:0"
242
+			//	draw line 0,0 to Xmouse,Ymouse 
243
+			//	TypeOfBrush$="gerade_Line"
244
+			//	option set "BrushSize", "Enabled", true
245
+			//	option set "Brush5", "Enabled", true
246
+			//	option set "Brush1", "Enabled", true
247
+			//	option set "Brush2", "Enabled", true
248
+			//	option set "Brush3", "Enabled", true
249
+			//break
250
+			case "Brush3:1:0:0"
251
+				//bitmap 32,32, "Pinsel"
252
+				//err = draw image 0,0 to 31,31, "/boot/home/Projekte/yab/Malprogramm/Brush/baer.png", "Pinsel"
253
+			break
254
+			case "BrushSize:0:0:0"
255
+				r = COLORCONTROL GET "Farbauswahl", "Red"
256
+				b = COLORCONTROL GET "Farbauswahl", "Blue"
257
+				g = COLORCONTROL GET "Farbauswahl", "Green"
258
+				//print r,g,b
259
+				Pinselgroesse = SPINCONTROL GET "BrushSize"
260
+			//	print "BrushSize"+TypeOfBrush$
261
+				if (old_TypeOfBrush$<>TypeOfBrush$) then
262
+					//Draw flush "BrushSize"
263
+				else
264
+					old_TypeOfBrush$=TypeOfBrush$
265
+				endif
266
+				Anzeige_Brushsize(Pinselgroesse,TypeOfBrush$,r,g,b)
267
+			break
268
+			
269
+			case "datei1:1:0:0" //new
270
+			    //option set "ToolbarNew", "Enabled", true
271
+				//option set "ToolbarNew", "Enabled", false
272
+				casestring$=""
273
+				resizen=0
274
+				If (CanVas_1=1) then
275
+				else
276
+					ToolbarSubmenu(PRGMenu,resizen)
277
+					option set "datei1", "Enabled", false 
278
+				endif
279
+			break
280
+			case "datei2:1:0:0" //close
281
+			    //option set "ToolbarNew", "Enabled", true
282
+				//option set "ToolbarNew", "Enabled", false
283
+				casestring$=""
284
+				view_exists=view get "Malflaeche","exists"
285
+				print view_exists
286
+  				if (view_exists=1) then
287
+  					view remove "Malflaeche"
288
+  				endif
289
+				FileType$=""
290
+  				Picturesize$=""
291
+				ImageFile$=""
292
+  				Filetype(ImageFile$)
293
+  				filetype()
294
+  				option set "datei1", "Enabled", true 
295
+			break
296
+			case "datei3:1:0:0" //load
297
+			    //option set "ToolbarNew", "Enabled", true
298
+				//option set "ToolbarNew", "Enabled", false
299
+				BITMAP 0,0, "first_init"
300
+				casestring$=""
301
+				ImageFile$ = FILEPANEL  "Load-File",  "Load-File", ""
302
+				if (ImageFile$<>"") then
303
+					pos=rinstr(ImageFile$,".")
304
+					FileType$=right$(ImageFile$,len(ImageFile$)-pos)
305
+					ErrCode = BITMAP IMAGE ImageFile$, "first_init"
306
+					Create_Malflaeche(WindowSize_x,WindowSize_y,Start_FensterName$)
307
+					LoadError = DRAW IMAGE 0,0, ImageFile$, "CanVas_1"
308
+					Bitmap Remove "first_init"
309
+					Filename$=ImageFile$
310
+					Filetype(ImageFile$)
311
+					filetype()
312
+				else
313
+				endif
314
+			break
315
+			case "datei4:1:0:0" //save
316
+			    //option set "ToolbarNew", "Enabled", true
317
+				//option set "ToolbarNew", "Enabled", false
318
+				casestring$=""
319
+				view_exists=view get "Malflaeche","Exists"
320
+  				if (view_exists=1) then
321
+  					if (Filename$="")then
322
+						hint()
323
+						ImageFile$ = FILEPANEL "Save-File", "Save-File", "", Filename$		
324
+						if (ImageFile$<>"") then
325
+							picture_save(ImageFile$)
326
+						else
327
+						endif			
328
+					else					
329
+						picture_save(ImageFile$)
330
+					endif	
331
+				endif
332
+			break
333
+			case "datei5:1:0:0" //saveas
334
+			    //option set "ToolbarNew", "Enabled", true
335
+				//option set "ToolbarNew", "Enabled", false
336
+				casestring$=""
337
+				view_exists=view get "Malflaeche","Exists"
338
+  				if (view_exists=1) then
339
+					hint()
340
+					ImageFile$ = FILEPANEL "Save-File", "Save-File", "", Filename$
341
+					if (ImageFile$<>"") then
342
+						picture_save(ImageFile$)
343
+					else
344
+					endif
345
+				endif
346
+			break
347
+			
348
+			case "datei6:1:0:0" //printer
349
+			    //option set "ToolbarNew", "Enabled", true
350
+				//option set "ToolbarNew", "Enabled", false
351
+				casestring$=""
352
+				
353
+			break
354
+			case "CreateCanvas:1:0:0"
355
+				option set "datei1", "Enabled", true
356
+				Create_Malflaeche(WindowSize_x,WindowSize_y,Start_FensterName$)
357
+				casestring$=""
358
+				option set "Brush1", "Enabled", true
359
+				option set "Brush2", "Enabled", true
360
+				option set "Brush3", "Enabled", true
361
+				option set "Brush4", "Enabled", true				
362
+			break
363
+			case "CanVas_1:1:0:0"							
364
+				view_exists=view get "Malflaeche","Exists"
365
+				if (view_exists=1) then
366
+					
367
+					//draw line 0,0 to Xmouse,Ymouse, "CanVas_1"
368
+					draw bitmap Xmouse,Ymouse, "Pinsel", "alpha", "CanVas_1"				
369
+				endif
370
+			break
371
+			case "resize1:1:0:0"
372
+				resizen=1
373
+				If (CanVas_1=1) then
374
+				else
375
+					ToolbarSubmenu(PRGMenu,resizen)
376
+					option set "datei1", "Enabled", false 
377
+				endif
378
+			break
379
+			case "ResizeCanvas:1:0:0"
380
+				//Canvas_X_new=400
381
+				//Canvas_Y_new=400
382
+				//bitmap Canvas_X_new,Canvas_Y_new, "zwischenspeicher" 
383
+				BITMAP GET 0,0 to Canvas_X,Canvas_Y, "save","CanVas_1"
384
+				ErrCode = BITMAP SAVE "save",  daten_dir$+"/test.bmp", "bmp"	
385
+			if (view get "Neue_Canvas","Exists"=1) then				
386
+				Canvas_X_new=val(TEXTCONTROL GET$ "groesse_x")
387
+				Canvas_Y_new=val(TEXTCONTROL GET$ "groesse_y")
388
+				if (view get "Malflaeche","Exists"=1) then
389
+					view remove "Malflaeche"
390
+					Create_Canvas(Canvas_X_new,Canvas_Y_new) 		
391
+  				else
392
+ 			 	  	Create_Canvas(Canvas_X_new,Canvas_Y_new) 
393
+ 			 	endif
394
+				Canvas_X=Canvas_X_new
395
+				Canvas_Y=Canvas_Y_new	
396
+				LoadError = DRAW IMAGE 0,0 to Canvas_X,Canvas_Y, daten_dir$+"/test.bmp", "CanVas_1"		
397
+				OPTION SET "_HSB_", "Focus", true
398
+  					OPTION SET "_VSB_", "Focus", true
399
+			endif
400
+			break
401
+			case "Brightness:1:0:0"
402
+				AlphaValue=slider get "Brightness"
403
+			break
404
+			
405
+			default:
406
+				view_exists=view get "Malflaeche","Exists"
407
+  				if (view_exists=0) then
408
+  					Viewname$=""
409
+  					
410
+  				endif
411
+			break
412
+			
413
+		end switch
414
+	wend
415
+end sub
416
+sub WorkDirectory()
417
+REM ######Verzeichnis bestimmen######
418
+
419
+if(ready_to_compile=1)then
420
+	if (peek("isbound")) then
421
+		WorkDir$ = trim$(peek$("directory"))
422
+	else
423
+		WorkDir$ = trim$(system$("pwd"))
424
+		
425
+	fi
426
+else
427
+		WorkDir$="/Share/Projekte/yab_hpkg/ink"
428
+endif
429
+end sub
430
+sub IfExists(filename$)
431
+	return not system("test -e "+filename$)
432
+end sub
433
+Sub StartWindow(PRGMenu,TLB,WorkDir$)
434
+REM ######Fenteraufbau######
435
+
436
+
437
+	screenWidth = peek("desktopwidth")
438
+	screenHeight = peek("desktopheight")
439
+	WindowSize_x=800
440
+	WindowSize_y=620
441
+	
442
+	ProgrammName$="ink"
443
+	Start_FensterName_stack$="stack_ink"
444
+	Start_FensterName$="ink"
445
+	NameView$="Programme"
446
+	FileView$="Filename"
447
+	Hoehe_Toolbar=115
448
+	//TLB_Verzeichnis$="/Share/yab_hpkg/ink/TLB/"
449
+	TLB_Verzeichnis$=WorkDir$+"/TLB/"
450
+	print TLB_Verzeichnis$
451
+	ToolbarVerzeichnisImg$=TLB_Verzeichnis$+"img/"
452
+	print ToolbarVerzeichnisImg$
453
+	
454
+	daten_dir$="/boot/home/.besly/ink/data"
455
+	rem ###### Ueberpruefungen #########
456
+	if(IfExists(daten_dir$)) then
457
+		//start=1
458
+		if(IfExists(local_directory$)) then
459
+		else
460
+			output$=system$("mkdir -p "+local_directory$)
461
+		endif	
462
+	else
463
+		output$=system$("mkdir -p "+daten_dir$)
464
+	endif
465
+	
466
+	
467
+	window open ((screenWidth/2)-(WindowSize_x/2)), ((screenHeight/2)-(WindowSize_y/2)) to ((screenWidth/2)+(WindowSize_x/2)), ((screenHeight/2)+(WindowSize_y/2)), Start_FensterName_stack$,ProgrammName$
468
+	window set  Start_FensterName_stack$, "MinimumTo", WindowSize_x,WindowSize_y
469
+	window set  Start_FensterName_stack$, "MaximumTo", WindowSize_x,WindowSize_y
470
+	stackview 0,0 to  WindowSize_x,WindowSize_y, Start_FensterName$,2,Start_FensterName_stack$
471
+	if (PRGMenu=1) then
472
+		menu "Program", "About", "",Start_FensterName$+"1"
473
+		menu "Program", "Quit", "", Start_FensterName$+"1"
474
+		
475
+	else
476
+	endif
477
+	
478
+	If (TLB=1) then
479
+		TLB_auslesen(TLB_Verzeichnis$)
480
+			If (PRGMenu=1) then
481
+				local y
482
+				y=20
483
+				ToolbarCreate(0,y,WindowSize_x-300,Hoehe_Toolbar-5, "Toolbar",ToolbarVerzeichnisImg$, Start_FensterName$+"1") //NameView$)	
484
+				//ToolbarCreate(0,y+Hoehe_Toolbar,WindowSize_x-1,y+(4*Hoehe_Toolbar), "2.Toolbar",ToolbarVerzeichnisImg$, Start_FensterName$) //NameView$)			
485
+			else
486
+				ToolbarCreate(0,0,WindowSize_x-300,Hoehe_Toolbar-y, "Toolbar", ToolbarVerzeichnisImg$, Start_FensterName$+"1") //NameView$)
487
+			endif
488
+		    ge=1
489
+			for gc = 1 to anzahlzeilen
490
+			  //for gb = 1 to anzahlspalten
491
+			  	if (TLB_eintraege$(ge)="Seperator") then
492
+			  		ToolbarAddSeparator(Breite_Toolbar,"vertikal","Toolbar")	
493
+			  	else
494
+					ToolbarAddIcon(TLB_eintraege$(ge), TLB_eintraege$(ge+1), TLB_eintraege$(ge+2), TLB_eintraege$(ge+3), TLB_eintraege$(ge+4),"horizontal","Toolbar")									
495
+			  	endif
496
+			  //next gb
497
+			ge=ge+5			
498
+			next gc
499
+			SPINCONTROL WindowSize_x-300-135,5, "BrushSize", "", 1, 30, 1, "Toolbar"	
500
+			SPINCONTROL SET  "BrushSize", 1
501
+			TEXTCONTROL WindowSize_x-556,35 TO WindowSize_x-385 ,55, "Eingabetext" , "", "Put here your text" , "Toolbar"
502
+			
503
+			SLIDER WindowSize_x-300,85 to WindowSize_x-100,95, "Brightness", "",0,255, Start_FensterName$+"1" //"Toolbar"
504
+			//Slider label "Brightness", "0", "255"
505
+			SLIDER SET "Brightness", 255
506
+			AlphaValue=255
507
+			//SLIDER SET "Brightness", "top", 10
508
+			COLORCONTROL WindowSize_x-300,25, "Farbauswahl",  Start_FensterName$+"1" //"Toolbar"	
509
+			
510
+			
511
+			//DRAW SET "system-plain,regular,6" ,"Brightness" 
512
+			//DRAW TEXT WindowSize_x-330,100,"Brightness", Start_FensterName$ //"Toolbar" 
513
+			//return
514
+		else	
515
+	endif
516
+		option set "BrushSize", "Enabled", false
517
+		//alle Brushes deaktivieren
518
+		//option set "Brush1", "Enabled", false
519
+		//option set "Brush2", "Enabled", false
520
+		//option set "Brush3", "Enabled", false
521
+		//option set "Brush4", "Enabled", false
522
+		//option set "Brush5", "Enabled", false
523
+		//option set "Brush6", "Enabled", false
524
+		//option set "Brush7", "Enabled", false
525
+		// alle weiteren Funktionen deaktivieren
526
+		//option set "datei2", "Enabled", false
527
+		//option set "datei4", "Enabled", false
528
+		//option set "datei5", "Enabled", false
529
+		//option set "datei6", "Enabled", false
530
+		
531
+	//Texteingabe	
532
+	Pinselgroesse=0
533
+	TypeOfBrush$=""
534
+	//BITMAP 0,0, "Pinsel"
535
+	Anzeige_Brushsize(Pinselgroesse, TypeOfBrush$)	
536
+	draw set "highcolor", 0,0,0, Start_FensterName$+"1"
537
+	//obere Linie
538
+	
539
+	draw line 0,Hoehe_Toolbar to WindowSize_x,Hoehe_Toolbar,Start_FensterName$+"1"
540
+	//untere Linie
541
+	
542
+	draw line 0,WindowSize_y-19 to WindowSize_x,WindowSize_y-19, Start_FensterName$+"1"
543
+	View 0,WindowSize_y-18 to WindowSize_x,WindowSize_y, "Filename", Start_FensterName$+"1"
544
+	filetype()
545
+End sub
546
+
547
+sub TLB_auslesen(TLB_Verzeichnis$)
548