00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 void tdialogbox::rahmen(bool invers,
00098 int x1,
00099 int y1,
00100 int x2,
00101 int y2)
00102 {
00103 collategraphicoperations cgs ( x1, y1, x2, y2 );
00104
00105 char col = (invers == false) ? white : darkgray;
00106
00107 line(x1,y1,x1,y2,col);
00108 line(x1,y1,x2,y1,col);
00109
00110 col = (invers == true) ? white : darkgray;
00111
00112 line(x2,y1,x2,y2,col);
00113 line(x1,y2,x2,y2,col);
00114 }
00115
00116 void tdialogbox::rahmen( bool invers,
00117 tmouserect rect )
00118 {
00119 rahmen ( invers, rect.x1, rect.y1, rect.x2,rect.y2 );
00120 }
00121
00122 void tdialogbox::knopf(int xx1,
00123 int yy1,
00124 int xx2,
00125 int yy2)
00126 {
00127 collategraphicoperations cgs ( xx1, yy1, xx2, yy2 );
00128
00129 paintsurface2(xx1,yy1,xx2,yy2);
00130 rahmen(false,xx1,yy1,xx2,yy2);
00131 }
00132
00133
00134 void tdialogbox::knopfdruck(int xx1,
00135 int yy1,
00136 int xx2,
00137 int yy2)
00138 {
00139
00140 collategraphicoperations cgs ( xx1, yy1, xx2, yy2 );
00141
00142 void* p;
00143 int mt;
00144
00145 mt = mouseparams.taste;
00146 mousevisible(false);
00147
00148 void* pq = asc_malloc ( imagesize ( xx1 , yy1 , xx2 , yy2 ));
00149 getimage( xx1 , yy1 , xx2 , yy2 , pq );
00150
00151 p = asc_malloc ( imagesize ( xx1 + 1,yy1 + 1,xx2 - 2,yy2 - 2 ));
00152 getimage(xx1 + 1,yy1 + 1,xx2 - 2,yy2 - 2, p);
00153 putimage(xx1 + 3,yy1 + 3, p );
00154 rahmen(true, xx1, yy1, xx2, yy2);
00155 mousevisible(true);
00156 knopfsuccessful = true;
00157 bool kn = true;
00158 do {
00159 if ((mouseparams.x > xx2) || (mouseparams.x < xx1) || (mouseparams.y > yy2) || (mouseparams.y < yy1)) {
00160 knopfsuccessful = false;
00161 kn = false;
00162 }
00163 if (mouseparams.taste != mt)
00164 kn = false;
00165 releasetimeslice();
00166 } while (kn == true);
00167 mousevisible(false);
00168
00169 putimage(xx1 + 1,yy1 + 1, p);
00170 asc_free ( p );
00171
00172 putimage( xx1 , yy1 , pq );
00173 asc_free ( pq );
00174
00175 mousevisible(true);
00176 }
00177
00178
00179
00180 void tdialogbox::newknopf(int xx1,
00181 int yy1,
00182 int xx2,
00183 int yy2)
00184 {
00185 collategraphicoperations cgs ( xx1-1, yy1-1, xx2+1, yy2+1 );
00186
00187 paintsurface2(xx1,yy1,xx2,yy2);
00188
00189 rahmen(true, xx1 - 1, yy1 - 1,xx2 + 1,yy2 + 1);
00190 rahmen(false, xx1,yy1, xx2,yy2);
00191 }
00192
00193
00194 void tdialogbox::newknopfdruck2(int xx1,
00195 int yy1,
00196 int xx2,
00197 int yy2)
00198 {
00199
00200 void* p;
00201 bool kn;
00202 int mt;
00203 {
00204 collategraphicoperations cgs ( xx1 -1, yy1 -1, xx2 + 1, yy2 + 1 );
00205 mt = mouseparams.taste;
00206 mousevisible(false);
00207 p = asc_malloc ( imagesize ( xx1 + 1,yy1 + 1,xx2 - 2,yy2 - 2 ) );
00208 getimage(xx1 + 1,yy1 + 1,xx2 - 2,yy2 - 2, p);
00209 putimage(xx1 + 3,yy1 + 3, p);
00210
00211 line(xx1 - 1,yy1 - 1,xx2 + 1,yy1 - 1, 8);
00212 line(xx1 - 1,yy1 - 1,xx1 - 1,yy2 + 1, 8);
00213 line(xx2 + 1,yy1 - 1,xx2 + 1,yy2 + 1, 15);
00214 line(xx1 - 1,yy2 + 1,xx2 + 1,yy2 + 1, 15);
00215
00216 line(xx1,yy1,xx2,yy1, 8);
00217 line(xx1,yy1,xx1,yy2, 8);
00218 line(xx2,yy1,xx2,yy2, 15);
00219 line(xx1,yy2,xx2,yy2, 15);
00220
00221 mousevisible(true);
00222 knopfsuccessful = true;
00223 kn = true;
00224 }
00225 do {
00226 if ((mouseparams.x > xx2) || (mouseparams.x < xx1) || (mouseparams.y > yy2) || (mouseparams.y < yy1)) {
00227 knopfsuccessful = false;
00228 kn = false;
00229 }
00230 if (mouseparams.taste != mt)
00231 kn = false;
00232 releasetimeslice();
00233 } while (kn == true);
00234 {
00235 collategraphicoperations cgo ( xx1 - 1, yy1 - 1, xx2 + 1, yy2 + 1 );
00236
00237 mousevisible(false);
00238
00239 if (knopfsuccessful == false)
00240 putimage (xx1 + 1,yy1 + 1,p);
00241 asc_free ( p );
00242
00243 if (knopfsuccessful == false) {
00244 line(xx1 - 1,yy1 - 1,xx2 + 1,yy1 - 1, 8);
00245 line(xx1 - 1,yy1 - 1,xx1 - 1,yy2 + 1, 8);
00246 line(xx2 + 1,yy1 - 1,xx2 + 1,yy2 + 1, 15);
00247 line(xx1 - 1,yy2 + 1,xx2 + 1,yy2 + 1, 15);
00248
00249 line(xx1,yy1,xx2,yy1, 15);
00250 line(xx1,yy1,xx1,yy2, 15);
00251 line(xx2,yy1,xx2,yy2, 8);
00252 line(xx1,yy2,xx2,yy2, 8);
00253 }
00254 mousevisible(true);
00255 }
00256
00257 }
00258
00259
00260 void tdialogbox::newknopfdruck3(int xx1,
00261 int yy1,
00262 int xx2,
00263 int yy2)
00264 {
00265 collategraphicoperations cgs ( xx1, yy1, xx2, yy2 );
00266
00267 void* p;
00268
00269
00270
00271 p = asc_malloc ( imagesize ( xx1 + 4,yy1 + 4,xx2 - 2,yy2 - 2 ));
00272 getimage(xx1 + 4,yy1 + 4,xx2 - 2,yy2 - 2, p );
00273
00274 putimage(xx1 + 2,yy1 + 2,p);
00275 asc_free ( p );
00276
00277 rahmen(false,xx1,yy1,xx2,yy2);
00278 }
00279
00280
00281
00282
00283 void tdialogbox::newknopfdruck4(int xx1,
00284 int yy1,
00285 int xx2,
00286 int yy2)
00287 {
00288 collategraphicoperations cgs ( xx1, yy1, xx2, yy2 );
00289
00290 void* p;
00291
00292
00293 p = asc_malloc ( imagesize ( xx1 + 2,yy1 + 2,xx2 - 4,yy2 - 4 )) ;
00294 getimage(xx1 + 2,yy1 + 2,xx2 - 4,yy2 - 4, p);
00295 putimage(xx1 + 4,yy1 + 4, p);
00296 asc_free ( p );
00297
00298 rahmen(true,xx1,yy1,xx2,yy2);
00299 }
00300
00301
00302 void tdialogbox::newknopfdruck(int xx1,
00303 int yy1,
00304 int xx2,
00305 int yy2)
00306 {
00307
00308 void* p;
00309 bool kn;
00310 int mt;
00311 void* pq ;
00312 {
00313 collategraphicoperations cgs( xx1-1, yy1-1, xx2+1, yy2+1 );
00314 mt = mouseparams.taste;
00315 mousevisible(false);
00316
00317 pq = asc_malloc ( imagesize ( xx1 , yy1 , xx2 , yy2 ));
00318 getimage( xx1 , yy1 , xx2 , yy2 , pq );
00319
00320
00321 p = asc_malloc ( imagesize ( xx1 + 1,yy1 + 1,xx2 - 2,yy2 - 2 ));
00322 getimage(xx1 + 1,yy1 + 1,xx2 - 2,yy2 - 2, p);
00323 putimage(xx1 + 3,yy1 + 3, p);
00324
00325 line(xx1 - 1,yy1 - 1,xx2 + 1,yy1 - 1, 8);
00326 line(xx1 - 1,yy1 - 1,xx1 - 1,yy2 + 1, 8);
00327
00328 line(xx2 + 1,yy1 - 1,xx2 + 1,yy2 + 1, 15);
00329 line(xx1 - 1,yy2 + 1,xx2 + 1,yy2 + 1, 15);
00330
00331 line(xx1,yy1,xx2,yy1, 8);
00332 line(xx1,yy1,xx1,yy2, 8);
00333
00334 line(xx2,yy1,xx2,yy2, 15);
00335 line(xx1,yy2,xx2,yy2, 15);
00336 mousevisible(true);
00337
00338 knopfsuccessful = true;
00339 kn = true;
00340 }
00341 do {
00342 if ((mouseparams.x > xx2) || (mouseparams.x < xx1) || (mouseparams.y > yy2) || (mouseparams.y < yy1)) {
00343 knopfsuccessful = false;
00344 kn = false;
00345 }
00346 if (mouseparams.taste != mt)
00347 kn = false;
00348 releasetimeslice();
00349 } while (kn == true);
00350 {
00351 collategraphicoperations cgo( xx1-1, yy1-1, xx2+1, yy2+1 );
00352 mousevisible(false);
00353 putimage(xx1 + 1,yy1 + 1,p);
00354 asc_free ( p ) ;
00355
00356 line(xx1 - 1,yy1 - 1,xx2 + 1,yy1 - 1, 8);
00357 line(xx1 - 1,yy1 - 1,xx1 - 1,yy2 + 1, 8);
00358
00359 line(xx2 + 1,yy1 - 1,xx2 + 1,yy2 + 1, 15);
00360 line(xx1 - 1,yy2 + 1,xx2 + 1,yy2 + 1, 15);
00361
00362 line(xx1,yy1,xx2,yy1, 15);
00363 line(xx1,yy1,xx1,yy2, 15);
00364
00365 line(xx2,yy1,xx2,yy2, 8);
00366 line(xx1,yy2,xx2,yy2, 8);
00367
00368 putimage( xx1 , yy1 , pq );
00369 asc_free ( pq );
00370
00371 mousevisible(true);
00372 }
00373 }