From 2083ab4dc9f24fd6c1b95295259da97e3a19081c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Feb 2012 15:44:32 +0900 Subject: [PATCH] =?utf8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E6=95=B4?= =?utf8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- nlite.suo | Bin 178688 -> 179200 bytes nlite/nlite_chatData.cpp | 15 +- nlite/nlite_commentWrite.cpp | 1130 +++++++++++++++++++++--------------------- nlite/nlite_commentview.cpp | 10 +- 4 files changed, 576 insertions(+), 579 deletions(-) diff --git a/nlite.suo b/nlite.suo index 3b39f78dae6f6c397138c01520c7f8c9d2428c23..50f287c6d1744eba64a094221807ecad238990ba 100644 GIT binary patch delta 5230 zcmb_geOQxMmVeJB34uZk5h#ra2}V?gQpAt?RgKoVl==~^+o3LlfJo7?7!h6SX8=E{ zA_NX{tm7bBiz8Mi8YJ4SEn3&s*o?jejtS>bu1!>+r~hE6q={KzrR!EPhyFTQ7bUK)M&qWi@ zKn41@$JCB2f!W?=BP$?uhmJY&M+@lK;>4oYb=39)gas=~C$9#yLr?W|@_YcX=pLn` z$!B04<|IX9=NJ=RTnB5=bvX$gV|1{AcHf1i=pG$|Vr;9FE1mYl!4%y5iV@q)8t-4m zZ2-)EK8(T+KnWR-fsWimz>Kc(moRdI(O7<^pmconPp^ICKXBOA`pw7Qk_mpTp4C>u z_~{8iZ^>(yw3>;}th`YfO6@)vF8QU=_Zo=Aob7dZ{jD%qLwC=>%j6s(ra~*bwVE6Y zL?YYc4la4Snhg8c$IUyV>*HY+yH`)wJHdd?w>3~s6APqkFT<20bDSFE!O(+ckv|os zhu=vIS$XKo_q?v`6m5j{-~ae8|8;x$t)W%@_b)y8cz-(Hy%XiVH19{w3!9WtO@c+| zgF+yYe_DHqja|+e_=RRDmModA8Tib`l9q_vldm6&G}q5r6P)<+qslAVWIS9Nh5nLM z@8jYrK{A!F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XJjxy!kX0}_O zXoFPRa}WGvx(Ahw!mb~pVZ!lfnj+GM+~dpH6Z~N1A^*O2tVy7NT-)GMq)%E=+ zSG!NWR7y9xN14g}qXbnax`vSDAQbuwBSkZ)rRA4&NF(aFX{n_!gIbtk+4OPs9_3gh zq=tP<^=9FR7OD8MOi-O!Xi4Mc+f+w_rO$S>_!BS_f1byEk#nj>a?lv)kXyeGQ(MW! zs-mvBt8Q|YH>shD5_pZ?iV@*br^*BB*E&%oLJwZpt`^f2inWTizUH*^nylk^?RvaniLX3cHS)4|8C1 zhDEY2q$s15(X`GcPV=V<%{(Z^1?O;2vQ$~%UpHC+Jm}p2pEtl#I;0myW`h7MH}^4p zJiAN{P9|pWNG>+vi=axa$J}tSPvhB>*?8p6WGYV(QSusDh2p7LbR?t%=$I<?nV(zJErlnXJ?4Blvco{ z)!`K(H18$xGx}tjIIVt9soTUjX>%#M*ILP1EUcQLj7tCIgIvWTR};-C_+aK%v2e%> zIJp*xTB=wnqWzYIq8r5PllPYhK}GY#GxS+~VCT(pgHZpVCE~Fl+A>{q_}M!%;5C~C zLIU>_<83Y{Kh0&W)X<-^#THO#REwBI+gFGZ8a-bmQuKB)M&edP#%1CO?+!-kg)-5h z;t3=De^@D!z|Y`jiuToF3TR9Z9pE+gvezM|kaL5G@H^IuRzc3~!r(VlitogJH@jT_ zyqM-^^vm>gy@0{{at3e6%YP=f2%-O2A}WJRidq~2SBgjJkoO^+rTK`z z^Va>pANh~LJhI-W>q|rv6;5Y^a+R2@rRO$sz+sEn>}P;h^1iQ#o$bxyUI;wxzyG%2 pw&R-`@w8!N$2_($Qd;SdRyI* pWriter; CreateXmlWriter(__uuidof(IXmlWriter), reinterpret_cast(&pWriter), 0); - // ƒtƒ@ƒCƒ‹ƒXƒgƒŠ[ƒ€ì¬ CComPtr pStream; SHCreateStreamOnFile(fileName, STGM_CREATE | STGM_WRITE, &pStream); @@ -396,6 +402,7 @@ BOOL CListenerList::WriteProperty(LPCTSTR fileName){ auto begin = m_listenerList.begin(); auto end = m_listenerList.end(); + //ƒŠƒXƒi[ƒŠƒXƒg‚©‚ç•Û‘¶‘Ώۂ̃f[ƒ^‚Ì‚ÝxmlŒ`Ž®‚Å•Û‘¶ for(;begin != end;++begin){ if(begin->name.Length() > 0 || begin->nameColor != ListenerData::INIT_COLOR || begin->bgcolor != ListenerData::INIT_COLOR){ pWriter->WriteStartElement(NULL,TEXT("user"),NULL); diff --git a/nlite/nlite_commentWrite.cpp b/nlite/nlite_commentWrite.cpp index 9843313..a657ff0 100644 --- a/nlite/nlite_commentWrite.cpp +++ b/nlite/nlite_commentWrite.cpp @@ -4,752 +4,750 @@ namespace nlite{ -const static SIZE commentColorBoxSize = {35,0}; + const static SIZE commentColorBoxSize = {35,0}; //FŒˆ’èƒRƒ“ƒ{ƒ{ƒbƒNƒX‚̃TƒCƒY + const static LPCTSTR ANONYMOUS_MAILCOMMAND = TEXT("184"); //184’萔•¶Žš—ñ + const static LPCTSTR ANONYMOUS_BOTTONSTRING = ANONYMOUS_MAILCOMMAND; //184ƒ[ƒ‹ƒRƒ}ƒ“ƒh’萔•¶Žš—ñ + const static LPCTSTR OWNERMODE_BOTTONSTRING = TEXT("ŽåƒRƒ"); //ŽåƒRƒ‘I‘ðƒ{ƒ^ƒ“’萔•¶Žš—ñ + const static LPCTSTR WRITE_BOTTONSTRING = TEXT("‘‚«ž‚Ý"); //‘‚«ž‚݃{ƒ^ƒ“’萔•¶Žš—ñ + const static COLORREF OWNEREDITCOLOR = RGB(255,192,192); //ŽåƒRƒ‘‚«ž‚݃GƒfƒBƒbƒgF + const static COLORREF NORMALEDITCOLOR = RGB(255,255,255); //ƒŠƒXƒi[Žž‚̏‘‚«ž‚݃GƒfƒBƒbƒgF + const static RECT COMMENTWRITEWINDOW_SEPARATEFSIZE = {0,5,0,5}; //ƒRƒƒ“ƒg‘‚«ž‚݃EƒBƒ“ƒhƒE‚̏㉺ƒXƒy[ƒX + const static UINT_PTR COMMENTWRITEWINDOW_SIDESEPARATESIZE = 5; //‰¡ƒXƒy[ƒX• + const static UINT_PTR INIT_COMMENTWRITE_MAXLENGTH = 60; //‰º‹L•¶Žš—ñÅ‘å’· + const static UINT_PTR CHECKBUTTON_SUBSCRIPT_HEIGHT = 10; //‘I‘ðƒ{ƒ^ƒ“•¶Žš—ñ‚̍‚‚³ + const static LPCTSTR DEFAULT_COMMENTCOLOR = TEXT("white"); //‹K’è‚̃Rƒƒ“ƒgF + const static LPCTSTR DEFAULT_COMMENTSIZE = TEXT("medium"); //‹K’è‚̃Rƒƒ“ƒg•¶Žš—ñ + const static LPCTSTR DEFAULT_COMMENTPOS = TEXT("naka"); //‹K’è‚̃Rƒƒ“ƒg•\Ž¦ˆÊ’u + + + + namespace generalUser{ + const CommentColorInfo COMMENT_COLORLIST[] = { + {DEFAULT_COMMENTCOLOR,PALETTERGB(0xFF,0xFF,0xFF)}, //”’ + {TEXT("red"),PALETTERGB(0xFF,0x00,0x00)}, //Ô + {TEXT("pink"),PALETTERGB(0xFF,0x80,0x80)}, //ƒsƒ“ƒN + {TEXT("orange"),PALETTERGB(0xFF,0xC0,0x00)}, //ƒIƒŒƒ“ƒW + {TEXT("yellow"),PALETTERGB(0xFF,0xFF,0x00)}, //‰©F + {TEXT("green"),PALETTERGB(0x00,0xFF,0x00)}, //—Î + {TEXT("cyan"),PALETTERGB(0x00,0xFF,0xFF)}, //Š¦F + {TEXT("blue"),PALETTERGB(0x00,0x00,0xFF)}, //Â + {TEXT("purple"),PALETTERGB(0xC0,0x00,0xFF)}, //Ž‡ + + }; + + const CommentSizeInfo COMMENT_SIZELIST[] = { + {TEXT("•’ʁ@"),DEFAULT_COMMENTSIZE}, //•’ʃTƒCƒY + {TEXT("¬@"),TEXT("small")} //¬ƒTƒCƒY + }; + + + const CommentPosInfo COMMENT_POSLIST[] = { + {TEXT("’ʏí@"),DEFAULT_COMMENTPOS} //’ʏí•\Ž¦ + }; + } + + namespace premiumUser{ -const static LPCTSTR ANONYMOUS_MAILCOMMAND = TEXT("184"); -const static LPCTSTR ANONYMOUS_BOTTONSTRING = ANONYMOUS_MAILCOMMAND; -const static LPCTSTR OWNERMODE_BOTTONSTRING = TEXT("ŽåƒRƒ"); -const static LPCTSTR WRITE_BOTTONSTRING = TEXT("‘‚«ž‚Ý"); -const static LPCTSTR CHECKBUTTON_HIDDENSTRING = TEXT(" "); + const CommentColorInfo COMMENT_COLORLIST[] = { + {TEXT("black"),PALETTERGB(0x00,0x00,0x00)}, //• + {TEXT("white2"),PALETTERGB(0xCC,0xCC,0x99)}, //”’‚»‚Ì‚Q + {TEXT("red2"),PALETTERGB(0xCC,0x00,0x33)}, //Ô‚»‚Ì‚Q + {TEXT("pink2"),PALETTERGB(0xFF,0x33,0xCC)}, //ƒsƒ“ƒN‚»‚Ì‚Q + {TEXT("orange2"),PALETTERGB(0xFF,0x66,0x00)}, //ƒIƒŒƒ“ƒW‚»‚Ì‚Q + {TEXT("yellow2"),PALETTERGB(0x99,0x99,0x00)}, //‰©F‚»‚Ì‚Q + {TEXT("green2"),PALETTERGB(0x00,0xCC,0x66)}, //—΂»‚Ì‚Q + {TEXT("cyan2"),PALETTERGB(0x00,0xCC,0xCC)}, //Š¦F‚»‚Ì‚Q + {TEXT("blue2"),PALETTERGB(0x33,0x99,0xFF)}, //Â‚»‚Ì‚Q + {TEXT("purple2"),PALETTERGB(0x66,0x33,0xCC)} //Ž‡‚»‚Ì‚Q + // {TEXT("black2"),PALETTERGB(0x66,0x66,0x66)} //•‚»‚Ì‚Q‚Í‚È‚¢H + }; + const CommentSizeInfo COMMENT_SIZELIST[] = { + {TEXT("‘å@"),TEXT("big")} //‘åƒTƒCƒY + }; -const static COLORREF OWNEREDITCOLOR = RGB(255,192,192); -const static COLORREF NORMALEDITCOLOR = RGB(255,255,255); -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 LPCTSTR DEFAULT_COMMENTCOLOR = TEXT("white"); -const static LPCTSTR DEFAULT_COMMENTSIZE = TEXT("medium"); -const static LPCTSTR DEFAULT_COMMENTPOS = TEXT("naka"); -const static COLORREF MAX_COLOR = 0xFFFFFF; + const CommentPosInfo COMMENT_POSLIST[] = { + {TEXT("‰º@"),TEXT("shita")}, //‰º‚É•\Ž¦ + {TEXT("ã@"),TEXT("ue")} //ã‚É•\Ž¦ + }; + } + -namespace generalUser{ - const CommentColorInfo COMMENT_COLORLIST[] = { - {DEFAULT_COMMENTCOLOR,PALETTERGB(0xFF,0xFF,0xFF)}, //”’ - {TEXT("red"),PALETTERGB(0xFF,0x00,0x00)}, //Ô - {TEXT("pink"),PALETTERGB(0xFF,0x80,0x80)}, //ƒsƒ“ƒN - {TEXT("orange"),PALETTERGB(0xFF,0xC0,0x00)}, //ƒIƒŒƒ“ƒW - {TEXT("yellow"),PALETTERGB(0xFF,0xFF,0x00)}, //‰©F - {TEXT("green"),PALETTERGB(0x00,0xFF,0x00)}, //—Î - {TEXT("cyan"),PALETTERGB(0x00,0xFF,0xFF)}, //Š¦F - {TEXT("blue"),PALETTERGB(0x00,0x00,0xFF)}, //Â - {TEXT("purple"),PALETTERGB(0xC0,0x00,0xFF)}, //Ž‡ - - }; - const CommentSizeInfo COMMENT_SIZELIST[] = { - {TEXT("•’ʁ@"),DEFAULT_COMMENTSIZE}, //•’ʃTƒCƒY - {TEXT("¬@"),TEXT("small")} //¬ƒTƒCƒY - }; - const CommentPosInfo COMMENT_POSLIST[] = { - {TEXT("’ʏí@"),DEFAULT_COMMENTPOS} //’ʏí•\Ž¦ - }; -} + template + static VOID addItemList(CComboBox &combo,T * colorList,UINT_PTR length){ -namespace premiumUser{ + UINT_PTR startItemcount = combo.GetCount(); + length+= startItemcount; + for(UINT_PTR index = startItemcount; index < length;index++){ - const CommentColorInfo COMMENT_COLORLIST[] = { - {TEXT("black"),PALETTERGB(0x00,0x00,0x00)}, //• - {TEXT("white2"),PALETTERGB(0xCC,0xCC,0x99)}, //”’‚»‚Ì‚Q - {TEXT("red2"),PALETTERGB(0xCC,0x00,0x33)}, //Ô‚»‚Ì‚Q - {TEXT("pink2"),PALETTERGB(0xFF,0x33,0xCC)}, //ƒsƒ“ƒN‚»‚Ì‚Q - {TEXT("orange2"),PALETTERGB(0xFF,0x66,0x00)}, //ƒIƒŒƒ“ƒW‚»‚Ì‚Q - {TEXT("yellow2"),PALETTERGB(0x99,0x99,0x00)}, //‰©F‚»‚Ì‚Q - {TEXT("green2"),PALETTERGB(0x00,0xCC,0x66)}, //—΂»‚Ì‚Q - {TEXT("cyan2"),PALETTERGB(0x00,0xCC,0xCC)}, //Š¦F‚»‚Ì‚Q - {TEXT("blue2"),PALETTERGB(0x33,0x99,0xFF)}, //Â‚»‚Ì‚Q - {TEXT("purple2"),PALETTERGB(0x66,0x33,0xCC)} //Ž‡‚»‚Ì‚Q - // {TEXT("black2"),PALETTERGB(0x66,0x66,0x66)} //•‚»‚Ì‚Q‚Í‚È‚¢H - }; + combo.AddString(colorList[index - startItemcount].name); + combo.SetItemDataPtr(index,(LPVOID)&colorList[index - startItemcount]); - const CommentSizeInfo COMMENT_SIZELIST[] = { - {TEXT("‘å@"),TEXT("big")} //‘åƒTƒCƒY - }; + } + return; + } - const CommentPosInfo COMMENT_POSLIST[] = { - {TEXT("‰º@"),TEXT("shita")}, //‰º‚É•\Ž¦ - {TEXT("ã@"),TEXT("ue")} //ã‚É•\Ž¦ - }; -} + template + 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) + {} -template -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++){ + BOOL CCommentWriteWindow::IsWrighthing(){ - combo.AddString(colorList[index - startItemcount].name); - combo.SetItemDataPtr(index,(LPVOID)&colorList[index - startItemcount]); + return this->commentSubEdit.untilConnectingFlag; } - return; -} + UINT_PTR CCommentWriteWindow::GetHeight(){ + + return commentWriteHeight + infoDispHeight - COMMENTWRITEWINDOW_SEPARATEFSIZE.top; + } + LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){ + + //ƒEƒBƒ“ƒhƒEì¬ˆ— + + 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()); + + //ƒtƒHƒ“ƒg‚̐ݒè + 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; + + //ƒEƒBƒ“ƒhƒE‚̍‚‚³‚ð‹‚ß‚é + 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); + + //ƒvƒbƒVƒ…ƒ‰ƒCƒNƒ{ƒ^ƒ“‚̃tƒHƒ“ƒg‚ðŒˆ‚ß‚é + 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; + } -template -static UINT_PTR CalcComboBoxWidth(CComboBox &combo){ + 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), -streamTime(0) -{} - - -BOOL CCommentWriteWindow::IsWrighthing(){ - - return this->commentSubEdit.untilConnectingFlag; - -} - -UINT_PTR CCommentWriteWindow::GetHeight(){ - - return commentWriteHeight + infoDispHeight - COMMENTWRITEWINDOW_SEPARATEFSIZE.top; -} - - -LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){ - - //ƒEƒBƒ“ƒhƒEì¬ˆ— - - 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()); - - - 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; - 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); - - 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(); - -} - - - -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("Œo‰ßŽžŠÔ:")); - LPTSTR timePtr = timeString + _tcslen(timeString); - time_t dispTime = static_cast(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){ + LRESULT CCommentWriteWindow::OnSize(UINT wParam,SIZE lParam){ + ChangeSize(lParam); + return 0; + } + VOID CCommentWriteWindow::OnPaint(HDC hdc){ - timeFormat = TEXT("-%H:%M:%S"); + CPaintDC pdc(*this); + RECT clientRect; + this->GetClientRect(&clientRect); - } else if(dispTimeStruct.tm_hour <= 0 && yetStartFlag == TRUE){ + pdc.FillRect(&clientRect,COLOR_BTNFACE); - timeFormat = TEXT(" -%M:%S"); - } else if(dispTimeStruct.tm_hour > 0){ - timeFormat = TEXT(" %H:%M:%S"); - }else { - - timeFormat = TEXT(" %M:%S"); + pdc.SetBkColor(GetSysColor(COLOR_BTNFACE)); + if(streamTime != 0){ - } + RECT timeStringRect; - _tcsftime(timePtr,ARRAY_LENGTH(timeString) - _tcslen(timeString),timeFormat,&dispTimeStruct); + TCHAR timeString[LENGTH_256]; + _tcscpy(timeString,TEXT("Œo‰ßŽžŠÔ:")); + LPTSTR timePtr = timeString + _tcslen(timeString); + time_t dispTime = static_cast(difftime(streamTime,nicoLiveStream.GetStartTime())); + LPTSTR timeFormat; + BOOL yetStartFlag = FALSE; + if(dispTime < 0){ + yetStartFlag = TRUE; + dispTime = abs(dispTime); + } - INT_PTR len = _tcslen(timeString); - pdc.SelectFont(timeFont); + tm dispTimeStruct = *gmtime(&dispTime); - - 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); - } + if(dispTimeStruct.tm_hour > 0 && yetStartFlag == TRUE){ + timeFormat = TEXT("-%H:%M:%S"); - - - return; -} + } else if(dispTimeStruct.tm_hour <= 0 && yetStartFlag == TRUE){ -VOID CSubChatEdit::EnterChatBox(LPVOID userData){ + timeFormat = TEXT(" -%M:%S"); + } else if(dispTimeStruct.tm_hour > 0){ - auto owner = ((CSubChatEdit*)userData)->self; - auto &self = *((CSubChatEdit*)userData); - CCommentMaker commentMaker; - std::vector chat(owner.commentSubEdit.GetWindowTextLengthW() + 1); + timeFormat = TEXT(" %H:%M:%S"); + }else { - owner.commentSubEdit.GetWindowTextW(&chat[0],chat.size()); - commentMaker.SetChatString(&chat[0]); - if(owner.anonymousButton.GetCheck() == BST_CHECKED){ + timeFormat = TEXT(" %M:%S"); - 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){ + _tcsftime(timePtr,ARRAY_LENGTH(timeString) - _tcslen(timeString),timeFormat,&dispTimeStruct); - commentMaker.AddMail(rCommentSizeInfo.userData); + INT_PTR len = _tcslen(timeString); + pdc.SelectFont(timeFont); - } - 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){ + 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); + } - 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); + return; } + VOID CSubChatEdit::EnterChatBox(LPVOID userData){ - NLIB_RESULT code = NLIB_ERR_CODE_NOTSET; - if(owner.nicoLiveStream.IsOwner() ==TRUE && owner.ownerModeButton.GetCheck() == BST_CHECKED){ - - code = owner.nicoLiveStream.SendOwnerChat(commentMaker); + auto owner = ((CSubChatEdit*)userData)->self; + auto &self = *((CSubChatEdit*)userData); + CCommentMaker commentMaker; + std::vector chat(owner.commentSubEdit.GetWindowTextLengthW() + 1); - } else { - code = owner.nicoLiveStream.SendChat(commentMaker); + 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){ - switch(code){ + commentMaker.AddMail(rCommentSizeInfo.userData); - case NLIB_ERR_OK: + } + 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){ - owner.commentSubEdit.SetWindowText(TEXT("")); - goto end; + commentMaker.AddMail(rCommentPosInfo.userData); + } - case NLIB_ERR_NOT_LIVECONNECT: - case NLIB_FAILED_CONNECT: - ::MessageBox(owner,NLIB_GetErrorMessage(code),TEXT("ƒRƒƒ“ƒg‘‚«ž‚݃Gƒ‰["),MB_ICONERROR | MB_OK); - owner.commentSubEdit.AgreeEnter(); - break; + 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); + } - default: - UnexpectedErrorMessageShow(TEXT("ƒRƒƒ“ƒg‘‚«ž‚Ý’†‚É"),NLIB_GetErrorMessage(code),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__)); - owner.commentSubEdit.AgreeEnter(); - break; + NLIB_RESULT code = NLIB_ERR_CODE_NOTSET; - } + if(owner.nicoLiveStream.IsOwner() ==TRUE && owner.ownerModeButton.GetCheck() == BST_CHECKED){ + code = owner.nicoLiveStream.SendOwnerChat(commentMaker); -end: + } else { + code = owner.nicoLiveStream.SendChat(commentMaker); + } - - self.AgreeEnter(); + switch(code){ - _endthread(); - return; -} + case NLIB_ERR_OK: -BOOL CCommentWriteWindow::SendChat(){ - this->commentSubEdit.untilConnectingFlag = TRUE; - this->commentSubEdit.SetReadOnly(TRUE); - _beginthread(CSubChatEdit::EnterChatBox,0,&this->commentSubEdit); - - - + owner.commentSubEdit.SetWindowText(TEXT("")); + goto end; + case NLIB_ERR_NOT_LIVECONNECT: + case NLIB_FAILED_CONNECT: + ::MessageBox(owner,NLIB_GetErrorMessage(code),TEXT("ƒRƒƒ“ƒg‘‚«ž‚݃Gƒ‰["),MB_ICONERROR | MB_OK); + owner.commentSubEdit.AgreeEnter(); + break; - return TRUE; -} -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; -} -VOID CCommentWriteWindow::OnChatReceveStart(CNicoLiveStream &nicoLiveStream,NicoLiveThreadComment_P threadComment){ - - this->ShowWindow(SW_HIDE); - this->commentColorBox.ResetContent(); - this->commentPosBox.ResetContent(); - this->commentSizeBox.ResetContent(); + default: + UnexpectedErrorMessageShow(TEXT("ƒRƒƒ“ƒg‘‚«ž‚Ý’†‚É"),NLIB_GetErrorMessage(code),__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__)); + owner.commentSubEdit.AgreeEnter(); + break; - 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)); + } - if(nicoLiveStream.IsPremium() == TRUE){ +end: - 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)); + + + self.AgreeEnter(); + + _endthread(); + return; } - this->commentColorBox.SetCurSel(0); - this->commentPosBox.SetCurSel(0); - this->commentSizeBox.SetCurSel(0); - + BOOL CCommentWriteWindow::SendChat(){ + this->commentSubEdit.untilConnectingFlag = TRUE; + this->commentSubEdit.SetReadOnly(TRUE); + _beginthread(CSubChatEdit::EnterChatBox,0,&this->commentSubEdit); - this->ShowWindow(SW_SHOW); - this->streamTime = threadComment->server_time; - this->SetTimer(TIMER_ID,1000,NULL); - if(nicoLiveStream.IsOwner() == TRUE){ - this->ownerModeButton.ShowWindow(SW_SHOW); - ownerModeButton.SetCheck(BST_CHECKED); - editBkColor = OWNEREDITCOLOR; - - } else { - this->ownerModeButton.ShowWindow(SW_HIDE); - editBkColor = NORMALEDITCOLOR; - } - if(this->editBkBrush.IsNull() ==FALSE){ - editBkBrush.DeleteObject(); + + + return TRUE; } - 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(commentPosBox); - this->commentPosBoxCS.Unlock(); - - commentSizeBoxRect.left = commentPosBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE; - this->commentSizeBoxCS.Lock(); - commentSizeBoxRect.right = commentSizeBoxRect.left + CalcComboBoxWidth(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 { - - commentEditRect.left = anonymousButtonRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE; - defwindowCount = 6; + + 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; } - - commentWriteButtonRect.right = size.cx - COMMENTWRITEWINDOW_SIDESEPARATESIZE; - commentWriteButtonRect.left = commentWriteButtonRect.right - commentWriteButtonSize.cx; - commentEditRect.right = commentWriteButtonRect.left - COMMENTWRITEWINDOW_SIDESEPARATESIZE; + VOID CCommentWriteWindow::OnChatReceveStart(CNicoLiveStream &nicoLiveStream,NicoLiveThreadComment_P threadComment){ + + this->ShowWindow(SW_HIDE); + this->commentColorBox.ResetContent(); + this->commentPosBox.ResetContent(); + this->commentSizeBox.ResetContent(); - + 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)); - //ˆÚ“®ˆ— - 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); + if(nicoLiveStream.IsPremium() == TRUE){ - commentColorBox.DeferWindowPos(hDwp,*this, - commentColorBoxRect.left,writeSpaceHeight,commentColorBoxRect.right - commentColorBoxRect.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)); - anonymousButton.DeferWindowPos(hDwp,*this, - anonymousButtonRect.left,writeSpaceHeight,anonymousButtonRect.right - anonymousButtonRect.left,commentWriteInternalHeight, - SWP_NOZORDER); + } + this->commentColorBox.SetCurSel(0); + this->commentPosBox.SetCurSel(0); + this->commentSizeBox.SetCurSel(0); - 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); - - EndDeferWindowPos(hDwp); - - 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; + + this->ShowWindow(SW_SHOW); + this->streamTime = threadComment->server_time; + this->SetTimer(TIMER_ID,1000,NULL); + if(nicoLiveStream.IsOwner() == TRUE){ + + this->ownerModeButton.ShowWindow(SW_SHOW); + ownerModeButton.SetCheck(BST_CHECKED); + editBkColor = OWNEREDITCOLOR; + } else { - itemNo = lParam->itemID; + + this->ownerModeButton.ShowWindow(SW_HIDE); + editBkColor = NORMALEDITCOLOR; + + } + + if(this->editBkBrush.IsNull() ==FALSE){ + editBkBrush.DeleteObject(); } - - CommentInfo &commentColor = *(CommentInfo *)commentColorBox.GetItemDataPtr(itemNo); - - - if(lParam->itemState & (ODS_FOCUS | ODS_COMBOBOXEDIT)){ - - - - bkBrush.CreateSolidBrush(PALETTERGB(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(commentPosBox); + this->commentPosBoxCS.Unlock(); + + commentSizeBoxRect.left = commentPosBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE; + this->commentSizeBoxCS.Lock(); + commentSizeBoxRect.right = commentSizeBoxRect.left + CalcComboBoxWidth(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(PALETTERGB(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; + + + + //ˆÚ“®ˆ— + 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; + } + + CommentInfo &commentColor = *(CommentInfo *)commentColorBox.GetItemDataPtr(itemNo); + + + if(lParam->itemState & (ODS_FOCUS | ODS_COMBOBOXEDIT)){ + + + + bkBrush.CreateSolidBrush(PALETTERGB(160,160,160)); + + } else { + + bkBrush.CreateSolidBrush(PALETTERGB(255,255,255)); + + } + -LRESULT CCommentWriteWindow::OnEraseBkGnd(HDC wParam){ - return TRUE; -} + CBrush brush; + CPen cpen; -LRESULT CCommentWriteWindow::OnCtlolorEdit(HDC hdc,HWND hWnd){ + brush.CreateSolidBrush(commentColor.userData); + dcHandle.SelectBrush(brush); + dcHandle.FillRect(&lParam->rcItem,bkBrush); + dcHandle.SelectBrush(brush); + dcHandle.SelectPen((HPEN)::GetStockObject(BLACK_PEN)); + dcHandle.Rectangle(&drawRect); - if(hWnd == this->commentSubEdit){ + } - - SetBkMode(hdc, TRANSPARENT); // ”wŒi‚ð“§‰ß - SetBkColor(hdc,this->editBkColor); // ƒeƒLƒXƒg‚ª‘‚©‚ê‚Ä‚¢‚é•”•ª‚̃eƒLƒXƒg‚Ì”wŒi‚̐F - - return (LRESULT)editBkBrush.m_hBrush; + return; } - return 0; -} + LRESULT CCommentWriteWindow::OnEraseBkGnd(HDC wParam){ -LRESULT CCommentWriteWindow::OnButton(UINT hiWparam,INT_PTR loWparam,HWND lParam){ + return TRUE; + } - if(lParam == commentWriteButton){ - - this->SendChat(); - } else if(lParam == this->ownerModeButton){ + LRESULT CCommentWriteWindow::OnCtlolorEdit(HDC hdc,HWND hWnd){ - if(this->ownerModeButton.GetCheck() == BST_CHECKED){ + if(hWnd == this->commentSubEdit){ - this->editBkColor = OWNEREDITCOLOR; - } else { + SetBkMode(hdc, TRANSPARENT); // ”wŒi‚ð“§‰ß + SetBkColor(hdc,this->editBkColor); // ƒeƒLƒXƒg‚ª‘‚©‚ê‚Ä‚¢‚é•”•ª‚̃eƒLƒXƒg‚Ì”wŒi‚̐F - this->editBkColor = NORMALEDITCOLOR; + return (LRESULT)editBkBrush.m_hBrush; } - if(this->editBkBrush.IsNull() == FALSE){ + return 0; + } + + LRESULT CCommentWriteWindow::OnButton(UINT hiWparam,INT_PTR loWparam,HWND lParam){ + + if(lParam == commentWriteButton){ + + this->SendChat(); + + } else if(lParam == this->ownerModeButton){ - this->editBkBrush.DeleteObject(); + 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(); } - this->editBkBrush.CreateSolidBrush(editBkColor); - commentSubEdit.Invalidate(); - + return TRUE; } - return TRUE; -} + VOID CCommentWriteWindow::OnTimer(UINT id){ + streamTime++; + this->Invalidate(); -VOID CCommentWriteWindow::OnTimer(UINT id){ - streamTime++; - this->Invalidate(); + return; + } - return; -} + VOID CCommentWriteWindow::OnMeasureItem(UINT wParam,LPMEASUREITEMSTRUCT lParam){ -VOID CCommentWriteWindow::OnMeasureItem(UINT wParam,LPMEASUREITEMSTRUCT lParam){ + switch(lParam->CtlID){ - 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; - 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; } - break; + + + return; } - - return; -} + VOID CCommentWriteWindow::OnSendChatResult(){ + + commentSubEdit.AgreeEnter(); + return; + } + -VOID CCommentWriteWindow::OnSendChatResult(){ + VOID CCommentWriteWindow::OnHeartBeat(NicoLiveHeartBeat_P heartBeat){ - commentSubEdit.AgreeEnter(); - return; -} + if(heartBeat->status == NLIB_ERR_OK){ + streamTime = heartBeat->time; + } + return; + } -VOID CCommentWriteWindow::OnHeartBeat(NicoLiveHeartBeat_P heartBeat){ + VOID CCommentWriteWindow::OnDisConnect(){ - if(heartBeat->status == NLIB_ERR_OK){ - streamTime = heartBeat->time; + this->KillTimer(TIMER_ID); + return; } - return; -} -VOID CCommentWriteWindow::OnDisConnect(){ + // + //CSubChatEditƒNƒ‰ƒX + ////////////////////////////////////////////////////////////////////////////////////// - this->KillTimer(TIMER_ID); + void CSubChatEdit::OnKeyDown(TCHAR wParam, UINT upLParam,UINT loLParam){ + if(wParam == VK_RETURN){ - return; -} + cs.Lock(); + if(untilConnectingFlag == FALSE){ -// -//CSubChatEditƒNƒ‰ƒX -////////////////////////////////////////////////////////////////////////////////////// -void CSubChatEdit::OnKeyDown(TCHAR wParam, UINT upLParam,UINT loLParam){ - if(wParam == VK_RETURN){ - - cs.Lock(); - - if(untilConnectingFlag == FALSE){ - - - self.SendChat(); + self.SendChat(); + } + + cs.Unlock(); + + } - - cs.Unlock(); - - + return; } - return; -} -VOID CSubChatEdit::AgreeEnter(){ - cs.Lock(); - this->SetReadOnly(FALSE); - untilConnectingFlag = FALSE; - cs.Unlock(); -} + VOID CSubChatEdit::AgreeEnter(){ + cs.Lock(); + this->SetReadOnly(FALSE); + untilConnectingFlag = FALSE; + cs.Unlock(); + } } \ No newline at end of file diff --git a/nlite/nlite_commentview.cpp b/nlite/nlite_commentview.cpp index c40824e..51c276c 100644 --- a/nlite/nlite_commentview.cpp +++ b/nlite/nlite_commentview.cpp @@ -1303,6 +1303,7 @@ end: VOID CCommentListWindow::CalcItemHeight(CChatData &chatData){ + if(chatData.viewData.height == 0){ RECT drowSize; self.m_header.GetItemRect(CCommentView::COMMENT,&drowSize); @@ -1328,13 +1329,6 @@ end: LRESULT CCommentListWindow::OnCreate(LPCREATESTRUCT lpCreateStruct){ - - //CComPtr iu; - //::AtlAxCreateControlEx(TEXT("MSHTML:"),*this,(IStream*)NULL,(IUnknown**)NULL,&iu,GUID_NULL); - - //iu->QueryInterface(DIID_DWebBrowserEvents2,&addToMyListWindow); - RECT rc = {0,0,300,200}; -// addToMyListWindow.Create(m_hWnd, &rc,_T("Shell.Explorer.2"),WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN , 0); return 0; } @@ -1416,8 +1410,6 @@ end: VOID CCommentListWindow::OnDestroy(){ -// this->addToMyListWindow.DestroyWindow(); - } VOID CCommentListWindow::OnLButtonDown(UINT wParam, _WTYPES_NS::CPoint &point){ -- 2.11.0