Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonasno <jonasno@users.sourceforge.net>2010-02-28 04:10:12 +0300
committerjonasno <jonasno@users.sourceforge.net>2010-02-28 04:10:12 +0300
commit6c994a451308d352d44ccb71e616bfeb1c9b7d85 (patch)
treeb4604ee85821f81a145d720a303ac4f739116d97 /src/apps/mplayerc
parent51ecdf4ac088b105f837ef292ff6a11045684eb5 (diff)
Moved "Remember DVD position" and "Remember File position" in Player page, part 2 and some code cleaned up
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1710 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc')
-rw-r--r--src/apps/mplayerc/ChildView.cpp36
-rw-r--r--src/apps/mplayerc/ChildView.h3
-rw-r--r--src/apps/mplayerc/PPageCasimir.cpp15
-rw-r--r--src/apps/mplayerc/PPageCasimir.h2
-rw-r--r--src/apps/mplayerc/PPagePlayer.cpp23
-rw-r--r--src/apps/mplayerc/PPagePlayer.h3
6 files changed, 26 insertions, 56 deletions
diff --git a/src/apps/mplayerc/ChildView.cpp b/src/apps/mplayerc/ChildView.cpp
index 724b4dcbc..e5cff9565 100644
--- a/src/apps/mplayerc/ChildView.cpp
+++ b/src/apps/mplayerc/ChildView.cpp
@@ -163,14 +163,11 @@ BEGIN_MESSAGE_MAP(CChildView, CWnd)
ON_WM_PAINT()
ON_WM_ERASEBKGND()
ON_WM_SIZE()
- //ON_WM_WINDOWPOSCHANGED()
ON_COMMAND_EX(ID_PLAY_PLAYPAUSE, OnPlayPlayPauseStop)
ON_COMMAND_EX(ID_PLAY_PLAY, OnPlayPlayPauseStop)
ON_COMMAND_EX(ID_PLAY_PAUSE, OnPlayPlayPauseStop)
ON_COMMAND_EX(ID_PLAY_STOP, OnPlayPlayPauseStop)
ON_WM_SETCURSOR()
- //ON_WM_NCCALCSIZE()
- //ON_WM_NCPAINT()
//}}AFX_MSG_MAP
// ON_WM_NCHITTEST()
ON_WM_NCHITTEST()
@@ -235,13 +232,6 @@ void CChildView::OnSize(UINT nType, int cx, int cy)
((CMainFrame*)GetParentFrame())->MoveVideoWindow();
}
-/*void CChildView::OnWindowPosChanged(WINDOWPOS* lpwndpos)
-{
- CWnd::OnWindowPosChanged(lpwndpos);
-
- ((CMainFrame*)GetParentFrame())->MoveVideoWindow();
-}*/
-
BOOL CChildView::OnPlayPlayPauseStop(UINT nID)
{
if(nID == ID_PLAY_STOP) SetVideoRect();
@@ -267,32 +257,6 @@ BOOL CChildView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
return CWnd::OnSetCursor(pWnd, nHitTest, message);
}
-/*void CChildView::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp)
-{
- if(!((CMainFrame*)GetParentFrame())->IsFrameLessWindow())
- {
- InflateRect(&lpncsp->rgrc[0], -1, -1);
- }
-
- CWnd::OnNcCalcSize(bCalcValidRects, lpncsp);
-}
-
-void CChildView::OnNcPaint()
-{
- if(!((CMainFrame*)GetParentFrame())->IsFrameLessWindow())
- {
- CRect r, c;
- GetWindowRect(r);
- r.OffsetRect(-r.left, -r.top);
- c = r;
- c.DeflateRect (1,1);
-
- CWindowDC dc(this);
- dc.ExcludeClipRect(c); // Casimir666 : prevent flashing when resizing
- dc.Draw3dRect(&r, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
- }
-}*/
-
LRESULT CChildView::OnNcHitTest(CPoint point)
{
UINT nHitTest = CWnd::OnNcHitTest(point);
diff --git a/src/apps/mplayerc/ChildView.h b/src/apps/mplayerc/ChildView.h
index 61309f2f1..3f5ee961f 100644
--- a/src/apps/mplayerc/ChildView.h
+++ b/src/apps/mplayerc/ChildView.h
@@ -55,11 +55,8 @@ protected:
afx_msg void OnPaint();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnSize(UINT nType, int cx, int cy);
- //afx_msg void OnWindowPosChanged(WINDOWPOS* lpwndpos);
afx_msg BOOL OnPlayPlayPauseStop(UINT nID);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
- //afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
- //afx_msg void OnNcPaint();
DECLARE_MESSAGE_MAP()
public:
diff --git a/src/apps/mplayerc/PPageCasimir.cpp b/src/apps/mplayerc/PPageCasimir.cpp
index ec7a2ffed..67a00182c 100644
--- a/src/apps/mplayerc/PPageCasimir.cpp
+++ b/src/apps/mplayerc/PPageCasimir.cpp
@@ -34,8 +34,6 @@
IMPLEMENT_DYNAMIC(CPPageCasimir, CPPageBase)
CPPageCasimir::CPPageCasimir()
: CPPageBase(CPPageCasimir::IDD, CPPageCasimir::IDD)
- , m_fRememberDVDPos(FALSE)
- , m_fRememberFilePos(FALSE)
{
}
@@ -50,8 +48,6 @@ void CPPageCasimir::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_SLI_BRIGHTNESS, m_SliBrightness);
DDX_Control(pDX, IDC_SLI_HUE, m_SliHue);
DDX_Control(pDX, IDC_SLI_SATURATION, m_SliSaturation);
- DDX_Check(pDX, IDC_DVD_POS, m_fRememberDVDPos);
- DDX_Check(pDX, IDC_FILE_POS, m_fRememberFilePos);
}
@@ -70,9 +66,6 @@ BOOL CPPageCasimir::OnInitDialog()
AppSettings& s = AfxGetAppSettings();
- m_fRememberDVDPos = s.fRememberDVDPos;
- m_fRememberFilePos = s.fRememberFilePos;
-
UpdateData(FALSE);
CreateToolTip();
@@ -117,9 +110,6 @@ BOOL CPPageCasimir::OnInitDialog()
m_SliSaturation.SetPos ((int)(m_dSaturation*100));
}
- GetDlgItem(IDC_FILE_POS)->EnableWindow(s.fKeepHistory);
- GetDlgItem(IDC_DVD_POS)->EnableWindow(s.fKeepHistory);
-
return TRUE;
}
@@ -129,15 +119,10 @@ BOOL CPPageCasimir::OnApply()
AppSettings& s = AfxGetAppSettings();
- GetDlgItem(IDC_FILE_POS)->EnableWindow(s.fKeepHistory);
- GetDlgItem(IDC_DVD_POS)->EnableWindow(s.fKeepHistory);
-
s.dBrightness = m_dBrightness;
s.dContrast = m_dContrast;
s.dHue = m_dHue;
s.dSaturation = m_dSaturation;
- s.fRememberDVDPos = m_fRememberDVDPos ? true : false;
- s.fRememberFilePos = m_fRememberFilePos ? true : false;
return __super::OnApply();
}
diff --git a/src/apps/mplayerc/PPageCasimir.h b/src/apps/mplayerc/PPageCasimir.h
index 254bfb0aa..d9420c91c 100644
--- a/src/apps/mplayerc/PPageCasimir.h
+++ b/src/apps/mplayerc/PPageCasimir.h
@@ -60,7 +60,5 @@ public:
CSliderCtrl m_SliHue;
CSliderCtrl m_SliSaturation;
afx_msg void OnBnClickedReset();
- BOOL m_fRememberDVDPos;
- BOOL m_fRememberFilePos;
virtual void OnCancel();
};
diff --git a/src/apps/mplayerc/PPagePlayer.cpp b/src/apps/mplayerc/PPagePlayer.cpp
index a9ecb0605..0749d302a 100644
--- a/src/apps/mplayerc/PPagePlayer.cpp
+++ b/src/apps/mplayerc/PPagePlayer.cpp
@@ -45,6 +45,8 @@ CPPagePlayer::CPPagePlayer()
, m_fHideCDROMsSubMenu(FALSE)
, m_priority(FALSE)
, m_fShowOSD(FALSE)
+ , m_fRememberDVDPos(FALSE)
+ , m_fRememberFilePos(FALSE)
{
}
@@ -68,11 +70,15 @@ void CPPagePlayer::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_CHECK10, m_fHideCDROMsSubMenu);
DDX_Check(pDX, IDC_CHECK9, m_priority);
DDX_Check(pDX, IDC_SHOW_OSD, m_fShowOSD);
+ DDX_Check(pDX, IDC_DVD_POS, m_fRememberDVDPos);
+ DDX_Check(pDX, IDC_FILE_POS, m_fRememberFilePos);
}
BEGIN_MESSAGE_MAP(CPPagePlayer, CPPageBase)
ON_BN_CLICKED(IDC_CHECK8, OnBnClickedCheck8)
ON_UPDATE_COMMAND_UI(IDC_CHECK13, OnUpdateCheck13)
+ ON_UPDATE_COMMAND_UI(IDC_DVD_POS, OnUpdatePos)
+ ON_UPDATE_COMMAND_UI(IDC_FILE_POS, OnUpdatePos)
END_MESSAGE_MAP()
// CPPagePlayer message handlers
@@ -96,9 +102,14 @@ BOOL CPPagePlayer::OnInitDialog()
m_fHideCDROMsSubMenu = s.fHideCDROMsSubMenu;
m_priority = s.priority != NORMAL_PRIORITY_CLASS;
m_fShowOSD = s.fShowOSD;
+ m_fRememberDVDPos = s.fRememberDVDPos;
+ m_fRememberFilePos = s.fRememberFilePos;
UpdateData(FALSE);
+ GetDlgItem(IDC_FILE_POS)->EnableWindow(s.fKeepHistory);
+ GetDlgItem(IDC_DVD_POS)->EnableWindow(s.fKeepHistory);
+
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -121,6 +132,8 @@ BOOL CPPagePlayer::OnApply()
s.fHideCDROMsSubMenu = !!m_fHideCDROMsSubMenu;
s.priority = !m_priority ? NORMAL_PRIORITY_CLASS : GetVersion() < 0 ? HIGH_PRIORITY_CLASS : ABOVE_NORMAL_PRIORITY_CLASS;
s.fShowOSD = !!m_fShowOSD;
+ s.fRememberDVDPos = m_fRememberDVDPos ? true : false;
+ s.fRememberFilePos = m_fRememberFilePos ? true : false;
if(!m_fKeepHistory)
{
@@ -134,6 +147,9 @@ BOOL CPPagePlayer::OnApply()
::SetPriorityClass(::GetCurrentProcess(), s.priority);
+ GetDlgItem(IDC_FILE_POS)->EnableWindow(s.fKeepHistory);
+ GetDlgItem(IDC_DVD_POS)->EnableWindow(s.fKeepHistory);
+
return __super::OnApply();
}
@@ -153,3 +169,10 @@ void CPPagePlayer::OnUpdateCheck13(CCmdUI* pCmdUI)
pCmdUI->Enable(m_iTitleBarTextStyle == 1);
}
+
+void CPPagePlayer::OnUpdatePos(CCmdUI* pCmdUI)
+{
+ UpdateData();
+
+ pCmdUI->Enable( !!m_fKeepHistory );
+}
diff --git a/src/apps/mplayerc/PPagePlayer.h b/src/apps/mplayerc/PPagePlayer.h
index f16fde4ee..ecb72d1dd 100644
--- a/src/apps/mplayerc/PPagePlayer.h
+++ b/src/apps/mplayerc/PPagePlayer.h
@@ -49,6 +49,8 @@ public:
BOOL m_fHideCDROMsSubMenu;
BOOL m_priority;
BOOL m_fShowOSD;
+ BOOL m_fRememberDVDPos;
+ BOOL m_fRememberFilePos;
// Dialog Data
enum { IDD = IDD_PPAGEPLAYER };
@@ -64,4 +66,5 @@ public:
afx_msg void OnBnClickedCheck8();
afx_msg void OnUpdateTimeout(CCmdUI* pCmdUI);
afx_msg void OnUpdateCheck13(CCmdUI* pCmdUI);
+ afx_msg void OnUpdatePos(CCmdUI* pCmdUI);
};