OSDN Git Service

2012/01/18 17:22:29
authorunknown <qwerty2501@users.sourceforge.jp>
Wed, 18 Jan 2012 08:22:29 +0000 (17:22 +0900)
committerunknown <qwerty2501@users.sourceforge.jp>
Wed, 18 Jan 2012 08:22:29 +0000 (17:22 +0900)
nlite.suo
nlite/nlite.cpp
nlite/nlite_appInfo.cpp
nlite/nlite_chatData.cpp
nlite/nlite_commentWrite.cpp
nlite/nlite_commentWrite.h
nlite/nlite_commentview.cpp
nlite/nlite_mainframe.cpp
nlite/nlite_property.cpp
nlite/nlite_property.h
nlite/stdafx.h

index 3c5f449..51fc55f 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index a1340a2..061252e 100644 (file)
@@ -3,9 +3,14 @@
 
 #include "stdafx.h"
 #include "nlite_include.h"
+using namespace nlite;
+CAppModule _Module;
+
+
+
+
 
 
-CAppModule _Module;
 
 const CApplicationInfo* nlite::appInfo = NULL;
 static TCHAR localAppDataPath[_MAX_PATH];
@@ -168,4 +173,5 @@ static BOOL InitializeNlite(){
         WSACleanup();
 
         return;
- }
\ No newline at end of file
+ }
+
index f57ec34..2367e3f 100644 (file)
@@ -1,6 +1,7 @@
 #include "stdafx.h"
 #include "nlite_include.h"
 
+namespace nlite {
 
 CApplicationInfo::CApplicationInfo(){
 
@@ -102,4 +103,6 @@ CApplicationInfo::~CApplicationInfo(){
 
 
        safeFree(pBlock);
+}
+
 }
\ No newline at end of file
index 3e2fb3f..ae1f7a3 100644 (file)
@@ -1,7 +1,7 @@
 #include "stdafx.h"
 #include "nlite_include.h"
 
-
+namespace nlite{
 CListenerList nlite::listenerList;
 
 //\83\8a\83X\83i\81[\8c\9f\8dõ\83I\83u\83W\83F\83N\83g
@@ -213,4 +213,7 @@ CListenerList::reference CListenerList::Register(LPCTSTR user_id){
        
        return *rslt;
 
+}
+
+
 }
\ No newline at end of file
index f39a531..cc5c3ee 100644 (file)
@@ -1,7 +1,7 @@
 #include "stdafx.h"
 #include "nlite_include.h"
 
-
+namespace nlite{
 
 const static SIZE commentPosBoxSize = {40,0};
 const static SIZE commentSizeBoxSize = {40,0};
@@ -11,38 +11,87 @@ const static LPCTSTR ANONYMOUS_BOTTONSTRING = TEXT("184");
 const static LPCTSTR WRITE_BOTTONSTRING = TEXT("\8f\91\82«\8d\9e\82Ý");
 
 
-static const RECT COMMENTWRITEWINDOW_SEPARATEFSIZE = {5,5,5,5};
+const static RECT COMMENTWRITEWINDOW_SEPARATEFSIZE = {5,5,5,5};
+const static UINT_PTR INIT_COMMENTWRITE_MAXLENGTH = 60;
+
+
+
+
+const ComentColor GENERALUSER_COMMENT_COLORLIST[] = {
+       {TEXT("white"),0xFFFFFF},
+       {TEXT("red"),0xFF0000},
+       {TEXT("pink"),0xFF8080},
+       {TEXT("orange"),0xFFC000},
+       {TEXT("yellow"),0xFFFF00},
+       {TEXT("green"),0x00FF00},
+       {TEXT("cyan"),0x00FFFF},
+       {TEXT("blue"),0x0000FF},
+       {TEXT("purple"),0xC000FF},
+       {TEXT("black"),0x000000}
+};
+
+const ComentColor PREMIUM_COMMENT_COLORLIST[] = {
+       {TEXT("white2"),0xCCCC99},
+       {TEXT("red2"),0xCC0033},
+       {TEXT("pink2"),0xFF33CC},
+       {TEXT("orange2"),0xFF6600},
+       {TEXT("yellow2"),0x999900},
+       {TEXT("green2"),0x00CC66},
+       {TEXT("cyan2"),0x00CCCC},
+       {TEXT("blue2"),0x3399FF},
+       {TEXT("purple2"),0x6633CC},
+       {TEXT("black2"),0x666666}
+};
 
+static VOID addCommentColorList(CComboBox &combo,LPVOID * colorList,UINT_PTR length);
+
+static VOID addCommentColorList(CComboBox &combo,LPVOID * colorList,UINT_PTR length){
+
+       UINT_PTR startItemcount = combo.GetCount();
+       for(UINT_PTR index = startItemcount; index < length;index++){
+
+               combo.AddString(TEXT(""));
+               combo.SetItemDataPtr(index,(LPVOID)&colorList[index - startItemcount]);
+
+       }
+
+       return;
+}
 
 CCommentWriteWindow::CCommentWriteWindow():
-commentWriteHeight(0)
+commentWriteHeight(0),
+commentWriteMaxLength(INIT_COMMENTWRITE_MAXLENGTH)
 {}
 
-LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){
 
-       commentPosBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,0);
-       commentSizeBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,0);
-       commentColorBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,0);
-       anonymousButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_CHECKBOX,0);
-       comment.Create(m_hWnd,0,WC_EDIT,WS_CHILD | WS_VISIBLE | WS_BORDER,0);
-       commentWriteButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,0);
 
+LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){
+
+       commentPosBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST ,0,COMMENTPOS_BOX);
+       commentSizeBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,0,COMMENTSIZE_BOX);
+       commentColorBox.Create(m_hWnd,0,WC_COMBOBOX,WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST  ,0,COMMENTCOLOR_BOX);
+       anonymousButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_CHECKBOX,0,ANONYMOUS_BUTTON);
+       comment.Create(m_hWnd,0,WC_EDIT,WS_CHILD | WS_VISIBLE | WS_BORDER,0,COMMENT_EDIT);
+       commentWriteButton.Create(m_hWnd,0,WC_BUTTON,WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,0,COMMENTWRITE_BOTTON);
        commentPosBox.SetFont(AtlGetDefaultGuiFont());
        commentSizeBox.SetFont(AtlGetDefaultGuiFont());
        commentColorBox.SetFont(AtlGetDefaultGuiFont());
        anonymousButton.SetWindowTextW(ANONYMOUS_BOTTONSTRING);
        anonymousButton.SetFont(AtlGetDefaultGuiFont());
        comment.SetFont(AtlGetDefaultGuiFont());
+       comment.SetLimitText(commentWriteMaxLength);
        commentWriteButton.SetWindowTextW(WRITE_BOTTONSTRING);
        commentWriteButton.SetFont(AtlGetDefaultGuiFont());
        comment.SetWindowTextW(TEXT(""));
        
-
+       addCommentColorList(commentColorBox,(LPVOID*)GENERALUSER_COMMENT_COLORLIST,ARRAY_LENGTH(GENERALUSER_COMMENT_COLORLIST));
+       
+       commentColorBox.SetItemData(0,12);
        CFont font;
        font = AtlGetDefaultGuiFont();
        CPaintDC pdc(*this);
        SIZE thisSize;
-       LPCTSTR sample = TEXT("a\82 A");
+       LPCTSTR sample = TEXT(" ");
        GetTextExtentPoint32(pdc,sample,_tcslen(sample),&thisSize);
        commentWriteHeight = thisSize.cy + COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom;
 
@@ -82,6 +131,8 @@ VOID CCommentWriteWindow::OnPaint(HDC hdc){
 }
 
 VOID CCommentWriteWindow::ChangeSize(SIZE &size){
+       
+       
 
        SIZE commentAnonymousButtonSize;
        SIZE commentWriteButtonSize;
@@ -95,4 +146,8 @@ VOID CCommentWriteWindow::ChangeSize(SIZE &size){
        comment.MoveWindow((COMMENTWRITEWINDOW_SEPARATEFSIZE.left * 5) + (COMMENTWRITEWINDOW_SEPARATEFSIZE.right * 4) + commentPosBoxSize.cx + commentSizeBoxSize.cx + commentColorBoxSize.cx + commentAnonymousButtonSize.cx,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,size.cx - (COMMENTWRITEWINDOW_SEPARATEFSIZE.left + (COMMENTWRITEWINDOW_SEPARATEFSIZE.right * 2) + commentWriteButtonSize.cx + ((COMMENTWRITEWINDOW_SEPARATEFSIZE.left * 5) + (COMMENTWRITEWINDOW_SEPARATEFSIZE.right * 4) + commentPosBoxSize.cx + commentSizeBoxSize.cx + commentColorBoxSize.cx + commentAnonymousButtonSize.cx)),commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom),TRUE);
        commentWriteButton.MoveWindow(size.cx - (commentWriteButtonSize.cx),COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentWriteButtonSize.cx - COMMENTWRITEWINDOW_SEPARATEFSIZE.right,commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom),TRUE);        
        return;
