OSDN Git Service

コメント整理
authorunknown <qwerty2501@users.sourceforge.jp>
Tue, 14 Feb 2012 06:44:32 +0000 (15:44 +0900)
committerunknown <qwerty2501@users.sourceforge.jp>
Tue, 14 Feb 2012 06:44:32 +0000 (15:44 +0900)
nlite.suo
nlite/nlite_chatData.cpp
nlite/nlite_commentWrite.cpp
nlite/nlite_commentview.cpp

index 3b39f78..50f287c 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index 51ac8af..e5569cd 100644 (file)
@@ -40,6 +40,7 @@ nameColor(INIT_COLOR)
 {}
 
 VOID ListenerData::SetNameColor(COLORREF nameColor_in){
+       
        nameColor = nameColor_in;
 
        return;
@@ -316,24 +317,30 @@ VOID CListenerList::BkColorCollect(CListenerColorCollector &target){
 
 CListenerList::reference CListenerList::Register(ListenerData &listener,BOOL bUpdate){
 
+       //\8aÖ\90\94\83I\83u\83W\83F\83N\83g\90\90¬
        ListenerPre listenerPre(listener);
 
+
        iterator begin = m_listenerList.begin();
        iterator end = m_listenerList.end();
 
+       //\93o\98^\97\\92è\82Ì\83\8a\83X\83i\81[\83f\81[\83^\82ª\82·\82Å\82É\93o\98^\82³\82ê\82Ä\82¢\82é\82©\8c\9f\8dõ
        iterator rslt = std::find_if(begin,end,listenerPre);
 
 
-
+       //\83\8a\83X\83i\81[\83f\81[\83^\82ª\93o\98^\82³\82ê\82Ä\82¢\82È\82¢\8fê\8d\87
        if(rslt == end){
 
-               
-               
+               //\83\8a\83X\83i\81[\83f\81[\83^\82ð\93o\98^
                m_listenerList.push_back(listener);
                return m_listenerList.back();
 
+
+
+               //\83\8a\83X\83i\81[\83f\81[\83^\82ª\93o\98^\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82Å\81A\8dX\90V\83t\83\89\83O\82ªtrue\82Ì\8fê\8d\87
        } else if(bUpdate == TRUE){
 
+               //\83\8a\83X\83i\81[\83f\81[\83^\82ð\8dX\90V
                *rslt = listener;
 
                
@@ -378,7 +385,6 @@ BOOL CListenerList::WriteProperty(LPCTSTR fileName){
 
        CComPtr<IXmlWriter> pWriter;
        CreateXmlWriter(__uuidof(IXmlWriter), reinterpret_cast<void**>(&pWriter), 0);
-       // \83t\83@\83C\83\8b\83X\83g\83\8a\81[\83\80\8dì\90¬
        CComPtr<IStream> 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();
 
+       //\83\8a\83X\83i\81[\83\8a\83X\83g\82©\82ç\95Û\91\91Î\8fÛ\82Ì\83f\81[\83^\82Ì\82Ýxml\8c`\8e®\82Å\95Û\91
        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);
index 9843313..a657ff0 100644 (file)
 namespace nlite{
 
 
-const static SIZE commentColorBoxSize = {35,0};
+       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 static LPCTSTR ANONYMOUS_MAILCOMMAND = TEXT("184");
-const static LPCTSTR ANONYMOUS_BOTTONSTRING = ANONYMOUS_MAILCOMMAND;
-const static LPCTSTR OWNERMODE_BOTTONSTRING = TEXT("\8eå\83R\83\81");
-const static LPCTSTR WRITE_BOTTONSTRING = TEXT("\8f\91\82«\8d\9e\82Ý");
-const static LPCTSTR CHECKBUTTON_HIDDENSTRING = TEXT(" ");
+               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 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("\89º\81@"),TEXT("shita")},                                           //\89º\82É\95\\8e¦
+                       {TEXT("\8fã\81@"),TEXT("ue")}                                                       //\8fã\82É\95\\8e¦
+               };
+       }
+
 
-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¦
-       };
-}
+       template<typename T>
+       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)},                     //\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
-       };
+                       combo.AddString(colorList[index - startItemcount].name);
+                       combo.SetItemDataPtr(index,(LPVOID)&colorList[index - startItemcount]);
 
-       const CommentSizeInfo COMMENT_SIZELIST[] = {
-               {TEXT("\91å\81@"),TEXT("big")}                                                      //\91å\83T\83C\83Y
-       };
+               }
 
+               return;
+       }
 
 
-       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 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<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++){
+       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){
+
+               //\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;
+       }
 
-template<typename T>
-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){
-
-       //\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());
-       
-       
-       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("\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){
+       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("\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);
+                       }
 
-               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<TCHAR> 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<TCHAR> 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("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83G\83\89\81["),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("\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;
+               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("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83G\83\89\81["),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("\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;
 
-       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<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 {
-
-               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));
 
-       //\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);
+               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<COLORREF> &commentColor = *(CommentInfo<COLORREF> *)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<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(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;
+
+
+
+               //\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;
+                       }
+
+                       CommentInfo<COLORREF> &commentColor = *(CommentInfo<COLORREF> *)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);    // \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;
+               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);    // \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
 
-                       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\83N\83\89\83X
+       //////////////////////////////////////////////////////////////////////////////////////
 
-       this->KillTimer(TIMER_ID);
+       void CSubChatEdit::OnKeyDown(TCHAR wParam, UINT upLParam,UINT loLParam){
+               if(wParam == VK_RETURN){
 
-       return;
-}
+                       cs.Lock();
 
+                       if(untilConnectingFlag == FALSE){
 
-//
-//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();
+                               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
index c40824e..51c276c 100644 (file)
@@ -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<IUnknown> iu;
-               //::AtlAxCreateControlEx(TEXT("MSHTML:<HTML><BODY></BODY></HTML>"),*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){