⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 field_bk.h

📁 linux下的人机对话编程
💻 H
📖 第 1 页 / 共 5 页
字号:
 Ctr_3_DB=FALSE;     }     if(Ctr_3_FB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot3_1FB)); gtk_object_destroy(GTK_OBJECT(dot3_2FB)); Ctr_3_FB=FALSE;     }     if(value==FALSE){ line_3FB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);line_3DB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);     }if(value==TRUE){ gnome_canvas_item_set( line_3FB_DG,"points",point2,"fill_color", cr,"width_units",                       4.0,"join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);       gnome_canvas_item_request_update(line_3FB_DG);       gnome_canvas_item_show(line_3FB_DG);       gnome_canvas_item_hide(line_3DB_DG);           }    if(Ctr_3_FB==FALSE){c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0;dot3_1FB=  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0; dot3_2FB= gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);     Ctr_3_FB=TRUE; /* 两个点已经存在*/ }   }   if(i==9){     /*13DG*/  if(Ctr_13_DB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot13_1DB)); gtk_object_destroy(GTK_OBJECT(dot13_2DB)); Ctr_13_DB=FALSE;     }     if(Ctr_13_FB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot13_1FB)); gtk_object_destroy(GTK_OBJECT(dot13_2FB)); Ctr_13_FB=FALSE;     } if(value==FALSE){ line_13FB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); line_13DB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); }if(value==TRUE){ gnome_canvas_item_set( line_13FB_DG,"points",point2,"fill_color", cr,"width_units",                       4.0,"join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);       gnome_canvas_item_request_update(line_13FB_DG);       gnome_canvas_item_show(line_13FB_DG);       gnome_canvas_item_hide(line_13DB_DG);           } if(Ctr_13_FB==FALSE){  c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0; dot13_1FB=  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0; dot13_2FB= gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);      Ctr_13_FB=TRUE; /* 两个点已经存在*/ }   }if(i==10){ if(Ctr_15_DB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot15_1DB)); gtk_object_destroy(GTK_OBJECT(dot15_2DB)); Ctr_15_DB=FALSE;     }     if(Ctr_15_FB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot15_1FB)); gtk_object_destroy(GTK_OBJECT(dot15_2FB)); Ctr_15_FB=FALSE;     }     if(value==FALSE){ line_15FB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL); line_15DB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);     }if(value==TRUE){ gnome_canvas_item_set( line_15FB_DG,"points",point2,"fill_color", cr,"width_units",                       4.0,"join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);       gnome_canvas_item_request_update(line_15FB_DG);       gnome_canvas_item_show(line_15FB_DG);       gnome_canvas_item_hide(line_15DB_DG);           } if(Ctr_15_FB==FALSE){ c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0; dot15_1FB=  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0; dot15_2FB= gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);    Ctr_15_FB=TRUE; /* 两个点已经存在*/ }}if(i==11){ if(Ctr_17_DB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot17_1DB)); gtk_object_destroy(GTK_OBJECT(dot17_2DB)); Ctr_17_DB=FALSE;     }     if(Ctr_17_FB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot17_1FB)); gtk_object_destroy(GTK_OBJECT(dot17_2FB)); Ctr_17_FB=FALSE;     }     if(value==FALSE){  line_17FB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);  line_17DB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);   }if(value==TRUE){ gnome_canvas_item_set( line_17FB_DG,"points",point2,"fill_color", cr,"width_units",                       4.0,"join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);       gnome_canvas_item_request_update(line_17FB_DG);       gnome_canvas_item_show(line_17FB_DG);       gnome_canvas_item_hide(line_17DB_DG);           } if(Ctr_17_FB==FALSE){ c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0; dot17_1FB=  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0; dot17_2FB= gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);     Ctr_17_FB=TRUE; /* 两个点已经存在*/   }}    if(i==12){ if(Ctr_19_DB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot19_1DB)); gtk_object_destroy(GTK_OBJECT(dot19_2DB)); Ctr_19_DB=FALSE;     }     if(Ctr_19_FB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot19_1FB)); gtk_object_destroy(GTK_OBJECT(dot19_2FB)); Ctr_19_FB=FALSE;     }     if(value==FALSE){ line_19FB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);line_19DB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);     }if(value==TRUE){ gnome_canvas_item_set( line_19FB_DG,"points",point2,"fill_color", cr,"width_units",                       4.0,"join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);       gnome_canvas_item_request_update(line_19FB_DG);       gnome_canvas_item_show(line_19FB_DG);       gnome_canvas_item_hide(line_19DB_DG);           } if(Ctr_19_FB==FALSE){ c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0; dot19_1FB=  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0; dot19_2FB= gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);  Ctr_19_FB=TRUE; /* 两个点已经存在*/ }}if(i==22){  if(Ctr_10_DB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot10_1DB)); gtk_object_destroy(GTK_OBJECT(dot10_2DB)); Ctr_10_DB=FALSE;     }     if(Ctr_10_FB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot10_1FB)); gtk_object_destroy(GTK_OBJECT(dot10_2FB)); Ctr_10_FB=FALSE;     }     if(value==FALSE){ line_10FB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point2,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);line_10DB_DG= gnome_canvas_item_new(group,gnome_canvas_line_get_type(),                      "points",point1,"fill_color", cr,"width_units",4.0,                      "join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);     }if(value==TRUE){ gnome_canvas_item_set( line_10FB_DG,"points",point2,"fill_color", cr,"width_units",                       4.0,"join_style", GDK_CAP_BUTT,"line_style",                      GDK_LINE_SOLID,NULL);       gnome_canvas_item_request_update(line_10FB_DG);       gnome_canvas_item_show(line_10FB_DG);       gnome_canvas_item_hide(line_10DB_DG);           } if(Ctr_10_FB==FALSE){c1x=f1x-2.0; c1y=f1y-2.0; c2x=f1x+2.0; c2y=f1y+2.0; dot10_1FB=  gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c1x,"y1",c1y,"x2",c2x,"y2",c2y,"fill_color","yellow",		        NULL);  c3x=f9x-2.0; c3y=f9y-2.0; c4x=f9x+2.0; c4y=f9y+2.0; dot10_2FB= gnome_canvas_item_new(group,                        gnome_canvas_ellipse_get_type(),		        "x1",c3x,"y1",c3y,"x2",c4x,"y2",c4y,"fill_color","yellow",		        NULL);   Ctr_10_FB=TRUE; /* 两个点已经存在*/ }} gnome_canvas_points_unref(point1); gnome_canvas_points_unref(point2);  }  return 1;}/*--------------------------画双岔区段*--------------------------*/int draw_twosw_fd(double fx,double fy,double f1x,double f1y,double f2x,double f2y,double f3x,		  double f3y,double f4x,double f4y,double f8x,double f8y,double f9x,double f9y,double f10x,double f10y,double f11x,double f11y,int dir,gchar*cor,GtkWidget*canvas,int i){  GnomeCanvasPoints *point1,*point2,*point3;  GnomeCanvasGroup *group;  group=gnome_canvas_root(GNOME_CANVAS(canvas));  double c1x,c1y,c2x,c2y,c3x,c3y,c4x,c4y,c5x,c5y,c6x,c6y,c7x,c7y,c8x,c8y;   if(dir==0){   /*两个道岔都为定位*/        point1=gnome_canvas_points_new(2);   point1->coords[0]=fx;   point1->coords[1]=fy;   point1->coords[2]=f2x;   point1->coords[3]=f2y;   point2=gnome_canvas_points_new(3);   point2->coords[0]=fx;   point2->coords[1]=fy;   point2->coords[2]=f1x;   point2->coords[3]=f1y;   point2->coords[4]=f4x;   point2->coords[5]=f4y;   point3=gnome_canvas_points_new(3);   point3->coords[0]=f2x;   point3->coords[1]=f2y;   point3->coords[2]=f3x;   point3->coords[3]=f3y;   point3->coords[4]=f4x;   point3->coords[5]=f4y;  if(i==7){if(Ctr_5_DB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot5_1DB)); gtk_object_destroy(GTK_OBJECT(dot5_2DB)); Ctr_5_DB=FALSE;     }     if(Ctr_5_FB==TRUE){ gtk_object_destroy(GTK_OBJECT(dot5_1FB));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -