OSDN Git Service

2012/01/24 16:53:14
[nlite/nlite.git] / nlite / nlite_commentWrite.cpp
1 #include "stdafx.h"
2 #include "nlite_include.h"
3
4 namespace nlite{
5
6
7 const static SIZE commentColorBoxSize = {35,0};
8
9 const static LPCTSTR ANONYMOUS_MAILCOMMAND = TEXT("184");
10 const static LPCTSTR ANONYMOUS_BOTTONSTRING = ANONYMOUS_MAILCOMMAND;
11
12 const static LPCTSTR WRITE_BOTTONSTRING = TEXT("\8f\91\82«\8d\9e\82Ý");
13 const static LPCTSTR CHECKBUTTON_HIDDENSTRING = TEXT(" ");
14
15 const static RECT COMMENTWRITEWINDOW_SEPARATEFSIZE = {0,5,0,5};
16 const static UINT_PTR COMMENTWRITEWINDOW_SIDESEPARATESIZE = 5;
17 const static UINT_PTR INIT_COMMENTWRITE_MAXLENGTH = 60;
18 const static UINT_PTR CHECKBUTTON_SUBSCRIPT_HEIGHT = 10;
19 const static LPCTSTR DEFAULT_COMMENTCOLOR = TEXT("white");
20 const static LPCTSTR DEFAULT_COMMENTSIZE = TEXT("medium");
21 const static LPCTSTR DEFAULT_COMMENTPOS = TEXT("naka");
22 const static COLORREF MAX_COLOR = 0xFFFFFF;
23
24
25
26 namespace generalUser{
27         const CommentColorInfo COMMENT_COLORLIST[] = {
28                 {DEFAULT_COMMENTCOLOR,RGB(0xFF,0xFF,0xFF)},             //\94\92
29                 {TEXT("red"),RGB(0xFF,0x00,0x00)},                      //\90Ô
30                 {TEXT("pink"),RGB(0xFF,0x80,0x80)},                     //\83s\83\93\83N
31                 {TEXT("orange"),RGB(0xFF,0xC0,0x00)},           //\83I\83\8c\83\93\83W
32                 {TEXT("yellow"),RGB(0xFF,0xFF,0x00)},           //\89©\90F
33                 {TEXT("green"),RGB(0x00,0xFF,0x00)},            //\97Î
34                 {TEXT("cyan"),RGB(0x00,0xFF,0xFF)},                     //\8a¦\90F
35                 {TEXT("blue"),RGB(0x00,0x00,0xFF)},                     //\90Â
36                 {TEXT("purple"),RGB(0xC0,0x00,0xFF)},           //\8e\87
37         
38         };
39
40         const CommentSizeInfo COMMENT_SIZELIST[] = {
41                 {TEXT("\95\81\92Ê\81@"),DEFAULT_COMMENTSIZE},                   //\95\81\92Ê\83T\83C\83Y
42                 {TEXT("\8f¬\81@"),TEXT("small")}                            //\8f¬\83T\83C\83Y
43         };
44
45
46         const CommentPosInfo COMMENT_POSLIST[] = {
47                 {TEXT("\92Ê\8fí\81@"),DEFAULT_COMMENTPOS}                             //\92Ê\8fí\95\\8e¦
48         };
49 }
50
51 namespace premiumUser{
52
53         const CommentColorInfo COMMENT_COLORLIST[] = {
54                 {TEXT("black"),RGB(0x00,0x00,0x00)},            //\8d\95
55                 {TEXT("white2"),RGB(0xCC,0xCC,0x99)},           //\94\92\82»\82Ì\82Q
56                 {TEXT("red2"),RGB(0xCC,0x00,0x33)},                     //\90Ô\82»\82Ì\82Q
57                 {TEXT("pink2"),RGB(0xFF,0x33,0xCC)},            //\83s\83\93\83N\82»\82Ì\82Q
58                 {TEXT("orange2"),RGB(0xFF,0x66,0x00)},          //\83I\83\8c\83\93\83W\82»\82Ì\82Q
59                 {TEXT("yellow2"),RGB(0x99,0x99,0x00)},          //\89©\90F\82»\82Ì\82Q
60                 {TEXT("green2"),RGB(0x00,0xCC,0x66)},           //\97Î\82»\82Ì\82Q
61                 {TEXT("cyan2"),RGB(0x00,0xCC,0xCC)},            //\8a¦\90F\82»\82Ì\82Q
62                 {TEXT("blue2"),RGB(0x33,0x99,0xFF)},            //\90Â\82»\82Ì\82Q
63                 {TEXT("purple2"),RGB(0x66,0x33,0xCC)}           //\8e\87\82»\82Ì\82Q
64         //      {TEXT("black2"),RGB(0x66,0x66,0x66)}            //\8d\95\82»\82Ì\82Q\82Í\82È\82¢\81H
65         };
66
67         const CommentSizeInfo COMMENT_SIZELIST[] = {
68                 {TEXT("\91å\81@"),TEXT("big")}                                      //\91å\83T\83C\83Y
69         };
70
71
72
73         const CommentPosInfo COMMENT_POSLIST[] = {
74                 {TEXT("\89º\81@"),TEXT("shita")},                           //\89º\82É\95\\8e¦
75                 {TEXT("\8fã\81@"),TEXT("ue")}                                       //\8fã\82É\95\\8e¦
76         };
77 }
78
79
80
81
82
83 template<typename T>
84 static VOID addItemList(CComboBox &combo,T * colorList,UINT_PTR length){
85
86         UINT_PTR startItemcount = combo.GetCount();
87         for(UINT_PTR index = startItemcount; index < length;index++){
88
89                 combo.AddString(colorList[index - startItemcount].name);
90                 combo.SetItemDataPtr(index,(LPVOID)&colorList[index - startItemcount]);
91
92         }
93
94         return;
95 }
96
97
98
99 template<typename T>
100 static UINT_PTR CalcComboBoxWidth(CComboBox &combo){
101
102         CPaintDC pdc(combo);
103         SIZE size;
104         UINT_PTR rslt = 0;
105         UINT_PTR itemCount = combo.GetCount();
106         LPCTSTR name;
107         for(UINT_PTR index = 0;index < itemCount;index++){
108                 name = ((T*)combo.GetItemDataPtr(index))->name;
109                 ::GetTextExtentPoint32(pdc,name,_tcslen(name),&size);
110                 rslt = rslt < (UINT_PTR)size.cx ? size.cx : rslt;
111         }
112
113         return rslt;
114 }
115
116 CCommentWriteWindow::CCommentWriteWindow(CNicoLiveStream &in_nicoLiveStream):
117 commentWriteHeight(0),
118 commentWriteInternalHeight(0),
119 commentWriteMaxLength(INIT_COMMENTWRITE_MAXLENGTH),
120 nicoLiveStream(in_nicoLiveStream),
121 commentSubEdit(*this)
122 {}
123
124
125
126 LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){
127
128         commentPosBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST ,0,COMMENTPOS_BOX);
129         commentSizeBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,0,COMMENTSIZE_BOX);
130         commentColorBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE  | CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED        ,0,COMMENTCOLOR_BOX);
131         anonymousButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_CHECKBOX | BS_AUTOCHECKBOX ,0,ANONYMOUS_BUTTON);
132         commentEdit.Create(m_hWnd,0,WC_EDIT,WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL,0,COMMENT_EDIT);
133         commentWriteButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,0,COMMENTWRITE_BOTTON);
134         commentPosBox.SetFont(AtlGetDefaultGuiFont());
135         commentSizeBox.SetFont(AtlGetDefaultGuiFont());
136         commentColorBox.SetFont(AtlGetDefaultGuiFont());
137
138         
139         anonymousButton.SetWindowTextW(CHECKBUTTON_HIDDENSTRING);
140         anonymousButton.SetFont(AtlGetDefaultGuiFont());
141         commentEdit.SetFont(AtlGetDefaultGuiFont());
142         commentEdit.SetLimitText(commentWriteMaxLength);
143         commentWriteButton.SetWindowTextW(WRITE_BOTTONSTRING);
144         commentWriteButton.SetFont(AtlGetDefaultGuiFont());
145         commentEdit.SetWindowTextW(TEXT(""));
146         
147         addItemList(commentColorBox,generalUser::COMMENT_COLORLIST,ARRAY_LENGTH(generalUser::COMMENT_COLORLIST));
148         addItemList(commentSizeBox,generalUser::COMMENT_SIZELIST,ARRAY_LENGTH(generalUser::COMMENT_SIZELIST));
149         addItemList(commentPosBox,generalUser::COMMENT_POSLIST,ARRAY_LENGTH(generalUser::COMMENT_POSLIST));
150         commentColorBox.SetCurSel(0);
151         commentSizeBox.SetCurSel(0);
152         commentPosBox.SetCurSel(0);
153         CFont font;
154         font = AtlGetDefaultGuiFont();
155         CPaintDC pdc(*this);
156         SIZE thisSize;
157         LPCTSTR sample = TEXT(" ");
158         commentSubEdit.SubclassWindow(commentEdit);
159         GetTextExtentPoint32(pdc,sample,_tcslen(sample),&thisSize);
160         commentWriteHeight = thisSize.cy + (CHECKBUTTON_SUBSCRIPT_HEIGHT / 2) + COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom;
161         commentWriteInternalHeight = commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom);
162         return 0;
163 }
164
165 VOID CCommentWriteWindow::OnDestroy(){
166         commentPosBox.DestroyWindow();
167         commentSizeBox.DestroyWindow();
168         commentColorBox.DestroyWindow();
169         anonymousButton.DestroyWindow();
170         commentEdit.DestroyWindow();
171         commentWriteButton.DestroyWindow();
172
173 }
174
175 VOID CCommentWriteWindow::OnSizing(UINT wParam,LPRECT lParam){
176
177         RECT client;
178         GetClientRect(&client);
179
180         ChangeSize( _WTYPES_NS::CSize(client.right - client.left,client.bottom - client.top));
181         return;
182 }
183
184 LRESULT CCommentWriteWindow::OnSize(UINT wParam,SIZE lParam){
185         ChangeSize(lParam);
186         return 0;
187 }
188 VOID CCommentWriteWindow::OnPaint(HDC hdc){
189
190         CPaintDC pdc(*this);
191         RECT clientRect;
192         this->GetClientRect(&clientRect);
193
194         pdc.FillRect(&clientRect,COLOR_BTNFACE);
195
196         
197         RECT anonymousRect;
198         SIZE anonymousStringSize;
199
200         anonymousButton.GetWindowRect(&anonymousRect);
201         CPoint anonymousPoint(anonymousRect.left,anonymousRect.top);
202         ::ScreenToClient(*this,&anonymousPoint);
203         anonymousRect.right -= anonymousRect.left;
204         anonymousRect.bottom -= anonymousRect.top;
205         anonymousRect.left = anonymousPoint.x;
206         anonymousRect.top = anonymousPoint.y + anonymousRect.bottom;
207
208
209         ::GetTextExtentPoint32(pdc,ANONYMOUS_BOTTONSTRING,_tcslen(ANONYMOUS_BOTTONSTRING),&anonymousStringSize);
210         anonymousRect.right = anonymousRect.left + anonymousStringSize.cx;
211         anonymousRect.bottom = anonymousRect.top + anonymousStringSize.cy;
212
213         LOGFONT anonymousLogFont = {0};
214         anonymousLogFont.lfHeight = CHECKBUTTON_SUBSCRIPT_HEIGHT;
215         anonymousLogFont.lfCharSet = SHIFTJIS_CHARSET;
216
217         CFont anonymousFont = CreateFontIndirect(&anonymousLogFont);
218         pdc.SelectFont(anonymousFont);
219         pdc.SetBkColor(GetSysColor(COLOR_BTNFACE));
220         pdc.DrawText(ANONYMOUS_BOTTONSTRING,_tcslen(ANONYMOUS_BOTTONSTRING),&anonymousRect,0);
221         
222         return;
223 }
224
225 static VOID agreeEnterKeyThread(LPVOID userData){
226
227         Sleep(1000);
228         ((CSubChatEdit*)userData)->AgreeEnter();
229
230         return;
231 }
232
233 BOOL CCommentWriteWindow::SendChat(){
234         this->commentEdit.SetReadOnly(TRUE);
235         CCommentMaker commentMaker;
236         std::vector<TCHAR> chat(commentEdit.GetWindowTextLengthW() + 1);
237         commentEdit.GetWindowTextW(&chat[0],chat.size());
238         commentMaker.SetChatString(&chat[0]);
239         if(this->anonymousButton.GetCheck() == BST_CHECKED){
240
241                 commentMaker.AddMail(ANONYMOUS_MAILCOMMAND);
242         }
243         INT_PTR sizeIndex = commentSizeBox.GetCurSel();
244         if(sizeIndex == CB_ERR)sizeIndex = 0;
245         auto &rCommentSizeInfo = *(CommentSizeInfo*)commentSizeBox.GetItemDataPtr(sizeIndex);
246
247         if(_tcscmp(rCommentSizeInfo.userData,DEFAULT_COMMENTSIZE) != 0){
248
249                 commentMaker.AddMail(rCommentSizeInfo.userData);
250
251         }
252         INT_PTR posIndex = commentPosBox.GetCurSel();
253         if(posIndex == CB_ERR)posIndex = 0;
254         auto &rCommentPosInfo = *(CommentPosInfo*)commentPosBox.GetItemDataPtr(posIndex);
255
256         if(_tcscmp(rCommentPosInfo.userData,DEFAULT_COMMENTPOS) != 0){
257
258                 commentMaker.AddMail(rCommentPosInfo.userData);
259         }
260
261         INT_PTR colorIndex = commentColorBox.GetCurSel();
262         if(colorIndex == CB_ERR)colorIndex = 0;
263         auto &rCommentColorInfo = *(CommentColorInfo*)commentColorBox.GetItemDataPtr(colorIndex);
264
265         if(_tcscmp(rCommentColorInfo.name,DEFAULT_COMMENTCOLOR) != 0){
266
267                 commentMaker.AddMail(rCommentColorInfo.name);
268         }
269
270
271         BOOL rslt = FALSE;
272         NLIB_RESULT code = nicoLiveStream.SendChat(commentMaker);
273
274         switch(code){
275
276         case NLIB_ERR_OK:
277
278                 rslt = TRUE;
279                 this->commentEdit.SetWindowText(TEXT(""));
280                 break;
281
282         case NLIB_ERR_NOT_LIVECONNECT:
283                 commentSubEdit.AgreeEnter();
284                 ::MessageBox(NULL,NLIB_GetErrorMessage(code),TEXT("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83G\83\89\81["),MB_ICONERROR | MB_OK);
285
286                 rslt = FALSE;
287                 break;
288
289         default:
290                 commentSubEdit.AgreeEnter();
291                 errprint(TEXT("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\92\86\82É\83G\83\89\81[:%s"),NLIB_GetErrorMessage(code));
292                 UnexpectedErrorMessageShow(TEXT("\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\92\86\82É"),NLIB_GetErrorMessage(code));
293                 rslt = FALSE;
294                 break;
295
296         }
297
298         
299         
300
301         return rslt;
302 }
303
304
305
306 VOID CCommentWriteWindow::ChangeSize(SIZE &size){
307
308         SIZE commentAnonymousButtonSize;
309         SIZE commentWriteButtonSize;
310         commentWriteButton.GetIdealSize(&commentWriteButtonSize);
311         anonymousButton.GetIdealSize(&commentAnonymousButtonSize);
312
313         RECT commentPosBoxRect;
314         RECT commentSizeBoxRect;
315         RECT commentColorBoxRect;
316         RECT anonymousButtonRect;
317         RECT commentEditRect;
318         RECT commentWriteButtonRect;
319
320         RECT thisWindowRect;
321         this->GetWindowRect(&thisWindowRect);
322
323         commentPosBoxRect.left = COMMENTWRITEWINDOW_SIDESEPARATESIZE;
324         this->commentPosBoxCS.Lock();
325         commentPosBoxRect.right = commentPosBoxRect.left + CalcComboBoxWidth<CommentPosInfo>(commentPosBox);
326         this->commentPosBoxCS.Unlock();
327
328         commentSizeBoxRect.left = commentPosBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
329         this->commentSizeBoxCS.Lock();
330         commentSizeBoxRect.right = commentSizeBoxRect.left + CalcComboBoxWidth<CommentSizeInfo>(commentSizeBox);
331         this->commentSizeBoxCS.Unlock();
332
333         commentColorBoxRect.left = commentSizeBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
334         commentColorBoxRect.right = commentColorBoxRect.left + commentColorBoxSize.cx;
335
336         CDC cdc(anonymousButton.GetDC());
337         SIZE anonymousStringSize;
338         ::GetTextExtentPoint32(cdc,CHECKBUTTON_HIDDENSTRING,_tcslen(CHECKBUTTON_HIDDENSTRING),&anonymousStringSize);
339         
340         anonymousButtonRect.left = commentColorBoxRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
341         anonymousButtonRect.right = anonymousButtonRect.left + commentAnonymousButtonSize.cx - anonymousStringSize.cx;
342
343         commentEditRect.left = anonymousButtonRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
344         
345         commentWriteButtonRect.right = size.cx - COMMENTWRITEWINDOW_SIDESEPARATESIZE;
346         commentWriteButtonRect.left = commentWriteButtonRect.right - commentWriteButtonSize.cx;
347
348         commentEditRect.right = commentWriteButtonRect.left - COMMENTWRITEWINDOW_SIDESEPARATESIZE;
349
350         
351
352         //\88Ú\93®\8f\88\97\9d
353         HDWP hDwp = BeginDeferWindowPos(6);
354         
355         commentPosBox.DeferWindowPos(hDwp,*this,
356                 commentPosBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentPosBoxRect.right - commentPosBoxRect.left,commentWriteInternalHeight,
357                 SWP_NOZORDER);
358
359         commentSizeBox.DeferWindowPos(hDwp,*this,
360                 commentSizeBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentSizeBoxRect.right - commentSizeBoxRect.left,commentWriteInternalHeight,
361                 SWP_NOZORDER);
362
363         commentColorBox.DeferWindowPos(hDwp,*this,
364                 commentColorBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentColorBoxRect.right - commentColorBoxRect.left,commentWriteInternalHeight,
365                 SWP_NOZORDER);
366
367         anonymousButton.DeferWindowPos(hDwp,*this,
368                 anonymousButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,anonymousButtonRect.right - anonymousButtonRect.left,commentWriteInternalHeight - CHECKBUTTON_SUBSCRIPT_HEIGHT,
369                 SWP_NOZORDER);
370
371         commentEdit.DeferWindowPos(hDwp,*this,
372                 commentEditRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentEditRect.right - commentEditRect.left,commentWriteInternalHeight,
373                 SWP_NOZORDER);
374
375         commentWriteButton.DeferWindowPos(hDwp,*this,
376                 commentWriteButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentWriteButtonRect.right - commentWriteButtonRect.left,commentWriteInternalHeight,
377                 SWP_NOZORDER);
378
379         EndDeferWindowPos(hDwp);
380
381         return;
382 }
383
384 VOID CCommentWriteWindow::OnDrawItem(UINT wParam,LPDRAWITEMSTRUCT lParam){
385         
386         
387
388         if(lParam->hwndItem == commentColorBox.m_hWnd && commentColorBox.GetCount() > 0){
389                 
390                 
391
392                 RECT drawRect = lParam->rcItem;
393                 UINT_PTR itemNo = 0;
394                 INT_PTR curselNo = commentColorBox.GetCurSel();
395                 CDCHandle dcHandle = lParam->hDC;
396                 CBrush bkBrush;
397                 const UINT_PTR width = 1;
398                 drawRect.left += width;
399                 drawRect.top += width;
400                 drawRect.right -= width;
401                 drawRect.bottom -= width;
402
403                 if(lParam->itemID == ((UINT)-1)){
404                         itemNo = curselNo == CB_ERR ? 0 : curselNo;
405                 } else {
406                         itemNo = lParam->itemID;
407                 }
408                 
409                 CommentInfo<COLORREF> &commentColor = *(CommentInfo<COLORREF> *)commentColorBox.GetItemDataPtr(itemNo);
410                 
411                 
412                 if(lParam->itemState & (ODS_FOCUS | ODS_COMBOBOXEDIT)){
413                         
414                         
415                         
416                         bkBrush.CreateSolidBrush(RGB(160,160,160));
417                                 
418                 } else {
419
420                         bkBrush.CreateSolidBrush(RGB(255,255,255));
421
422                 }
423
424
425                 
426                 
427                 CBrush brush;
428                 CPen cpen;
429
430                 brush.CreateSolidBrush(commentColor.userData);
431                 dcHandle.SelectBrush(brush);
432                 dcHandle.FillRect(&lParam->rcItem,bkBrush);
433                 dcHandle.SelectBrush(brush);
434                 dcHandle.SelectPen((HPEN)::GetStockObject(BLACK_PEN));
435                 dcHandle.Rectangle(&drawRect);
436                 
437         }
438
439         return;
440 }
441
442 LRESULT CCommentWriteWindow::OnEraseBkGnd(HDC wParam){
443
444         return TRUE;
445 }
446
447
448 LRESULT CCommentWriteWindow::OnButton(UINT hiWparam,INT_PTR loWparam,HWND lParam){
449
450         if(lParam == commentWriteButton){
451                 
452                 this->SendChat();
453
454         }
455
456         return TRUE;
457 }
458
459 VOID CCommentWriteWindow::OnMeasureItem(UINT wParam,LPMEASUREITEMSTRUCT lParam){
460
461         switch(lParam->CtlID){
462
463         case COMMENTCOLOR_BOX:
464                 {
465                         SIZE itemSize;
466                         CPaintDC pdc(*this);
467                         pdc.SelectFont(AtlGetDefaultGuiFont());
468                         LPCTSTR sample = TEXT(" ");
469                         ::GetTextExtentPoint32(pdc,sample,_tcslen(sample),&itemSize);
470                         lParam->itemHeight = itemSize.cy;
471
472                 }
473                 break;
474
475         }
476
477         
478
479         return;
480 }
481
482
483
484
485 VOID CCommentWriteWindow::OnSendChatResult(){
486
487         commentSubEdit.AgreeEnter();
488         return;
489 }
490
491
492
493
494
495
496 //
497 //CSubChatEdit
498 ////////////////////////////////////////
499
500 void CSubChatEdit::OnKeyDown(TCHAR wParam, UINT upLParam,UINT loLParam){
501         if(wParam == VK_RETURN){
502                                         
503                 cs.Lock();
504                                         
505                 if(untilConnectingFlag == FALSE){
506                         untilConnectingFlag = TRUE;
507                         
508
509                         self.SendChat();
510                 }
511                                         
512                 cs.Unlock();
513                                         
514                                         
515         }
516         return;
517 }
518
519
520 VOID CSubChatEdit::AgreeEnter(){
521         cs.Lock();
522         self.commentEdit.SetReadOnly(FALSE);
523         untilConnectingFlag = FALSE;
524         cs.Unlock();
525 }
526
527 }