OSDN Git Service

2012/01/27 15:13:39
authorunknown <qwerty2501@users.sourceforge.jp>
Fri, 27 Jan 2012 06:13:40 +0000 (15:13 +0900)
committerunknown <qwerty2501@users.sourceforge.jp>
Fri, 27 Jan 2012 06:13:40 +0000 (15:13 +0900)
nlite.suo
nlite/nlite_chatData.cpp
nlite/nlite_chatData.h
nlite/nlite_commentWrite.cpp
nlite/nlite_commentWrite.h
nlite/nlite_commentview.cpp
nlite/nlite_commentview.h
nlite/nlite_property.cpp
nlite/nlite_property.h

index 550bee1..c45f2f7 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index d36febd..c1dd69e 100644 (file)
@@ -24,7 +24,7 @@ struct ListenerPre{
 ListenerData::ListenerData(LPCTSTR user_id_in):
 user_id(user_id_in),
 userName(TEXT("")),
-bkColor(RGB(0,0,0)),
+bkColor(PALETTERGB(0,0,0)),
 originBkFlag(FALSE)
 {}
 
@@ -45,7 +45,12 @@ VOID CCommentList::OnChatReceve(NicoLiveChat_P chatData_in, UINT_PTR commnetCoun
        chatList.push_back(chatData);
        return;
 }
-
+CChatData::ViewData::ViewData():
+                       sellLineColor(INIT_COLOR),
+                       stringColor(INIT_COLOR),
+                       backColor(INIT_COLOR),
+                 selectFlag(FALSE)
+               {}
 
 VOID CChatData::SetChat(NicoLiveChat &chat_in){
        
@@ -92,14 +97,12 @@ struct GetCurSelFunc_t{
        INT_PTR count;
        BOOL findFlag;
        GetCurSelFunc_t():
-               count(0),
-               findFlag(FALSE)
+               count(0)
                {}
 
        BOOL operator() (CChatData &target){
                count++;
-               findFlag = target.selectFlag;
-               return target.selectFlag;
+               return  target.viewData.selectFlag;
        }
 
 };
@@ -110,9 +113,12 @@ CCommentList::~CCommentList(){}
 
 INT_PTR CCommentList::GetCurSel(){
        GetCurSelFunc_t functa;
-       std::find_if(chatList.begin(),chatList.end(),functa);
+       auto end = this->end();
+       auto ite = this->begin();
+       INT_PTR count = 0;
+       for(;ite != end && ite->viewData.selectFlag == FALSE;++ite,++count);
 
-       return functa.findFlag == TRUE ? functa.count - 1 : -1;
+       return ite != end ? count : ERR;
 }
 
 CCommentList::iterator CCommentList::GetCurSelItem(){
@@ -123,10 +129,19 @@ CCommentList::iterator CCommentList::GetCurSelItem(){
 
 
 VOID CCommentList::SetCurSel(INT_PTR cursel){
-       if(cursel < 0)return;
-       iterator data = chatList.begin();
-       std::advance(data,cursel);
-       data->selectFlag = TRUE;
+       if(cursel < 0)goto end;
+       {
+               auto curselItem = this->GetCurSelItem();
+       
+               if(curselItem != this->end()){
+                       curselItem->viewData.selectFlag = FALSE;
+               }
+       
+               iterator data = chatList.begin();
+               std::advance(data,cursel);
+               data->viewData.selectFlag = TRUE;
+       }
+end:
 
        return;
 }
index f4f2aed..ee04bb6 100644 (file)
@@ -105,7 +105,22 @@ namespace nlite{
 
        class CChatData{
 
+               
        public:
+               struct ViewData{
+
+                       enum{
+                               INIT_COLOR = -1
+                       };
+                       BOOL selectFlag;                                        //\91I\91ð\8fó\91Ô
+                       COLORREF stringColor;                           //\93Æ\8e©\95\8e\9a\90F
+                       COLORREF backColor;                                     //\93Æ\8e©\94w\8ci\90F
+                       COLORREF sellLineColor;                         //\98g\90ü\90F
+
+                       ViewData();
+               };
+
+               ViewData viewData;                                      //\95\\8e¦\97p\83f\81[\83^
                UINT_PTR premium;                                       //\83v\83\8c\83~\83A\83\80\8eí\95Ê
                BOOL anonymity;                                         //\93½\96¼\83t\83\89\83O
                UINT_PTR no;                                            //\83R\83\81\94Ô
@@ -117,13 +132,13 @@ namespace nlite{
                CNLiteString chatBuf;                                   //\83`\83\83\83b\83g\96{\95
                std::vector<CNLiteString> mail;                 //\83\81\81[\83\8b\83R\83}\83\93\83h
                ULONG_PTR thread;                                       //\83X\83\8c\83b\83h\94Ô\8d\86
-               BOOL selectFlag;                                        //\91I\91ð\8fó\91Ô
-//             UINT_PTR height;                                        //\95\\8e¦\97Ì\88æ\82Ì\8d\82\82³
+               
 
+               
+
+               
        public:
-               CChatData():
-                 selectFlag(FALSE)
-               {}
+
 
                VOID SetChat(NicoLiveChat &chat_in);
 
@@ -139,6 +154,7 @@ namespace nlite{
                typedef std::list<CChatData> ChatList;
                ChatList chatList;
 
+       
 
        
                //\83G\83\89\81[\83R\81[\83h
index f4b0e8e..8458aab 100644 (file)
@@ -25,15 +25,15 @@ const static COLORREF MAX_COLOR = 0xFFFFFF;
 
 namespace generalUser{
        const CommentColorInfo COMMENT_COLORLIST[] = {
-               {DEFAULT_COMMENTCOLOR,RGB(0xFF,0xFF,0xFF)},             //\94\92
-               {TEXT("red"),RGB(0xFF,0x00,0x00)},                      //\90Ô
-               {TEXT("pink"),RGB(0xFF,0x80,0x80)},                     //\83s\83\93\83N
-               {TEXT("orange"),RGB(0xFF,0xC0,0x00)},           //\83I\83\8c\83\93\83W
-               {TEXT("yellow"),RGB(0xFF,0xFF,0x00)},           //\89©\90F
-               {TEXT("green"),RGB(0x00,0xFF,0x00)},            //\97Î
-               {TEXT("cyan"),RGB(0x00,0xFF,0xFF)},                     //\8a¦\90F
-               {TEXT("blue"),RGB(0x00,0x00,0xFF)},                     //\90Â
-               {TEXT("purple"),RGB(0xC0,0x00,0xFF)},           //\8e\87
+               {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
        
        };
 
@@ -51,17 +51,17 @@ namespace generalUser{
 namespace premiumUser{
 
        const CommentColorInfo COMMENT_COLORLIST[] = {
-               {TEXT("black"),RGB(0x00,0x00,0x00)},            //\8d\95
-               {TEXT("white2"),RGB(0xCC,0xCC,0x99)},           //\94\92\82»\82Ì\82Q
-               {TEXT("red2"),RGB(0xCC,0x00,0x33)},                     //\90Ô\82»\82Ì\82Q
-               {TEXT("pink2"),RGB(0xFF,0x33,0xCC)},            //\83s\83\93\83N\82»\82Ì\82Q
-               {TEXT("orange2"),RGB(0xFF,0x66,0x00)},          //\83I\83\8c\83\93\83W\82»\82Ì\82Q
-               {TEXT("yellow2"),RGB(0x99,0x99,0x00)},          //\89©\90F\82»\82Ì\82Q
-               {TEXT("green2"),RGB(0x00,0xCC,0x66)},           //\97Î\82»\82Ì\82Q
-               {TEXT("cyan2"),RGB(0x00,0xCC,0xCC)},            //\8a¦\90F\82»\82Ì\82Q
-               {TEXT("blue2"),RGB(0x33,0x99,0xFF)},            //\90Â\82»\82Ì\82Q
-               {TEXT("purple2"),RGB(0x66,0x33,0xCC)}           //\8e\87\82»\82Ì\82Q
-       //      {TEXT("black2"),RGB(0x66,0x66,0x66)}            //\8d\95\82»\82Ì\82Q\82Í\82È\82¢\81H
+               {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[] = {
@@ -442,11 +442,11 @@ VOID CCommentWriteWindow::OnDrawItem(UINT wParam,LPDRAWITEMSTRUCT lParam){
                        
                        
                        
-                       bkBrush.CreateSolidBrush(RGB(160,160,160));
+                       bkBrush.CreateSolidBrush(PALETTERGB(160,160,160));
                                
                } else {
 
-                       bkBrush.CreateSolidBrush(RGB(255,255,255));
+                       bkBrush.CreateSolidBrush(PALETTERGB(255,255,255));
 
                }
 
index 1b5ddaf..3616b05 100644 (file)
@@ -74,7 +74,7 @@ namespace nlite{
 
                BEGIN_MSG_MAP_EX(CSubLiveNoComboBox)
                        MSG_WM_KEYDOWN(OnKeyDown)
-                       END_MSG_MAP()
+               END_MSG_MAP()
 
                        void OnKeyDown(TCHAR wParam, UINT upLParam,UINT loLParam);
 
index e95c9d2..4bf457a 100644 (file)
@@ -3,17 +3,17 @@
 
 
 namespace nlite{
-
+       /*
        //\90F\92è\90\94
        namespace ColorList{
                enum type{
-                       selectBack = RGB(255,240,240),
-                       outLineSelect = RGB(255,0,0),
-                       outLineNomal = RGB(0,0,0),
-                       colLine = RGB(224,224,224)
+                       selectBack = PALLETRGB(255,240,240),
+                       outLineSelect = PALLETRGB(255,0,0),
+                       outLineNomal = PALLETRGB(0,0,0),
+                       colLine = PALLETRGB(224,224,224)
                };
        };
-
+       */
        //
        //\83R\83\81\83\93\83g\83r\83\85\81[\83N\83\89\83X\83\81\83\\83b\83h
        ///////////////////////////////////////////////////////
@@ -256,7 +256,7 @@ namespace nlite{
 
        static UCHAR getrgb(){
 
-               UCHAR rgb = 160 + rand() % 92;
+               UCHAR rgb = 192 + rand() % 64;
                return rgb;
        }
 
@@ -612,19 +612,13 @@ namespace nlite{
                                baseBkBrush.DeleteObject();
                                CCommentList::iterator endData = commentList.end();
                                listRect.bottom = 0;
-
-                               CPen outLinePen;
-                               outLinePen.CreatePen(PS_SOLID,1,ColorList::outLineNomal);
-                               mdc.SelectPen(outLinePen);
-                               mdc.MoveTo(listRect.right,listRect.top);
-                               mdc.LineTo(listRect.right,listRect.bottom);
-
+                               
 
                                for(;chatData != endData && listRect.top < clientRect.bottom;++chatData){
                                        listRect.bottom +=      CalcItemHeight(*chatData);
 
 
-                                       if(chatData->selectFlag == TRUE){
+                                       if(chatData->viewData.selectFlag == TRUE){
                                                selectFlag = TRUE;
                                                selectData = chatData;
                                                selectRect = listRect;
@@ -637,9 +631,8 @@ namespace nlite{
                                        listRect.top = listRect.bottom;
                                }
 
-                               mdc.SelectPen(outLinePen);
-                               mdc.MoveTo(listRect.left,listRect.bottom);
-                               mdc.LineTo(listRect.right,listRect.bottom);
+       
+                               
 
                                if(selectFlag == TRUE){
                                        this->DrawItem(mdc,selectRect,*selectData);
@@ -757,28 +750,32 @@ overclientrect:
                _tcsftime(dateString,ARRAY_LENGTH(dateString),timeFormat,&ct);
 
                COLORREF bkColor;
-               COLORREF outLineColor;
+               COLORREF sellLineColor;
 
-               CPen outLinePen;
-               CPen colLinePen;
+               CPen sellLinePen;
+               CPen collLinePen;
                CBrush bkBrush;
-               colLinePen.CreatePen(PS_SOLID,1,ColorList::colLine);
+               collLinePen.CreatePen(PS_SOLID,1,self.viewproperty.colLineColor);
 
 
                //\91I\91ð\8fó\91Ô\82©\83`\83F\83b\83N
-               if (chatData.selectFlag == TRUE)
+               if (chatData.viewData.selectFlag == TRUE)
                {
-                       bkColor = ColorList::selectBack;
-                       outLineColor = ColorList::outLineSelect;
+                       bkColor = self.viewproperty.selectBackColor;
+                       sellLineColor = self.viewproperty.selectSellLineColor;
 
 
                }
                else  
                {
 
-                       outLineColor = ColorList::outLineNomal;
+                       sellLineColor = chatData.viewData.sellLineColor == CChatData::ViewData::INIT_COLOR ? self.viewproperty.normalSellLineColor : chatData.viewData.sellLineColor;
 
-                       if(chatData.listenerData->originBkFlag == TRUE){
+                       if(chatData.viewData.backColor != CChatData::ViewData::INIT_COLOR){
+                       
+                               bkColor = chatData.viewData.backColor;
+
+                       }else if(chatData.listenerData->originBkFlag == TRUE){
 
                                bkColor = chatData.listenerData->bkColor;
 
@@ -791,28 +788,14 @@ overclientrect:
 
                        }
                }
-
-               outLinePen.CreatePen(PS_SOLID,1,outLineColor);
+               
+               sellLinePen.CreatePen(PS_SOLID,1,sellLineColor);
                bkBrush.CreateSolidBrush(bkColor);
-               dc.SelectPen(outLinePen);
-
-               if(chatData.selectFlag == TRUE){
-
-                       dc.MoveTo(rc.left,rc.bottom);
-                       dc.LineTo(rc.right,rc.bottom);
-               }
-               dc.FillRect(&rc,bkBrush);
+               dc.SelectPen(sellLinePen);
+               dc.SelectBrush(bkBrush);
+               dc.Rectangle(rc.left,rc.top  - 1,rc.right ,rc.bottom + 1);
                dc.SetBkColor(bkColor);
-               dc.MoveTo(rc.left,rc.top);
-               dc.LineTo(rc.right,rc.top);
-
-
-
-               dc.SetTextColor(self.viewproperty.baseStringColor);
-
-
-
-
+               dc.SetTextColor(chatData.viewData.stringColor == CChatData::ViewData::INIT_COLOR ? chatData.viewData.stringColor :self.viewproperty.baseStringColor);
 
                //\95`\89æ\83T\83C\83Y\82ð\8cv\8eZ
 
@@ -846,7 +829,7 @@ overclientrect:
                chatViewRect.bottom = rc.bottom - 2;
                infoViewRect.bottom = rc.bottom - 2;
 
-               dc.SelectPen(colLinePen);
+               dc.SelectPen(collLinePen);
 
                dc.MoveTo(noViewRect.right,rc.top);
                dc.LineTo(noViewRect.right,rc.bottom);
@@ -866,6 +849,27 @@ overclientrect:
        }
 
 
+
+       VOID CCommentListWindow::ShowCurSel(){
+
+               INT_PTR cursel = self.commentlist.GetCurSel();
+               if(cursel == CCommentList::ERR)goto end;
+
+               SCROLLINFO vScrollInfo;
+               vScrollInfo.cbSize = sizeof(vScrollInfo);
+               vScrollInfo.fMask = SIF_ALL;
+               self.GetScrollInfo(SB_VERT,&vScrollInfo);
+
+               if(!(cursel >= vScrollInfo.nPos && cursel < vScrollInfo.nPos + static_cast<INT_PTR>(vScrollInfo.nPage))){
+                       self.SetScrollPos(SB_VERT,cursel - (vScrollInfo.nPage / 2));
+               }
+
+               this->Invalidate();
+end:
+
+               return;
+       }
+
        UINT_PTR CCommentListWindow::CalcItemHeight(CChatData &chatData){
 
                RECT drowSize;
@@ -923,29 +927,28 @@ end:
 
        VOID CCommentListWindow::OnLButtonDown(UINT wParam, _WTYPES_NS::CPoint &point){
 
-
+               if(point.x > (INT_PTR)self.GetColumnHolSizeSum()) goto end;
 
                this->SetFocus();
-               if(self.commentlist.empty() == TRUE)return;
-               auto curselItem = self.commentlist.GetCurSelItem();
-               if(curselItem != self.commentlist.end()){
-                       curselItem->selectFlag = FALSE;
-               }
+               if(self.commentlist.empty() == TRUE)goto end;
+               
                self.commentlist.SetCurSel(CalcClickLine(point.y));
                if(TryEnterCriticalSection(&this->m_sec) == TRUE){
                        this->Invalidate();
                        this->Unlock();
                }
-               return;
-       }
 
+end:
 
-       VOID CCommentListWindow::OnLButtonDbClk(UINT wParam, _WTYPES_NS::CPoint &point){
+               return;
+       }
 
 
+       VOID CCommentListWindow::OnLButtonDblClk(UINT wParam, _WTYPES_NS::CPoint &point){
 
+               if(point.x > (INT_PTR)self.GetColumnHolSizeSum()) return;
+               
 
-               this->SetFocus();
                if(self.commentlist.empty() == TRUE)return;
 
                auto chatData = self.commentlist.GetChatAt(CalcClickLine(point.y));
@@ -963,7 +966,7 @@ end:
                                red = getrgb();
                                green = getrgb();
                                blue = getrgb();
-                               bkColor = RGB(red,green,blue);
+                               bkColor = PALETTERGB(red,green,blue);
 
                        }while(colorCollector.Find(bkColor));
 
@@ -996,6 +999,39 @@ end:
                return TRUE;
        }
 
+       VOID CCommentListWindow::OnKeyDown(TCHAR vKey,UINT loLParam,UINT hiLParam){
+
+               INT_PTR dy = 0;
+               switch(vKey){
+
+               case VK_DOWN:
+               case VK_RETURN:
+                       dy = 1;
+
+                       break;
+               case VK_UP:
+
+                       dy = -1;
+                       break;
+               default:
+                       break;
+
+
+               }
+
+               dy += self.commentlist.GetCurSel();
+               
+               if(dy < 0 || dy > static_cast<INT_PTR>(self.commentlist.Size()))goto end;
+
+               self.commentlist.SetCurSel(dy);
+
+               this->ShowCurSel();
+end:
+
+                                       
+               return;
+       }
+
        LRESULT CCommentListWindow::OnMouseWheel(UINT loWparam,SHORT hiWparam,CPoint &point){
 
 
index 6575ba8..9e9f7b4 100644 (file)
@@ -46,13 +46,14 @@ namespace nlite{
                //\83\81\83b\83Z\81[\83W\83}\83b\83v
                //
                BEGIN_MSG_MAP(CCommentListWindow)
-                       MSG_WM_LBUTTONDBLCLK(OnLButtonDbClk)
+                       MSG_WM_LBUTTONDBLCLK(OnLButtonDblClk)
                        MSG_WM_LBUTTONDOWN(OnLButtonDown)
                        MSG_WM_CREATE(OnCreate)
                        MSG_WM_ERASEBKGND(OnEraseBkGnd)
                        MSG_WM_MOUSEWHEEL(OnMouseWheel)
                        MSG_WM_PAINT(OnPaint)
                        MSG_WM_SIZE(OnSize)
+                       MSG_WM_KEYDOWN(OnKeyDown)
                END_MSG_MAP()
 
 
@@ -79,6 +80,11 @@ namespace nlite{
                ///\8ds\82Ì\8d\82\82³\82ð\96â\82¢\8d\87\82í\82¹
                ///
                UINT_PTR CalcItemHeight(CChatData &chatData);
+
+               ///
+               ///\91I\91ð\8ds\82ð\95\\8e¦
+               ///
+               VOID ShowCurSel();
                
 
                //\83v\83\89\83C\83x\81[\83g\8aÖ\90\94
@@ -124,7 +130,7 @@ namespace nlite{
                ///
                ///\83}\83E\83X\83_\83u\83\8b\83N\83\8a\83b\83N\8e\9e\82Ì\8f\88\97\9d
                ///
-               VOID OnLButtonDbClk(UINT wParam, _WTYPES_NS::CPoint &point);
+               VOID OnLButtonDblClk(UINT wParam, _WTYPES_NS::CPoint &point);
 
                ///
                ///\94w\8ci\93h\82è\82Â\82Ô\82µ
@@ -135,6 +141,11 @@ namespace nlite{
                ///\83}\83E\83X\83z\83C\81[\83\8b
                ///
                LRESULT OnMouseWheel(UINT loWparam,SHORT hiWparam,CPoint &point);
+
+               ///
+               ///\83L\81[\89\9f\89º\8e\9e\82Ì\8f\88\97\9d
+               ///
+               VOID OnKeyDown(TCHAR vKey,UINT loLParam,UINT hiLParam);
                
        };
        
index 3520004..3a60efd 100644 (file)
@@ -3,17 +3,6 @@
 
 namespace nlite{
 
-#define NLITE_READ_INI_INT(cs,mm,path)         cs.mm = GetPrivateProfileInt(cs.GetSectionName(),TEXT(#mm),cs.mm,path)
-
-#define NLITE_READ_INI_STR(cs,mm,bv,path)      \
-       GetPrivateProfileString(cs.GetSectionName(),TEXT(#mm),cs.mm,&bv[0],bv.size(),path);\
-       cs.mm = &bv[0]\
-       /*\83}\83N\83\8d\81@\8fI\97¹*/
-
-#define NLITE_WRITE_INI_INT(cs,mm,path)                WritePrivateProfileInt(cs.GetSectionName(),TEXT(#mm),cs.mm,path)
-
-#define NLITE_WRITE_INI_STR(cs,mm,path)                WritePrivateProfileString(cs.GetSectionName(),TEXT(#mm),cs.mm,path)
-
 
 #define NLITE_GET_TYPENAME(n)                  (_tcsstr(CComBSTR(typeid(n).name()),TEXT("::")) + 2)
 
@@ -184,8 +173,12 @@ CommentViewProperty::CommentViewProperty():
        commentFoldingFlag(TRUE),
        commentTimeType(StreamingTimeType),
        PropertyBase(TEXT("COMMENTVIEW")),
-       baseStringColor(RGB(0,0,0)),
-       backColor(RGB(255,255,255))
+       baseStringColor(PALETTERGB(0,0,0)),
+       backColor(PALETTERGB(255,255,255)),
+       selectBackColor(PALETTERGB(255,240,240)),                       
+       selectSellLineColor(PALETTERGB(255,0,0)),                                               
+       normalSellLineColor( PALETTERGB(0,0,0)),
+       colLineColor(PALETTERGB(224,224,224))
 
 {
 
@@ -282,119 +275,8 @@ VOID Property::ReadProperty(){
        buf[buf.size() -1 ] = TEXT('\0'); 
        propertyFile.Read(&buf[0],buf.size());
        ReadPropertyXML reader(*this);
-       dumpln_mb(CP_UTF8,"%s",&buf[0]);
        reader.Parse(&buf[0],buf.size());
-       /*
-       std::vector<TCHAR> buffer(LENGTH_2048);
-       
-       //crp\82Ì\90Ý\92è\92l\93Ç\82Ý\8d\9e\82Ý
-
-       NLITE_READ_INI_INT(crp,besideLengthFlag,propertyPath);
-
-       NLITE_READ_INI_INT(crp,bspReadFlag,propertyPath);
-
-       NLITE_READ_INI_INT(crp,commentReadFlag,propertyPath);
-
-       NLITE_READ_INI_INT(crp,administratorCommentReadFlag,propertyPath);
-
-       NLITE_READ_INI_INT(crp,maxCommentLength,propertyPath);
-
-       NLITE_READ_INI_INT(crp,newLineReadFlag,propertyPath);
-
-       NLITE_READ_INI_INT(crp,ngUserReadFlag,propertyPath);
-
-       NLITE_READ_INI_INT(crp,ngWordReadFlag,propertyPath);
-
-       NLITE_READ_INI_INT(crp,teropReadFlag,propertyPath);
-
-       NLITE_READ_INI_INT(crp,userCommentReadFlag,propertyPath);
-
-       NLITE_READ_INI_STR(crp,outString,buffer,propertyPath);
-
-       NLITE_READ_INI_STR(crp,shortComment,buffer,propertyPath);
-
-
-       //commentview\90Ý\92è\92l\93Ç\82Ý\8d\9e\82Ý
-
-       NLITE_READ_INI_INT(cvp,anonymousIDLinkColor,propertyPath);
-
-       NLITE_READ_INI_INT(cvp,backColor,propertyPath);
-
-       NLITE_READ_INI_INT(cvp,baseStringColor,propertyPath);
-
-       NLITE_READ_INI_INT(cvp,commentFoldingFlag,propertyPath);
-
-       NLITE_READ_INI_INT(cvp,commentTimeType,propertyPath);
-
-       NLITE_READ_INI_INT(cvp,IDLinkColor,propertyPath);
-
-       NLITE_READ_INI_INT(cvp,lineColor,propertyPath);
-       
        
-       TCHAR headerKey[_MAX_PATH];
-       TCHAR headerOrderKey[_MAX_PATH];
-
-       for(UINT_PTR index = 0;index < ARRAY_LENGTH(cvp.headerholSize);index++){
-               _stprintf(headerKey,headerFormat,index);
-               _stprintf(headerOrderKey,headerOrderFormat,index);
-               cvp.headerholSize[index] = GetPrivateProfileInt(cvp.GetSectionName(),headerKey,cvp.headerholSize[index],propertyPath);
-               cvp.headerOraderArray[index] = GetPrivateProfileInt(cvp.GetSectionName(),headerOrderKey,index,propertyPath);
-       }
-
-       //mainframe\90Ý\92è\92l\93Ç\8eæ
-
-       NLITE_READ_INI_INT(mfp,windowFrontFlag,propertyPath);
-                       
-       NLITE_READ_INI_INT(mfp,windowSize.cx,propertyPath);
-
-       NLITE_READ_INI_INT(mfp,windowSize.cy,propertyPath);
-
-       //general\90Ý\92è\92l\93Ç\8eæ
-                       
-       NLITE_READ_INI_INT(gp,activeCountTimeFlag,propertyPath);
-
-       NLITE_READ_INI_INT(gp,autoColorRegisterFlag,propertyPath);
-
-       NLITE_READ_INI_INT(gp,autoNameRegisterFlag,propertyPath);
-
-       NLITE_READ_INI_INT(gp,autoNameUpdateFlag,propertyPath);
-
-       NLITE_READ_INI_STR(gp,browserPath,buffer,propertyPath);
-
-       NLITE_READ_INI_INT(gp,commentLogAutoSaveFlag,propertyPath);
-
-       NLITE_READ_INI_STR(gp,commentPath,buffer,propertyPath);
-                       
-       NLITE_READ_INI_INT(gp,defaultBrowserFlag,propertyPath);
-
-       NLITE_READ_INI_INT(gp,numberNameFlag,propertyPath);
-
-       NLITE_READ_INI_INT(gp,userCountUpdateFlag,propertyPath);
-
-
-
-       typedef std::map<CNLiteString, BROWSERTYPE> funcs_type;
-
-    funcs_type funcs;
-    funcs.insert(std::make_pair(bt_none, BT_NOSETTING));
-    funcs.insert(std::make_pair(bt_ie, BT_INTERNET_EXPLORER));
-       funcs.insert(std::make_pair(bt_firefox, BT_FIRE_FOX));
-       funcs.insert(std::make_pair(bt_chrome, BT_GOOGLE_CHROME));
-       funcs.insert(std::make_pair(bt_iecm,BT_IE_COMPONENT));
-
-    CNLiteString browserTypeName;
-
-       GetPrivateProfileString(gp.GetSectionName(),TEXT(TOSTR(browserType)),bt_none,&buffer[0],buffer.size(),propertyPath);
-       browserTypeName = &buffer[0];
-
-    funcs_type::iterator it = funcs.find(browserTypeName);
-    if (it != funcs.end()){
-
-               gp.browserType = it->second;
-       }else{
-        throw AppInitException(__LINE__,TEXT(__FILE__),TEXT(__FUNCTION__));
-       }
-       */
        return;
 }
 
@@ -495,6 +377,12 @@ VOID Property::WriteProperty(){
        NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.commentTimeType);
        NLITE_XML_WRITE_FOR_INT(pWriter,cvp.headerOraderArray);
        NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.IDLinkColor);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.selectBackColor);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.selectSellLineColor);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.colLineColor);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,cvp.normalSellLineColor);
+
+       
        pWriter->WriteEndElement();
 
 
@@ -510,48 +398,7 @@ VOID Property::WriteProperty(){
        NLITE_ATTRIBUTE_WRITE_INT(pWriter,gp.autoNameUpdateFlag);
        NLITE_ATTRIBUTE_WRITE_INT(pWriter,gp.autoNameRegisterFlag);
        NLITE_ATTRIBUTE_WRITE_STR(pWriter,gp.browserPath);
-
-
-       CNLiteString browserTypeName;
-
-
-       switch (gp.browserType){
-
-       case BT_NOSETTING:
-               
-               browserTypeName = bt_none;
-
-               break;
-
-       case BT_INTERNET_EXPLORER:
-
-               browserTypeName = bt_ie;
-
-               break;
-
-       case BT_GOOGLE_CHROME:
-
-               browserTypeName = bt_chrome;
-
-               break;
-
-       case BT_FIRE_FOX:
-
-               browserTypeName = bt_firefox;
-               
-               break;
-
-       case BT_IE_COMPONENT:
-               browserTypeName = bt_iecm;
-               break;
-
-       default:
-               browserTypeName = bt_none;
-               break;
-
-       }
-
-       NLITE_ATTRIBUTE_WRITE_STR(pWriter,browserTypeName);
+       NLITE_ATTRIBUTE_WRITE_INT(pWriter,gp.browserType);
        NLITE_ATTRIBUTE_WRITE_INT(pWriter,gp.commentLogAutoSaveFlag);
        NLITE_ATTRIBUTE_WRITE_STR(pWriter,gp.commentPath);
        NLITE_ATTRIBUTE_WRITE_INT(pWriter,gp.defaultBrowserFlag);
@@ -560,6 +407,8 @@ VOID Property::WriteProperty(){
        pWriter->WriteEndElement();
        pWriter->WriteEndDocument();
 
+       pWriter->Flush();
+
        return;
 }
 
@@ -642,16 +491,30 @@ void ReadPropertyXML::OnEndElement (const XML_Char *pszName){
        }
 
 #define NLITE_R_X_P_I(p,p2,v) \
-       dumpln(TEXT("%s"),TEXT(#v));\
        if(_tcscmp(TEXT(#v),nodeName.c_str()) == 0){\
                p.p2.v = 0;\
                strToIntN(p.p2.v,pszData,nLength);\
                break;\
        }
 
+#define NLITE_RXP_AI(p,p2,v) {\
+       TCHAR name[LENGTH_256];\
+       for(INT_PTR index = 0;index < ARRAY_LENGTH(p.p2.v);index++){\
+               _stprintf(name,TEXT("%s%d"),TEXT(#v),index);\
+               if(_tcscmp(name,nodeName.c_str()) == 0){\
+                       p.p2.v[index] = 0;\
+                       strToIntN(p.p2.v[index],pszData,nLength);\
+                       goto end;\
+               }\
+       }\
+}
+
+#define NLITE_NAME(n) (#n)
+
 void ReadPropertyXML::OnCharacterData (const XML_Char *pszData, int nLength){
 
        if (nodeName.empty() == true)return;
+
        switch(propertyType){
 
 
@@ -667,19 +530,43 @@ void ReadPropertyXML::OnCharacterData (const XML_Char *pszData, int nLength){
                NLITE_R_X_P_I(nliteProperty,crp,newLineReadFlag);
                NLITE_R_X_P_I(nliteProperty,crp,ngUserReadFlag);
                NLITE_R_X_P_I(nliteProperty,crp,ngWordReadFlag);
+               NLITE_R_X_P_S(nliteProperty,crp,outString);
+               NLITE_R_X_P_S(nliteProperty,crp,shortComment);
+               NLITE_R_X_P_I(nliteProperty,crp,teropReadFlag);
+               NLITE_R_X_P_I(nliteProperty,crp,userCommentReadFlag);
 
                break;
        case Node::CommentViewProperty:
-
-
+               NLITE_R_X_P_I(nliteProperty,cvp,anonymousIDLinkColor);
+               NLITE_R_X_P_I(nliteProperty,cvp,backColor);
+               NLITE_R_X_P_I(nliteProperty,cvp,baseStringColor);
+               NLITE_R_X_P_I(nliteProperty,cvp,commentFoldingFlag);
+               NLITE_R_X_P_I(nliteProperty,cvp,commentTimeType);
+               NLITE_R_X_P_I(nliteProperty,cvp,IDLinkColor);
+               NLITE_RXP_AI(nliteProperty,cvp,headerholSize);
+               NLITE_RXP_AI(nliteProperty,cvp,headerOraderArray);
+               NLITE_R_X_P_I(nliteProperty,cvp,selectBackColor);
+               NLITE_R_X_P_I(nliteProperty,cvp,selectSellLineColor);
+               NLITE_R_X_P_I(nliteProperty,cvp,normalSellLineColor);
+               NLITE_R_X_P_I(nliteProperty,cvp,colLineColor);
                break;
        case Node::GeneralProperty:
-
-
+               NLITE_R_X_P_I(nliteProperty,gp,activeCountTimeFlag);
+               NLITE_R_X_P_I(nliteProperty,gp,autoColorRegisterFlag);
+               NLITE_R_X_P_I(nliteProperty,gp,autoNameRegisterFlag);
+               NLITE_R_X_P_I(nliteProperty,gp,autoNameUpdateFlag);
+               NLITE_R_X_P_S(nliteProperty,gp,browserPath);
+               NLITE_R_X_P_I(nliteProperty,gp,browserType);
+               NLITE_R_X_P_I(nliteProperty,gp,commentLogAutoSaveFlag);
+               NLITE_R_X_P_S(nliteProperty,gp,commentPath);
+               NLITE_R_X_P_I(nliteProperty,gp,defaultBrowserFlag);
+               NLITE_R_X_P_I(nliteProperty,gp,numberNameFlag);
+               NLITE_R_X_P_I(nliteProperty,gp,userCountUpdateFlag);
                break;
        case Node::MainFrameProperty:
-
-
+               NLITE_R_X_P_I(nliteProperty,mfp,windowSize.cx);
+               NLITE_R_X_P_I(nliteProperty,mfp,windowSize.cy);
+               NLITE_R_X_P_I(nliteProperty,mfp,windowFrontFlag);
                break;
 
 
@@ -690,6 +577,7 @@ void ReadPropertyXML::OnCharacterData (const XML_Char *pszData, int nLength){
 
        }
 
+end:
 
        return;
 }
index 140bd2a..ebf60d5 100644 (file)
@@ -89,10 +89,14 @@ namespace nlite{
                BOOL commentFoldingFlag;                                                                        //\83R\83\81\83\93\83g\90Ü\82è\82½\82½\82Ý\83t\83\89\83O
                UINT_PTR commentTimeType;                                                                       //\83R\83\81\83\93\83g\8e\9e\8aÔ\95\\8e¦\83^\83C\83v
                COLORREF backColor;                                                                                     //\8aî\92ê\82Ì\94w\8ci\90F
+               COLORREF selectBackColor;                                                                       //\91I\91ð\8e\9e\82Ì\94w\8ci\90F
+               COLORREF selectSellLineColor;                                                           //\91I\91ð\8e\9e\82Ì\98g\90ü
+               COLORREF normalSellLineColor;                                                           //\92Ê\8fí\8e\9e\82Ì\98g\90ü
                COLORREF baseStringColor;                                                                       //\8aî\92ê\82Ì\95\8e\9a\90F
                COLORREF IDLinkColor;                                                                           //\8aî\92ê\82Ì\83n\83C\83p\81[\83\8a\83\93\83N\82Ì\90F
                COLORREF anonymousIDLinkColor;                                                          //\93½\96¼ID\95\\8e¦\90F
-               COLORREF lineColor;                                                                                     //\8b«\8aE\90ü\82Ì\90F
+               COLORREF colLineColor;                                                                          //\8d\80\96Ú\82Ì\8fc\90ü
+
 
                ///
                ///\83R\83\93\83X\83g\83\89\83N\83^