OSDN Git Service

2012/01/19 17:31:46
authorunknown <qwerty2501@users.sourceforge.jp>
Thu, 19 Jan 2012 08:31:46 +0000 (17:31 +0900)
committerunknown <qwerty2501@users.sourceforge.jp>
Thu, 19 Jan 2012 08:31:46 +0000 (17:31 +0900)
nlite.suo
nlite/nlite.cpp
nlite/nlite_commentWrite.cpp
nlite/nlite_commentWrite.h
nlite/nlite_commentview.cpp
nlite/nlite_mainframe.cpp
nlite/nlite_string.h

index 12ab40c..153fc8a 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index 061252e..81b9280 100644 (file)
@@ -54,7 +54,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE,
                _heapmin();
 
                
-
+               
                nRet = theLoop.Run();
 
                vcassert(_heapchk() == _HEAPOK,TEXT("\83q\81[\83v\83G\83\89\81[\82Å\82·"));
index 1dbf9aa..d7b3178 100644 (file)
@@ -3,21 +3,23 @@
 
 namespace nlite{
 
-const static SIZE commentPosBoxSize = {40,0};
-const static SIZE commentSizeBoxSize = {40,0};
-const static SIZE commentColorBoxSize = {40,0};
+
+const static SIZE commentColorBoxSize = {33,0};
 
 const static LPCTSTR ANONYMOUS_BOTTONSTRING = TEXT("184");
 const static LPCTSTR WRITE_BOTTONSTRING = TEXT("\8f\91\82«\8d\9e\82Ý");
 
 
-const static RECT COMMENTWRITEWINDOW_SEPARATEFSIZE = {5,5,5,5};
+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 COMBOBOX_BUTTON_WIDTH = 15;
 
+//const static COLORREF MAX_COLOR = ((COLORREF)-1);
 
+const static COLORREF MAX_COLOR = 0xFFFFFF;
 
-
-const ComentColor GENERALUSER_COMMENT_COLORLIST[] = {
+const CommentColorInfo generalUser::COMMENT_COLORLIST[] = {
        {TEXT("white"),RGB(0xFF,0xFF,0xFF)},
        {TEXT("red"),RGB(0xFF,0x00,0x00)},
        {TEXT("pink"),RGB(0xFF,0x80,0x80)},
@@ -30,7 +32,7 @@ const ComentColor GENERALUSER_COMMENT_COLORLIST[] = {
        {TEXT("black"),RGB(0x00,0x00,0x00)}
 };
 
-const ComentColor PREMIUM_COMMENT_COLORLIST[] = {
+const CommentColorInfo premiumUser::COMMENT_COLORLIST[] = {
        {TEXT("white2"),RGB(0xCC,0xCC,0x99)},
        {TEXT("red2"),RGB(0xCC,0x00,0x33)},
        {TEXT("pink2"),RGB(0xFF,0x33,0xCC)},
@@ -43,8 +45,24 @@ const ComentColor PREMIUM_COMMENT_COLORLIST[] = {
        {TEXT("black2"),RGB(0x66,0x66,0x66)}
 };
 
-template<typename T>
-static VOID addItemList(CComboBox &combo,T * colorList,UINT_PTR length);
+const CommentSizeInfo generalUser::COMMENT_SIZELIST[] = {
+       {TEXT("\95\81\92Ê\81@"),TEXT("medium")},
+       {TEXT("\8f¬\81@"),TEXT("small")}
+};
+
+const CommentSizeInfo premiumUser::COMMENT_SIZELIST[] = {
+       {TEXT("\91å\81@"),TEXT("big")}
+};
+
+const CommentPosInfo generalUser::COMMENT_POSLIST[] = {
+       {TEXT("\92Ê\8fí\81@"),TEXT("naka")}
+};
+
+const CommentPosInfo premiumUser::COMMENT_POSLIST[] = {
+       {TEXT("\89º\81@"),TEXT("shita")},
+       {TEXT("\8fã\81@"),TEXT("ue")}
+};
+
 
 template<typename T>
 static VOID addItemList(CComboBox &combo,T * colorList,UINT_PTR length){
@@ -52,7 +70,7 @@ static VOID addItemList(CComboBox &combo,T * colorList,UINT_PTR length){
        UINT_PTR startItemcount = combo.GetCount();
        for(UINT_PTR index = startItemcount; index < length;index++){
 
-               combo.AddString(TEXT(""));
+               combo.AddString(colorList[index - startItemcount].name);
                combo.SetItemDataPtr(index,(LPVOID)&colorList[index - startItemcount]);
 
        }
@@ -60,8 +78,28 @@ static VOID addItemList(CComboBox &combo,T * colorList,UINT_PTR length){
        return;
 }
 
+
+
+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():
 commentWriteHeight(0),
+commentWriteInternalHeight(0),
 commentWriteMaxLength(INIT_COMMENTWRITE_MAXLENGTH)
 {}
 
@@ -73,7 +111,7 @@ LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){
        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_CHECKBOX,0,ANONYMOUS_BUTTON);
-       comment.Create(m_hWnd,0,WC_EDIT,WS_CHILD | WS_VISIBLE | WS_BORDER,0,COMMENT_EDIT);
+       commentEdit.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());
@@ -82,14 +120,18 @@ LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){
        
        anonymousButton.SetWindowTextW(ANONYMOUS_BOTTONSTRING);
        anonymousButton.SetFont(AtlGetDefaultGuiFont());
-       comment.SetFont(AtlGetDefaultGuiFont());
-       comment.SetLimitText(commentWriteMaxLength);
+       commentEdit.SetFont(AtlGetDefaultGuiFont());
+       commentEdit.SetLimitText(commentWriteMaxLength);
        commentWriteButton.SetWindowTextW(WRITE_BOTTONSTRING);
        commentWriteButton.SetFont(AtlGetDefaultGuiFont());
-       comment.SetWindowTextW(TEXT(""));
-       
-       addItemList(commentColorBox,GENERALUSER_COMMENT_COLORLIST,ARRAY_LENGTH(GENERALUSER_COMMENT_COLORLIST));
+       commentEdit.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);
        CFont font;
        font = AtlGetDefaultGuiFont();
        CPaintDC pdc(*this);
@@ -97,7 +139,7 @@ LRESULT CCommentWriteWindow::OnCreate(LPCREATESTRUCT lpReateStruct){
        LPCTSTR sample = TEXT(" ");
        GetTextExtentPoint32(pdc,sample,_tcslen(sample),&thisSize);
        commentWriteHeight = thisSize.cy + COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom;
-
+       commentWriteInternalHeight = commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom);
        return 0;
 }
 
@@ -106,7 +148,7 @@ VOID CCommentWriteWindow::OnDestroy(){
        commentSizeBox.DestroyWindow();
        commentColorBox.DestroyWindow();
        anonymousButton.DestroyWindow();
-       comment.DestroyWindow();
+       commentEdit.DestroyWindow();
        commentWriteButton.DestroyWindow();
 
 }
@@ -141,44 +183,135 @@ VOID CCommentWriteWindow::ChangeSize(SIZE &size){
        SIZE commentWriteButtonSize;
        commentWriteButton.GetIdealSize(&commentWriteButtonSize);
        anonymousButton.GetIdealSize(&commentAnonymousButtonSize);
-       //\83T\83C\83Y\95Ï\8dX\8f\88\97\9d
-       commentPosBox.MoveWindow(COMMENTWRITEWINDOW_SEPARATEFSIZE.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top, commentPosBoxSize.cx,commentWriteHeight  - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom),TRUE);
-       commentSizeBox.MoveWindow((COMMENTWRITEWINDOW_SEPARATEFSIZE.left * 2) + COMMENTWRITEWINDOW_SEPARATEFSIZE.right + commentPosBoxSize.cx, COMMENTWRITEWINDOW_SEPARATEFSIZE.top, commentSizeBoxSize.cx,commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom),TRUE);
-       commentColorBox.MoveWindow((COMMENTWRITEWINDOW_SEPARATEFSIZE.left * 3) + (COMMENTWRITEWINDOW_SEPARATEFSIZE.right * 2) + commentPosBoxSize.cx + commentSizeBoxSize.cx,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentColorBoxSize.cx, commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom),TRUE);
-       anonymousButton.MoveWindow((COMMENTWRITEWINDOW_SEPARATEFSIZE.left * 4) + (COMMENTWRITEWINDOW_SEPARATEFSIZE.right * 3) + commentPosBoxSize.cx + commentSizeBoxSize.cx + commentColorBoxSize.cx ,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentAnonymousButtonSize.cx,commentWriteHeight - (COMMENTWRITEWINDOW_SEPARATEFSIZE.top + COMMENTWRITEWINDOW_SEPARATEFSIZE.bottom),TRUE);
-       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);        
+
+       RECT commentPosBoxRect;
+       RECT commentSizeBoxRect;
+       RECT commentColorBoxRect;
+       RECT anonymousButtonRect;
+       RECT commentEditRect;
+       RECT commentWriteButtonRect;
+
+
+       
+
+
+       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;
+
+       commentEditRect.left = anonymousButtonRect.right + COMMENTWRITEWINDOW_SIDESEPARATESIZE;
+       
+       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(6);
+       
+       commentPosBox.DeferWindowPos(hDwp,NULL,
+               commentPosBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentPosBoxRect.right - commentPosBoxRect.left,commentWriteInternalHeight,
+               SWP_NOZORDER);
+       commentSizeBox.DeferWindowPos(hDwp,NULL,
+               commentSizeBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentSizeBoxRect.right - commentSizeBoxRect.left,commentWriteInternalHeight,
+               SWP_NOZORDER);
+
+       commentColorBox.DeferWindowPos(hDwp,NULL,
+               commentColorBoxRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentColorBoxRect.right - commentColorBoxRect.left,commentWriteInternalHeight,
+               SWP_NOZORDER);
+
+       anonymousButton.DeferWindowPos(hDwp,NULL,
+               anonymousButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,anonymousButtonRect.right - anonymousButtonRect.left,commentWriteInternalHeight,
+               SWP_NOZORDER);
+
+
+       commentEdit.DeferWindowPos(hDwp,NULL,
+               commentEditRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,commentEditRect.right - commentEditRect.left,commentWriteInternalHeight,
+               SWP_NOZORDER);
+
+       commentWriteButton.DeferWindowPos(hDwp,NULL,
+               commentWriteButtonRect.left,COMMENTWRITEWINDOW_SEPARATEFSIZE.top,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;
+
+               drawRect.left += 2;
+               drawRect.top += 2;
+               drawRect.right -= 2;
+               drawRect.bottom -= 2;
                if(lParam->itemID == ((UINT)-1)){
-                       INT_PTR curselNo = commentColorBox.GetCurSel();
+                       
 
-                       itemNo = curselNo == -1 ? 0 : curselNo;
+                       itemNo = curselNo == CB_ERR ? 0 : curselNo;
+                       
 
                } else {
                        itemNo = lParam->itemID;
+                       
+                       
+                       
+
+                       
 
                }
-               CDCHandle dcHandle = lParam->hDC;
                
-               ComentColor *commentColor = (ComentColor *)commentColorBox.GetItemDataPtr(itemNo);
+               CommentInfo<COLORREF> &commentColor = *(CommentInfo<COLORREF> *)commentColorBox.GetItemDataPtr(itemNo);
+               
+               
+               if(lParam->itemState & (ODS_FOCUS | ODS_COMBOBOXEDIT)){
+                       
+                       
+                       
+                       bkBrush.CreateSolidBrush(RGB(160,160,160));
+                               
+               } else {
+
+                       bkBrush.CreateSolidBrush(RGB(255,255,255));
+
+               }
+
 
                
                
                CBrush brush;
                CPen cpen;
 
-               brush.CreateSolidBrush(commentColor->color);
-               
+               brush.CreateSolidBrush(commentColor.userData);
+               dcHandle.FillRect(&lParam->rcItem,bkBrush);
                dcHandle.SelectBrush(brush);
                dcHandle.SelectPen((HPEN)::GetStockObject(BLACK_PEN));
-               dcHandle.Rectangle(lParam->rcItem.left,lParam->rcItem.top,lParam->rcItem.right,lParam->rcItem.bottom);
+               dcHandle.FillRect(&drawRect,brush);
                
        }
 
