📄 drawwindows.c
字号:
GrFillRect(Wid_Button_Y,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_Y,Gid_Draw_Black_Gray,9,18,"隐藏",-1,GR_TFASCII);//黑笔灰底 GrMoveWindow(Wid_Button_LangY,Button_Start_X,Button_Start_Y); 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); GrMoveWindow(Wid_Button_ShortY,Button_Start_X+1*(Button_Width+Button_Between),Button_Start_Y); 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); GrMoveWindow(Wid_Button_MoveUpY,Button_Start_X+2*(Button_Width+Button_Between),Button_Start_Y); 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); GrMoveWindow(Wid_Button_MoveDownY,Button_Start_X+3*(Button_Width+Button_Between),Button_Start_Y); 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); Mark_Panel_Analyze_State=1; } else//现在面板状态为伸,下一步要为缩 { //挪走不用的按钮 GrMoveWindow(Wid_Button_LangY,Button_Start_X+5*(Button_Width+Button_Between),Button_Start_Y); 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); GrMoveWindow(Wid_Button_ShortY,Button_Start_X+6*(Button_Width+Button_Between),Button_Start_Y); 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); GrMoveWindow(Wid_Button_MoveUpY,Button_Start_X+7*(Button_Width+Button_Between),Button_Start_Y); 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); GrMoveWindow(Wid_Button_MoveDownY,Button_Start_X+8*(Button_Width+Button_Between),Button_Start_Y); 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); //显示按钮,并重会文字,窗口不会被覆盖可是在窗口上的绘图会被覆盖 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; } } //伸长X轴 if(Event.button.wid==Wid_Button_LangX) { GrFillRect(Wid_Button_LangX,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_LangX,Gid_Draw_Black_White,12,20,"伸长",-1,GR_TFASCII); Mask_Screen_XCount/=5;//放置伸长X轴的代码 if(Mask_Screen_XCount==20000) { Mask_Screen_XCount=78125; } if(Mask_Screen_XCount<=0) { Mask_Screen_XCount=1; } } //伸长Y轴 if(Event.button.wid==Wid_Button_LangY) { GrFillRect(Wid_Button_LangY,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_LangY,Gid_Draw_Black_White,12,20,"伸长",-1,GR_TFASCII); switch(Mark_Channel_State)//放置伸长Y轴的代码 { case 0: Mask_YSpread_One*=2; Mask_YSpread_Two*=2; break; case 1: Mask_YSpread_One*=2; break; case 2: Mask_YSpread_Two*=2; break; default: Mark_Channel_State=0; break; } if(Mask_YSpread_One>=16) { Mask_YSpread_One=16; } if(Mask_YSpread_Two>=16) { Mask_YSpread_Two=16; } } //缩短X轴 if(Event.button.wid==Wid_Button_ShortX) { GrFillRect(Wid_Button_ShortX,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_ShortX,Gid_Draw_Black_White,12,20,"缩短",-1,GR_TFASCII); Mask_Screen_XCount*=5;//放置缩短X轴的代码 if(Mask_Screen_XCount>=100000) { Mask_Screen_XCount=100000; } } //缩短Y轴 if(Event.button.wid==Wid_Button_ShortY) { GrFillRect(Wid_Button_ShortY,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_ShortY,Gid_Draw_Black_White,12,20,"缩短",-1,GR_TFASCII); switch(Mark_Channel_State)//放置缩短Y轴的代码 { case 0: Mask_YSpread_One/=2; Mask_YSpread_Two/=2; break; case 1: Mask_YSpread_One/=2; break; case 2: Mask_YSpread_Two/=2; break; default: Mark_Channel_State=0; break; } if(Mask_YSpread_One<=1) { Mask_YSpread_One=1; } if(Mask_YSpread_Two<=1) { Mask_YSpread_Two=1; } } //左移X轴 /*if(Event.button.wid==Wid_Button_MoveLeftX) { GrFillRect(Wid_Button_MoveLeftX,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_MoveLeftX,Gid_Draw_Black_White,12,20,"左移",-1,GR_TFASCII); //放置左移X轴的代码 }*/ //上移Y轴 if(Event.button.wid==Wid_Button_MoveUpY) { GrFillRect(Wid_Button_MoveUpY,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_MoveUpY,Gid_Draw_Black_White,12,20,"上移",-1,GR_TFASCII); switch(Mark_Channel_State)//放置上移Y轴的代码 { case 0: Mask_YMove_One+=2; Mask_YMove_Two+=2; break; case 1: Mask_YMove_One+=2; break; case 2: Mask_YMove_Two+=2; break; default: Mark_Channel_State=0; break; } } //右移X轴 /*if(Event.button.wid==Wid_Button_MoveRightX) { GrFillRect(Wid_Button_MoveRightX,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_MoveRightX,Gid_Draw_Black_White,12,20,"右移",-1,GR_TFASCII); //放置右移X轴的代码 }*/ //下移Y轴 if(Event.button.wid==Wid_Button_MoveDownY) { GrFillRect(Wid_Button_MoveDownY,Gid_Draw_White,0,0,Button_Width,Button_High);//画填充矩形为按钮 GrText(Wid_Button_MoveDownY,Gid_Draw_Black_White,12,20,"下移",-1,GR_TFASCII); switch(Mark_Channel_State)//放置下移Y轴的代码 { case 0: Mask_YMove_One-=2; Mask_YMove_Two-=2; break; case 1: Mask_YMove_One-=2; break; case 2: Mask_YMove_Two-=2; break; default: Mark_Channel_State=0; break; } } //选择通道面板各个按钮的按下事件 //把手 if(Event.button.wid==Wid_Button_Panel_Channel) { if(Mark_Panel_State==0)//现在面板状态为缩,下一步要为伸 { GrUnmapWindow(Wid_Button_Panel_Control);//先隐藏其它把手 GrUnmapWindow(Wid_Button_Panel_Analyze); GrUnmapWindow(Wid_Button_Panel_Message); GrMoveWindow(Wid_Panel_Channel,0,205);//伸出面板 GrMoveWindow(Wid_Button_Panel_Channel,5,205);//把把手靠在面板上 GrFillRect(Wid_Button_Panel_Channel,Gid_Draw_Gray,0,0,Button_Pannel_Width,Button_Pannel_High);//画填充矩形为按钮 GrText(Wid_Button_Panel_Channel,Gid_Draw_Black_Gray,9,18,"隐藏",-1,GR_TFASCII);//黑笔灰底 if(Mark_Channel_State==0) { GrMapWindow(Wid_Button_Channel_One); GrFillRect(Wid_Button_Channel_One,Gid_Draw_Gray,0,0,Button_Width,Button_High);//画填充矩形为按钮
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -