46 KanjiCode = CODE_SJIS;
54 DEBUG_INFO(
"DESTRUCTOR: CLogWndView: START\n");
58 DEBUG_INFO(
"DESTRUCTOR: CLogWndView: END\n");
75 CSize sizeTotal(100, 100);
76 CSize sizeLine(m_FontSizeX, m_FontSizeY);
78 SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine);
80 BOOL ret = CScrollView::PreCreateWindow(cs);
104 if (pRB->getMaxLineY()==0)
return;
108 while (!
lock.IsLocked()) {
117 pDC->GetClipBox(&rc);
122 for (
int i=nLineBegin; i<nLineEnd; i++) {
123 Buffer buf = pRB->getRingBuffer(i);
124 if (buf.buf==NULL)
break;
127 pDC->SetBkColor(RGB(200,200,200));
130 pDC->SetBkColor(RGB(255,255,255));
133 if (buf.state==LOG_RB_WARNING) {
134 pDC->SetTextColor(RGB(20,20,200));
136 else if (buf.state==LOG_RB_ERROR) {
137 pDC->SetTextColor(RGB(200,20,20));
139 else if (buf.state==LOG_RB_DEBUG) {
140 pDC->SetTextColor(RGB(20,150,20));
142 else if (buf.state==LOG_RB_INFO) {
143 pDC->SetTextColor(RGB(20,150,150));
146 pDC->SetTextColor(RGB(0,0,0));
150 CString outtext =
mbs2ts((
char*)buf.buf);
159 pDC->SelectObject(pOldFontX);
165 int lastPos = pRB->getLastPosition();
174 pt.y = (lastPos+1)*
m_FontSizeY - rc.bottom + rc.top;
175 if (pt.y<0) pt.y = 0;
177 ScrollToPosition(pt);
186 if (pRB->getMaxLineY()==0 || pRB->getMaxLineX()==0)
return;
200 SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine);
217 dc.GetTextMetrics(&tm);
219 m_FontSizeX = dc.GetTextExtent(CString(
'0', 1)).cx;
230 SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine);
244 while (!
lock.IsLocked()) {
257 SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine);
263 ScrollToPosition(pt);
267 InvalidateRect(NULL, TRUE);
278 pFrame->SetWindowText(title);
279 pDoc->SetTitle(title);
289 CScrollView::AssertValid();
296 CScrollView::Dump(dc);
303 ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(
CLogWndDoc)));
318 if (CScrollView::OnCreate(lpcs)==-1)
return -1;
320 CString fname, fsize;
323 int sz = ttoi(fsize);
337 CScrollView::OnDestroy();
347 CPoint scrlpos = GetScrollPosition();
348 m_msx = point.x + scrlpos.x;
349 m_msy = point.y + scrlpos.y;
358 if (point.x>=rc.left && point.x<=rc.right && point.y>rc.top && point.y<=rc.bottom) {
361 InvalidateRect(NULL, FALSE);
364 CScrollView::OnLButtonDown(nFlags, point);
372 CScrollView::OnLButtonUp(nFlags, point);
379 CPoint scrlpos = GetScrollPosition();
380 m_mex = point.x + scrlpos.x;
381 m_mey = point.y + scrlpos.y;
388 InvalidateRect(NULL, FALSE);
392 CScrollView::OnMouseMove(nFlags, point);
398 CString ret = _T(
"");
400 if (m_copysy < 0 || m_copysy >
m_copyey)
return ret;
407 Buffer buf = dup_Buffer(pRB->pBuf[i]);
408 if (pRB->getKindData(i)!=LOG_RB_BINARY_DATA) {
409 if (buf.buf[buf.vldsz-1]!=
'\n') cat_s2Buffer(
"\n", &buf);
412 ret = ret +
mbs2ts((
char*)buf.buf);
426 info.cbSize =
sizeof(SCROLLINFO);
427 info.fMask = SIF_TRACKPOS;
429 if (LOBYTE(nScrollCode)==SB_THUMBTRACK)
431 GetScrollInfo(SB_HORZ, &info);
432 nPos = info.nTrackPos;
435 if (HIBYTE(nScrollCode)==SB_THUMBTRACK)
437 GetScrollInfo(SB_VERT, &info);
438 nPos = info.nTrackPos;
441 return CScrollView::OnScroll(nScrollCode, nPos, bDoScroll);
virtual void OnInitialUpdate()
afx_msg void OnSize(UINT nType, int cx, int cy)
afx_msg BOOL OnEraseBkgnd(CDC *pDC)
CLogRingBuffer * ringBuffer
CCriticalSection criticalKey
afx_msg void OnDestroy(void)
afx_msg void OnDraw(CDC *pDC)
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
virtual void OnInitialUpdate()
BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll)
afx_msg void OnSize(UINT nType, int cx, int cy)
void SetTitle(LPCTSTR title)
afx_msg int OnCreate(LPCREATESTRUCT lpcs)
void setScrollPosition(CDC *pDC, CLogRingBuffer *pBR)
CString getCopyData(void)
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
CLogWndDoc * GetDocument() const
virtual void AssertValid() const
virtual void Dump(CDumpContext &dc) const
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
afx_msg BOOL OnEraseBkgnd(CDC *pDC)
void resetScrollSize(void)
CString mbs2ts(char *str)
#define IDS_STR_FONT_GOTHIC
#define IDS_STR_FONT_SIZE