www.pudn.com > cwin.rar > DISPINFO.C
/*-----------------------------------------------------------
函数 dispinfo : 显示提示信息
-----------------------------------------------------------*/
#include
#include
void _Cdecl dispinfo(col,line,width,high,prompt)
int col; /* 提示框左上角列坐标(以字节为单位) */
int line; /* 提示框左上角行坐标(以象素为单位) */
int width; /* 提示框宽度(以字节为单位) */
int high; /* 提示框高度(以象素为单位) */
char *prompt; /* 提示信息 */
{
char **block; /* 存储提示框背景的缓冲区指针 */
int pmtwidth = _CurrentHZK->fontwidth*_Xtimes*strlen(prompt)/2;
int pmthigh = (_CurrentHZK->fonthigh+2)*_Ytimes;
int pmtcol = col+(width-pmtwidth)/2;
int pmtline = line+(high-pmthigh)/2;
delight_mouse();
block = getblock(col,line,width,high);
_Box(col*8,line,width*8,high);
if(pmtwidth<=width-2)
outxystr(pmtcol,pmtline,_TextColor,prompt);
else
{
int old_wl,old_wt,old_wr,old_wb;
int old_col = _TextCol;
int old_row = _TextLine;
get_window(old_wl,old_wt,old_wr,old_wb);
pmthigh = (pmtwidth/(width-2)+2)*_CurrentHZK->fonthigh*_Ytimes;
pmtwidth = width-2;
pmtcol = col+1;
pmtline = line+8;
set_window(pmtcol,pmtline,pmtcol+pmtwidth-1,pmtline+pmthigh-1);
movecursor(pmtcol,pmtline);
outstr(prompt);
set_window(old_wl,old_wt,old_wr,old_wb);
movecursor(old_col,old_row);
}
light_mouse();
till_mouse_pop(LEFT_BUTTON);
geth();
delight_mouse();
putblock(col,line,width,high,block);
light_mouse();
}