📄 f133.c
字号:
/**************
name:f133.c
ability:Display the window which be created!
******************/
int Open_Vp(int num)
{
int x1,y1,xr,yr;
x1=vframe[num].left;
y1=vframe[num].top;
xr=vframe[num].right;
yr=vframe[num].bottom;
if(vframe[num].vc.shadow){
xr+=SDVwd;
yr+=SDVht;
}
if(!vframe[num].active){
/*S_VP(x1,y1,xr,yr,vframe[num].scrptr);*/
vframe[num].active=1;
}
Fill_Vp(num);
Disp_Border(num);
Disp_Title(num);
Disp_Ask(num);
return num;
}
void Disp_Border(int num)
{
int width;
int x1,y1,xr,yr;
x1=vframe[num].left;
y1=vframe[num].top;
xr=vframe[num].right;
yr=vframe[num].bottom;
setcolor(vframe[num].vc.border_color);
if(vframe[num].vc.border_style==DOUBLE){
width=BORDERwd/3;
setlinestyle(SOLID_LINE,0,vframe[num].vc.border_thickness);
rectangle(x1+width,y1+width,xr-width,yr-width);
}
else {
width=BORDERwd/2;
setlinestyle(vframe[num].vc.border_style,0,vframe[num].vc.border_thickness);
rectangle(x1+width,y1+width,xr-width,yr-width);
}
return;
}
void Disp_Title(int num)
{
int xt,yt,x1,y1,x2,y2;
int width,len,bw;
if(vframe[num].title!=NULL){
bw=BORDERwd;
width=(vframe[num].right-vframe[num].left+1-2*BORDERwd)/8;
len=strlen(vframe[num].title);
len=len>width?width:len;
*(vframe[num].title+len)='\0';
xt=(vframe[num].left+vframe[num].right)/2-len*8/2;
x1=vframe[num].left+bw;
y1=vframe[num].top+bw;
x2=vframe[num].right-bw;
y2=vframe[num].top+BORDERwd+20;
yt=y1+2;
setcolor(15);
rectangle(x1,y1,x2,y2);
/*setfillstyle(SOLID_FILL,vframe[num].vc.bk_color);*/
/*bar(xt,vframe[num].top,xt+len*textheight(vframe[num].title),vframe[num].top+BORDERwd);*/
setcolor(vframe[num].vc.title_color);
out16hz(xt,yt,0,15,vframe[num].title);
}
return;
}
void Disp_Ask(int num)
{
int xt,yt,x1,y1,x2,y2;
int len;/*width,vp_width,height,charwd;*/
int bw=BORDERwd;
if(vframe[num].ask!=NULL){
/*vp_width=vframe[num].right-vframe[num].left+1-2*BORDERwd;
charwd=textwidth(vframe[num].ask)/strlen(vframe[num].ask);
vp_width/=charwd;
width=width>=vp_width?width:vp_width;*/
len=strlen(vframe[num].ask);
x1=vframe[num].left+bw;
y1=vframe[num].top+2*bw+18;
x2=vframe[num].right-bw;
y2=vframe[num].bottom-bw;
setcolor(15);
rectangle(x1,y1,x2,y2);
*(vframe[num].ask+len)='\0';
/*height=textheight(vframe[num].ask);
height=height>BORDERwd?height:BORDERwd;*/
xt=x1+2;
yt=y1+2;
setcolor(vframe[num].vc.ask_color);
out16hz(xt,yt,0,15,vframe[num].ask);
vframe[num].curx=xt;
vframe[num].cury=yt+10;
}
return;
}
void Disp_Cursor(int mode,int x,int y,int chwd,int chht)
{
int i;
setwritemode(XOR_PUT);
Goto_Vpxy(x,y,curr_vp);
x=getx();
y=gety();
switch(mode){
case INSERT:
for(i=y+chht*4/5;i<y+chht;i++)
line(x,i,x+chwd,i);
break;
case REPLACE:
for(i=y;i<y+chht;i++)
line(x,i,x+chwd,i);
break;
}
setwritemode(COPY_PUT);
return;
}
void Fill_Vp(int num)
{
setfillstyle(vframe[num].vc.fill_style,vframe[num].vc.bk_color);
bar(vframe[num].left,vframe[num].top,vframe[num].right,vframe[num].bottom);
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -