📄 drawwindows.c
字号:
} else//现在面板状态为伸,下一步要为缩 { GrMoveWindow(Wid_Panel_Control,0,240); GrMoveWindow(Wid_Button_Panel_Control,5,207); 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); 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; } } //开始按钮 if(Event.button.wid==Wid_Button_Start) { if(Mark_System_State==0)//现在为暂停,下一步要开始 { GrFillRect(Wid_Button_Start,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Start,Gid_Draw_Black_White,12,20,"暂停",-1,GR_TFASCII);//按钮按下以后为暂停按钮,文字向下挪一下显示按下的效果 Mark_System_State=1;//表示系统开始 //当用户有动作时给予一定提示 if(Mark_System_Stop==0) { FUN_ShowMessage("正在初始化,请稍后. . . . . .",0,Wid_Panel_Control);//显示提示消息 Mark_System_Stop=1;//表示系统开始 if(Mask==0) { sleep(2);//在这里启动开始数据采集的线程 FUN_ShowMessage("初始化完毕! ",0,Wid_Panel_Control);//显示提示消息 } Mask=1; } } else { //在这里挂起数据采集的线程 Mark_System_State=0;//表示系统暂停 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); //FUN_ShowMessage("已暂停!",0,Wid_Panel_Control); } } //存储按钮 if(Event.button.wid==Wid_Button_Store) { if(Mask_Store==0) { GrFillRect(Wid_Button_Store,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Store,Gid_Draw_Black_White,12,20,"存储",-1,GR_TFASCII); Mask_Store=1; } else { GrFillRect(Wid_Button_Store,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Store,Gid_Draw_Black_Gray,9,18,"存储",-1,GR_TFASCII); Mask_Store=0; } } //再现按钮 if(Event.button.wid==Wid_Button_Show) { if(Mask_Show==0) { GrFillRect(Wid_Button_Show,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Show,Gid_Draw_Black_White,12,20,"再现",-1,GR_TFASCII); Mask_Show=1; } else { GrFillRect(Wid_Button_Show,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Show,Gid_Draw_Black_Gray,9,18,"再现",-1,GR_TFASCII); Mask_Show=0; } } //停止按钮 if(Event.button.wid==Wid_Button_Stop) { GrFillRect(Wid_Button_Stop,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Stop,Gid_Draw_Black_White,12,20,"停止",-1,GR_TFASCII); Mark_System_State=0;//表示系统暂停 goto stop;//在这里放置停止的代码 Mark_System_Stop=0;//表示系统停止 } //分析面板各个按钮的按下事件 //把手 if(Event.button.wid==Wid_Button_Panel_Analyze) { if(Mark_Panel_State==0)//现在面板状态为缩,下一步要为伸 { GrUnmapWindow(Wid_Button_Panel_Control);//先隐藏其它把手 GrUnmapWindow(Wid_Button_Panel_Channel); GrUnmapWindow(Wid_Button_Panel_Message); GrMoveWindow(Wid_Panel_Analyze,0,205);//伸出面板 GrMoveWindow(Wid_Button_Panel_Analyze,5,205);//把把手靠在面板上 GrFillRect(Wid_Button_Panel_Analyze,Gid_Draw_Gray,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮 GrText(Wid_Button_Panel_Analyze,Gid_Draw_Black_Gray,9,18,"隐藏",-1,GR_TFASCII);//黑笔灰底 //显示按钮,并重会文字,窗口不会被覆盖可是在窗口上的绘图会被覆盖 GrMapWindow(Wid_Button_X); GrMoveWindow(Wid_Button_X,Button_Start_X,Button_Start_Y); GrFillRect(Wid_Button_X,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_X,Gid_Draw_Black_White,9,18,"X轴",-1,GR_TFASCII); GrMapWindow(Wid_Button_Y); GrMoveWindow(Wid_Button_Y,Button_Start_X+2*(Button_Width+Button_Between),Button_Start_Y); GrFillRect(Wid_Button_Y,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Y,Gid_Draw_Black_White,9,18,"Y轴",-1,GR_TFASCII); Mark_Panel_State=1; } else//现在面板状态为伸,下一步要为缩 { GrMoveWindow(Wid_Panel_Analyze,0,240); GrMapWindow(Wid_Button_Panel_Analyze); GrMoveWindow(Wid_Button_Panel_Analyze,Button_Pannel_Start_X+1*(Button_Pannel_Width+Button_Pannel_Between),Button_Pannel_Start_Y); 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_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_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); 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; } } //X轴分析按钮 if(Event.button.wid==Wid_Button_X) { if(Mark_Panel_Analyze_State==0) { GrUnmapWindow(Wid_Button_Y);//先隐藏Y的按钮 GrUnmapWindow(Wid_Button_Panel_Analyze); GrMoveWindow(Wid_Button_X,5,0);//使X按钮变成把手 GrFillRect(Wid_Button_X,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_X,Gid_Draw_Black_Gray,9,18,"隐藏",-1,GR_TFASCII);//黑笔灰底 GrMoveWindow(Wid_Button_LangX,Button_Start_X,Button_Start_Y); 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); GrMoveWindow(Wid_Button_ShortX,Button_Start_X+1*(Button_Width+Button_Between),Button_Start_Y); 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); /*GrMoveWindow(Wid_Button_MoveLeftX,Button_Start_X+2*(Button_Width+Button_Between),Button_Start_Y); 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); GrMoveWindow(Wid_Button_MoveRightX,Button_Start_X+3*(Button_Width+Button_Between),Button_Start_Y); 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);*/ Mark_Panel_Analyze_State=1; } else//现在面板状态为伸,下一步要为缩 { //挪走不用的按钮 GrMoveWindow(Wid_Button_LangX,Button_Start_X+5*(Button_Width+Button_Between),Button_Start_Y); 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); GrMoveWindow(Wid_Button_ShortX,Button_Start_X+6*(Button_Width+Button_Between),Button_Start_Y); 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); /*GrMoveWindow(Wid_Button_MoveLeftX,Button_Start_X+7*(Button_Width+Button_Between),Button_Start_Y); 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); GrMoveWindow(Wid_Button_MoveRightX,Button_Start_X+8*(Button_Width+Button_Between),Button_Start_Y); 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);*/ //显示按钮,并重会文字,窗口不会被覆盖可是在窗口上的绘图会被覆盖 GrMoveWindow(Wid_Button_Panel_Analyze,5,205); GrMapWindow(Wid_Button_Panel_Analyze); GrFillRect(Wid_Button_Panel_Analyze,Gid_Draw_Gray,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮 GrText(Wid_Button_Panel_Analyze,Gid_Draw_Black_Gray,9,18,"隐藏",-1,GR_TFASCII);//黑笔灰底 GrMoveWindow(Wid_Button_X,Button_Start_X,Button_Start_Y); GrMapWindow(Wid_Button_X); GrFillRect(Wid_Button_X,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_X,Gid_Draw_Black_White,9,18,"X轴",-1,GR_TFASCII); GrMoveWindow(Wid_Button_Y,Button_Start_X+2*(Button_Width+Button_Between),Button_Start_Y); GrMapWindow(Wid_Button_Y); GrFillRect(Wid_Button_Y,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Y,Gid_Draw_Black_White,9,18,"Y轴",-1,GR_TFASCII); Mark_Panel_Analyze_State=0; } } //Y轴分析按钮 if(Event.button.wid==Wid_Button_Y) { if(Mark_Panel_Analyze_State==0)//现在面板状态为缩,下一步要为伸 { GrUnmapWindow(Wid_Button_X);//先隐藏X按钮 GrUnmapWindow(Wid_Button_Panel_Analyze); GrMoveWindow(Wid_Button_Y,5,0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -