namespace nlite{
-const static SIZE commentColorBoxSize = {33,0};
+const static SIZE commentColorBoxSize = {35,0};
const static LPCTSTR ANONYMOUS_BOTTONSTRING = TEXT("184");
const static LPCTSTR WRITE_BOTTONSTRING = TEXT("\8f\91\82«\8d\9e\82Ý");
-
+const static LPCTSTR CHECKBUTTON_HIDDENSTRING = TEXT(" ");
const static RECT COMMENTWRITEWINDOW_SEPARATEFSIZE = {0,5,0,5};
const static UINT_PTR COMMENTWRITEWINDOW_SIDESEPARATESIZE = 5;
const static UINT_PTR INIT_COMMENTWRITE_MAXLENGTH = 60;
-//const static UINT_PTR COMBOBOX_BUTTON_WIDTH = 15;
-
-//const static COLORREF MAX_COLOR = ((COLORREF)-1);
+const static UINT_PTR CHECKBUTTON_SUBSCRIPT_HEIGHT = 10;
const static COLORREF MAX_COLOR = 0xFFFFFF;
{TEXT("cyan"),RGB(0x00,0xFF,0xFF)},
{TEXT("blue"),RGB(0x00,0x00,0xFF)},
{TEXT("purple"),RGB(0xC0,0x00,0xFF)},
- {TEXT("black"),RGB(0x00,0x00,0x00)}
+
};
const CommentColorInfo premiumUser::COMMENT_COLORLIST[] = {
+ {TEXT("black"),RGB(0x00,0x00,0x00)},
{TEXT("white2"),RGB(0xCC,0xCC,0x99)},
{TEXT("red2"),RGB(0xCC,0x00,0x33)},
{TEXT("pink2"),RGB(0xFF,0x33,0xCC)},
{TEXT("green2"),RGB(0x00,0xCC,0x66)},
{TEXT("cyan2"),RGB(0x00,0xCC,0xCC)},
{TEXT("blue2"),RGB(0x33,0x99,0xFF)},
- {TEXT("purple2"),RGB(0x66,0x33,0xCC)},
- {TEXT("black2"),RGB(0x66,0x66,0x66)}
+ {TEXT("purple2"),RGB(0x66,0x33,0xCC)}
+// {TEXT("black2"),RGB(0x66,0x66,0x66)}
};
const CommentSizeInfo generalUser::COMMENT_SIZELIST[] = {
CCommentWriteWindow::CCommentWriteWindow():
commentWriteHeight(0),
commentWriteInternalHeight(0),
-commentWriteMaxLength(INIT_COMMENTWRITE_MAXLENGTH)
-{}
+commentWriteMaxLength(INIT_COMMENTWRITE_MAXLENGTH){
+
+}
commentColorBox.SetFont(AtlGetDefaultGuiFont());
- anonymousButton.SetWindowTextW(ANONYMOUS_BOTTONSTRING);
+ anonymousButton.SetWindowTextW(CHECKBUTTON_HIDDENSTRING);
anonymousButton.SetFont(AtlGetDefaultGuiFont());
commentEdit.SetFont(AtlGetDefaultGuiFont());
commentEdit.SetLimitText(commentWriteMaxLength);
SIZE thisSize;
LPCTSTR sample = TEXT(" ");
GetTextExtentPoint32(pdc,sample,_tcslen(sample),&thisSize);
- commentWriteHeight = thisSize.cy + COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom;
+ commentWriteHeight = thisSize.cy + (CHECKBUTTON_SUBSCRIPT_HEIGHT / 2) + COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom;
commentWriteInternalHeight = commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom);
return 0;
}
VOID CCommentWriteWindow::OnPaint(HDC hdc){
CPaintDC pdc(*this);
+ RECT clientRect;
+ this->GetClientRect(&clientRect);
+
+ pdc.FillRect(&clientRect,COLOR_BTNFACE);
+
+
+ RECT anonymousRect;
+ SIZE anonymousStringSize;
- pdc.FillRect(&pdc.m_ps.rcPaint,COLOR_BTNFACE);
+ anonymousButton.GetWindowRect(&anonymousRect);
+ CPoint anonymousPoint(anonymousRect.left,anonymousRect.top);
+ ::ScreenToClient(*this,&anonymousPoint);
+ anonymousRect.right -= anonymousRect.left;
+ anonymousRect.bottom -= anonymousRect.top;
+ anonymousRect.left = anonymousPoint.x;
+ anonymousRect.top = anonymousPoint.y + anonymousRect.bottom;
+
+ ::GetTextExtentPoint32(pdc,ANONYMOUS_BOTTONSTRING,_tcslen(ANONYMOUS_BOTTONSTRING),&anonymousStringSize);
+ anonymousRect.right = anonymousRect.left + anonymousStringSize.cx;
+ anonymousRect.bottom = anonymousRect.top + anonymousStringSize.cy;
+
+ LOGFONT anonymousLogFont = {0};
+ anonymousLogFont.lfHeight = CHECKBUTTON_SUBSCRIPT_HEIGHT;
+ anonymousLogFont.lfCharSet = SHIFTJIS_CHARSET;
+
+ CFont anonymousFont = CreateFontIndirect(&anonymousLogFont);
+ pdc.SelectFont(anonymousFont);
+ pdc.DrawText(ANONYMOUS_BOTTONSTRING,_tcslen(ANONYMOUS_BOTTONSTRING),&anonymousRect,0);
+
return;
}
RECT commentEditRect;
RECT commentWriteButtonRect;
-
-
-
+ RECT thisWindowRect;
+ this->GetWindowRect(&thisWindowRect);
commentPosBoxRect.left = COMMENTWRITEWINDOW_SIDESEPARATESIZE;
this->commentPosBoxCS.Lock();
commentColorBoxRect.left = commentSizeBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
commentColorBoxRect.right = commentColorBoxRect.left + commentColorBoxSize.cx;
+ CDC cdc(anonymousButton.GetDC());
+ SIZE anonymousStringSize;
+ ::GetTextExtentPoint32(cdc,CHECKBUTTON_HIDDENSTRING,_tcslen(CHECKBUTTON_HIDDENSTRING),&anonymousStringSize);
+
anonymousButtonRect.left = commentColorBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
- anonymousButtonRect.right = anonymousButtonRect.left + commentAnonymousButtonSize.cx;
+ anonymousButtonRect.right = anonymousButtonRect.left + commentAnonymousButtonSize.cx - anonymousStringSize.cx;
commentEditRect.left = anonymousButtonRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
//\88Ú\93®\8f\88\97\9d
HDWP hDwp = BeginDeferWindowPos(6);
- commentPosBox.DeferWindowPos(hDwp,NULL,
+ commentPosBox.DeferWindowPos(hDwp,*this,
commentPosBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentPosBoxRect.right - commentPosBoxRect.left,commentWriteInternalHeight,
SWP_NOZORDER);
- commentSizeBox.DeferWindowPos(hDwp,NULL,
+
+ commentSizeBox.DeferWindowPos(hDwp,*this,
commentSizeBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentSizeBoxRect.right - commentSizeBoxRect.left,commentWriteInternalHeight,
SWP_NOZORDER);
- commentColorBox.DeferWindowPos(hDwp,NULL,
+ commentColorBox.DeferWindowPos(hDwp,*this,
commentColorBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentColorBoxRect.right - commentColorBoxRect.left,commentWriteInternalHeight,
SWP_NOZORDER);
- anonymousButton.DeferWindowPos(hDwp,NULL,
- anonymousButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,anonymousButtonRect.right - anonymousButtonRect.left,commentWriteInternalHeight,
+ anonymousButton.DeferWindowPos(hDwp,*this,
+ anonymousButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,anonymousButtonRect.right - anonymousButtonRect.left,commentWriteInternalHeight - CHECKBUTTON_SUBSCRIPT_HEIGHT,
SWP_NOZORDER);
-
- commentEdit.DeferWindowPos(hDwp,NULL,
+ commentEdit.DeferWindowPos(hDwp,*this,
commentEditRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentEditRect.right - commentEditRect.left,commentWriteInternalHeight,
SWP_NOZORDER);
- commentWriteButton.DeferWindowPos(hDwp,NULL,
+ commentWriteButton.DeferWindowPos(hDwp,*this,
commentWriteButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentWriteButtonRect.right - commentWriteButtonRect.left,commentWriteInternalHeight,
SWP_NOZORDER);
INT_PTR curselNo = commentColorBox.GetCurSel();
CDCHandle dcHandle = lParam->hDC;
CBrush bkBrush;
+ const UINT_PTR width = 1;
+ drawRect.left += width;
+ drawRect.top += width;
+ drawRect.right -= width;
+ drawRect.bottom -= width;
- drawRect.left += 2;
- drawRect.top += 2;
- drawRect.right -= 2;
- drawRect.bottom -= 2;
if(lParam->itemID == ((UINT)-1)){
-
-
itemNo = curselNo == CB_ERR ? 0 : curselNo;
-
-
} else {
itemNo = lParam->itemID;
-
-
-
-
-
-
}
CommentInfo<COLORREF> &commentColor = *(CommentInfo<COLORREF> *)commentColorBox.GetItemDataPtr(itemNo);
CPen cpen;
brush.CreateSolidBrush(commentColor.userData);
+ dcHandle.SelectBrush(brush);
dcHandle.FillRect(&lParam->rcItem,bkBrush);
dcHandle.SelectBrush(brush);
dcHandle.SelectPen((HPEN)::GetStockObject(BLACK_PEN));
- dcHandle.FillRect(&drawRect,brush);
+ dcHandle.Rectangle(&drawRect);
}
return;
}
+LRESULT CCommentWriteWindow::OnEraseBkGnd(HDC wParam){
+
+ return TRUE;
+}
+
VOID CCommentWriteWindow::OnMeasureItem(UINT wParam,LPMEASUREITEMSTRUCT lParam){
switch(lParam->CtlID){
CCommentList &commentList = self.commentlist;
-
-
-
+ BOOL selectFlag = FALSE;
+ CCommentList::iterator selectData;
+ RECT selectRect = {0};
if(commentList.Size() > (UINT_PTR)self.viewStartHeight){
- clock_t start,sum = 0;;
+
CCommentList::iterator chatData = commentList.begin();
std::advance(chatData,self.viewStartHeight);
baseBkBrush.DeleteObject();
CCommentList::iterator endData = commentList.end();
listRect.bottom = 0;
+
+ CPen outLinePen;
+ outLinePen.CreatePen(PS_SOLID,1,ColorList::outLineNomal);
+ mdc.SelectPen(outLinePen);
+ mdc.MoveTo(listRect.right,listRect.top);
+ mdc.LineTo(listRect.right,listRect.bottom);
+
+
for(;chatData != endData && listRect.top < clientRect.bottom;++chatData){
listRect.bottom += CalcItemHeight(*chatData);
- start = clock();
- this->DrawItem(mdc,listRect,*chatData);
- sum += clock() - start;
+
+ if(chatData->selectFlag == TRUE){
+ selectFlag = TRUE;
+ selectData = chatData;
+ selectRect = listRect;
+ } else {
+
+ this->DrawItem(mdc,listRect,*chatData);
+ }
listRect.top = listRect.bottom;
}
-
+ mdc.SelectPen(outLinePen);
+ mdc.MoveTo(listRect.left,listRect.bottom);
+ mdc.LineTo(listRect.right,listRect.bottom);
+
+ if(selectFlag == TRUE){
+ this->DrawItem(mdc,selectRect,*selectData);
+ }
+
}
outLinePen.CreatePen(PS_SOLID,1,outLineColor);
bkBrush.CreateSolidBrush(bkColor);
- dc.SelectBrush(bkBrush);
dc.SelectPen(outLinePen);
- dc.Rectangle(&rc);
+
+ if(chatData.selectFlag == TRUE){
+
+ dc.MoveTo(rc.left,rc.bottom);
+ dc.LineTo(rc.right,rc.bottom);
+ }
+ dc.FillRect(&rc,bkBrush);
dc.SetBkColor(bkColor);
- //\83e\83L\83X\83g\82Ì\83J\83\89\81[\82ð\90Ý\92è
- dc.SetTextColor(self.viewproperty.baseStringColor);
+ dc.MoveTo(rc.left,rc.top);
+ dc.LineTo(rc.right,rc.top);
+
+ dc.SetTextColor(self.viewproperty.baseStringColor);
+
tabctrl.MoveWindow(tabWindowRect.left,tabWindowRect.top,tabWindowRect.right - tabWindowRect.left ,tabWindowRect.bottom - tabWindowRect.top);
- commentWriteWindow.MoveWindow(commentWriteWindowRect.left,commentWriteWindowRect.top,commentWriteWindowRect.right - commentWriteWindowRect.left ,commentWriteWindowRect.bottom - commentWriteWindowRect.top);
+
tabctrl.GetClientRect(&commentViewRect);
tabctrl.AdjustRect(FALSE,&commentViewRect);
commentView.MoveWindow(commentViewRect.left, commentViewRect.top,commentViewRect.right - commentViewRect.left, commentViewRect.bottom - commentViewRect.top);
-
-
+ commentWriteWindow.MoveWindow(commentWriteWindowRect.left,commentWriteWindowRect.top,commentWriteWindowRect.right - commentWriteWindowRect.left ,commentWriteWindowRect.bottom - commentWriteWindowRect.top);
+ tabctrl.SetWindowPos(*this,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
+ commentWriteWindow.SetWindowPos(*this,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
return;
}
tabctrl.Create(m_hWnd,0,NULL,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_DLGFRAME );
commentView.Create(tabctrl.m_hWnd);
- commentWriteWindow.Create(m_hWnd,0,COMMENTWRITEWINDOW,WS_CHILD | WS_VISIBLE );
+ commentWriteWindow.Create(m_hWnd,0,NULL,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN );
CreateSimpleReBar();
HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd,IDC_NLITE, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);
lvNoCombo.Create(m_hWnd, CRect(0, 0, 100, 100), NULL,WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWN , 0, IDC_COMBO_REBAR);
AddSimpleReBarBand(lvNoCombo,TEXT("\95ú\91\97URL"));
SizeSimpleReBarBands();
- //tabctrl.SetWindowPos(HWND_BOTTOM,0,0,0,0,SWP_SHOWWINDOW);
+ //tabctrl.SetWindowPos(*this,0,0,0,0,SWP_SHOWWINDOW);
tabctrl.SetFont(hTabFont);
tabctrl.AddItem(TCIF_TEXT | TCIF_PARAM, _T("\83R\83\81\83\93\83g\88ê\97\97"), 0, (DWORD)commentView.m_hWnd);