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

📄 drawwindows.c

📁 uClinux 下MicroWindows开发的电机控制平台软件和模拟示波器的双路数据采集系统源码
💻 C
📖 第 1 页 / 共 4 页
字号:
			 GrText(Wid_Button_Channel_One,Gid_Draw_Black_Gray,5,18,"通道1",-1,GR_TFASCII);                                   			 GrMapWindow(Wid_Button_Channel_Two);                         GrFillRect(Wid_Button_Channel_Two,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			 GrText(Wid_Button_Channel_Two,Gid_Draw_Black_Gray,5,18,"通道2",-1,GR_TFASCII);                         			 GrMapWindow(Wid_Button_Channel_All);                         GrFillRect(Wid_Button_Channel_All,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			 GrText(Wid_Button_Channel_All,Gid_Draw_Black_White,2,20,"双通道",-1,GR_TFASCII);		       }		       if(Mark_Channel_State==1)		       {		         GrMapWindow(Wid_Button_Channel_One);			 GrFillRect(Wid_Button_Channel_One,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                                          GrText(Wid_Button_Channel_One,Gid_Draw_Black_White,7,20,"通道1",-1,GR_TFASCII);                                   			 GrMapWindow(Wid_Button_Channel_Two);                         GrFillRect(Wid_Button_Channel_Two,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			 GrText(Wid_Button_Channel_Two,Gid_Draw_Black_Gray,5,18,"通道2",-1,GR_TFASCII);                         			 GrMapWindow(Wid_Button_Channel_All);                         GrFillRect(Wid_Button_Channel_All,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			                          GrText(Wid_Button_Channel_All,Gid_Draw_Black_Gray,2,18,"双通道",-1,GR_TFASCII);		       }		       if(Mark_Channel_State==2)		       {		         GrMapWindow(Wid_Button_Channel_One);                         GrFillRect(Wid_Button_Channel_One,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                                          GrText(Wid_Button_Channel_One,Gid_Draw_Black_Gray,5,18,"通道1",-1,GR_TFASCII);                                            			 GrMapWindow(Wid_Button_Channel_Two);			 GrFillRect(Wid_Button_Channel_Two,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                                          GrText(Wid_Button_Channel_Two,Gid_Draw_Black_White,7,20,"通道2",-1,GR_TFASCII);                         			 GrMapWindow(Wid_Button_Channel_All);                         GrFillRect(Wid_Button_Channel_All,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			                          GrText(Wid_Button_Channel_All,Gid_Draw_Black_Gray,2,18,"双通道",-1,GR_TFASCII);		       }		       Mark_Panel_State=1;		    }		    else//现在面板状态为伸,下一步要为缩		    {		       GrMoveWindow(Wid_Panel_Channel,0,240);		       GrMoveWindow(Wid_Button_Panel_Channel,Button_Pannel_Start_X+2*(Button_Pannel_Width+Button_Pannel_Between),Button_Pannel_Start_Y);		       GrFillRect(Wid_Button_Panel_Channel,Gid_Draw_White,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		       GrText(Wid_Button_Panel_Channel,Gid_Draw_Black_White,9,18,"通道",-1,GR_TFASCII);		       		       GrMapWindow(Wid_Button_Panel_Control);//显示其它把手		       GrFillRect(Wid_Button_Panel_Control,Gid_Draw_White,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		       GrText(Wid_Button_Panel_Control,Gid_Draw_Black_White,9,18,"控制",-1,GR_TFASCII);		       		       GrMapWindow(Wid_Button_Panel_Analyze);		       GrFillRect(Wid_Button_Panel_Analyze,Gid_Draw_White,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		       		       GrText(Wid_Button_Panel_Analyze,Gid_Draw_Black_White,9,18,"分析",-1,GR_TFASCII);		       		       GrMapWindow(Wid_Button_Panel_Message);		       GrFillRect(Wid_Button_Panel_Message,Gid_Draw_White,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		       		       	       		       GrText(Wid_Button_Panel_Message,Gid_Draw_Black_White,9,18,"信息",-1,GR_TFASCII);		       		       Mark_Panel_State=0;		    }                }		    //通道1选择		    if(Event.button.wid==Wid_Button_Channel_One)		    {		      if(Mark_Channel_State!=1)		      {		         GrFillRect(Wid_Button_Channel_One,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                                          GrText(Wid_Button_Channel_One,Gid_Draw_Black_White,7,20,"通道1",-1,GR_TFASCII);                                                            GrFillRect(Wid_Button_Channel_Two,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			 GrText(Wid_Button_Channel_Two,Gid_Draw_Black_Gray,5,18,"通道2",-1,GR_TFASCII);                                                  GrFillRect(Wid_Button_Channel_All,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			                          GrText(Wid_Button_Channel_All,Gid_Draw_Black_Gray,2,18,"双通道",-1,GR_TFASCII);						 Mark_Channel_State=1;			 //放置只显示通道1的代码			          		      }		    }		    //通道2选择		    if(Event.button.wid==Wid_Button_Channel_Two)		    {		      if(Mark_Channel_State!=2)		      {		         GrFillRect(Wid_Button_Channel_One,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                                          GrText(Wid_Button_Channel_One,Gid_Draw_Black_Gray,5,18,"通道1",-1,GR_TFASCII);                                            			 GrFillRect(Wid_Button_Channel_Two,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                                          GrText(Wid_Button_Channel_Two,Gid_Draw_Black_White,7,20,"通道2",-1,GR_TFASCII);                                                  GrFillRect(Wid_Button_Channel_All,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			                          GrText(Wid_Button_Channel_All,Gid_Draw_Black_Gray,2,18,"双通道",-1,GR_TFASCII);			 Mark_Channel_State=2;			 //放置只显示通道2的代码			          		      }		    }		    //双通道选择		    if(Event.button.wid==Wid_Button_Channel_All)		    {		      if(Mark_Channel_State!=0)		      {		         GrFillRect(Wid_Button_Channel_One,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        			 GrText(Wid_Button_Channel_One,Gid_Draw_Black_Gray,5,18,"通道1",-1,GR_TFASCII);                                                           GrFillRect(Wid_Button_Channel_Two,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			 GrText(Wid_Button_Channel_Two,Gid_Draw_Black_Gray,5,18,"通道2",-1,GR_TFASCII);                                                  GrFillRect(Wid_Button_Channel_All,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		                                 			 GrText(Wid_Button_Channel_All,Gid_Draw_Black_White,2,20,"双通道",-1,GR_TFASCII);			 Mark_Channel_State=0;			 //放置显示双通道的代码			          		      }		    }	    //选择信息面板	    if(Event.button.wid==Wid_Button_Panel_Message)	    {	       if(Mark_Panel_State==0)//现在面板状态为缩,下一步要为伸	       {		  GrUnmapWindow(Wid_Button_Panel_Control);//先隐藏其它把手		  GrUnmapWindow(Wid_Button_Panel_Analyze);		  GrUnmapWindow(Wid_Button_Panel_Channel);		  GrMoveWindow(Wid_Panel_Message,0,205);//伸出面板		  		  GrMoveWindow(Wid_Button_Panel_Message,5,205);//把把手靠在面板上		  GrFillRect(Wid_Button_Panel_Message,Gid_Draw_Gray,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		       		  GrText(Wid_Button_Panel_Message,Gid_Draw_Black_Gray,9,18,"隐藏",-1,GR_TFASCII);//黑笔灰底		  		  GrText(Wid_Panel_Message,Gid_Message_Text,60,25,MessageInfo,-1,GR_TFASCII);//显示消息内容		  		  Mark_Panel_State=1;	       }	       else//现在面板状态为伸,下一步要为缩	       {		  GrMoveWindow(Wid_Panel_Message,0,240);		  GrMoveWindow(Wid_Button_Panel_Message,Button_Pannel_Start_X+3*(Button_Pannel_Width+Button_Pannel_Between),Button_Pannel_Start_Y);		  GrFillRect(Wid_Button_Panel_Message,Gid_Draw_White,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		       		  GrText(Wid_Button_Panel_Message,Gid_Draw_Black_White,9,18,"信息",-1,GR_TFASCII);		  		  GrMapWindow(Wid_Button_Panel_Control);                  GrMoveWindow(Wid_Button_Panel_Control,Button_Pannel_Start_X,Button_Pannel_Start_Y);		  		  GrFillRect(Wid_Button_Panel_Control,Gid_Draw_White,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		  GrText(Wid_Button_Panel_Control,Gid_Draw_Black_White,9,18,"控制",-1,GR_TFASCII);		  		  GrMapWindow(Wid_Button_Panel_Analyze);		  GrFillRect(Wid_Button_Panel_Analyze,Gid_Draw_White,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		  		  GrText(Wid_Button_Panel_Analyze,Gid_Draw_Black_White,9,18,"分析",-1,GR_TFASCII);		  		  GrMapWindow(Wid_Button_Panel_Channel);		  GrFillRect(Wid_Button_Panel_Channel,Gid_Draw_White,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮		  		  GrText(Wid_Button_Panel_Channel,Gid_Draw_Black_White,9,18,"通道",-1,GR_TFASCII);		  		  Mark_Panel_State=0;	       }		     	    }  			   break;           	   	   case GR_EVENT_TYPE_BUTTON_UP:	           //控制面板各个按钮的放起事件		   if(Event.button.wid==Wid_Button_Stop)		   {		       GrFillRect(Wid_Button_Stop,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮	               GrText(Wid_Button_Stop,Gid_Draw_Black_Gray,9,18,"停止",-1,GR_TFASCII);		       GrFillRect(Wid_Button_Start,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		       GrText(Wid_Button_Start,Gid_Draw_Black_Gray,9,18,"开始",-1,GR_TFASCII);		   }		   		   if(Event.button.wid==Wid_Button_LangX)  		   {		        GrFillRect(Wid_Button_LangX,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        		   		        GrText(Wid_Button_LangX,Gid_Draw_Black_Gray,9,18,"伸长",-1,GR_TFASCII);		   }		   if(Event.button.wid==Wid_Button_LangY)  		   {		        GrFillRect(Wid_Button_LangY,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        		   		        GrText(Wid_Button_LangY,Gid_Draw_Black_Gray,9,18,"伸长",-1,GR_TFASCII);		   }		   if(Event.button.wid==Wid_Button_ShortX)  		   {		        GrFillRect(Wid_Button_ShortX,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        			GrText(Wid_Button_ShortX,Gid_Draw_Black_Gray,9,18,"缩短",-1,GR_TFASCII);		   }		   if(Event.button.wid==Wid_Button_ShortY)  		   {		        GrFillRect(Wid_Button_ShortY,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        			GrText(Wid_Button_ShortY,Gid_Draw_Black_Gray,9,18,"缩短",-1,GR_TFASCII);		   }		   /*if(Event.button.wid==Wid_Button_MoveLeftX)  		   {		        GrFillRect(Wid_Button_MoveLeftX,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        			GrText(Wid_Button_MoveLeftX,Gid_Draw_Black_Gray,9,18,"左移",-1,GR_TFASCII);		   }*/		   if(Event.button.wid==Wid_Button_MoveUpY)  		   {		        GrFillRect(Wid_Button_MoveUpY,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        			GrText(Wid_Button_MoveUpY,Gid_Draw_Black_Gray,9,18,"上移",-1,GR_TFASCII);		   }		   /*if(Event.button.wid==Wid_Button_MoveRightX)  		   {		        GrFillRect(Wid_Button_MoveRightX,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        			GrText(Wid_Button_MoveRightX,Gid_Draw_Black_Gray,9,18,"右移",-1,GR_TFASCII);		   }*/		   if(Event.button.wid==Wid_Button_MoveDownY)  		   {		        GrFillRect(Wid_Button_MoveDownY,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮		        		        		        		        			GrText(Wid_Button_MoveDownY,Gid_Draw_Black_Gray,9,18,"下移",-1,GR_TFASCII);		   }                           	   break;       }    }//while(1)    stop:    GrClose();    return NULL;//正常退出}

⌨️ 快捷键说明

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