+}
+
+
+
 }
\ No newline at end of file
index c02c3fb..0bfef79 100644 (file)
@@ -2,7 +2,23 @@
 
 namespace nlite{
 
-       
+       ///
+       ///\83R\83\81\83\93\83g\90F\8d\\91¢\91Ì
+       ///
+       struct ComentColor{
+               LPCTSTR name;
+               COLORREF color;
+       };
+
+       ///
+       ///\88ê\94Ê\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
+       ///
+       extern const ComentColor GENERALUSER_COMMENT_COLORLIST[];
+
+       ///
+       ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
+       ///
+       extern const ComentColor PREMIUM_COMMENT_COLORLIST[];
 
        const static LPCTSTR COMMENTWRITEWINDOW = TEXT("commentWriteWindow");
        
@@ -15,7 +31,17 @@ namespace nlite{
                CButton anonymousButton;
                CEdit comment;
                CButton commentWriteButton;
+               UINT_PTR commentWriteMaxLength;
+
+               enum CONTROLID{
+                       COMMENTPOS_BOX = 1,
+                       COMMENTSIZE_BOX = 2,
+                       COMMENTCOLOR_BOX = 3,
+                       ANONYMOUS_BUTTON = 4,
+                       COMMENT_EDIT = 5,
+                       COMMENTWRITE_BOTTON = 6,
 
+               };
 
        public:
                UINT_PTR commentWriteHeight;
@@ -53,7 +79,6 @@ namespace nlite{
 
                VOID ChangeSize(SIZE &size);
 
-               
        };
 
 }
\ No newline at end of file
index cb98098..2d17482 100644 (file)
@@ -2,7 +2,7 @@
 #include "nlite_include.h"
 
 
-
+namespace nlite{
 
 //
 //\83R\83\81\83\93\83g\83r\83\85\81[\83N\83\89\83X\83\81\83\\83b\83h
@@ -227,7 +227,7 @@ VOID CCommentView::OnChatReceveSettle(UINT_PTR chatNo,UINT_PTR commentCountSum){
        if(scrollFlag == TRUE){
                this->SendMessageW(WM_VSCROLL,MAKEWORD(SB_BOTTOM,0),0);
        }
-       if(TryEnterCriticalSection(&m_commentListWindow.m_sec) == TRUE){
+       if(vScrollInfo.nPos + vScrollInfo.nPage >= vScrollInfo.nMax - vScrollInfo.nPage && TryEnterCriticalSection(&m_commentListWindow.m_sec) == TRUE){
                m_commentListWindow.Invalidate();
                m_commentListWindow.Unlock();
        }
@@ -937,3 +937,4 @@ LRESULT CCommentListWindow::OnMouseWheel(UINT loWparam,SHORT hiWparam,CPoint &po
 
 
 
+}
\ No newline at end of file
index ad95865..5fc5ab3 100644 (file)
@@ -2,7 +2,7 @@
 #include "nlite_include.h"
 
 
-
+namespace nlite{
 
 static const RECT commentViewSize = {5,0,5,0};
 
@@ -162,4 +162,5 @@ NLIB_RESULT CNliteMainFrame::LiveCallBack(NICOLIVE_EVENT eventType,NicoLiveStrea
        
 
        return NLIB_ERR_OK;
+}
 }
\ No newline at end of file
index 4767171..e7f0002 100644 (file)
@@ -1,7 +1,7 @@
 #include "stdafx.h"
 #include "nlite_include.h"
 
-
+namespace nlite{
 
 #define NLITE_READ_INI_INT(cs,mm,path)         cs.mm = GetPrivateProfileInt(cs.GetSectionName(),TEXT(#mm),cs.mm,path)
 
@@ -337,4 +337,6 @@ VOID Property::WriteIniFile(){
        WritePrivateProfileString(gp.GetSectionName(),TEXT(TOSTR(browserType)),browserTypeName,propertyPath);
 
        return;
+}
+
 }
\ No newline at end of file
index e549537..c781401 100644 (file)
@@ -2,6 +2,8 @@
 
 namespace nlite{
 
+       
+
        class CCookieSettingWindow:public CDialogImpl<CCookieSettingWindow>{
                
        private:
index f9f0238..0358ba2 100644 (file)
@@ -61,7 +61,6 @@ extern CAppModule _Module;
 #pragma comment(lib,"ComCtl32.lib")
 #pragma comment(lib,"atlthunk.lib")
 #pragma comment(lib,"version.lib")
-namespace nlite{}
-using namespace nlite;
+