Rev 16943 | Rev 17518 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 16943 | Rev 17351 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | #endif |
10 | #endif |
11 | int i; |
11 | int i; |
12 | int type; |
12 | int type; |
13 | for(i = 0 ; i < MAX_JS_FUNCTIONS; i++){ |
13 | for(i = 0 ; i < MAX_JS_FUNCTIONS; i++){ |
14 | /* |
14 | /* |
15 | fprintf(stdout,"checking js_function[%d] = %d<br |
15 | fprintf(stdout,"checking js_function[%d] = %d<br>",i,js_function[i]); |
16 | */ |
16 | */ |
17 | if( js_function[i] == 1){ |
17 | if( js_function[i] == 1){ |
18 | switch(i){ |
18 | switch(i){ |
19 | 19 | ||
20 | case JS_ARROWHEAD: |
20 | case JS_ARROWHEAD: |
Line 248... | Line 248... | ||
248 | return math_fun;\ |
248 | return math_fun;\ |
249 | };"); |
249 | };"); |
250 | break; |
250 | break; |
251 | 251 | ||
252 | case INTERACTIVE: |
252 | case INTERACTIVE: |
253 | /* 1/8/2022 NOTE : getMouse() code should run at maximum speed and not be bothered with all kind of fancy tests !! |
253 | /* 1/8/2022 NOTE : getMouse() code should run at maximum speed and not be bothered with all kind of fancy tests !! |
254 | 1/8/2022 : latest improvements related to 'reponsiveness' will fatally lockup browsers in the pixel-by-pixel filling...at least in userdraw clickfill...*/ |
254 | 1/8/2022 : latest improvements related to 'reponsiveness' will fatally lockup browsers in the pixel-by-pixel filling...at least in userdraw clickfill...*/ |
255 | fprintf(js_include_file,"\n/* add mouse support */\ |
255 | fprintf(js_include_file,"\n/* add mouse support */\ |
256 | var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));\ |
256 | var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0));\ |
257 | var getMouse = function(e, element){\ |
257 | var getMouse = function(e, element){\ |
258 | var mx,my;var offsetX = 0,offsetY = 0;\ |
258 | var mx,my;var offsetX = 0,offsetY = 0;\ |
Line 2528... | Line 2528... | ||
2528 | input_xy_div.id = \"input_xy_div\";\ |
2528 | input_xy_div.id = \"input_xy_div\";\ |
2529 | tooltip_div.appendChild(input_xy_div);",canvas_root_id); |
2529 | tooltip_div.appendChild(input_xy_div);",canvas_root_id); |
2530 | 2530 | ||
2531 | if(strstr(draw_type,"polyline") != NULL || strstr(draw_type,"point") != NULL || strstr(draw_type,"cross") != NULL ){ /* ( input_x : input_y )*/ |
2531 | if(strstr(draw_type,"polyline") != NULL || strstr(draw_type,"point") != NULL || strstr(draw_type,"cross") != NULL ){ /* ( input_x : input_y )*/ |
2532 | type=1; |
2532 | type=1; |
2533 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br |
2533 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br><span class='%s'>(<input type='text' size='2' value='' id='userinput_x'/> : <input type='text' size='2' value='' id='userinput_y'/>)<input id='update_button' type='button' value='OK' onclick='' style='color:red;background-color:lightblue;'/><input id='delete_button' type='button' value='NOK' onclick='' style='color:blue;background-color:red;'/></span> \";",css_class); |
2534 | }else{ |
2534 | }else{ |
2535 | if(strstr(draw_type,"circle") != NULL ){/* M: (input_x :input_y) R:input_r*/ |
2535 | if(strstr(draw_type,"circle") != NULL ){/* M: (input_x :input_y) R:input_r*/ |
2536 | type=2; |
2536 | type=2; |
2537 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br |
2537 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br><span class='%s'>M: (<input type='text' size='2' value='' id='userinput_x'/> : <input type='text' size='2' value='' id='userinput_y'/>) R: <input type='text' size='2' value='' id='userinput_r'/><input id='update_button' type='button' value='OK' onclick='' style='color:red;background-color:lightblue;'/><input id='delete_button' type='button' value='NOK' onclick='' style='color:blue;background-color:red;'/></span> \";",css_class); |
2538 | }else{ |
2538 | }else{ |
2539 | type=3; |
2539 | type=3; |
2540 | if(strstr(draw_type,"segment") != NULL || strstr(draw_type,"line") != NULL || strstr(draw_type,"arrow") != NULL ){ /* ( input_x1 : input_y1) --- ( input_x2 : input_y2) */ |
2540 | if(strstr(draw_type,"segment") != NULL || strstr(draw_type,"line") != NULL || strstr(draw_type,"arrow") != NULL ){ /* ( input_x1 : input_y1) --- ( input_x2 : input_y2) */ |
2541 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br |
2541 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br><span class='%s'>(<input type='text' size='2' value='' id='userinput_x1'/> : <input type='text' size='2' value='' id='userinput_y1'/>) −−− (<input type='text' size='2' value='' id='userinput_x2'/> : <input type='text' size='2' value='' id='userinput_y2'/>)<input id='update_button' type='button' value='OK' onclick='' style='color:red;background-color:lightblue;'/><input id='delete_button' type='button' value='NOK' onclick='' style='color:blue;background-color:red;'/></span> \";",css_class); |
2542 | }else{ |
2542 | }else{ |
2543 | type=4; |
2543 | type=4; |
2544 | if(strstr(draw_type,"triang") != NULL ){ /* ( input_x1 : input_y1) --- ( input_x2 : input_y2) --- ( input_x3 : input_y3) */ |
2544 | if(strstr(draw_type,"triang") != NULL ){ /* ( input_x1 : input_y1) --- ( input_x2 : input_y2) --- ( input_x3 : input_y3) */ |
2545 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br |
2545 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br><span class='%s'>⃤ <input id='update_button' type='button' value='OK' onclick='' style='color:red;background-color:lightblue;'/><input id='delete_button' type='button' value='NOK' onclick='' style='color:blue;background-color:red;'/><br/>(<input type='text' size='2' value='' id='userinput_x1'/> : <input type='text' size='2' value='' id='userinput_y1'/>)<br/>(<input type='text' size='2' value='' id='userinput_x2'/> : <input type='text' size='2' value='' id='userinput_y2'/>)<br/>(<input type='text' size='2' value='' id='userinput_x3'/> : <input type='text' size='2' value='' id='userinput_y3'/>)</span> \";",css_class); |
2546 | }else{ |
2546 | }else{ |
2547 | type=5; |
2547 | type=5; |
2548 | if(strstr(draw_type,"text") != NULL ){ /*Text: input_r ( input_x1 : input_y1) */ |
2548 | if(strstr(draw_type,"text") != NULL ){ /*Text: input_r ( input_x1 : input_y1) */ |
2549 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br |
2549 | fprintf(js_include_file,"input_xy_div.innerHTML=\"<br><span class='%s'>(<input type='text' size='2' value='' id='userinput_x'/>:<input type='text' size='2' value='' id='userinput_y'/>) <input id='update_button' type='button' value='OK' onclick='' style='color:red;background-color:lightblue;'/><input id='delete_button' type='button' value='NOK' onclick='' style='color:blue;background-color:red;'/></span> \";",css_class); |
2550 | }else{canvas_error("command 'userinput' or 'userinput_xy' is not supported for your 'userdraw' type..."); |
2550 | }else{canvas_error("command 'userinput' or 'userinput_xy' is not supported for your 'userdraw' type..."); |
2551 | }}}}} |
2551 | }}}}} |
2552 | 2552 | ||
2553 | fprintf(js_include_file,"\ |
2553 | fprintf(js_include_file,"\ |
2554 | var update_button = document.getElementById(\"update_button\");\ |
2554 | var update_button = document.getElementById(\"update_button\");\ |