From: unknown Date: Fri, 27 Jan 2012 06:13:40 +0000 (+0900) Subject: 2012/01/27 15:13:39 X-Git-Tag: v0.001~10 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c53d532142ac47aa051c7d5446713f8734efab5e;p=nlite%2Fnlite.git 2012/01/27 15:13:39 --- diff --git a/nlite.suo b/nlite.suo index 550bee1..c45f2f7 100644 Binary files a/nlite.suo and b/nlite.suo differ diff --git a/nlite/nlite_chatData.cpp b/nlite/nlite_chatData.cpp index d36febd..c1dd69e 100644 --- a/nlite/nlite_chatData.cpp +++ b/nlite/nlite_chatData.cpp @@ -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; } diff --git a/nlite/nlite_chatData.h b/nlite/nlite_chatData.h index f4f2aed..ee04bb6 100644 --- a/nlite/nlite_chatData.h +++ b/nlite/nlite_chatData.h @@ -105,7 +105,22 @@ namespace nlite{ class CChatData{ + public: + struct ViewData{ + + enum{ + INIT_COLOR = -1 + }; + BOOL selectFlag; //‘I‘ðó‘Ô + COLORREF stringColor; //“ÆŽ©•¶ŽšF + COLORREF backColor; //“ÆŽ©”wŒiF + COLORREF sellLineColor; //˜güF + + ViewData(); + }; + + ViewData viewData; //•\Ž¦—pƒf[ƒ^ UINT_PTR premium; //ƒvƒŒƒ~ƒAƒ€Ží•Ê BOOL anonymity; //“½–¼ƒtƒ‰ƒO UINT_PTR no; //ƒRƒ”Ô @@ -117,13 +132,13 @@ namespace nlite{ CNLiteString chatBuf; //ƒ`ƒƒƒbƒg–{•¶ std::vector mail; //ƒ[ƒ‹ƒRƒ}ƒ“ƒh ULONG_PTR thread; //ƒXƒŒƒbƒh”ԍ† - BOOL selectFlag; //‘I‘ðó‘Ô -// UINT_PTR height; //•\Ž¦—̈æ‚̍‚‚³ + + + + public: - CChatData(): - selectFlag(FALSE) - {} + VOID SetChat(NicoLiveChat &chat_in); @@ -139,6 +154,7 @@ namespace nlite{ typedef std::list ChatList; ChatList chatList; + //ƒGƒ‰[ƒR[ƒh diff --git a/nlite/nlite_commentWrite.cpp b/nlite/nlite_commentWrite.cpp index f4b0e8e..8458aab 100644 --- a/nlite/nlite_commentWrite.cpp +++ b/nlite/nlite_commentWrite.cpp @@ -25,15 +25,15 @@ const static COLORREF MAX_COLOR = 0xFFFFFF; namespace generalUser{ const CommentColorInfo COMMENT_COLORLIST[] = { - {DEFAULT_COMMENTCOLOR,RGB(0xFF,0xFF,0xFF)}, //”’ - {TEXT("red"),RGB(0xFF,0x00,0x00)}, //Ô - {TEXT("pink"),RGB(0xFF,0x80,0x80)}, //ƒsƒ“ƒN - {TEXT("orange"),RGB(0xFF,0xC0,0x00)}, //ƒIƒŒƒ“ƒW - {TEXT("yellow"),RGB(0xFF,0xFF,0x00)}, //‰©F - {TEXT("green"),RGB(0x00,0xFF,0x00)}, //—Î - {TEXT("cyan"),RGB(0x00,0xFF,0xFF)}, //Š¦F - {TEXT("blue"),RGB(0x00,0x00,0xFF)}, //Â - {TEXT("purple"),RGB(0xC0,0x00,0xFF)}, //Ž‡ + {DEFAULT_COMMENTCOLOR,PALETTERGB(0xFF,0xFF,0xFF)}, //”’ + {TEXT("red"),PALETTERGB(0xFF,0x00,0x00)}, //Ô + {TEXT("pink"),PALETTERGB(0xFF,0x80,0x80)}, //ƒsƒ“ƒN + {TEXT("orange"),PALETTERGB(0xFF,0xC0,0x00)}, //ƒIƒŒƒ“ƒW + {TEXT("yellow"),PALETTERGB(0xFF,0xFF,0x00)}, //‰©F + {TEXT("green"),PALETTERGB(0x00,0xFF,0x00)}, //—Î + {TEXT("cyan"),PALETTERGB(0x00,0xFF,0xFF)}, //Š¦F + {TEXT("blue"),PALETTERGB(0x00,0x00,0xFF)}, //Â + {TEXT("purple"),PALETTERGB(0xC0,0x00,0xFF)}, //Ž‡ }; @@ -51,17 +51,17 @@ namespace generalUser{ namespace premiumUser{ const CommentColorInfo COMMENT_COLORLIST[] = { - {TEXT("black"),RGB(0x00,0x00,0x00)}, //• - {TEXT("white2"),RGB(0xCC,0xCC,0x99)}, //”’‚»‚Ì‚Q - {TEXT("red2"),RGB(0xCC,0x00,0x33)}, //Ô‚»‚Ì‚Q - {TEXT("pink2"),RGB(0xFF,0x33,0xCC)}, //ƒsƒ“ƒN‚»‚Ì‚Q - {TEXT("orange2"),RGB(0xFF,0x66,0x00)}, //ƒIƒŒƒ“ƒW‚»‚Ì‚Q - {TEXT("yellow2"),RGB(0x99,0x99,0x00)}, //‰©F‚»‚Ì‚Q - {TEXT("green2"),RGB(0x00,0xCC,0x66)}, //—΂»‚Ì‚Q - {TEXT("cyan2"),RGB(0x00,0xCC,0xCC)}, //Š¦F‚»‚Ì‚Q - {TEXT("blue2"),RGB(0x33,0x99,0xFF)}, //Â‚»‚Ì‚Q - {TEXT("purple2"),RGB(0x66,0x33,0xCC)} //Ž‡‚»‚Ì‚Q - // {TEXT("black2"),RGB(0x66,0x66,0x66)} //•‚»‚Ì‚Q‚Í‚È‚¢H + {TEXT("black"),PALETTERGB(0x00,0x00,0x00)}, //• + {TEXT("white2"),PALETTERGB(0xCC,0xCC,0x99)}, //”’‚»‚Ì‚Q + {TEXT("red2"),PALETTERGB(0xCC,0x00,0x33)}, //Ô‚»‚Ì‚Q + {TEXT("pink2"),PALETTERGB(0xFF,0x33,0xCC)}, //ƒsƒ“ƒN‚»‚Ì‚Q + {TEXT("orange2"),PALETTERGB(0xFF,0x66,0x00)}, //ƒIƒŒƒ“ƒW‚»‚Ì‚Q + {TEXT("yellow2"),PALETTERGB(0x99,0x99,0x00)}, //‰©F‚»‚Ì‚Q + {TEXT("green2"),PALETTERGB(0x00,0xCC,0x66)}, //—΂»‚Ì‚Q + {TEXT("cyan2"),PALETTERGB(0x00,0xCC,0xCC)}, //Š¦F‚»‚Ì‚Q + {TEXT("blue2"),PALETTERGB(0x33,0x99,0xFF)}, //Â‚»‚Ì‚Q + {TEXT("purple2"),PALETTERGB(0x66,0x33,0xCC)} //Ž‡‚»‚Ì‚Q + // {TEXT("black2"),PALETTERGB(0x66,0x66,0x66)} //•‚»‚Ì‚Q‚Í‚È‚¢H }; const CommentSizeInfo COMMENT_SIZELIST[] = { @@ -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)); } diff --git a/nlite/nlite_commentWrite.h b/nlite/nlite_commentWrite.h index 1b5ddaf..3616b05 100644 --- a/nlite/nlite_commentWrite.h +++ b/nlite/nlite_commentWrite.h @@ -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); diff --git a/nlite/nlite_commentview.cpp b/nlite/nlite_commentview.cpp index e95c9d2..4bf457a 100644 --- a/nlite/nlite_commentview.cpp +++ b/nlite/nlite_commentview.cpp @@ -3,17 +3,17 @@ namespace nlite{ - + /* //F’萔 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) }; }; - + */ // //ƒRƒƒ“ƒgƒrƒ…[ƒNƒ‰ƒXƒƒ\ƒbƒh /////////////////////////////////////////////////////// @@ -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); //‘I‘ðó‘Ô‚©ƒ`ƒFƒbƒN - 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); //•`‰æƒTƒCƒY‚ðŒvŽZ @@ -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(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(self.commentlist.Size()))goto end; + + self.commentlist.SetCurSel(dy); + + this->ShowCurSel(); +end: + + + return; + } + LRESULT CCommentListWindow::OnMouseWheel(UINT loWparam,SHORT hiWparam,CPoint &point){ diff --git a/nlite/nlite_commentview.h b/nlite/nlite_commentview.h index 6575ba8..9e9f7b4 100644 --- a/nlite/nlite_commentview.h +++ b/nlite/nlite_commentview.h @@ -46,13 +46,14 @@ namespace nlite{ //ƒƒbƒZ[ƒWƒ}ƒbƒv // 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{ ///s‚̍‚‚³‚ð–â‚¢‡‚킹 /// UINT_PTR CalcItemHeight(CChatData &chatData); + + /// + ///‘I‘ðs‚ð•\Ž¦ + /// + VOID ShowCurSel(); //ƒvƒ‰ƒCƒx[ƒgŠÖ” @@ -124,7 +130,7 @@ namespace nlite{ /// ///ƒ}ƒEƒXƒ_ƒuƒ‹ƒNƒŠƒbƒNŽž‚̏ˆ— /// - VOID OnLButtonDbClk(UINT wParam, _WTYPES_NS::CPoint &point); + VOID OnLButtonDblClk(UINT wParam, _WTYPES_NS::CPoint &point); /// ///”wŒi“h‚è‚‚Ԃµ @@ -135,6 +141,11 @@ namespace nlite{ ///ƒ}ƒEƒXƒzƒC[ƒ‹ /// LRESULT OnMouseWheel(UINT loWparam,SHORT hiWparam,CPoint &point); + + /// + ///ƒL[‰Ÿ‰ºŽž‚̏ˆ— + /// + VOID OnKeyDown(TCHAR vKey,UINT loLParam,UINT hiLParam); }; diff --git a/nlite/nlite_property.cpp b/nlite/nlite_property.cpp index 3520004..3a60efd 100644 --- a/nlite/nlite_property.cpp +++ b/nlite/nlite_property.cpp @@ -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]\ - /*ƒ}ƒNƒ@I—¹*/ - -#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 buffer(LENGTH_2048); - - //crp‚̐ݒè’l“ǂݍž‚Ý - - 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Ý’è’l“ǂݍž‚Ý - - 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Ý’è’l“ÇŽæ - - NLITE_READ_INI_INT(mfp,windowFrontFlag,propertyPath); - - NLITE_READ_INI_INT(mfp,windowSize.cx,propertyPath); - - NLITE_READ_INI_INT(mfp,windowSize.cy,propertyPath); - - //generalÝ’è’l“ÇŽæ - - 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 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; } diff --git a/nlite/nlite_property.h b/nlite/nlite_property.h index 140bd2a..ebf60d5 100644 --- a/nlite/nlite_property.h +++ b/nlite/nlite_property.h @@ -89,10 +89,14 @@ namespace nlite{ BOOL commentFoldingFlag; //ƒRƒƒ“ƒgÜ‚肽‚½‚݃tƒ‰ƒO UINT_PTR commentTimeType; //ƒRƒƒ“ƒgŽžŠÔ•\Ž¦ƒ^ƒCƒv COLORREF backColor; //Šî’ê‚Ì”wŒiF + COLORREF selectBackColor; //‘I‘ðŽž‚Ì”wŒiF + COLORREF selectSellLineColor; //‘I‘ðŽž‚Ì˜gü + COLORREF normalSellLineColor; //’ʏ펞‚̘gü COLORREF baseStringColor; //Šî’ê‚Ì•¶ŽšF COLORREF IDLinkColor; //Šî’ê‚̃nƒCƒp[ƒŠƒ“ƒN‚̐F COLORREF anonymousIDLinkColor; //“½–¼ID•\Ž¦F - COLORREF lineColor; //‹«ŠEü‚̐F + COLORREF colLineColor; //€–ڂ̏cü + /// ///ƒRƒ“ƒXƒgƒ‰ƒNƒ^