From 603ed9e868f1e3a9ef417fd6309470ca7116dc0b Mon Sep 17 00:00:00 2001 From: qwerty2501 Date: Thu, 17 Nov 2011 06:32:02 +0900 Subject: [PATCH] 2011/11/17 6:32:02 --- nlite/nlite_commentview.h | 12 +++++++--- nlite/nlite_common.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++- nlite/nlite_mailframe.h | 21 ++++++++++------- nlite/nlite_mainframe.cpp | 17 +++++++++----- 4 files changed, 91 insertions(+), 18 deletions(-) diff --git a/nlite/nlite_commentview.h b/nlite/nlite_commentview.h index 5c5c420..e7b9b95 100644 --- a/nlite/nlite_commentview.h +++ b/nlite/nlite_commentview.h @@ -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]; } diff --git a/nlite/nlite_common.h b/nlite/nlite_common.h index 0945cc0..43f253e 100644 --- a/nlite/nlite_common.h +++ b/nlite/nlite_common.h @@ -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(); + } }; diff --git a/nlite/nlite_mailframe.h b/nlite/nlite_mailframe.h index eb8e368..4720a08 100644 --- a/nlite/nlite_mailframe.h +++ b/nlite/nlite_mailframe.h @@ -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: // ƒƒbƒZ[ƒWƒtƒBƒ‹ƒ^ˆ— @@ -143,7 +144,7 @@ namespace nlite{ CNliteMainFrame() :userData(commentView), - nicoLiveStream(userData,nicoVideoAuth) + nicoLiveStream() { LOGFONT lf = {0}; @@ -199,6 +200,9 @@ namespace nlite{ //ƒc[ƒ‹ƒo[‚‚³•ÏX 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; } diff --git a/nlite/nlite_mainframe.cpp b/nlite/nlite_mainframe.cpp index e57c80d..2a8d1d5 100644 --- a/nlite/nlite_mainframe.cpp +++ b/nlite/nlite_mainframe.cpp @@ -10,10 +10,11 @@ static const RECT commentViewSize = {5,0,5,0}; //ƒTƒCƒY•ÏXˆ— 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); -- 2.11.0