index e113abf..c1689dd 100644 (file)
@@ -2,23 +2,60 @@
 
 namespace nlite{
 
-       ///
-       ///\83R\83\81\83\93\83g\90F\8d\\91¢\91Ì
-       ///
-       struct ComentColor{
+       template <typename T>
+       struct CommentInfo{
                LPCTSTR name;
-               COLORREF color;
+               T userData;
        };
 
+       typedef CommentInfo<COLORREF> CommentColorInfo;
+       typedef CommentInfo<LPCTSTR> CommentSizeInfo; 
+       typedef CommentInfo<LPCTSTR> CommentPosInfo;
+
        ///
-       ///\88ê\94Ê\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
+       ///\88ê\94Ê\89ï\88õ\83R\83}\83\93\83h
        ///
-       extern const  ComentColor GENERALUSER_COMMENT_COLORLIST[];
+       namespace generalUser{
+               ///
+               ///\88ê\94Ê\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
+               ///
+               extern const  CommentColorInfo COMMENT_COLORLIST[];
+
+               ///
+               ///\88ê\94Ê\89ï\88õ\83T\83C\83Y\83R\83}\83\93\83h\83\8a\83X\83g
+               ///
+               extern const CommentSizeInfo COMMENT_SIZELIST[];
+
+               ///
+               ///\88ê\94Ê\89ï\88õ\83R\83\81\83\93\83g\88Ê\92u\83\8a\83X\83g
+               ///
+               extern const CommentPosInfo COMMENT_POSLIST[];
+
+       }
 
        ///
-       ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
+       ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83}\83\93\83h
        ///
-       extern const ComentColor PREMIUM_COMMENT_COLORLIST[];
+       namespace premiumUser{
+               ///
+               ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
+               ///
+               extern const CommentColorInfo COMMENT_COLORLIST[];
+
+
+               ///
+               ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83T\83C\83Y\83R\83}\83\93\83h\83\8a\83X\83g
+               ///
+               extern const CommentSizeInfo COMMENT_SIZELIST[];
+
+               ///
+               ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83\81\83\93\83g\88Ê\92u\83\8a\83X\83g
+               ///
+               extern const CommentPosInfo COMMENT_POSLIST[];
+
+       }
+       
+
 
        const static LPCTSTR COMMENTWRITEWINDOW = TEXT("commentWriteWindow");
        
