📄 brw_disp.c
字号:
memset(pString,0,100);
strcat(pString,pUnitBuff);
}
wCurCol += wUnitWidth;
pData += moveLen;
}
if (strlen(pString) != 0)
{
wTempState = handle->pBrwInfo->wStates;
handle->pBrwInfo->wStates = wState0;
BrowserDrawOneUnit(handle,pString,dwLineStart,wColStart);
handle->pBrwInfo->wStates = wTempState;
}
//释放堆栈
BROWSER_STACK_FREE(handle,100);
BROWSER_STACK_FREE(handle,BROWSER_UNIT_MAXLEN);
return;
}
/************************************************************************/
/* 函数名称: BrowserMarkPage */
/* 函数描述: MARK一屏 */
/* 当前版本: 1.0 */
/* 作 者: gaolinhui */
/* 输入参数: */
/* handle - 对象句柄 */
/* 输出参数: */
/* NONE */
/* 返回值 : */
/* NONE */
/* 更改记录: */
/* =====================================================================*/
/* 日期 人员 版本 描述 */
/* =====================================================================*/
/* 2006-3-1 gaolinhui 1.0 创建 */
/************************************************************************/
VOID BrowserMarkPage(MBrowser *handle)
{
UINT8 *pStart,*pEnd;
MLineInfo LineInfo;
UINT32 line1,line2;
UINT32 tmpLine;
// UINT16 tmpCol;
UINT16 col1,col2,wPageLine;
UINT16 x1,x2,y1,y2;
UINT16 x0,y0;
if (!(handle->pBrwInfo->wStates & BROWSER_STATE_MARKING))
{
return;
}
/*控件起始坐标*/
x0 = handle->pBrwInfo->nX;
y0 = handle->pBrwInfo->nY;
if (handle->pBrwInfo->pMarkEnd > handle->pBrwInfo->pMarkStart)
{
pStart = handle->pBrwInfo->pMarkStart;
pEnd = handle->pBrwInfo->pMarkEnd;
}
else
{
pStart = handle->pBrwInfo->pMarkEnd;
pEnd = handle->pBrwInfo->pMarkStart;
}
BrowserPosToLineCol(handle,pStart,&line1,&col1);
if (line1 < handle->pBrwInfo->dwTopLine)
{
handle->pBrwInfo->wStates &= ~BROWSER_STATE_MARKING;
return;
}
BrowserPendToLineCol(handle,pStart,pEnd,&line2,&col2);
/*********gaolinhui, added 修改多行连续mark时mark出错*****************************************/
/* if(line1 != line2)
{
if(GetLineInfo(handle, line2, &LineInfo))
{
//计算最后一行的起始可mark的列号
BrowserPosToLineCol(handle, LineInfo.pLinePtr, &tmpLine, &tmpCol);
}
//最后一行mark数据结束的显示列
col2 = tmpCol + col2;
}
*/
/******************************************************************************/
wPageLine = BrowserPageLineSum(handle,handle->pBrwInfo->dwTopLine);
if (line2 >= (handle->pBrwInfo->dwTopLine + wPageLine))
{
handle->pBrwInfo->wStates &= ~BROWSER_STATE_MARKING;
return;
}
line1 -= handle->pBrwInfo->dwTopLine;
line2 -= handle->pBrwInfo->dwTopLine;
BrowserLineColToXY(handle,line1,col1,&x1,&y1);
GraphDisableRefresh();
while (1)
{
UINT16 height;
height = BrowserLinesHeight(handle,line1 + handle->pBrwInfo->dwTopLine,
line1 + handle->pBrwInfo->dwTopLine);
if (line1 == line2)
{
BrowserLineColToXY(handle,line2,col2,&x2,&y2);
y2 += height - handle->wLineSpace;
GraphInvertRect(x0+x1,y0+y1, x0+x2-1, y0+y2-1);
break;
}
else
{
x2 = BrowserLineWidth(handle,line1 + handle->pBrwInfo->dwTopLine);
if (x2 <= x1)
{
x2 = handle->pBrwInfo->wTotalCol;
}
//y2 = y1 + height - handle->pBrwInfo->wLineSpace - lineSpace;
y2 = y1 + height - handle->pBrwInfo->wLineSpace;
GraphInvertRect(x0+x1, y0+y1, x0+x2-1, y0+y2-1);
line1 ++;
/**********GAOLINHUI,ADDED, 连续mark换行不mark空白部分***********************************/
tmpLine = line1+handle->pBrwInfo->dwTopLine;
col1 = 0;
if(GetLineInfo(handle, tmpLine, &LineInfo))
{
BrowserPosToLineCol(handle, LineInfo.pLinePtr, &tmpLine, &col1);
}
/***************************************************************************/
BrowserLineColToXY(handle,line1,col1,&x1,&y1);
}
}
GraphEnableRefresh();
}
/************************************************************************/
/* 函数名称: BrowserDrawUnderLine */
/* 函数描述: 画下划线 */
/* 当前版本: 1.0 */
/* 作 者: gaolinhui */
/* 输入参数: */
/* handle - 对象句柄 */
/* pStart - 数据指针 */
/* len - 数据长度 */
/* mode - 方式 */
/* 输出参数: */
/* NONE */
/* 返回值 : */
/* 起始位置 */
/* 更改记录: */
/* =====================================================================*/
/* 日期 人员 版本 描述 */
/* =====================================================================*/
/* 2006-3-1 gaolinhui 1.0 创建 */
/************************************************************************/
VOID BrowserDrawUnderLine(MBrowser *handle,UINT8 *pStart,
UINT32 len,UINT mode)
{
UINT8 *pEnd;
UINT32 line1,line2,line;
UINT16 col1,col2;
UINT16 x1,x2,y1,y2;
UINT16 x0,y0;
MLineInfo LineInfo;
/*控件起始坐标*/
x0 = handle->pBrwInfo->nX;
y0 = handle->pBrwInfo->nY;
pEnd = pStart + len;
BrowserPosToLineCol(handle,pStart,&line1,&col1);
if (line1 < handle->pBrwInfo->dwTopLine)
{
return;
}
line2 = line1;
col2 = col1;
BrowserPendToLineCol(handle,pStart,pEnd,&line2,&col2);
if (line2 < handle->pBrwInfo->dwTopLine)
{
return;
}
line = line1;
GetLineInfo(handle, line, &LineInfo);
line1 -= handle->pBrwInfo->dwTopLine;
line2 -= handle->pBrwInfo->dwTopLine;
BrowserLineColToXY(handle,line1,col1,&x1,&y1);
GraphDisableRefresh();
while (1)
{
UINT16 wPenStyle;
if (line1 == line2)
{
BrowserLineColToXY(handle,line2,col2,&x2,&y2);
y1 += LineInfo.wFontMaxHi;
y2 = y1;
switch (mode)
{
/*实下划线*/
case BROWSER_STATE_UNDERLINE:
GraphDrawLine(x0+x1,y0+y1,x0+x2,y0+y2);
y1 ++;
y2 ++;
GraphDrawLine(x0+x1,y0+y1,x0+x2,y0+y2);
break;
case BROWSER_STATE_DASHLINE:
wPenStyle = GraphSetPenColor(PS_DOT);
GraphDrawLine(x0+x1,y0+y1,x0+x2,y0+y2);
GraphSetPenColor(PS_SOLID);
break;
case NULL:
y2 ++;
GraphClearRect(x0+x1,y0+y1,x0+x2,y0+y2);
break;
}
break;
}
else
{
UINT8 *ps,*pe;
UINT32 l;
UINT16 c;
ps = BrowserLineColToPos(handle,line1 + handle->pBrwInfo->dwTopLine,0);
pe = BrowserLineColToPos(handle,line1 + handle->pBrwInfo->dwTopLine + 1,0);
BrowserPendToLineCol(handle,ps,pe,&l,&c);
l -= handle->pBrwInfo->dwTopLine;
BrowserLineColToXY(handle,l,c,&x2,&y2);
y1 += LineInfo.wFontMaxHi;
y2 = y1;
switch (mode)
{
/*实下划线*/
case BROWSER_STATE_UNDERLINE:
GraphDrawLine(x0+x1,y0+y1,x0+x2,y0+y2);
y1 ++;
y2 ++;
GraphDrawLine(x0+x1,y0+y1,x0+x2,y0+y2);
break;
case BROWSER_STATE_DASHLINE:
wPenStyle = GraphSetPenColor(PS_DOT);
GraphDrawLine(x0+x1,y0+y1,x0+x2,y0+y2);
GraphSetPenColor(PS_SOLID);
break;
case NULL:
y2 ++;
GraphClearRect(x0+x1,y0+y1,x0+x2,y0+y2);
break;
}
line1 ++;
line++;
GetLineInfo(handle, line, &LineInfo);
BrowserLineColToXY(handle,line1,0,&x1,&y1);
}
}
GraphEnableRefresh();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -