namespace nlite{
-const static SIZE commentColorBoxSize = {35,0};
-
-const static LPCTSTR ANONYMOUS_MAILCOMMAND = TEXT("184");
-const static LPCTSTR ANONYMOUS_BOTTONSTRING = ANONYMOUS_MAILCOMMAND;
-
-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 CHECKBUTTON_SUBSCRIPT_HEIGHT = 10;
-
-const static COLORREF MAX_COLOR = 0xFFFFFF;
-
-const CommentColorInfo generalUser::COMMENT_COLORLIST[] = {
- {TEXT("white"),RGB(0xFF,0xFF,0xFF)},
- {TEXT("red"),RGB(0xFF,0x00,0x00)},
- {TEXT("pink"),RGB(0xFF,0x80,0x80)},
- {TEXT("orange"),RGB(0xFF,0xC0,0x00)},
- {TEXT("yellow"),RGB(0xFF,0xFF,0x00)},
- {TEXT("green"),RGB(0x00,0xFF,0x00)},
- {TEXT("cyan"),RGB(0x00,0xFF,0xFF)},
- {TEXT("blue"),RGB(0x00,0x00,0xFF)},
- {TEXT("purple"),RGB(0xC0,0x00,0xFF)},
-
-};
-
-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("orange2"),RGB(0xFF,0x66,0x00)},
- {TEXT("yellow2"),RGB(0x99,0x99,0x00)},
- {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)}
-};
-
-const CommentSizeInfo generalUser::COMMENT_SIZELIST[] = {
- {TEXT("\95\81\92Ê\81@"),TEXT("medium")},
- {TEXT("\8f¬\81@"),TEXT("small")}
-};
-
-const CommentSizeInfo premiumUser::COMMENT_SIZELIST[] = {
- {TEXT("\91å\81@"),TEXT("big")}
-};
-
-const CommentPosInfo generalUser::COMMENT_POSLIST[] = {
- {TEXT("\92Ê\8fí\81@"),TEXT("naka")}
-};
-
-const CommentPosInfo premiumUser::COMMENT_POSLIST[] = {
- {TEXT("\89º\81@"),TEXT("shita")},
- {TEXT("\8fã\81@"),TEXT("ue")}
-};
-
-
-template<typename T>
-static VOID addItemList(CComboBox &combo,T * colorList,UINT_PTR length){
-
- UINT_PTR startItemcount = combo.GetCount();
- for(UINT_PTR index = startItemcount; index < length;index++){
-
- combo.AddString(colorList[index - startItemcount].name);
- combo.SetItemDataPtr(index,(LPVOID)&colorList[index - startItemcount]);
+ const static SIZE commentColorBoxSize = {35,0}; //\90F\8c\88\92è\83R\83\93\83{\83{\83b\83N\83X\82Ì\83T\83C\83Y
+ const static LPCTSTR ANONYMOUS_MAILCOMMAND = TEXT("184"); //184\92è\90\94\95¶\8e\9a\97ñ
+ const static LPCTSTR ANONYMOUS_BOTTONSTRING = ANONYMOUS_MAILCOMMAND; //184\83\81\81[\83\8b\83R\83}\83\93\83h\92è\90\94\95¶\8e\9a\97ñ
+ const static LPCTSTR OWNERMODE_BOTTONSTRING = TEXT("\8eå\83R\83\81"); //\8eå\83R\83\81\91I\91ð\83{\83^\83\93\92è\90\94\95¶\8e\9a\97ñ
+ const static LPCTSTR WRITE_BOTTONSTRING = TEXT("\8f\91\82«\8d\9e\82Ý"); //\8f\91\82«\8d\9e\82Ý\83{\83^\83\93\92è\90\94\95¶\8e\9a\97ñ
+ const static COLORREF OWNEREDITCOLOR = RGB(255,192,192); //\8eå\83R\83\81\8f\91\82«\8d\9e\82Ý\83G\83f\83B\83b\83g\90F
+ const static COLORREF NORMALEDITCOLOR = RGB(255,255,255); //\83\8a\83X\83i\81[\8e\9e\82Ì\8f\91\82«\8d\9e\82Ý\83G\83f\83B\83b\83g\90F
+ const static RECT COMMENTWRITEWINDOW_SEPARATEFSIZE = {0,5,0,5}; //\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83E\83B\83\93\83h\83E\82Ì\8fã\89º\83X\83y\81[\83X
+ const static UINT_PTR COMMENTWRITEWINDOW_SIDESEPARATESIZE = 5; //\89¡\83X\83y\81[\83X\95\9d
+ const static UINT_PTR INIT_COMMENTWRITE_MAXLENGTH = 60; //\89º\8bL\95¶\8e\9a\97ñ\8dÅ\91å\92·
+ const static UINT_PTR CHECKBUTTON_SUBSCRIPT_HEIGHT = 10; //\91I\91ð\83{\83^\83\93\95¶\8e\9a\97ñ\82Ì\8d\82\82³
+ const static LPCTSTR DEFAULT_COMMENTCOLOR = TEXT("white"); //\8bK\92è\82Ì\83R\83\81\83\93\83g\90F
+ const static LPCTSTR DEFAULT_COMMENTSIZE = TEXT("medium"); //\8bK\92è\82Ì\83R\83\81\83\93\83g\95¶\8e\9a\97ñ
+ const static LPCTSTR DEFAULT_COMMENTPOS = TEXT("naka"); //\8bK\92è\82Ì\83R\83\81\83\93\83g\95\\8e¦\88Ê\92u
+
+
+
+ namespace generalUser{
+ const CommentColorInfo COMMENT_COLORLIST[] = {
+ {DEFAULT_COMMENTCOLOR,PALETTERGB(0xFF,0xFF,0xFF)}, //\94\92
+ {TEXT("red"),PALETTERGB(0xFF,0x00,0x00)}, //\90Ô
+ {TEXT("pink"),PALETTERGB(0xFF,0x80,0x80)}, //\83s\83\93\83N
+ {TEXT("orange"),PALETTERGB(0xFF,0xC0,0x00)}, //\83I\83\8c\83\93\83W
+ {TEXT("yellow"),PALETTERGB(0xFF,0xFF,0x00)}, //\89©\90F
+ {TEXT("green"),PALETTERGB(0x00,0xFF,0x00)}, //\97Î
+ {TEXT("cyan"),PALETTERGB(0x00,0xFF,0xFF)}, //\8a¦\90F
+ {TEXT("blue"),PALETTERGB(0x00,0x00,0xFF)}, //\90Â
+ {TEXT("purple"),PALETTERGB(0xC0,0x00,0xFF)}, //\8e\87
+
+ };
+
+ const CommentSizeInfo COMMENT_SIZELIST[] = {
+ {TEXT("\95\81\92Ê\81@"),DEFAULT_COMMENTSIZE}, //\95\81\92Ê\83T\83C\83Y
+ {TEXT("\8f¬\81@"),TEXT("small")} //\8f¬\83T\83C\83Y
+ };
+
+
+ const CommentPosInfo COMMENT_POSLIST[] = {
+ {TEXT("\92Ê\8fí\81@"),DEFAULT_COMMENTPOS} //\92Ê\8fí\95\\8e¦
+ };
+ }
+
+ namespace premiumUser{
+
+ const CommentColorInfo COMMENT_COLORLIST[] = {
+ {TEXT("black"),PALETTERGB(0x00,0x00,0x00)}, //\8d\95
+ {TEXT("white2"),PALETTERGB(0xCC,0xCC,0x99)}, //\94\92\82»\82Ì\82Q
+ {TEXT("red2"),PALETTERGB(0xCC,0x00,0x33)}, //\90Ô\82»\82Ì\82Q
+ {TEXT("pink2"),PALETTERGB(0xFF,0x33,0xCC)}, //\83s\83\93\83N\82»\82Ì\82Q
+ {TEXT("orange2"),PALETTERGB(0xFF,0x66,0x00)}, //\83I\83\8c\83\93\83W\82»\82Ì\82Q
+ {TEXT("yellow2"),PALETTERGB(0x99,0x99,0x00)}, //\89©\90F\82»\82Ì\82Q
+ {TEXT("green2"),PALETTERGB(0x00,0xCC,0x66)}, //\97Î\82»\82Ì\82Q
+ {TEXT("cyan2"),PALETTERGB(0x00,0xCC,0xCC)}, //\8a¦\90F\82»\82Ì\82Q
+ {TEXT("blue2"),PALETTERGB(0x33,0x99,0xFF)}, //\90Â\82»\82Ì\82Q
+ {TEXT("purple2"),PALETTERGB(0x66,0x33,0xCC)} //\8e\87\82»\82Ì\82Q
+ // {TEXT("black2"),PALETTERGB(0x66,0x66,0x66)} //\8d\95\82»\82Ì\82Q\82Í\82È\82¢\81H
+ };
+
+ const CommentSizeInfo COMMENT_SIZELIST[] = {
+ {TEXT("\91å\81@"),TEXT("big")} //\91å\83T\83C\83Y
+ };
+
+
+
+ const CommentPosInfo COMMENT_POSLIST[] = {
+ {TEXT("\89º\81@"),TEXT("shita")}, //\89º\82É\95\\8e¦
+ {TEXT("\8fã\81@"),TEXT("ue")} //\8fã\82É\95\\8e¦
+ };
+ }
+
+
+
+
+
+ template<typename T>
+ static VOID addItemList(CComboBox &combo,T * colorList,UINT_PTR length){
+
+ UINT_PTR startItemcount = combo.GetCount();
+ length+= startItemcount;
+ for(UINT_PTR index = startItemcount; index < length;index++){
+
+ combo.AddString(colorList[index - startItemcount].name);
+ combo.SetItemDataPtr(index,(LPVOID)&colorList[index - startItemcount]);
+
+ }
+
+ return;
+ }
+
+
+
+ template<typename T>
+ static UINT_PTR CalcComboBoxWidth(CComboBox &combo){
+
+ CPaintDC pdc(combo);
+ SIZE size;
+ UINT_PTR rslt = 0;
+ UINT_PTR itemCount = combo.GetCount();
+ LPCTSTR name;
+ for(UINT_PTR index = 0;index < itemCount;index++){
+ name = ((T*)combo.GetItemDataPtr(index))->name;
+ ::GetTextExtentPoint32(pdc,name,_tcslen(name),&size);
+ rslt = rslt < (UINT_PTR)size.cx ? size.cx : rslt;
+ }
+
+ return rslt;
+ }
+
+ CCommentWriteWindow::CCommentWriteWindow(CNicoLiveStream &in_nicoLiveStream):
+ commentWriteHeight(0),
+ commentWriteInternalHeight(0),
+ commentWriteMaxLength(INIT_COMMENTWRITE_MAXLENGTH),
+ nicoLiveStream(in_nicoLiveStream),
+ commentSubEdit(*this),
+ streamTime(0)
+ {}
+
+
+ BOOL CCommentWriteWindow::IsWrighthing(){
+
+ return this->commentSubEdit.untilConnectingFlag;
}
- return;
-}
+ UINT_PTR CCommentWriteWindow::GetHeight(){
+ return commentWriteHeight + infoDispHeight - COMMENTWRITEWINDOW_SEPARATEFSIZE.top;
+ }
-template<typename T>
-static UINT_PTR CalcComboBoxWidth(CComboBox &combo){
+ LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){
+
+ //\83E\83B\83\93\83h\83E\8dì\90¬\8f\88\97\9d
+
+ commentPosBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST ,0,COMMENTPOS_BOX);
+ commentSizeBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,0,COMMENTSIZE_BOX);
+ commentColorBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED ,0,COMMENTCOLOR_BOX);
+ anonymousButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | BS_PUSHLIKE,0,ANONYMOUS_BUTTON);
+ ownerModeButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD |BS_AUTOCHECKBOX | BS_PUSHLIKE,0,OWNERMODE_BUTTON);
+ commentSubEdit.Create(m_hWnd,0,WC_EDIT,WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL,0,COMMENT_EDIT);
+ commentWriteButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,0,COMMENTWRITE_BOTTON);
+ commentPosBox.SetFont(AtlGetDefaultGuiFont());
+ commentSizeBox.SetFont(AtlGetDefaultGuiFont());
+ commentColorBox.SetFont(AtlGetDefaultGuiFont());
+
+ //\83t\83H\83\93\83g\82Ì\90Ý\92è
+ anonymousButton.SetFont(AtlGetDefaultGuiFont());
+ commentSubEdit.SetFont(AtlGetDefaultGuiFont());
+ commentSubEdit.SetLimitText(commentWriteMaxLength);
+ commentWriteButton.SetWindowTextW(WRITE_BOTTONSTRING);
+ commentWriteButton.SetFont(AtlGetDefaultGuiFont());
+
+ commentSubEdit.SetWindowTextW(TEXT(""));
+
+ addItemList(commentColorBox,generalUser::COMMENT_COLORLIST,ARRAY_LENGTH(generalUser::COMMENT_COLORLIST));
+ addItemList(commentSizeBox,generalUser::COMMENT_SIZELIST,ARRAY_LENGTH(generalUser::COMMENT_SIZELIST));
+ addItemList(commentPosBox,generalUser::COMMENT_POSLIST,ARRAY_LENGTH(generalUser::COMMENT_POSLIST));
+ commentColorBox.SetCurSel(0);
+ commentSizeBox.SetCurSel(0);
+ commentPosBox.SetCurSel(0);
+ CFontHandle font;
+ font = AtlGetDefaultGuiFont();
+ CPaintDC pdc(*this);
+ SIZE thisSize;
+
+ //\83E\83B\83\93\83h\83E\82Ì\8d\82\82³\82ð\8b\81\82ß\82é
+ LPCTSTR sample = TEXT(" ");
+ GetTextExtentPoint32(pdc,sample,_tcslen(sample),&thisSize);
+ commentWriteHeight = thisSize.cy + COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom;
+ infoDispHeight = commentWriteHeight;
+ commentWriteInternalHeight = commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom);
+
+ //\83v\83b\83V\83\85\83\89\83C\83N\83{\83^\83\93\82Ì\83t\83H\83\93\83g\82ð\8c\88\82ß\82é
+ LOGFONT anonymousLogFont = {0};
+ anonymousLogFont.lfHeight = CHECKBUTTON_SUBSCRIPT_HEIGHT;
+ anonymousLogFont.lfCharSet = SHIFTJIS_CHARSET;
+
+ checkButtonFont.CreateFontIndirect(&anonymousLogFont);
+ anonymousButton.SetFont(checkButtonFont);
+ ownerModeButton.SetFont(checkButtonFont);
+ CFontHandle f = AtlGetDefaultGuiFont();
+ LOGFONT timeLogFont;
+ f.GetLogFont(timeLogFont);
+
+ timeLogFont.lfWeight = FW_BOLD;
+
+ timeFont.CreateFontIndirectW(&timeLogFont);
+ anonymousButton.SetWindowTextW(ANONYMOUS_MAILCOMMAND);
+ ownerModeButton.SetWindowText(OWNERMODE_BOTTONSTRING);
+ return 0;
+ }
+
+ VOID CCommentWriteWindow::OnDestroy(){
+ commentPosBox.DestroyWindow();
+ commentSizeBox.DestroyWindow();
+ commentColorBox.DestroyWindow();
+ anonymousButton.DestroyWindow();
+ commentSubEdit.DestroyWindow();
+ commentWriteButton.DestroyWindow();
- CPaintDC pdc(combo);
- SIZE size;
- UINT_PTR rslt = 0;
- UINT_PTR itemCount = combo.GetCount();
- LPCTSTR name;
- for(UINT_PTR index = 0;index < itemCount;index++){
- name = ((T*)combo.GetItemDataPtr(index))->name;
- ::GetTextExtentPoint32(pdc,name,_tcslen(name),&size);
- rslt = rslt < (UINT_PTR)size.cx ? size.cx : rslt;
}
- return rslt;
-}
-
-CCommentWriteWindow::CCommentWriteWindow(CNicoLiveStream &in_nicoLiveStream):
-commentWriteHeight(0),
-commentWriteInternalHeight(0),
-commentWriteMaxLength(INIT_COMMENTWRITE_MAXLENGTH),
-nicoLiveStream(in_nicoLiveStream),
-commentSubEdit(*this)
-{
-
-}
-
-
-
-LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){
-
- commentPosBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST ,0,COMMENTPOS_BOX);
- commentSizeBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,0,COMMENTSIZE_BOX);
- commentColorBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED ,0,COMMENTCOLOR_BOX);
- anonymousButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_CHECKBOX | BS_AUTOCHECKBOX ,0,ANONYMOUS_BUTTON);
- commentEdit.Create(m_hWnd,0,WC_EDIT,WS_CHILD | WS_VISIBLE | WS_BORDER,0,COMMENT_EDIT);
- commentWriteButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,0,COMMENTWRITE_BOTTON);
- commentPosBox.SetFont(AtlGetDefaultGuiFont());
- commentSizeBox.SetFont(AtlGetDefaultGuiFont());
- commentColorBox.SetFont(AtlGetDefaultGuiFont());
-
-
- anonymousButton.SetWindowTextW(CHECKBUTTON_HIDDENSTRING);
- anonymousButton.SetFont(AtlGetDefaultGuiFont());
- commentEdit.SetFont(AtlGetDefaultGuiFont());
- commentEdit.SetLimitText(commentWriteMaxLength);
- commentWriteButton.SetWindowTextW(WRITE_BOTTONSTRING);
- commentWriteButton.SetFont(AtlGetDefaultGuiFont());
- commentEdit.SetWindowTextW(TEXT(""));
-
- addItemList(commentColorBox,generalUser::COMMENT_COLORLIST,ARRAY_LENGTH(generalUser::COMMENT_COLORLIST));
- addItemList(commentSizeBox,generalUser::COMMENT_SIZELIST,ARRAY_LENGTH(generalUser::COMMENT_SIZELIST));
- addItemList(commentPosBox,generalUser::COMMENT_POSLIST,ARRAY_LENGTH(generalUser::COMMENT_POSLIST));
- commentColorBox.SetCurSel(0);
- commentSizeBox.SetCurSel(0);
- commentPosBox.SetCurSel(0);
- CFont font;
- font = AtlGetDefaultGuiFont();
- CPaintDC pdc(*this);
- SIZE thisSize;
- LPCTSTR sample = TEXT(" ");
- commentSubEdit.SubclassWindow(commentEdit);
- GetTextExtentPoint32(pdc,sample,_tcslen(sample),&thisSize);
- 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::OnDestroy(){
- commentPosBox.DestroyWindow();
- commentSizeBox.DestroyWindow();
- commentColorBox.DestroyWindow();
- anonymousButton.DestroyWindow();
- commentEdit.DestroyWindow();
- commentWriteButton.DestroyWindow();
-
-}
-
-VOID CCommentWriteWindow::OnSizing(UINT wParam,LPRECT lParam){
-
- RECT client;
- GetClientRect(&client);
-
- ChangeSize( _WTYPES_NS::CSize(client.right - client.left,client.bottom - client.top));
- return;
-}
-
-LRESULT CCommentWriteWindow::OnSize(UINT wParam,SIZE lParam){
- ChangeSize(lParam);
- return 0;
-}
-VOID CCommentWriteWindow::OnPaint(HDC hdc){
-
- CPaintDC pdc(*this);
- RECT clientRect;
- this->GetClientRect(&clientRect);
-
- pdc.FillRect(&clientRect,COLOR_BTNFACE);
-
-
- RECT anonymousRect;
- SIZE anonymousStringSize;
-
- 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.SetBkColor(GetSysColor(COLOR_BTNFACE));
- pdc.DrawText(ANONYMOUS_BOTTONSTRING,_tcslen(ANONYMOUS_BOTTONSTRING),&anonymousRect,0);
-
- return;
-}
-
-
-VOID CCommentWriteWindow::SendChat(){
- CCommentMaker commentMaker;
- std::vector<TCHAR> chat(commentEdit.GetWindowTextLengthW() + 1);
- commentEdit.GetWindowTextW(&chat[0],chat.size());
- commentMaker.SetChatString(&chat[0]);
- if(this->anonymousButton.GetCheck() == BST_CHECKED){
-
- commentMaker.AddMail(ANONYMOUS_MAILCOMMAND);
+
+
+ LRESULT CCommentWriteWindow::OnSize(UINT wParam,SIZE lParam){
+ ChangeSize(lParam);
+ return 0;
}
+ VOID CCommentWriteWindow::OnPaint(HDC hdc){
+
+ CPaintDC pdc(*this);
+ RECT clientRect;
+ this->GetClientRect(&clientRect);
+
+ pdc.FillRect(&clientRect,COLOR_BTNFACE);
+
+
+
+
+ pdc.SetBkColor(GetSysColor(COLOR_BTNFACE));
+ if(streamTime != 0){
+
+ RECT timeStringRect;
+
+ TCHAR timeString[LENGTH_256];
+ _tcscpy(timeString,TEXT("\8co\89ß\8e\9e\8aÔ:"));
+ LPTSTR timePtr = timeString + _tcslen(timeString);
+ time_t dispTime = static_cast<time_t>(difftime(streamTime,nicoLiveStream.GetStartTime()));
+ LPTSTR timeFormat;
+ BOOL yetStartFlag = FALSE;
+ if(dispTime < 0){
+ yetStartFlag = TRUE;
+ dispTime = abs(dispTime);
+ }
+
+ tm dispTimeStruct = *gmtime(&dispTime);
+
+ if(dispTimeStruct.tm_hour > 0 && yetStartFlag == TRUE){
+
+ timeFormat = TEXT("-%H:%M:%S");
+
+ } else if(dispTimeStruct.tm_hour <= 0 && yetStartFlag == TRUE){
+
+ timeFormat = TEXT(" -%M:%S");
+
+ } else if(dispTimeStruct.tm_hour > 0){
+
+ timeFormat = TEXT(" %H:%M:%S");
+
+ }else {
+
+ timeFormat = TEXT(" %M:%S");
+
+ }
+
+ _tcsftime(timePtr,ARRAY_LENGTH(timeString) - _tcslen(timeString),timeFormat,&dispTimeStruct);
- nicoLiveStream.SendChat(commentMaker);
- return;
-}
+ INT_PTR len = _tcslen(timeString);
+ pdc.SelectFont(timeFont);
+ timeStringRect.top = COMMENTWRITEWINDOW_SEPARATEFSIZE.top;
+ timeStringRect.left = COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ timeStringRect.bottom =timeStringRect.top;
+ timeStringRect.right = timeStringRect.bottom;
+ pdc.DrawTextW(timeString,len,&timeStringRect,DT_CALCRECT);
+ pdc.DrawTextW(timeString,len,&timeStringRect,0);
+ }
+
+
+
+
+ return;
+ }
+
+ VOID CSubChatEdit::EnterChatBox(LPVOID userData){
+
+
+ auto owner = ((CSubChatEdit*)userData)->self;
+ auto &self = *((CSubChatEdit*)userData);
+ CCommentMaker commentMaker;
+ std::vector<TCHAR> chat(owner.commentSubEdit.GetWindowTextLengthW() + 1);
+
+
+ owner.commentSubEdit.GetWindowTextW(&chat[0],chat.size());
+ commentMaker.SetChatString(&chat[0]);
+ if(owner.anonymousButton.GetCheck() == BST_CHECKED){
+
+ commentMaker.AddMail(ANONYMOUS_MAILCOMMAND);
+ }
+ INT_PTR sizeIndex = owner.commentSizeBox.GetCurSel();
+ if(sizeIndex == CB_ERR)sizeIndex = 0;
+ auto &rCommentSizeInfo = *(CommentSizeInfo*)owner.commentSizeBox.GetItemDataPtr(sizeIndex);
+
+ if(_tcscmp(rCommentSizeInfo.userData,DEFAULT_COMMENTSIZE) != 0){
+
+ commentMaker.AddMail(rCommentSizeInfo.userData);
+
+ }
+ INT_PTR posIndex = owner.commentPosBox.GetCurSel();
+ if(posIndex == CB_ERR)posIndex = 0;
+ auto &rCommentPosInfo = *(CommentPosInfo*)owner.commentPosBox.GetItemDataPtr(posIndex);
+
+ if(_tcscmp(rCommentPosInfo.userData,DEFAULT_COMMENTPOS) != 0){
+
+ commentMaker.AddMail(rCommentPosInfo.userData);
+ }
+
+ INT_PTR colorIndex = owner.commentColorBox.GetCurSel();
+ if(colorIndex == CB_ERR)colorIndex = 0;
+ auto &rCommentColorInfo = *(CommentColorInfo*)owner.commentColorBox.GetItemDataPtr(colorIndex);
+
+ if(_tcscmp(rCommentColorInfo.name,DEFAULT_COMMENTCOLOR) != 0){
+
+ commentMaker.AddMail(rCommentColorInfo.name);
+ }
+
+
+ NLIB_RESULT code = NLIB_ERR_CODE_NOTSET;
+
+ if(owner.nicoLiveStream.IsOwner() ==TRUE && owner.ownerModeButton.GetCheck() == BST_CHECKED){
+
+ code = owner.nicoLiveStream.SendOwnerChat(commentMaker);
+
+ } else {
+
+ code = owner.nicoLiveStream.SendChat(commentMaker);
+
+ }
+
+ switch(code){
+
+ case NLIB_ERR_OK:
+
+
+ owner.commentSubEdit.SetWindowText(TEXT(""));
+ goto end;
+
+ case NLIB_ERR_NOT_LIVECONNECT:
+ case NLIB_FAILED_CONNECT:
+ ::MessageBox(owner,NLIB_GetErrorMessage(code),TEXT("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83G\83\89\81["),MB_ICONERROR | MB_OK);
+ owner.commentSubEdit.AgreeEnter();
+ break;
+
+
+
+
+
+ default:
+ UnexpectedErrorMessageShow(TEXT("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\92\86\82É"),NLIB_GetErrorMessage(code),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
+ owner.commentSubEdit.AgreeEnter();
+ break;
+
+ }
+
+
+end:
+
+
+
+
+ self.AgreeEnter();
+
+ _endthread();
+ return;
+ }
-VOID CCommentWriteWindow::ChangeSize(SIZE &size){
+ BOOL CCommentWriteWindow::SendChat(){
+ this->commentSubEdit.untilConnectingFlag = TRUE;
+ this->commentSubEdit.SetReadOnly(TRUE);
+ _beginthread(CSubChatEdit::EnterChatBox,0,&this->commentSubEdit);
- SIZE commentAnonymousButtonSize;
- SIZE commentWriteButtonSize;
- commentWriteButton.GetIdealSize(&commentWriteButtonSize);
- anonymousButton.GetIdealSize(&commentAnonymousButtonSize);
- RECT commentPosBoxRect;
- RECT commentSizeBoxRect;
- RECT commentColorBoxRect;
- RECT anonymousButtonRect;
- RECT commentEditRect;
- RECT commentWriteButtonRect;
- RECT thisWindowRect;
- this->GetWindowRect(&thisWindowRect);
- commentPosBoxRect.left = COMMENTWRITEWINDOW_SIDESEPARATESIZE;
- this->commentPosBoxCS.Lock();
- commentPosBoxRect.right = commentPosBoxRect.left + CalcComboBoxWidth<CommentPosInfo>(commentPosBox);
- this->commentPosBoxCS.Unlock();
- commentSizeBoxRect.left = commentPosBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
- this->commentSizeBoxCS.Lock();
- commentSizeBoxRect.right = commentSizeBoxRect.left + CalcComboBoxWidth<CommentSizeInfo>(commentSizeBox);
- this->commentSizeBoxCS.Unlock();
- 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 - anonymousStringSize.cx;
+ return TRUE;
+ }
- commentEditRect.left = anonymousButtonRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
-
- commentWriteButtonRect.right = size.cx - COMMENTWRITEWINDOW_SIDESEPARATESIZE;
- commentWriteButtonRect.left = commentWriteButtonRect.right - commentWriteButtonSize.cx;
- commentEditRect.right = commentWriteButtonRect.left - COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ BOOL CCommentWriteWindow::SetText(LPCTSTR lpStr){
-
+ BOOL rslt = this->commentSubEdit.SetWindowText(lpStr);
+ if(rslt == TRUE){
+ commentSubEdit.SetFocus();
+ int cursor = commentSubEdit.GetWindowTextLength();
+ commentSubEdit.SetSel(cursor,cursor);
+ //commentSubEdit.ShowCaret();
+ }
+ return rslt;
+ }
- //\88Ú\93®\8f\88\97\9d
- HDWP hDwp = BeginDeferWindowPos(6);
-
- commentPosBox.DeferWindowPos(hDwp,*this,
- commentPosBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentPosBoxRect.right - commentPosBoxRect.left,commentWriteInternalHeight,
- SWP_NOZORDER);
+ VOID CCommentWriteWindow::OnChatReceveStart(CNicoLiveStream &nicoLiveStream,NicoLiveThreadComment_P threadComment){
- commentSizeBox.DeferWindowPos(hDwp,*this,
- commentSizeBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentSizeBoxRect.right - commentSizeBoxRect.left,commentWriteInternalHeight,
- SWP_NOZORDER);
+ this->ShowWindow(SW_HIDE);
+ this->commentColorBox.ResetContent();
+ this->commentPosBox.ResetContent();
+ this->commentSizeBox.ResetContent();
- commentColorBox.DeferWindowPos(hDwp,*this,
- commentColorBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentColorBoxRect.right - commentColorBoxRect.left,commentWriteInternalHeight,
- SWP_NOZORDER);
+ addItemList(commentColorBox,generalUser::COMMENT_COLORLIST,ARRAY_LENGTH(generalUser::COMMENT_COLORLIST));
+ addItemList(commentSizeBox,generalUser::COMMENT_SIZELIST,ARRAY_LENGTH(generalUser::COMMENT_SIZELIST));
+ addItemList(commentPosBox,generalUser::COMMENT_POSLIST,ARRAY_LENGTH(generalUser::COMMENT_POSLIST));
- anonymousButton.DeferWindowPos(hDwp,*this,
- anonymousButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,anonymousButtonRect.right - anonymousButtonRect.left,commentWriteInternalHeight - CHECKBUTTON_SUBSCRIPT_HEIGHT,
- SWP_NOZORDER);
- commentEdit.DeferWindowPos(hDwp,*this,
- commentEditRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentEditRect.right - commentEditRect.left,commentWriteInternalHeight,
- SWP_NOZORDER);
+ if(nicoLiveStream.IsPremium() == TRUE){
- commentWriteButton.DeferWindowPos(hDwp,*this,
- commentWriteButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentWriteButtonRect.right - commentWriteButtonRect.left,commentWriteInternalHeight,
- SWP_NOZORDER);
+ addItemList(commentColorBox,premiumUser::COMMENT_COLORLIST,ARRAY_LENGTH(premiumUser::COMMENT_COLORLIST));
+ addItemList(commentSizeBox,premiumUser::COMMENT_SIZELIST,ARRAY_LENGTH(premiumUser::COMMENT_SIZELIST));
+ addItemList(commentPosBox,premiumUser::COMMENT_POSLIST,ARRAY_LENGTH(premiumUser::COMMENT_POSLIST));
- EndDeferWindowPos(hDwp);
+ }
+ this->commentColorBox.SetCurSel(0);
+ this->commentPosBox.SetCurSel(0);
+ this->commentSizeBox.SetCurSel(0);
- return;
-}
-VOID CCommentWriteWindow::OnDrawItem(UINT wParam,LPDRAWITEMSTRUCT lParam){
-
-
- if(lParam->hwndItem == commentColorBox.m_hWnd && commentColorBox.GetCount() > 0){
-
-
+ this->ShowWindow(SW_SHOW);
+ this->streamTime = threadComment->server_time;
+ this->SetTimer(TIMER_ID,1000,NULL);
+ if(nicoLiveStream.IsOwner() == TRUE){
- RECT drawRect = lParam->rcItem;
- UINT_PTR itemNo = 0;
- 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;
+ this->ownerModeButton.ShowWindow(SW_SHOW);
+ ownerModeButton.SetCheck(BST_CHECKED);
+ editBkColor = OWNEREDITCOLOR;
- if(lParam->itemID == ((UINT)-1)){
- itemNo = curselNo == CB_ERR ? 0 : curselNo;
} else {
- itemNo = lParam->itemID;
+
+ this->ownerModeButton.ShowWindow(SW_HIDE);
+ editBkColor = NORMALEDITCOLOR;
+
+ }
+
+ if(this->editBkBrush.IsNull() ==FALSE){
+ editBkBrush.DeleteObject();
}
-
- CommentInfo<COLORREF> &commentColor = *(CommentInfo<COLORREF> *)commentColorBox.GetItemDataPtr(itemNo);
-
-
- if(lParam->itemState & (ODS_FOCUS | ODS_COMBOBOXEDIT)){
-
-
-
- bkBrush.CreateSolidBrush(RGB(160,160,160));
-
+
+ editBkBrush.CreateSolidBrush(editBkColor);
+ SIZE size;
+ RECT windowRect;
+ this->GetClientRect(&windowRect);
+ size.cx = windowRect.right - windowRect.left;
+ size.cy = windowRect.bottom - windowRect.top;
+ ChangeSize(size);
+
+ return;
+ }
+
+ VOID CCommentWriteWindow::ChangeSize(SIZE &size){
+
+ SIZE commentAnonymousButtonSize;
+ SIZE commentWriteButtonSize;
+ commentWriteButton.GetIdealSize(&commentWriteButtonSize);
+ anonymousButton.GetIdealSize(&commentAnonymousButtonSize);
+ UINT_PTR defwindowCount = 0;
+ RECT commentPosBoxRect;
+ RECT commentSizeBoxRect;
+ RECT commentColorBoxRect;
+ RECT anonymousButtonRect;
+ RECT commentEditRect;
+ RECT commentWriteButtonRect;
+ RECT ownerModeButtonRect;
+ RECT thisWindowRect;
+
+ UINT_PTR writeSpaceHeight = COMMENTWRITEWINDOW_SEPARATEFSIZE.top * 2 + commentWriteInternalHeight;
+ this->GetWindowRect(&thisWindowRect);
+
+ commentPosBoxRect.left = COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ this->commentPosBoxCS.Lock();
+ commentPosBoxRect.right = commentPosBoxRect.left + CalcComboBoxWidth<CommentPosInfo>(commentPosBox);
+ this->commentPosBoxCS.Unlock();
+
+ commentSizeBoxRect.left = commentPosBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ this->commentSizeBoxCS.Lock();
+ commentSizeBoxRect.right = commentSizeBoxRect.left + CalcComboBoxWidth<CommentSizeInfo>(commentSizeBox);
+ this->commentSizeBoxCS.Unlock();
+
+ commentColorBoxRect.left = commentSizeBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ commentColorBoxRect.right = commentColorBoxRect.left + commentColorBoxSize.cx;
+
+
+
+ anonymousButtonRect.left = commentColorBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ anonymousButtonRect.right = anonymousButtonRect.left + commentAnonymousButtonSize.cx;
+
+ if(ownerModeButton.IsWindowVisible() == TRUE){
+
+
+ SIZE ownerModeButtonSize;
+ ownerModeButton.GetIdealSize(&ownerModeButtonSize);
+ ownerModeButtonRect.left = anonymousButtonRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ ownerModeButtonRect.right = ownerModeButtonRect.left + ownerModeButtonSize.cx;
+ commentEditRect.left = ownerModeButtonRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ defwindowCount = 7;
} else {
- bkBrush.CreateSolidBrush(RGB(255,255,255));
+ commentEditRect.left = anonymousButtonRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ defwindowCount = 6;
+ }
+
+ commentWriteButtonRect.right = size.cx - COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+ commentWriteButtonRect.left = commentWriteButtonRect.right - commentWriteButtonSize.cx;
+
+ commentEditRect.right = commentWriteButtonRect.left - COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+
+
+
+ //\88Ú\93®\8f\88\97\9d
+ HDWP hDwp = BeginDeferWindowPos(defwindowCount);
+
+ commentPosBox.DeferWindowPos(hDwp,*this,
+ commentPosBoxRect.left,writeSpaceHeight,commentPosBoxRect.right - commentPosBoxRect.left,commentWriteInternalHeight,
+ SWP_NOZORDER);
+
+ commentSizeBox.DeferWindowPos(hDwp,*this,
+ commentSizeBoxRect.left,writeSpaceHeight,commentSizeBoxRect.right - commentSizeBoxRect.left,commentWriteInternalHeight,
+ SWP_NOZORDER);
+
+ commentColorBox.DeferWindowPos(hDwp,*this,
+ commentColorBoxRect.left,writeSpaceHeight,commentColorBoxRect.right - commentColorBoxRect.left,commentWriteInternalHeight,
+ SWP_NOZORDER);
+
+ anonymousButton.DeferWindowPos(hDwp,*this,
+ anonymousButtonRect.left,writeSpaceHeight,anonymousButtonRect.right - anonymousButtonRect.left,commentWriteInternalHeight,
+ SWP_NOZORDER);
+
+ if(ownerModeButton.IsWindowVisible() == TRUE){
+ ownerModeButton.DeferWindowPos(hDwp,*this,
+ ownerModeButtonRect.left,writeSpaceHeight,ownerModeButtonRect.right - ownerModeButtonRect.left,commentWriteInternalHeight,
+ SWP_NOZORDER);
}
+ commentSubEdit.DeferWindowPos(hDwp,*this,
+ commentEditRect.left,writeSpaceHeight,commentEditRect.right - commentEditRect.left,commentWriteInternalHeight,
+ SWP_NOZORDER);
+ commentWriteButton.DeferWindowPos(hDwp,*this,
+ commentWriteButtonRect.left,writeSpaceHeight,commentWriteButtonRect.right - commentWriteButtonRect.left,commentWriteInternalHeight,
+ SWP_NOZORDER);
-
-
- CBrush brush;
- CPen cpen;
+ EndDeferWindowPos(hDwp);
- brush.CreateSolidBrush(commentColor.userData);
- dcHandle.SelectBrush(brush);
- dcHandle.FillRect(&lParam->rcItem,bkBrush);
- dcHandle.SelectBrush(brush);
- dcHandle.SelectPen((HPEN)::GetStockObject(BLACK_PEN));
- dcHandle.Rectangle(&drawRect);
-
+ return;
}
- return;
-}
+ VOID CCommentWriteWindow::OnDrawItem(UINT wParam,LPDRAWITEMSTRUCT lParam){
+
+
+
+ if(lParam->hwndItem == commentColorBox.m_hWnd && commentColorBox.GetCount() > 0){
+
+
+
+ RECT drawRect = lParam->rcItem;
+ UINT_PTR itemNo = 0;
+ 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;
+
+ if(lParam->itemID == ((UINT)-1)){
+ itemNo = curselNo == CB_ERR ? 0 : curselNo;
+ } else {
+ itemNo = lParam->itemID;
+ }
-LRESULT CCommentWriteWindow::OnEraseBkGnd(HDC wParam){
+ CommentInfo<COLORREF> &commentColor = *(CommentInfo<COLORREF> *)commentColorBox.GetItemDataPtr(itemNo);
- return TRUE;
-}
+ if(lParam->itemState & (ODS_FOCUS | ODS_COMBOBOXEDIT)){
-LRESULT CCommentWriteWindow::OnButton(UINT hiWparam,INT_PTR loWparam,HWND lParam){
- if(lParam == commentWriteButton){
-
- this->SendChat();
+ bkBrush.CreateSolidBrush(PALETTERGB(160,160,160));
+
+ } else {
+
+ bkBrush.CreateSolidBrush(PALETTERGB(255,255,255));
+
+ }
+
+
+
+
+ CBrush brush;
+ CPen cpen;
+
+ brush.CreateSolidBrush(commentColor.userData);
+ dcHandle.SelectBrush(brush);
+ dcHandle.FillRect(&lParam->rcItem,bkBrush);
+ dcHandle.SelectBrush(brush);
+ dcHandle.SelectPen((HPEN)::GetStockObject(BLACK_PEN));
+ dcHandle.Rectangle(&drawRect);
+
+ }
+
+ return;
}
- return TRUE;
-}
+ LRESULT CCommentWriteWindow::OnEraseBkGnd(HDC wParam){
+
+ return TRUE;
+ }
-VOID CCommentWriteWindow::OnMeasureItem(UINT wParam,LPMEASUREITEMSTRUCT lParam){
- switch(lParam->CtlID){
+ LRESULT CCommentWriteWindow::OnCtlolorEdit(HDC hdc,HWND hWnd){
- case COMMENTCOLOR_BOX:
- {
- SIZE itemSize;
- CPaintDC pdc(*this);
- pdc.SelectFont(AtlGetDefaultGuiFont());
- LPCTSTR sample = TEXT(" ");
- ::GetTextExtentPoint32(pdc,sample,_tcslen(sample),&itemSize);
- lParam->itemHeight = itemSize.cy;
+ if(hWnd == this->commentSubEdit){
+
+ SetBkMode(hdc, TRANSPARENT); // \94w\8ci\82ð\93§\89ß
+ SetBkColor(hdc,this->editBkColor); // \83e\83L\83X\83g\82ª\8f\91\82©\82ê\82Ä\82¢\82é\95\94\95ª\82Ì\83e\83L\83X\83g\82Ì\94w\8ci\82Ì\90F
+
+ return (LRESULT)editBkBrush.m_hBrush;
}
- break;
+ return 0;
}
-
+ LRESULT CCommentWriteWindow::OnButton(UINT hiWparam,INT_PTR loWparam,HWND lParam){
- return;
-}
+ if(lParam == commentWriteButton){
+ this->SendChat();
+ } else if(lParam == this->ownerModeButton){
+ if(this->ownerModeButton.GetCheck() == BST_CHECKED){
+ this->editBkColor = OWNEREDITCOLOR;
+ } else {
+ this->editBkColor = NORMALEDITCOLOR;
+ }
+ if(this->editBkBrush.IsNull() == FALSE){
+ this->editBkBrush.DeleteObject();
+ }
+ this->editBkBrush.CreateSolidBrush(editBkColor);
+ commentSubEdit.Invalidate();
+ }
+ return TRUE;
+ }
+
+ VOID CCommentWriteWindow::OnTimer(UINT id){
+ streamTime++;
+ this->Invalidate();
+
+ return;
+ }
+
+ VOID CCommentWriteWindow::OnMeasureItem(UINT wParam,LPMEASUREITEMSTRUCT lParam){
+
+ switch(lParam->CtlID){
+
+ case COMMENTCOLOR_BOX:
+ {
+ SIZE itemSize;
+ CPaintDC pdc(*this);
+ pdc.SelectFont(AtlGetDefaultGuiFont());
+ LPCTSTR sample = TEXT(" ");
+ ::GetTextExtentPoint32(pdc,sample,_tcslen(sample),&itemSize);
+ lParam->itemHeight = itemSize.cy;
+
+ }
+ break;
-void CSubChatEdit::OnKeyDown(TCHAR wParam, UINT upLParam,UINT loLParam){
- if(wParam == VK_RETURN){
-
- cs.Lock();
-
- if(untilConnectingFlag == FALSE){
- untilConnectingFlag = TRUE;
- self.SendChat();
}
-
- cs.Unlock();
-
-
+
+
+
+ return;
}
- return;
-}
-VOID CSubChatEdit::AgreeEnter(){
- cs.Lock();
- untilConnectingFlag = FALSE;
- cs.Unlock();
-}
+
+
+ VOID CCommentWriteWindow::OnSendChatResult(){
+
+ commentSubEdit.AgreeEnter();
+ return;
+ }
+
+
+
+ VOID CCommentWriteWindow::OnHeartBeat(NicoLiveHeartBeat_P heartBeat){
+
+ if(heartBeat->status == NLIB_ERR_OK){
+ streamTime = heartBeat->time;
+
+ }
+
+ return;
+ }
+
+ VOID CCommentWriteWindow::OnDisConnect(){
+
+ this->KillTimer(TIMER_ID);
+
+ return;
+ }
+
+
+ //
+ //CSubChatEdit\83N\83\89\83X
+ //////////////////////////////////////////////////////////////////////////////////////
+
+ void CSubChatEdit::OnKeyDown(TCHAR wParam, UINT upLParam,UINT loLParam){
+ if(wParam == VK_RETURN){
+
+ cs.Lock();
+
+ if(untilConnectingFlag == FALSE){
+
+
+
+ self.SendChat();
+ }
+
+ cs.Unlock();
+
+
+ } else {
+
+ this->DefWindowProc();
+
+ }
+ return;
+ }
+
+
+ VOID CSubChatEdit::AgreeEnter(){
+ cs.Lock();
+ this->SetReadOnly(FALSE);
+ untilConnectingFlag = FALSE;
+ cs.Unlock();
+ }
}
\ No newline at end of file