@@ -26,12 +63,15 @@ namespace nlite{
 
        private:
                CComboBox commentPosBox;
+               CComAutoCriticalSection commentPosBoxCS;
                CComboBox commentSizeBox;
+               CComAutoCriticalSection commentSizeBoxCS;
                CComboBox commentColorBox;
                CButton anonymousButton;
-               CEdit comment;
+               CEdit commentEdit;
                CButton commentWriteButton;
                UINT_PTR commentWriteMaxLength;
+               UINT_PTR commentWriteInternalHeight;
 
                enum CONTROLID{
                        COMMENTPOS_BOX = 1,
index b20be69..2d08d1d 100644 (file)
@@ -726,9 +726,9 @@ VOID CCommentListWindow::DrawItem(CDC &dc,RECT &rc,CChatData &chatData){
 
        outLinePen.CreatePen(PS_SOLID,1,outLineColor);
        bkBrush.CreateSolidBrush(bkColor);
-       dc.FillRect(&rc,bkBrush);
+       dc.SelectBrush(bkBrush);
        dc.SelectPen(outLinePen);
-       
+       dc.Rectangle(&rc);
        dc.SetBkColor(bkColor);
        //\83e\83L\83X\83g\82Ì\83J\83\89\81[\82ð\90Ý\92è        
        dc.SetTextColor(self.viewproperty.baseStringColor);
@@ -746,13 +746,6 @@ VOID CCommentListWindow::DrawItem(CDC &dc,RECT &rc,CChatData &chatData){
        self.m_header.GetItemRect(CCommentView::TIME,&timeViewRect);
        self.m_header.GetItemRect(CCommentView::INFO,&infoViewRect);
 
-       UINT_PTR upline = rc.top;
-       UINT_PTR bottomline = rc.bottom -1;
-       dc.MoveTo(rc.left,upline,NULL);
-       dc.LineTo(rc.right,upline);
-       dc.MoveTo(rc.left,bottomline,NULL);
-       dc.LineTo(rc.right,bottomline);
-       
        noViewRect.left += 2;
        userNameViewRect.left += 2;
        timeViewRect.left += 2;
index 5fc5ab3..a4926ca 100644 (file)
@@ -13,30 +13,36 @@ static const RECT commentViewSize = {5,0,5,0};
 VOID CNliteMainFrame::ChangeSize(const SIZE& client){
 
        
+       UINT_PTR tabheight = client.cy - (toolBarHeight + statusBarHeight + commentWriteWindow.commentWriteHeight);
 
        
-       INT_PTR tabheight = client.cy - (toolBarHeight + statusBarHeight + commentWriteWindow.commentWriteHeight);
-       tabctrl.MoveWindow(0,toolBarHeight,client.cx,tabheight);
-       
-
-       RECT tabClientRect;
-
-       tabctrl.GetClientRect(&tabClientRect);
-
+       RECT tabWindowRect = {0};
+       RECT commentViewRect = {0};
+       RECT commentWriteWindowRect = {0};
 
-       commentWriteWindow.MoveWindow(0,toolBarHeight +tabheight,client.cx,client.cy - ((toolBarHeight + tabheight +statusBarHeight)));
-       tabctrl.AdjustRect(FALSE,&tabClientRect);
 
+       tabWindowRect.left = 0;
+       tabWindowRect.top = toolBarHeight;
+       tabWindowRect.right =  client.cx - tabWindowRect.left;
+       tabWindowRect.bottom = tabWindowRect.top + tabheight;
        
        
+       commentWriteWindowRect.left = 0;
+       commentWriteWindowRect.top = tabWindowRect.bottom;
+       commentWriteWindowRect.right = commentWriteWindowRect.left + client.cx;
+       commentWriteWindowRect.bottom = commentWriteWindowRect.top + commentWriteWindow.commentWriteHeight;
 
-       commentView.MoveWindow(tabClientRect.left, tabClientRect.top,tabClientRect.right - tabClientRect.left, tabClientRect.bottom - tabClientRect.top);
 
        
 
-       ::SetWindowPos(commentWriteWindow,HWND_BOTTOM,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
-       //commentWriteWindow.MoveWindow(0,client.cy - (commentWriteWindowSize.cy + statusBarHeight),client.cx,client.cy - statusBarHeight);
+       tabctrl.MoveWindow(tabWindowRect.left,tabWindowRect.top,tabWindowRect.right - tabWindowRect.left ,tabWindowRect.bottom - tabWindowRect.top);
+       commentWriteWindow.MoveWindow(commentWriteWindowRect.left,commentWriteWindowRect.top,commentWriteWindowRect.right - commentWriteWindowRect.left ,commentWriteWindowRect.bottom - commentWriteWindowRect.top);
        
+       tabctrl.GetClientRect(&commentViewRect);
+       tabctrl.AdjustRect(FALSE,&commentViewRect);
+
+       commentView.MoveWindow(commentViewRect.left, commentViewRect.top,commentViewRect.right - commentViewRect.left, commentViewRect.bottom - commentViewRect.top);
+
        
 
        return;
@@ -47,11 +53,10 @@ LRESULT CNliteMainFrame::OnCreate(LPCREATESTRUCT lpcs){
        
        // \83X\83e\81[\83^\83X\83o\81[\82ð\8dì\90¬
        vcverify(CreateSimpleStatusBar(),TEXT("\83X\83e\81[\83^\83X\83o\81[\8dì\90¬\82É\8e¸\94s\82µ\82Ü\82µ\82½"));
-       tabctrl.Create(m_hWnd,0,NULL,WS_CHILD | WS_CLIPCHILDREN  | WS_DLGFRAME);
+       tabctrl.Create(m_hWnd,0,NULL,WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_DLGFRAME );
        commentView.Create(tabctrl.m_hWnd);
        
-       commentWriteWindow.Create(m_hWnd,0,COMMENTWRITEWINDOW,WS_CHILD | WS_VISIBLE);
-       commentWriteWindow.SetWindowPos(HWND_BOTTOM,0,0,0,0,SWP_SHOWWINDOW);
+       commentWriteWindow.Create(m_hWnd,0,COMMENTWRITEWINDOW,WS_CHILD | WS_VISIBLE  );
        CreateSimpleReBar();
        HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd,IDC_NLITE, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE);
        lvNoCombo.Create(m_hWnd, CRect(0, 0, 100, 100), NULL,WS_CHILD | WS_VISIBLE | WS_VSCROLL  | CBS_DROPDOWN , 0, IDC_COMBO_REBAR);
@@ -66,10 +71,9 @@ LRESULT CNliteMainFrame::OnCreate(LPCREATESTRUCT lpcs){
        AddSimpleReBarBand(lvNoCombo,TEXT("\95ú\91\97URL"));
        SizeSimpleReBarBands();
        
+       //tabctrl.SetWindowPos(HWND_BOTTOM,0,0,0,0,SWP_SHOWWINDOW);
        
-
-       tabctrl.SetFont(hTabFont);      
-       tabctrl.SetWindowPos(HWND_BOTTOM,0,0,0,0,SWP_SHOWWINDOW);
+       tabctrl.SetFont(hTabFont);
        tabctrl.AddItem(TCIF_TEXT | TCIF_PARAM, _T("\83R\83\81\83\93\83g\88ê\97\97"), 0, (DWORD)commentView.m_hWnd);
 
        
index 1fc2b62..5f2c54b 100644 (file)
@@ -16,204 +16,39 @@ namespace nlite{
 
        ///
        ///nlite\95\8e\9a\97ñ\83N\83\89\83X
-       ///\8aù\91\82Ì\95\8e\9a\97ñ\83N\83\89\83X\82Ì\83\89\83b\83p
+       ///CString\82ð\8cp\8f³
        ///
-       class CNLITESTRING_THISTYPE{
+       class CNLITESTRING_THISTYPE: public CNLITESTRING_INTERNALSTRINGTYPE{
 
 
        public:
                
 
-               //\83\81\83\93\83o
-       private:
-               CNLITESTRING_INTERNALSTRINGTYPE is_string;
-
-
-
-       public:
+       
+               
                ///
                ///\83R\83\93\83X\83g\83\89\83N\83^
                ///
-               CNLITESTRING_THISTYPE():is_string(){}
+               CNLITESTRING_THISTYPE():CNLITESTRING_INTERNALSTRINGTYPE(){}
 
-               CNLITESTRING_THISTYPE(LPCTSTR in_str):is_string(in_str){}
-
-               CNLITESTRING_THISTYPE(const CNLITESTRING_INTERNALSTRINGTYPE_REFERENCE in_str):is_string(in_str){}
-
-               CNLITESTRING_THISTYPE(const CNLITESTRING_THISTYPE_REFERENCE in_str):is_string(in_str.is_string){}
+               CNLITESTRING_THISTYPE(LPCTSTR in_str):CNLITESTRING_INTERNALSTRINGTYPE(in_str){}
 
+               CNLITESTRING_THISTYPE(const CNLITESTRING_INTERNALSTRINGTYPE_REFERENCE in_str):CNLITESTRING_INTERNALSTRINGTYPE(in_str){}
 
+               CNLITESTRING_THISTYPE(const CNLITESTRING_THISTYPE_REFERENCE in_str):CNLITESTRING_INTERNALSTRINGTYPE(in_str){}
+               
 
 
 
+public:
                ///
                ///\95\8e\9a\97ñ\82Ì\92·\82³\82ð\8eæ\93¾
                ///
                UINT_PTR length(){
 
-                       return _tcslen(is_string);
-               }
-
-               ///
-               ///\95\8e\9a\97ñ\82ð\8c\9f\8dõ
-               ///
-               template<typename T>
-               int Find(const T pszSub,int iStart = 0)const throw(){
-
-                       return is_string.Find(pszSub,iStart);
-               }
-
-               ///
-               ///\8f\91\8e®\82Å\83t\83H\81[\83}\83b\83g\89»\82·\82é
-               ///
-               template<typename T>
-               void Format(T format,...){
-                       va_list ap;
-                       va_start(ap,format);
-
-                       is_string.Format(format,ap);
-                       va_end(ap);
-
-               }
-
-
-               //
-               //\89\89\8eZ\8eq
-               //
-       public:
-               operator LPCTSTR(){
-                       return (LPCWSTR)is_string;
+                       return _tcslen(*this);
                }
-               
-               template<typename T>
-               CNLITESTRING_THISTYPE_REFERENCE operator=(const T &instr){
-                       is_string = instr;
-                       return *this;
-               }
-               
-               
-               CNLITESTRING_THISTYPE_REFERENCE operator=(const CNLITESTRING_THISTYPE_REFERENCE instr){
-                       is_string = instr.is_string;
-                       return *this;
-               }
-               
-               template<typename T>
-               CNLITESTRING_THISTYPE_REFERENCE operator+=(const T &instr){
-                       is_string += instr;
-                       return *this;
-               }
-
-               
-               CNLITESTRING_THISTYPE_REFERENCE operator+=(const CNLITESTRING_THISTYPE_REFERENCE instr){
-                       is_string += instr.is_string;
-                       return *this;
-               }
-
-
-               template<typename T>
-               friend CNLITESTRING_THISTYPE operator+(const CNLITESTRING_THISTYPE_REFERENCE instr1, const T &instr2){
-                       return CNLITESTRING_THISTYPE(instr1.is_string + instr2);
-               }
-
-
-               template<typename T>
-               friend CNLITESTRING_THISTYPE operator+(const T &instr1, const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return CNLITESTRING_THISTYPE(instr1 + instr2.is);
-               }
-
-               
-               friend CNLITESTRING_THISTYPE operator+(const CNLITESTRING_THISTYPE_REFERENCE instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
 
-                       return CNLITESTRING_THISTYPE(instr1.is_string + instr2.is_string);
-               }
-               
-               template<typename T>
-               friend bool operator< (const CNLITESTRING_THISTYPE_REFERENCE instr1,const T &instr2){
-                       return instr1.is_string < instr2;
-               }
-
-               template<typename T>
-               friend bool operator< (const T &instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string < instr2;
-               }
-               
-               friend bool operator< (const CNLITESTRING_THISTYPE_REFERENCE instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string < instr2.is_string;
-               }
-
-
-               template<typename T>
-               friend bool operator> (const CNLITESTRING_THISTYPE_REFERENCE instr1,const T &instr2){
-                       return instr1.is_string > instr2;
-               }
-
-               template<typename T>
-               friend bool operator> (const T &instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string > instr2;
-               }
-               
-               friend bool operator> (const CNLITESTRING_THISTYPE_REFERENCE instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string > instr2.is_string;
-               }
-
-               template<typename T>
-               friend bool operator<= (const CNLITESTRING_THISTYPE_REFERENCE instr1,const T &instr2){
-                       return instr1.is_string <= instr2;
-               }
-
-               template<typename T>
-               friend bool operator<= (const T &instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string <= instr2;
-               }
-               
-               friend bool operator<= (const CNLITESTRING_THISTYPE_REFERENCE instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string <= instr2.is_string;
-               }
-
-
-               template<typename T>
-               friend bool operator>= (const CNLITESTRING_THISTYPE_REFERENCE instr1,const T &instr2){
-                       return instr1.is_string >= instr2;
-               }
-
-               template<typename T>
-               friend bool operator>= (const T &instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string >= instr2;
-               }
-               
-               friend bool operator>= (const CNLITESTRING_THISTYPE_REFERENCE instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string >= instr2.is_string;
-               }
-
-
-               template<typename T>
-               friend bool operator== (const CNLITESTRING_THISTYPE_REFERENCE instr1,const T &instr2){
-                       return instr1.is_string == instr2;
-               }
-
-               template<typename T>
-               friend bool operator== (const T &instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string == instr2;
-               }
-               
-               friend bool operator== (const CNLITESTRING_THISTYPE_REFERENCE instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string == instr2.is_string;
-               }
-
-
-               template<typename T>
-               friend bool operator!= (const CNLITESTRING_THISTYPE_REFERENCE instr1,const T &instr2){
-                       return instr1.is_string != instr2;
-               }
-
-               template<typename T>
-               friend bool operator!= (const T &instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string != instr2;
-               }
-               
-               friend bool operator!= (const CNLITESTRING_THISTYPE_REFERENCE instr1,const CNLITESTRING_THISTYPE_REFERENCE instr2){
-                       return instr1.is_string != instr2.is_string;
-               }
 
        };
 }
\ No newline at end of file