?? wmessage.c
字號:
/* CXL - Copyright (c) 1987-1989 by Mike Smedley - All Rights Reserved */
/* WMESSAGE.C - displays text on window's top or bottom border */
/* Changed to allow if leftofs is negative, then offset is from right */
#include <string.h>
#include "cxlvid.h"
#include "cxlwin.h"
int wmessage(char *str,int border,int leftofs,int attr)
{
/* check for active window */
if(!_winfo.total) return(_winfo.errno=W_NOACTIVE);
/* make sure window has a border */
if(!_winfo.active->border) return(_winfo.errno=W_NOBORDER);
if ( leftofs >= 0 )
{
/* make sure string fits in window */
if( (_winfo.active->scol+leftofs+strlen(str)-1) > (_winfo.active->ecol) )
return(_winfo.errno=W_STRLONG);
/* display string */
prints(border?_winfo.active->erow:_winfo.active->srow,
_winfo.active->scol+leftofs,attr,str);
}
else {
/* Change sign */
leftofs = -leftofs;
/* make sure string fits in window */
if( (_winfo.active->ecol-leftofs-strlen(str)+1) < (_winfo.active->scol) )
return(_winfo.errno=W_STRLONG);
/* display string */
prints(border?_winfo.active->erow:_winfo.active->srow,
_winfo.active->ecol-leftofs-strlen(str)+1,attr,str);
}
/* return normally */
return(_winfo.errno=W_NOERROR);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -