return;
}
+HWND CCommentView::Create(HWND hWndParent){
+ HWND rslt = __super::Create(hWndParent,menuOrID);
+ PAINTSTRUCT ps;
+ HDC hdc = header.BeginPaint(&ps);
+ SIZE size;
-VOID CCommentView::OnHeaderTrack(){
+ HFONT hOld = (HFONT)SelectObject(hdc,hHeaderFontNew);
+ LPTSTR columns[] = {TEXT("\83R\83\81\94Ô"),TEXT("\83\86\81[\83U\81[\96¼"),TEXT("\83R\83\81\83\93\83g"),TEXT("\8e\9e\8aÔ"),TEXT("\8fî\95ñ")};
+ UINT_PTR holizenSize[] = {0,0,100,0,0};
+
+ for(UINT_PTR index = 0;index < ARRAY_LENGTH(columns) ;++index){
+
+ GetTextExtentPoint32(hdc , columns[index] , _tcslen(columns[index]) , &size);
+ UINT_PTR holsize = holizenSize[index] + size.cx + 15;
+ holizenSize[index] = viewproperty.headerholSize[index] >= 0 ? viewproperty.headerholSize[index] : holsize;
+ columnHolSizeSum += holsize > holizenSize[index] ? holsize : holizenSize[index];
+ }
+
+ SelectObject(hdc,hOld);
+
+ header.EndPaint(&ps);
+
+
+ HEADERSINFO headersinfo = {columns,holizenSize,ARRAY_LENGTH(columns)};
+
+ AddHeader(&headersinfo);
+
+
+
+
+
+ return rslt;
+}
+
+
+
+VOID CCommentView::OnHeaderItemChanged(){
+
+ RECT headerSizeRect;
+ header.GetClientRect(&headerSizeRect);
Lock();
CPen outLinePenSelect;
CPen colLinePen;
+
enum{
NO,
USERNAME,
bkBurushNomal.DeleteObject();
}
bkBurushNomal.CreateSolidBrush(viewproperty.backColor);
-
-
-
-
return;
}
- HWND Create(HWND hWndParent){
-
- HWND rslt = __super::Create(hWndParent,menuOrID);
-
- PAINTSTRUCT ps;
- HDC hdc = header.BeginPaint(&ps);
- SIZE size;
-
- HFONT hOld = (HFONT)SelectObject(hdc,hHeaderFontNew);
-
- LPTSTR columns[] = {TEXT("\83R\83\81\94Ô"),TEXT("\83\86\81[\83U\81[\96¼"),TEXT("\83R\83\81\83\93\83g"),TEXT("\8e\9e\8aÔ"),TEXT("\8fî\95ñ")};
- UINT_PTR holizenSize[] = {0,0,100,0,0};
-
- for(UINT_PTR index = 0;index < ARRAY_LENGTH(columns) ;++index){
-
- GetTextExtentPoint32(hdc , columns[index] , _tcslen(columns[index]) , &size);
- UINT_PTR holsize = holizenSize[index] + size.cx + 15;
- holizenSize[index] = viewproperty.headerholSize[index] >= 0 ? viewproperty.headerholSize[index] : holsize;
- columnHolSizeSum += holsize > holizenSize[index] ? holsize : holizenSize[index];
- }
-
- SelectObject(hdc,hOld);
-
- header.EndPaint(&ps);
-
-
- HEADERSINFO headersinfo = {columns,holizenSize,ARRAY_LENGTH(columns)};
-
- AddHeader(&headersinfo);
-
-
-
- return rslt;
- }
+ HWND Create(HWND hWndParent);
public:
UINT_PTR GetColumnHolSizeSum(){
commentlist.OnConnect();
listBox.SetRedraw(FALSE);
listBox.ResetContent();
-
}
+
VOID SetStreamStatus(StreamStatus &st);
VOID OnDrawList(LPDRAWITEMSTRUCT lpDrawItemStruct);
- VOID OnHeaderTrack();
+ VOID OnHeaderItemChanged();
VOID OnListBoxDoubleClick();
const UINT headerID;
const UINT listBoxID;
HFONT hHeaderFontNew;
+ UINT_PTR horizonSize;
public:
CListViewEx():
headerID(NLITE_HEADER_ID),
listBoxID(NLITE_LIST_ID),
- t((TBase*)this)
+ t((TBase*)this),
+ horizonSize(0)
{
LOGFONT lf = {0};
}
-
-
-
DECLARE_WND_CLASS(LISTVIEW_EX)
//\83\81\83b\83Z\81[\83W\83}\83b\83v
MSG_WM_MEASUREITEM(OnMersureItem)
MSG_WM_SIZING(OnSizing)
MSG_WM_SIZE(OnSize)
+ MSG_WM_ERASEBKGND(OnEraseBkgnd)
COMMAND_CODE_HANDLER_EX(LBN_DBLCLK,OnListBoxDoubleClick)
- NOTIFY_CODE_HANDLER_EX(HDN_ENDDRAG ,OnHeaderEndDrag)
- NOTIFY_CODE_HANDLER_EX(HDN_ENDTRACK ,OnHeaderEndTrack)
-
+ NOTIFY_CODE_HANDLER_EX(HDN_ITEMCHANGED ,OnheaderItemChanged)
+ NOTIFY_CODE_HANDLER_EX(HDN_ENDDRAG ,OnHeaderEndDrag)
END_MSG_MAP()
+
- //\83T\83C\83Y\95Ï\8dX\92\86
- VOID OnSizing(UINT wParam,LPRECT lParam){
+ //\83T\83C\83Y\95Ï\8dX\92\86
+ VOID OnSizing(UINT wParam,LPRECT lParam){
- RECT client;
- GetClientRect(&client);
+ RECT client;
+ GetClientRect(&client);
- ChangeSize( _WTYPES_NS::CSize(client.right - client.left,client.bottom - client.top));
- return;
+ ChangeSize( _WTYPES_NS::CSize(client.right - client.left,client.bottom - client.top));
- }
-
- //\83T\83C\83Y\95Ï\8dX\8cã
- LRESULT OnSize(UINT wParam,SIZE lParam){
- ChangeSize(lParam);
- return 0;
- }
+
+ return;
+
+ }
- //\83T\83C\83Y\95Ï\8dX\8f\88\97\9d
- VOID ChangeSize(const SIZE& client){
+ //\83T\83C\83Y\95Ï\8dX\8cã
+ LRESULT OnSize(UINT wParam,SIZE lParam){
+ ChangeSize(lParam);
+
+ return 0;
+ }
- header.MoveWindow(0 , 0,client.cx , headerHaight );
- listBox.MoveWindow(0,headerHaight,client.cx,client.cy - headerHaight);
+ //\83T\83C\83Y\95Ï\8dX\8f\88\97\9d
+ VOID ChangeSize(const SIZE& client){
+
+ header.MoveWindow(0 , 0,client.cx , headerHaight );
+ listBox.MoveWindow(0,headerHaight,client.cx,client.cy - headerHaight);
- return;
- }
+ return;
+ }
+
+ //\83`\83\89\83c\83L\82ð\82È\82\82·
+ LRESULT OnEraseBkgnd(HDC wParam){
+ return TRUE;
+ }
- VOID OnDestroy(){
- m_hWnd;
- header.DestroyWindow();
- listBox.DestroyWindow();
- return;
-
- }
+ VOID OnDestroy(){
+ m_hWnd;
+ header.DestroyWindow();
+ listBox.DestroyWindow();
+ return;
+ }
- LRESULT OnHeaderEndDrag(LPNMHDR lParam){
+ LRESULT OnheaderItemChanged(LPNMHDR lParam){
- if(lParam->hwndFrom == header.m_hWnd){
+ if(lParam->hwndFrom == header.m_hWnd){
- listBox.InvalidateRect(NULL,TRUE);
+ t->OnHeaderItemChanged();
+ }
+ return 0;
}
- return 0;
- }
+ LRESULT OnHeaderEndDrag(LPNMHDR lParam){
+ if(lParam->hwndFrom == header.m_hWnd){
- LRESULT OnListBoxDoubleClick(UINT uNotifyCode, int nID, CWindow wndCtl){
+ listBox.InvalidateRect(NULL,TRUE);
+ }
-
- if(wndCtl.m_hWnd == listBox.m_hWnd){
-
- t->OnListBoxDoubleClick();
+ return 0;
}
- return 0;
- }
- LRESULT OnHeaderEndTrack(LPNMHDR lParam){
+ LRESULT OnListBoxDoubleClick(UINT uNotifyCode, int nID, CWindow wndCtl){
- if(lParam->hwndFrom == header.m_hWnd){
- t->OnHeaderTrack();
- }
+
+ if(wndCtl.m_hWnd == listBox.m_hWnd){
- return 0;
+ t->OnListBoxDoubleClick();
+ }
+
+ return 0;
+ }
- }
- LRESULT OnCreate(LPCREATESTRUCT lpcs){
- header.Create(m_hWnd,0,WC_HEADER,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | HDS_BUTTONS | HDS_HOTTRACK | HDS_DRAGDROP ,0,headerID);
- listBox.Create(m_hWnd,0,WC_LISTBOX,WS_CHILD | WS_VISIBLE| WS_HSCROLL | WS_VSCROLL | WS_CLIPCHILDREN | LBS_OWNERDRAWVARIABLE | LBS_NOTIFY | LBS_NOREDRAW ,0,listBoxID);
- listBox.SetFont(AtlGetDefaultGuiFont());
+ LRESULT OnCreate(LPCREATESTRUCT lpcs){
+ header.Create(m_hWnd,0,WC_HEADER,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | HDS_BUTTONS | HDS_HOTTRACK | HDS_DRAGDROP ,0,headerID);
+ listBox.Create(m_hWnd,0,WC_LISTBOX,WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_CLIPCHILDREN | LBS_OWNERDRAWVARIABLE | LBS_NOTIFY | LBS_NOREDRAW ,0,listBoxID);
+ listBox.SetFont(AtlGetDefaultGuiFont());
- return 0;
- }
+
+ return 0;
+ }
protected:
HWND Create(HWND hWndParent,ATL::_U_MENUorID menuOrID){
-
- HWND rslt = __super::Create(hWndParent,0,LISTVIEW_EX,WS_VISIBLE | WS_CHILD | WS_BORDER,0,menuOrID);
- if(rslt == NULL){
-
- throw AppInitException(__LINE__,TEXT(__FILE__));
- }
-
-
-
-
-
-
- return rslt;
+ return __super::Create(hWndParent,0,LISTVIEW_EX,WS_VISIBLE | WS_CHILD | WS_HSCROLL | WS_BORDER,0,menuOrID);
}
- VOID AddHeader(LPHEADERSINFO infos){
+ UINT_PTR AddHeader(LPHEADERSINFO infos){
header.SetFont(hHeaderFontNew);
HDITEM item;
item.mask = HDI_FORMAT | HDI_TEXT | HDI_WIDTH;
item.fmt = HDF_CENTER | HDF_STRING;
-
+
for(UINT_PTR index = 0;index < infos->count ;++index){
item.pszText = infos->columns[index];
item.cxy = infos->holizensize[index];
-
+ horizonSize += infos->holizensize[index];
header.InsertItem(index,&item);
}
+
+ SCROLLINFO scrollInfo = {0};
+ scrollInfo.fMask = SIF_RANGE | SIF_POS;
+ scrollInfo.nMax = horizonSize;
+
+
+ this->SetScrollInfo(SB_HORZ,&scrollInfo,TRUE);
+ return horizonSize;
}
VOID OnMersureItem(UINT wParam, LPMEASUREITEMSTRUCT lParam){