OSDN Git Service

2011/11/17 6:32:02
authorqwerty2501 <riot313@gmail.com>
Wed, 16 Nov 2011 21:32:02 +0000 (06:32 +0900)
committerqwerty2501 <riot313@gmail.com>
Wed, 16 Nov 2011 21:32:02 +0000 (06:32 +0900)
nlite/nlite_commentview.h
nlite/nlite_common.h
nlite/nlite_mailframe.h
nlite/nlite_mainframe.cpp

index 5c5c420..e7b9b95 100644 (file)
@@ -25,7 +25,7 @@ namespace nlite{
        private:
                const UINT menuOrID;
                CCommentList commentlist;
-               UINT_PTR headerHol[5];
+               CCommentViewProperty viewproperty;
                UINT_PTR columnHolSizeSum;
                
 
@@ -35,10 +35,15 @@ namespace nlite{
                        :menuOrID(256),
                        columnHolSizeSum(0)
                {
-                       ZeroMemory(headerHol,sizeof(headerHol));
+                       
                }
 
 
+               VOID SetProperty(CCommentViewProperty &setProperty){
+
+                       viewproperty = setProperty;
+               }
+               /*
                VOID SetHeaderSize(UINT_PTR first,UINT_PTR second,UINT_PTR third,UINT_PTR forth,UINT_PTR fifth){
 
                        headerHol[0] = first;
@@ -47,6 +52,7 @@ namespace nlite{
                        headerHol[3] = forth;
                        headerHol[4] = fifth;
                }
+               */
 
                HWND Create(HWND hWndParent){
 
@@ -65,7 +71,7 @@ namespace nlite{
 
                                GetTextExtentPoint32(hdc , columns[index] , _tcslen(columns[index]) , &size);
                                UINT_PTR holsize = holizenSize[index] + size.cx + 15;
-                               holizenSize[index] = headerHol[index] > 0 ? headerHol[index] : holsize;
+                               holizenSize[index] = viewproperty.headerholSize[index] >= 0 ? viewproperty.headerholSize[index] : holsize;
                                columnHolSizeSum += holsize > holizenSize[index] ? holsize : holizenSize[index];
                        }
 
index 0945cc0..43f253e 100644 (file)
@@ -9,8 +9,65 @@ namespace nlite{
 
        }HEADERSINFO,*LPHEADERSINFO;
 
-       class Property{
+       
+
+       class CCommentViewProperty{
+
+
+       public:
+               INT_PTR headerholSize[5];
+
+               CCommentViewProperty(){
+
+                       this->Initialize();
+               }
+
+               VOID Initialize(){
+                       memset(headerholSize,-1,sizeof(headerholSize));
+               }
+               
+
+       };
+       
+       class CMainFrameProperty{
+
+       public:
+
+               SIZE windowSize;
+               BOOL windowFrontFlag;
+
+               CMainFrameProperty(){
+
+                       Initialize();
+
+               }
+
+
+               VOID Initialize(){
+
+                       ZeroMemory(&windowSize,sizeof(windowSize));
+                       windowFrontFlag = TRUE;
+               }
+
+
+       };
+
+       class CProperty{
+
+       public:
+               CCommentViewProperty cvp;
+               CMainFrameProperty mfp;
+
+               CProperty(){
+
+                       this->Initialize();
+               }
+
+               VOID Initialize(){
+
+                       cvp.Initialize();
 
+               }
 
 
        };
index eb8e368..4720a08 100644 (file)
@@ -55,13 +55,11 @@ namespace nlite{
 
        private:
                NicoLiveStream_P nicoLiveStream;
-               CLiveUserData &userData;
-               CNicoVideoAuth &nicoVideoAuth;
+
        public:
-               CNicoLiveStream(CLiveUserData &ud,CNicoVideoAuth &nva)
-                       :nicoLiveStream(NicoLiveStream_new()),
-                       userData(ud),
-                       nicoVideoAuth(nva)
+               CNicoLiveStream()
+                       :nicoLiveStream(NicoLiveStream_new())
+
                {}
                ~CNicoLiveStream(){
 
@@ -71,7 +69,7 @@ namespace nlite{
 
                
 
-               VOID Connect(LPCTSTR url){
+               VOID Connect(CLiveUserData &userData,CNicoVideoAuth &nicoVideoAuth,LPCTSTR url){
 
                        NLIB_RESULT rslt;
 
@@ -123,8 +121,11 @@ namespace nlite{
                CStatusBarCtrl statusBar;
                CLiveUserData userData;
                CTabCtrl tabctrl;
+               CProperty nliteProperty;
                HFONT hTabFont;
                CComboBox lvNoCombo;
+               INT_PTR statusBarHeight;
+               INT_PTR toolBarHeight;
        private:
 
                // \83\81\83b\83Z\81[\83W\83t\83B\83\8b\83^\8f\88\97\9d
@@ -143,7 +144,7 @@ namespace nlite{
 
                CNliteMainFrame()
                        :userData(commentView),
-                       nicoLiveStream(userData,nicoVideoAuth)
+                       nicoLiveStream()
                {
                        LOGFONT lf = {0};
 
@@ -199,6 +200,9 @@ namespace nlite{
                //\83c\81[\83\8b\83o\81[\8d\82\82³\95Ï\8dX
                LRESULT OnRbnHeightChange(INT_PTR wParam,LPNMHDR lParam,BOOL &bHandled){
 
+                       RECT toolbarRect;
+                       ::GetClientRect(m_hWndToolBar,&toolbarRect);
+                       toolBarHeight = toolbarRect.bottom - toolbarRect.top;
 
                        RECT client;
                        GetClientRect(&client);
@@ -206,6 +210,7 @@ namespace nlite{
                        ChangeSize( _WTYPES_NS::CSize(client.right - client.left,client.bottom - client.top));
 
 
+
                        return 0;
                }
                
index e57c80d..2a8d1d5 100644 (file)
@@ -10,10 +10,11 @@ static const RECT commentViewSize = {5,0,5,0};
 //\83T\83C\83Y\95Ï\8dX\8f\88\97\9d
 VOID CNliteMainFrame::ChangeSize(const SIZE& client){
 
-       RECT toolbarRect;
-       ::GetClientRect(m_hWndToolBar,&toolbarRect);
        
-       tabctrl.MoveWindow(toolbarRect.left,toolbarRect.bottom,client.cx - toolbarRect.left,client.cy - toolbarRect.bottom);
+       
+       
+       
+       tabctrl.MoveWindow(0,toolBarHeight,client.cx,client.cy - (toolBarHeight + statusBarHeight));
        
 
        RECT tabClientRect;
@@ -23,7 +24,7 @@ VOID CNliteMainFrame::ChangeSize(const SIZE& client){
        
        
 
-       commentView.MoveWindow(tabClientRect.left, tabClientRect.top,tabClientRect.right - tabClientRect.left, tabClientRect.bottom - (tabClientRect.top + toolbarRect.bottom));
+       commentView.MoveWindow(tabClientRect.left, tabClientRect.top,tabClientRect.right - tabClientRect.left, tabClientRect.bottom - tabClientRect.top);
 
        
        
@@ -65,10 +66,14 @@ LRESULT CNliteMainFrame::OnCreate(LPCREATESTRUCT lpcs){
        this->GetWindowRect(&wndRect);
        
        LONG cyMaxImized = GetSystemMetrics (SM_CYMAXIMIZED);
-       wndRect.bottom = (LONG)cyMaxImized / 2;
-       wndRect.right = commentViewSize.left + commentViewSize.right + 20 + commentView.GetColumnHolSizeSum();
+       wndRect.bottom = nliteProperty.mfp.windowSize.cy != 0 ? nliteProperty.mfp.windowSize.cy : (LONG)cyMaxImized / 2;
+       wndRect.right = nliteProperty.mfp.windowSize.cx != 0 ? nliteProperty.mfp.windowSize.cx : commentViewSize.left + commentViewSize.right + 20 + commentView.GetColumnHolSizeSum();
+
 
+       RECT statusbarRect;
+       ::GetClientRect(m_hWndStatusBar,&statusbarRect);
 
+       statusBarHeight = statusbarRect.bottom - statusbarRect.top;
 
        this->MoveWindow(wndRect.left,wndRect.top,wndRect.right,wndRect.bottom);