欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
Vertical lines for column borders
http://www.codeguru.com/Cpp/controls/listview/gridlines/article.php/c999/

void CMyListCtrl::OnPaint()
{
// First let the control do its default drawing.
const MSG *msg = GetCurrentMessage();
DefWindowProc( msg->message, msg->wParam, msg->lParam );

// Draw the lines only for LVS_REPORT mode
if( (GetStyle() & LVS_TYPEMASK) == LVS_REPORT )
{
// Get the number of columns
CClientDC dc(this );
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
int nColumnCount = pHeader->GetItemCount();

// The bottom of the header corresponds to the top of the line
RECT rect;
pHeader->GetClientRect( &rect );
int top = rect.bottom;

// Now get the client rect so we know the line length and
// when to stop
GetClientRect( &rect );

// The border of the column is offset by the horz scroll
int borderx = 0 - GetScrollPos( SB_HORZ );
for( int i = 0; i < nColumnCount; i++ )
{
// Get the next border
borderx += GetColumnWidth( i );

// if next border is outside client area, break out
if( borderx >= rect.right ) break;

// Draw the line.
dc.MoveTo( borderx-1, top);
dc.LineTo( borderx-1, rect.bottom );
}
}

// Do not call CListCtrl::OnPaint() for painting messages
}
To draw the vertical lines, we use the header control to determine thecolumn dimensions and also the effective client area after taking intoaccount the header control itself. Finally, we draw a line to the rightof each column.

Note that the horizontal scrollbars position is taken into account whendetermining the border. If we dont do this, we might end up with a lineright in the middle of a column when the list has been horizontally scrolled.The GetScrollPos() function returns 0 if there is no scrollbar so we dontneed to make a prior check on whether the list view control does have ahorizontal scrollbar. We could also have used GetItemRect() function, butit works only if the list has atleast one item.

The line is actually drawn one pixel left of the column border. Thisaligns it better with the column header. It also introduces a bug. Whenyou increase a column width, the column area below the last visible itemis not updated, thus leaving traces of the previous line. There are twoapproaches you can take to resolve this. First, draw the line exactly onthe column border (e.i. do not subtract 1 from borderx). The second approachis to handle the HDN_TRACK notification from the header controland invalidate the exposed area so that it gets redrawn.

Tools:


本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
用OpenCV和OCR識別圖片中的表格數據 !OpenCV簡(jiǎn)直太強大了!
pdfplumber說(shuō)明文檔翻譯
draw2d里面的一函數 translateToAbsolute(rect)
用EXCEL可多種辦法生成99乘法表
Heeseop Yoon 內飾繪畫(huà)藝術(shù)作品集
\vspace vs. \vskip
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久